diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5de9a3c389..e1284ab1f8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -326,6 +326,10 @@ + + params) { break; } } - opcode = String.format("%s.setTypeface(Typeface.createFromAsset(getAssets(),\"fonts/%s.ttf\"), %s);", params.get(0), params.get(1), opcode); + String fontName = params.get(1); + if ("default_font".equals(fontName)) { + opcode = String.format("%s.setTypeface(Typeface.DEFAULT, %s);", params.get(0), opcode); + } else { + opcode = String.format("%s.setTypeface(Typeface.createFromAsset(getAssets(),\"fonts/%s.ttf\"), %s);", params.get(0), fontName, opcode); + } break; case "getText": opcode = String.format("%s.getText().toString()", params.get(0)); diff --git a/app/src/main/java/a/a/a/ZA.java b/app/src/main/java/a/a/a/ZA.java index 65b1bc72c9..40bff81b8f 100644 --- a/app/src/main/java/a/a/a/ZA.java +++ b/app/src/main/java/a/a/a/ZA.java @@ -2,8 +2,11 @@ import android.app.Dialog; import android.content.Context; +import android.view.Window; import android.widget.TextView; +import androidx.core.view.WindowCompat; + import com.airbnb.lottie.LottieAnimationView; import pro.sketchware.R; @@ -20,6 +23,12 @@ public ZA(Context context) { TextView tvProgress = findViewById(R.id.tv_progress); tvProgress.setText(Helper.getResString(R.string.common_message_loading)); super.setCancelable(false); + + Window window = getWindow(); + if (window != null) { + window.setStatusBarColor(0); + WindowCompat.setDecorFitsSystemWindows(window, false); + } } public void cancelAnimation() { diff --git a/app/src/main/java/a/a/a/br.java b/app/src/main/java/a/a/a/br.java index e05a9260aa..dea2c341b8 100644 --- a/app/src/main/java/a/a/a/br.java +++ b/app/src/main/java/a/a/a/br.java @@ -275,7 +275,7 @@ void bind(ComponentBean componentBean) { previewBinding.getRoot().setLayoutParams(layoutParams); previewBinding.icon.setImageResource(oq.a(event.eventName)); previewBinding.iconBg.setBackgroundResource( - R.drawable.circle_bg_white_outline_secondary); + R.drawable.circle_bg_surface); binding.eventsPreview.addView(previewBinding.getRoot()); availableEvents.remove(event.eventName); } diff --git a/app/src/main/java/a/a/a/oq.java b/app/src/main/java/a/a/a/oq.java index 254d382752..cc945af467 100644 --- a/app/src/main/java/a/a/a/oq.java +++ b/app/src/main/java/a/a/a/oq.java @@ -24,60 +24,60 @@ public static int a(String eventName) { return switch (eventName) { case "initializeLogic", "onBackPressed", "onPostCreate", "onStart", "onStop", "onDestroy", "onResume", "onPause", "moreBlock" -> R.drawable.bg_event_type_activity; - case "onBannerAdClicked", "onClick" -> R.drawable.event_on_click_48dp; - case "onCheckedChange" -> R.drawable.event_on_check_changed_48dp; - case "onItemSelected" -> R.drawable.event_on_item_selected_48dp; - case "onItemClicked" -> R.drawable.event_on_item_clicked_48dp; - case "onItemLongClicked" -> R.drawable.event_on_item_long_clicked_48dp; - case "onTextChanged" -> R.drawable.event_on_text_changed_48dp; - case "onPageStarted" -> R.drawable.event_on_page_started_48dp; - case "onPageFinished" -> R.drawable.event_on_page_finished_48dp; - case "onProgressChanged" -> R.drawable.event_on_progress_changed_48dp; - case "onStartTrackingTouch" -> R.drawable.event_on_start_tracking_touch_48dp; - case "onStopTrackingTouch" -> R.drawable.event_on_stop_tracking_touch_48dp; - case "onAnimationStart" -> R.drawable.event_on_animation_start_48dp; - case "onAnimationEnd" -> R.drawable.event_on_animation_end_48dp; - case "onAnimationCancel" -> R.drawable.event_on_animation_cancel_48dp; - case "onAnimationRepeat" -> R.drawable.event_animation_repeat_48dp; - case "onBindCustomView" -> R.drawable.event_on_bind_custom_view_48dp; - case "onDateChange" -> R.drawable.event_on_date_changed_48dp; - case "onChildAdded" -> R.drawable.event_on_child_added_48dp; - case "onChildChanged" -> R.drawable.event_on_child_changed_48dp; - case "onChildMoved" -> R.drawable.event_on_child_moved_48dp; - case "onChildRemoved", "onDeleteSuccess" -> R.drawable.event_on_child_removed_48dp; - case "onCancelled" -> R.drawable.event_on_cancelled_48dp; - case "onCreateUserComplete" -> R.drawable.event_on_create_user_complete_48dp; - case "onSignInUserComplete" -> R.drawable.event_on_signin_complete_48dp; - case "onResetPasswordEmailSent" -> R.drawable.event_on_reset_password_email_sent_48dp; - case "onSensorChanged" -> R.drawable.event_on_sensor_changed_48dp; - case "onAccuracyChanged" -> R.drawable.event_on_accuracy_changed_48dp; + case "onBannerAdClicked", "onClick" -> R.drawable.ic_mtrl_touch; + case "onCheckedChange" -> R.drawable.ic_mtrl_checkbox; + case "onItemSelected" -> R.drawable.ic_mtrl_pull_down; + case "onItemClicked" -> R.drawable.ic_mtrl_list; + case "onItemLongClicked" -> R.drawable.ic_mtrl_touch_long; + case "onTextChanged" -> R.drawable.ic_mtrl_text_change; + case "onPageStarted" -> R.drawable.ic_mtrl_progress; + case "onPageFinished" -> R.drawable.ic_mtrl_preview; + case "onProgressChanged" -> R.drawable.ic_mtrl_progress_check; + case "onStartTrackingTouch" -> R.drawable.ic_mtrl_track_started; + case "onStopTrackingTouch" -> R.drawable.ic_mtrl_target; + case "onAnimationStart" -> R.drawable.ic_mtrl_sprint; + case "onAnimationEnd" -> R.drawable.ic_mtrl_anim_end; + case "onAnimationCancel" -> R.drawable.ic_mtrl_anim_cancel; + case "onAnimationRepeat" -> R.drawable.ic_mtrl_refresh; + case "onBindCustomView" -> R.drawable.ic_mtrl_bind; + case "onDateChange" -> R.drawable.ic_mtrl_date_changed; + case "onChildAdded" -> R.drawable.ic_mtrl_database_added; + case "onChildChanged" -> R.drawable.ic_mtrl_database_edit; + case "onChildMoved" -> R.drawable.ic_mtrl_database_moved; + case "onChildRemoved", "onDeleteSuccess" -> R.drawable.ic_mtrl_database_off; + case "onCancelled" -> R.drawable.ic_mtrl_cancel; + case "onCreateUserComplete" -> R.drawable.ic_mtrl_user_create; + case "onSignInUserComplete" -> R.drawable.ic_mtrl_signin; + case "onResetPasswordEmailSent" -> R.drawable.ic_mtrl_reset; + case "onSensorChanged" -> R.drawable.ic_mtrl_sensor; + case "onAccuracyChanged" -> R.drawable.ic_mtrl_center; case "onInterstitialAdLoaded", "onBannerAdLoaded", "onRewardAdLoaded" -> - R.drawable.event_on_ad_loaded; + R.drawable.ic_mtrl_loaded; case "onBannerAdFailedToLoad", "onInterstitialAdFailedToLoad", "onAdFailedToShowFullScreenContent", "onRewardAdFailedToLoad", "onFailure" -> - R.drawable.event_on_ad_failed_to_load; - case "onAdShowedFullScreenContent", "onBannerAdOpened" -> R.drawable.event_on_ad_opened; + R.drawable.ic_mtrl_load_failed; + case "onAdShowedFullScreenContent", "onBannerAdOpened" -> R.drawable.ic_mtrl_preview; case "onAdDismissedFullScreenContent", "onBannerAdClosed" -> - R.drawable.event_on_ad_closed; - case "onUploadProgress" -> R.drawable.event_on_upload_progress_48dp; - case "onDownloadProgress" -> R.drawable.event_on_download_progress_48dp; - case "onUploadSuccess" -> R.drawable.event_on_upload_success_48dp; - case "onDownloadSuccess" -> R.drawable.event_on_download_success_48dp; - case "onPictureTaken" -> R.drawable.event_on_picture_taken_48dp; - case "onPictureTakenCancel" -> R.drawable.event_on_picture_taken_cancel_48dp; - case "onFilesPicked" -> R.drawable.event_on_file_picked_48dp; - case "onFilesPickedCancel" -> R.drawable.event_on_file_picked_cancel_48dp; - case "onResponse" -> R.drawable.event_on_response_48dp; - case "onErrorResponse" -> R.drawable.event_on_error_response_48dp; - case "onSpeechResult" -> R.drawable.event_on_speech_result; - case "onSpeechError" -> R.drawable.event_on_speech_error; - case "onConnected" -> R.drawable.event_on_connected_96; - case "onDataReceived" -> R.drawable.event_on_data_received_96; - case "onDataSent" -> R.drawable.event_on_data_sent_96; - case "onConnectionError" -> R.drawable.event_on_connection_error_96; - case "onConnectionStopped" -> R.drawable.event_on_connection_stopped_96; - case "onLocationChanged" -> R.drawable.event_on_location_changed_96; - case "onMapReady" -> R.drawable.event_on_map_ready_96; - case "onMarkerClicked" -> R.drawable.event_on_marker_clicked_96; + R.drawable.ic_mtrl_preview_off; + case "onUploadProgress" -> R.drawable.ic_mtrl_uploading; + case "onDownloadProgress" -> R.drawable.ic_mtrl_downloading; + case "onUploadSuccess" -> R.drawable.ic_mtrl_uploaded; + case "onDownloadSuccess" -> R.drawable.ic_mtrl_download; + case "onPictureTaken" -> R.drawable.ic_mtrl_pic_taken; + case "onPictureTakenCancel" -> R.drawable.ic_mtrl_pic_cancel; + case "onFilesPicked" -> R.drawable.ic_mtrl_file_picked; + case "onFilesPickedCancel" -> R.drawable.ic_mtrl_pick_cancel; + case "onResponse" -> R.drawable.ic_mtrl_sensor; + case "onErrorResponse" -> R.drawable.ic_mtrl_sensor_cancel; + case "onSpeechResult" -> R.drawable.ic_mtrl_speech; + case "onSpeechError" -> R.drawable.ic_mtrl_speech_cancel; + case "onConnected" -> R.drawable.ic_mtrl_bluetooth_connected; + case "onDataReceived" -> R.drawable.ic_mtrl_bt_received; + case "onDataSent" -> R.drawable.ic_mtrl_bt_sent; + case "onConnectionError" -> R.drawable.ic_mtrl_bt_error; + case "onConnectionStopped" -> R.drawable.ic_mtrl_bt_cancel; + case "onLocationChanged" -> R.drawable.ic_mtrl_location_changed; + case "onMapReady" -> R.drawable.ic_mtrl_map_ready; + case "onMarkerClicked" -> R.drawable.ic_mtrl_loc_click; default -> ManageEvent.d(eventName); }; } diff --git a/app/src/main/java/a/a/a/sy.java b/app/src/main/java/a/a/a/sy.java index f8c68a8c49..de446d92dd 100644 --- a/app/src/main/java/a/a/a/sy.java +++ b/app/src/main/java/a/a/a/sy.java @@ -3,7 +3,7 @@ import com.besome.sketch.beans.ViewBean; // todo: move this to another package -// 'sy' is used in ViewPane itens, example ItemLinearLayout +// 'sy' is used in ViewPane items, example ItemLinearLayout public interface sy { ViewBean getBean(); @@ -12,4 +12,4 @@ public interface sy { void setBean(ViewBean viewBean); void setSelection(boolean selection); -} \ No newline at end of file +} diff --git a/app/src/main/java/com/besome/sketch/beans/ProjectLibraryBean.java b/app/src/main/java/com/besome/sketch/beans/ProjectLibraryBean.java index 3c9cdbbea9..a091981723 100644 --- a/app/src/main/java/com/besome/sketch/beans/ProjectLibraryBean.java +++ b/app/src/main/java/com/besome/sketch/beans/ProjectLibraryBean.java @@ -84,10 +84,10 @@ public static Parcelable.Creator getCreator() { public static int getLibraryIcon(int i) { return switch (i) { - case 0 -> R.drawable.widget_firebase; - case 1 -> R.drawable.connected_96; - case 2 -> R.drawable.widget_admob; - case 3 -> R.drawable.widget_google_map; + case 0 -> R.drawable.ic_mtrl_firebase; + case 1 -> R.drawable.ic_mtrl_design; + case 2 -> R.drawable.ic_mtrl_admob; + case 3 -> R.drawable.ic_mtrl_map; case 4 -> R.drawable.ic_mtrl_box; case 5 -> R.drawable.ic_mtrl_settings_input; default -> 0; diff --git a/app/src/main/java/com/besome/sketch/design/DesignActivity.java b/app/src/main/java/com/besome/sketch/design/DesignActivity.java index df4c826cfb..725a44c16a 100644 --- a/app/src/main/java/com/besome/sketch/design/DesignActivity.java +++ b/app/src/main/java/com/besome/sketch/design/DesignActivity.java @@ -8,7 +8,6 @@ import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; -import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.graphics.Typeface; @@ -24,10 +23,8 @@ import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; -import android.widget.Button; import android.widget.ImageView; import android.widget.LinearLayout; -import android.widget.PopupMenu; import android.widget.TextView; import android.widget.Toast; @@ -96,7 +93,6 @@ import a.a.a.mB; import a.a.a.rs; import a.a.a.wq; -import a.a.a.xB; import a.a.a.yB; import a.a.a.yq; import a.a.a.zy; @@ -110,7 +106,6 @@ import mod.agus.jcoderz.editor.manage.resource.ManageResourceActivity; import mod.hey.studios.activity.managers.assets.ManageAssetsActivity; import mod.hey.studios.activity.managers.java.ManageJavaActivity; -import mod.hey.studios.build.BuildSettings; import mod.hey.studios.build.BuildSettingsDialog; import mod.hey.studios.compiler.kotlin.KotlinCompilerBridge; import mod.hey.studios.project.custom_blocks.CustomBlocksDialog; @@ -130,7 +125,6 @@ import mod.jbk.diagnostic.MissingFileException; import mod.jbk.util.LogUtil; import mod.khaled.logcat.LogReaderActivity; -import pro.sketchware.utility.ThemeUtils; import pro.sketchware.R; import pro.sketchware.activities.appcompat.ManageAppCompatActivity; import pro.sketchware.activities.editor.command.ManageXMLCommandActivity; @@ -138,7 +132,9 @@ import pro.sketchware.databinding.ProgressMsgBoxBinding; import pro.sketchware.utility.FileUtil; import pro.sketchware.utility.SketchwareUtil; +import pro.sketchware.utility.ThemeUtils; import pro.sketchware.utility.apk.ApkSignatures; +import pro.sketchware.activities.editor.view.CodeViewerActivity; public class DesignActivity extends BaseAppCompatActivity implements View.OnClickListener { public static String sc_id; @@ -803,59 +799,36 @@ private void askIfToRestoreOldUnsavedProjectData() { } private void showCurrentActivitySrcCode() { - if (projectFile == null) return; - ProgressMsgBoxBinding loadingDialogBinding = ProgressMsgBoxBinding.inflate(getLayoutInflater()); + if (projectFile == null) return; + var loadingDialogBinding = ProgressMsgBoxBinding.inflate(getLayoutInflater()); loadingDialogBinding.tvProgress.setText("Generating source code..."); var loadingDialog = new MaterialAlertDialogBuilder(this) - .setTitle("Please wait") - .setCancelable(false) - .setView(loadingDialogBinding.getRoot()) - .create(); + .setTitle("Please wait") + .setCancelable(false) + .setView(loadingDialogBinding.getRoot()) + .create(); loadingDialog.show(); - + new Thread(() -> { - String filename = fileName.getText().toString(); - final String source = new yq(getApplicationContext(), sc_id).getFileSrc(filename, jC.b(sc_id), jC.a(sc_id), jC.c(sc_id)); - - var dialogBuilder = new MaterialAlertDialogBuilder(this) - .setTitle(filename) - .setCancelable(false) - .setPositiveButton("Dismiss", null); - + var filename = fileName.getText().toString(); + final String source = new yq(getApplicationContext(), sc_id) + .getFileSrc(filename, jC.b(sc_id), jC.a(sc_id), jC.c(sc_id)); runOnUiThread(() -> { if (isFinishing()) return; loadingDialog.dismiss(); - - CodeEditor editor = new CodeEditor(this); - editor.setTypefaceText(Typeface.MONOSPACE); - editor.setEditable(false); - editor.setTextSize(14); - editor.setText(!source.isEmpty() ? source : "Failed to generate source."); - editor.getComponent(Magnifier.class).setWithinEditorForcibly(true); - + if (source.isEmpty()) { + Toast.makeText(this, "Failed to generate source.", Toast.LENGTH_SHORT).show(); + return; + } + var intent = new Intent(this, CodeViewerActivity.class); + intent.putExtra("code", source); + intent.putExtra("sc_id", sc_id); if (filename.endsWith(".xml")) { - editor.setEditorLanguage(CodeEditorLanguages.loadTextMateLanguage(CodeEditorLanguages.SCOPE_NAME_XML)); - if (ThemeUtils.isDarkThemeEnabled(getApplicationContext())) { - editor.setColorScheme(CodeEditorColorSchemes.loadTextMateColorScheme(CodeEditorColorSchemes.THEME_DRACULA)); - } else { - editor.setColorScheme(CodeEditorColorSchemes.loadTextMateColorScheme(CodeEditorColorSchemes.THEME_GITHUB)); - } + intent.putExtra("scheme", CodeViewerActivity.SCHEME_XML); } else { - editor.setEditorLanguage(new JavaLanguage()); - if (ThemeUtils.isDarkThemeEnabled(getApplicationContext())) { - editor.setColorScheme(new SchemeDarcula()); - } else { - editor.setColorScheme(new EditorColorScheme()); - } + intent.putExtra("scheme", CodeViewerActivity.SCHEME_JAVA); } - - AlertDialog dialog = dialogBuilder.create(); - dialog.setView(editor, - (int) getDip(24), - (int) getDip(20), - (int) getDip(24), - (int) getDip(0)); - dialog.show(); + startActivity(intent); }); }).start(); } @@ -889,7 +862,7 @@ private void showAvailableViews() { } /** - * Opens {@link ViewCodeEditor}. + * Opens {@link ViewCodeEditorActivity}. */ void toViewCodeEditor() { if (projectFile == null) return; @@ -939,7 +912,7 @@ void toAndroidManifestManager() { } /** - * Opens {@link ManageCustomAttributeActivity}. + * Opens {@link ManageAppCompatActivity}. */ void toAppCompatInjectionManager() { if (projectFile == null) return; diff --git a/app/src/main/java/com/besome/sketch/editor/LogicEditorActivity.java b/app/src/main/java/com/besome/sketch/editor/LogicEditorActivity.java index f8dcda6193..4dfdd1aaaf 100644 --- a/app/src/main/java/com/besome/sketch/editor/LogicEditorActivity.java +++ b/app/src/main/java/com/besome/sketch/editor/LogicEditorActivity.java @@ -118,11 +118,6 @@ import a.a.a.yq; import a.a.a.yy; import dev.aldi.sayuti.block.ExtraPaletteBlock; -import io.github.rosemoe.sora.langs.java.JavaLanguage; -import io.github.rosemoe.sora.widget.CodeEditor; -import io.github.rosemoe.sora.widget.component.Magnifier; -import io.github.rosemoe.sora.widget.schemes.EditorColorScheme; -import io.github.rosemoe.sora.widget.schemes.SchemeDarcula; import mod.bobur.StringEditorActivity; import mod.bobur.XmlToSvgConverter; import mod.hey.studios.editor.view.IdGenerator; @@ -130,7 +125,7 @@ import mod.hey.studios.moreblock.importer.MoreblockImporterDialog; import mod.hey.studios.project.ProjectSettings; import mod.hey.studios.util.Helper; -import mod.hilal.saif.asd.asdforall.AsdAllEditor; +import mod.hilal.saif.asd.AsdDialog; import mod.jbk.editor.manage.MoreblockImporter; import mod.jbk.util.BlockUtil; import mod.pranav.viewbinding.ViewBindingBuilder; @@ -144,6 +139,7 @@ import pro.sketchware.utility.FileUtil; import pro.sketchware.utility.SketchwareUtil; import pro.sketchware.utility.SvgUtils; +import pro.sketchware.activities.editor.view.CodeViewerActivity; @SuppressLint({"ClickableViewAccessibility", "RtlHardcoded", "SetTextI18n", "DefaultLocale"}) public class LogicEditorActivity extends BaseAppCompatActivity implements View.OnClickListener, Vs, View.OnTouchListener, MoreblockImporterDialog.CallBack { @@ -1850,10 +1846,10 @@ public void f(Ss ss) { dialog.a(customView); dialog.configureDefaultButton("Code Editor", v -> { - AsdAllEditor editor = new AsdAllEditor(this); + AsdDialog editor = new AsdDialog(this); editor.setCon(ss.getArgValue().toString()); editor.show(); - editor.saveLis(this, ss); + editor.saveLis(this, false, ss, editor);; editor.cancelLis(editor); dialog.dismiss(); }); @@ -2724,39 +2720,11 @@ public void showSourceCode() { yq yq = new yq(this, B); yq.a(jC.c(B), jC.b(B), jC.a(B), false); String code = new Fx(M.getActivityName(), yq.N, o.getBlocks(), isViewBindingEnabled).a(); - - CodeEditor codeEditor = new CodeEditor(this); - codeEditor.setEditable(false); - codeEditor.setEditorLanguage(new JavaLanguage()); - codeEditor.setText(Lx.j(code, false)); - codeEditor.setTextSize(12); - codeEditor.setTypefaceText(Typeface.MONOSPACE); - codeEditor.setWordwrap(false); - codeEditor.getComponent(Magnifier.class).setWithinEditorForcibly(true); - - if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.R) { - Configuration configuration = getResources().getConfiguration(); - boolean isDarkTheme = configuration.isNightModeActive(); - if (isDarkTheme) { - codeEditor.setColorScheme(new SchemeDarcula()); - } else { - codeEditor.setColorScheme(new EditorColorScheme()); - } - } else { - codeEditor.setColorScheme(new EditorColorScheme()); - } - - var dialog = new MaterialAlertDialogBuilder(this) - .setTitle("Source code") - .setPositiveButton(R.string.common_word_close, null) - .create(); - - dialog.setView(codeEditor, - (int) getDip(24), - (int) getDip(20), - (int) getDip(24), - (int) getDip(0)); - dialog.show(); + var intent = new Intent(this, CodeViewerActivity.class); + intent.putExtra("code", code); + intent.putExtra("sc_id", B); + intent.putExtra("scheme", CodeViewerActivity.SCHEME_JAVA); + startActivity(intent); } public void t() { diff --git a/app/src/main/java/com/besome/sketch/editor/component/CollapsibleComponentLayout.java b/app/src/main/java/com/besome/sketch/editor/component/CollapsibleComponentLayout.java index 985a183f51..0273dd47ae 100644 --- a/app/src/main/java/com/besome/sketch/editor/component/CollapsibleComponentLayout.java +++ b/app/src/main/java/com/besome/sketch/editor/component/CollapsibleComponentLayout.java @@ -1,6 +1,8 @@ package com.besome.sketch.editor.component; import android.content.Context; +import android.graphics.PorterDuff; +import android.graphics.PorterDuffColorFilter; import android.util.AttributeSet; import androidx.annotation.NonNull; @@ -8,6 +10,8 @@ import com.besome.sketch.lib.ui.CollapsibleButton; import com.besome.sketch.lib.base.CollapsibleLayout; +import com.google.android.material.color.MaterialColors; + import pro.sketchware.R; import java.util.List; @@ -27,7 +31,11 @@ public CollapsibleComponentLayout(@NonNull Context context, @Nullable AttributeS @Override protected List initializeButtons(@NonNull Context context) { - delete = CollapsibleButton.create(context, 0, R.drawable.delete_96, R.string.common_word_delete); + delete = CollapsibleButton.create(context, 0, R.drawable.ic_mtrl_delete, R.string.common_word_delete); + var colorError = MaterialColors.getColor(delete, com.google.android.material.R.attr.colorError); + var iconFilter = new PorterDuffColorFilter(colorError, PorterDuff.Mode.SRC_ATOP); + delete.getLabel().setTextColor(colorError); + delete.getIcon().setColorFilter(iconFilter); return List.of(delete); } diff --git a/app/src/main/java/com/besome/sketch/editor/component/ComponentEventButton.java b/app/src/main/java/com/besome/sketch/editor/component/ComponentEventButton.java index f989f7dedb..c6f8c729a5 100644 --- a/app/src/main/java/com/besome/sketch/editor/component/ComponentEventButton.java +++ b/app/src/main/java/com/besome/sketch/editor/component/ComponentEventButton.java @@ -9,6 +9,8 @@ import android.widget.LinearLayout; import android.widget.TextView; +import com.google.android.material.color.MaterialColors; + import pro.sketchware.R; import a.a.a.wB; @@ -38,9 +40,8 @@ private void initialize(Context context) { public void onEventAdded() { addEvent.setVisibility(GONE); - ColorMatrix colorMatrix = new ColorMatrix(); - colorMatrix.setSaturation(1); - icon.setColorFilter(new ColorMatrixColorFilter(colorMatrix)); + icon.setColorFilter(MaterialColors.getColor(name, com.google.android.material.R.attr.colorSecondary)); + } public void setClickListener(View.OnClickListener onClickListener) { @@ -49,9 +50,8 @@ public void setClickListener(View.OnClickListener onClickListener) { public void onEventAvailableToAdd() { addEvent.setVisibility(VISIBLE); - ColorMatrix colorMatrix = new ColorMatrix(); - colorMatrix.setSaturation(0); - icon.setColorFilter(new ColorMatrixColorFilter(colorMatrix)); + icon.setColorFilter(MaterialColors.getColor(name, com.google.android.material.R.attr.colorOutlineVariant)); + } public ImageView getIcon() { diff --git a/app/src/main/java/com/besome/sketch/editor/manage/ManageCollectionActivity.java b/app/src/main/java/com/besome/sketch/editor/manage/ManageCollectionActivity.java index 6e7533ce56..b6d32b2906 100644 --- a/app/src/main/java/com/besome/sketch/editor/manage/ManageCollectionActivity.java +++ b/app/src/main/java/com/besome/sketch/editor/manage/ManageCollectionActivity.java @@ -146,7 +146,7 @@ private void changeDeletingItemsState(boolean deletingItems) { private void handleFabOnClick(int categoryId) { if (categoryId == 0) { showAddImageDialog(); - }else if (categoryId == 1) { + } else if (categoryId == 1) { showAddSoundDialog(); } else { showAddFontDialog(); @@ -414,9 +414,9 @@ public void onClick(View v) { if (id == R.id.btn_cancel && selectingToBeDeletedItems) { changeDeletingItemsState(false); - }else if (id == R.id.btn_delete && selectingToBeDeletedItems) { + } else if (id == R.id.btn_delete && selectingToBeDeletedItems) { deleteSelectedToBeDeletedItems(); - }else if (id == R.id.fab) { + } else if (id == R.id.fab) { changeDeletingItemsState(false); handleFabOnClick(currentItemId); } @@ -628,7 +628,7 @@ public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) { return; } fab.hide(); - }else if (dy < -2 && fab.isEnabled()) { + } else if (dy < -2 && fab.isEnabled()) { fab.show(); } } @@ -1117,4 +1117,4 @@ public WidgetCollectionViewHolder(View itemView) { } } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/besome/sketch/editor/manage/library/LibraryItemView.java b/app/src/main/java/com/besome/sketch/editor/manage/library/LibraryItemView.java index 5f7a8d5010..f31b90575d 100644 --- a/app/src/main/java/com/besome/sketch/editor/manage/library/LibraryItemView.java +++ b/app/src/main/java/com/besome/sketch/editor/manage/library/LibraryItemView.java @@ -6,19 +6,19 @@ import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.TextView; -import android.widget.LinearLayout; -import com.besome.sketch.beans.ProjectLibraryBean; +import androidx.cardview.widget.CardView; -import pro.sketchware.R; +import com.besome.sketch.beans.ProjectLibraryBean; import a.a.a.wB; import a.a.a.xB; +import pro.sketchware.R; public class LibraryItemView extends FrameLayout { protected final Context context; - - public final LinearLayout container; + + public final CardView container; public final ImageView icon; public final TextView title; public final TextView description; diff --git a/app/src/main/java/com/besome/sketch/editor/manage/library/ManageLibraryActivity.java b/app/src/main/java/com/besome/sketch/editor/manage/library/ManageLibraryActivity.java index 70eea1ba8b..34cd3acd06 100644 --- a/app/src/main/java/com/besome/sketch/editor/manage/library/ManageLibraryActivity.java +++ b/app/src/main/java/com/besome/sketch/editor/manage/library/ManageLibraryActivity.java @@ -23,21 +23,18 @@ import com.besome.sketch.editor.manage.library.googlemap.ManageGoogleMapActivity; import com.besome.sketch.lib.base.BaseAppCompatActivity; -import dev.aldi.sayuti.editor.manage.ManageLocalLibraryActivity; - -import mod.hey.studios.activity.managers.nativelib.ManageNativelibsActivity; - -import pro.sketchware.R; - import java.lang.ref.WeakReference; import a.a.a.MA; import a.a.a.aB; import a.a.a.jC; import a.a.a.mB; +import dev.aldi.sayuti.editor.manage.ManageLocalLibraryActivity; +import mod.hey.studios.activity.managers.nativelib.ManageNativelibsActivity; import mod.hey.studios.util.Helper; import mod.jbk.editor.manage.library.ExcludeBuiltInLibrariesActivity; import mod.jbk.editor.manage.library.ExcludeBuiltInLibrariesLibraryItemView; +import pro.sketchware.R; public class ManageLibraryActivity extends BaseAppCompatActivity implements View.OnClickListener { @@ -62,14 +59,13 @@ public class ManageLibraryActivity extends BaseAppCompatActivity implements View private TextView externalLib; - private void addLibraryItem(@Nullable ProjectLibraryBean libraryBean, int drawable) { + private void addLibraryItem(@Nullable ProjectLibraryBean libraryBean) { LibraryItemView libraryItemView; if (libraryBean != null) { libraryItemView = new LibraryItemView(this); } else { libraryItemView = new ExcludeBuiltInLibrariesLibraryItemView(this, sc_id); } - libraryItemView.container.setBackgroundResource(drawable); libraryItemView.setTag(libraryBean != null ? libraryBean.libType : null); //noinspection ConstantConditions since the variant if it's nullable handles nulls correctly libraryItemView.setData(libraryBean); @@ -328,14 +324,14 @@ public void onPostCreate(Bundle savedInstanceState) { originalGoogleMapUseYn = savedInstanceState.getString("originalGoogleMapUseYn"); } - addLibraryItem(compatLibraryBean, R.drawable.shape_top); - addLibraryItem(firebaseLibraryBean, R.drawable.shape_middle); - addLibraryItem(admobLibraryBean, R.drawable.shape_middle); - addLibraryItem(googleMapLibraryBean, R.drawable.shape_bottom); - addLibraryItem(new ProjectLibraryBean(ProjectLibraryBean.PROJECT_LIB_TYPE_LOCAL_LIB), R.drawable.shape_top); - addLibraryItem(new ProjectLibraryBean(ProjectLibraryBean.PROJECT_LIB_TYPE_NATIVE_LIB), R.drawable.shape_bottom); + addLibraryItem(compatLibraryBean); + addLibraryItem(firebaseLibraryBean); + addLibraryItem(admobLibraryBean); + addLibraryItem(googleMapLibraryBean); + addLibraryItem(new ProjectLibraryBean(ProjectLibraryBean.PROJECT_LIB_TYPE_LOCAL_LIB)); + addLibraryItem(new ProjectLibraryBean(ProjectLibraryBean.PROJECT_LIB_TYPE_NATIVE_LIB)); // Exclude built-in libraries - addLibraryItem(null, R.drawable.shape_alone); + addLibraryItem(null); } @Override @@ -362,7 +358,7 @@ public void onSaveInstanceState(Bundle outState) { private void showFirebaseNeedCompatDialog() { aB dialog = new aB(this); - dialog.a(R.drawable.widget_firebase); + dialog.a(R.drawable.ic_mtrl_firebase); dialog.b(Helper.getResString(R.string.common_word_warning)); dialog.a(Helper.getResString(R.string.design_library_firebase_message_need_compat)); dialog.b(Helper.getResString(R.string.common_word_ok), Helper.getDialogDismissListener(dialog)); diff --git a/app/src/main/java/com/besome/sketch/editor/manage/library/admob/AdmobActivity.java b/app/src/main/java/com/besome/sketch/editor/manage/library/admob/AdmobActivity.java index 4617a0919c..015b3a9575 100644 --- a/app/src/main/java/com/besome/sketch/editor/manage/library/admob/AdmobActivity.java +++ b/app/src/main/java/com/besome/sketch/editor/manage/library/admob/AdmobActivity.java @@ -214,7 +214,7 @@ public void onCreate(Bundle savedInstanceState) { binding.tvGotoConsole.setText(Helper.getResString(R.string.design_library_admob_button_goto_setting)); binding.tvPrevbtn.setText(Helper.getResString(R.string.common_word_prev)); binding.tvPrevbtn.setOnClickListener(this); - binding.icon.setImageResource(R.drawable.widget_admob); + binding.icon.setImageResource(R.drawable.ic_mtrl_admob); binding.tvNextbtn.setText(Helper.getResString(R.string.common_word_next)); binding.tvNextbtn.setOnClickListener(this); binding.imgBackbtn.setOnClickListener(Helper.getBackPressedClickListener(this)); diff --git a/app/src/main/java/com/besome/sketch/editor/manage/view/ManageViewActivity.java b/app/src/main/java/com/besome/sketch/editor/manage/view/ManageViewActivity.java index 09a69bee8b..9a1e5af6b8 100644 --- a/app/src/main/java/com/besome/sketch/editor/manage/view/ManageViewActivity.java +++ b/app/src/main/java/com/besome/sketch/editor/manage/view/ManageViewActivity.java @@ -11,7 +11,6 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; -import android.widget.LinearLayout; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; @@ -25,7 +24,6 @@ import com.besome.sketch.lib.base.BaseAppCompatActivity; import com.google.android.material.appbar.MaterialToolbar; import com.google.android.material.card.MaterialCardView; -import com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.tabs.TabLayout; @@ -42,7 +40,6 @@ import a.a.a.mB; import a.a.a.wq; import a.a.a.xw; -import mod.hey.studios.util.Helper; import pro.sketchware.R; public class ManageViewActivity extends BaseAppCompatActivity implements OnClickListener, ViewPager.OnPageChangeListener { @@ -110,6 +107,7 @@ public void onPageScrollStateChanged(int var1) { @Override public void onPageScrolled(int var1, float var2, int var3) { + a(false); } public final void a(ProjectFileBean var1, ArrayList var2) { diff --git a/app/src/main/java/com/besome/sketch/editor/property/PropertyInputItem.java b/app/src/main/java/com/besome/sketch/editor/property/PropertyInputItem.java index 69e1d98b92..594bc5fe2c 100644 --- a/app/src/main/java/com/besome/sketch/editor/property/PropertyInputItem.java +++ b/app/src/main/java/com/besome/sketch/editor/property/PropertyInputItem.java @@ -101,13 +101,13 @@ public PropertyInputItem(Context context, boolean z) { private void setIcon(ImageView imageView) { switch (key) { case "property_id" -> icon = R.drawable.ic_mtrl_id; - case "property_text" -> icon = R.drawable.ic_mtrl_type; + case "property_text" -> icon = R.drawable.ic_mtrl_text_select; case "property_hint" -> icon = R.drawable.ic_mtrl_bulb; case "property_weight", "property_weight_sum" -> icon = R.drawable.ic_mtrl_weight; - case "property_rotate" -> icon = R.drawable.ic_mtrl_rotate_90; + case "property_rotate" -> icon = R.drawable.ic_mtrl_rotate; case "property_lines" -> icon = R.drawable.ic_mtrl_numbers; case "property_progress" -> icon = R.drawable.ic_mtrl_prog_min; - case "property_max" -> icon = R.drawable.ic_mtrl_circle; + case "property_max" -> icon = R.drawable.ic_mtrl_prog_max; case "property_alpha" -> icon = R.drawable.ic_mtrl_opacity_full; case "property_translation_x" -> icon = R.drawable.ic_mtrl_move_x; case "property_translation_y" -> icon = R.drawable.ic_mtrl_move_y; diff --git a/app/src/main/java/com/besome/sketch/editor/view/ViewEvents.java b/app/src/main/java/com/besome/sketch/editor/view/ViewEvents.java index adefbe3b7a..d852845411 100644 --- a/app/src/main/java/com/besome/sketch/editor/view/ViewEvents.java +++ b/app/src/main/java/com/besome/sketch/editor/view/ViewEvents.java @@ -15,6 +15,7 @@ import com.besome.sketch.beans.EventBean; import com.besome.sketch.beans.ProjectFileBean; import com.besome.sketch.beans.ViewBean; +import com.google.android.material.color.MaterialColors; import pro.sketchware.R; import pro.sketchware.databinding.EventGridItemBinding; @@ -115,7 +116,7 @@ public void bind(EventBean event, int position) { binding.tvTitle.setText(event.eventName); if (event.isSelected) { - mB.a(binding.imgIcon, 1); + binding.imgIcon.setColorFilter(MaterialColors.getColor(binding.tvTitle, com.google.android.material.R.attr.colorSecondary)); binding.imgUsedEvent.setVisibility(View.GONE); binding.container.setOnLongClickListener(v -> { aB dialog = new aB((Activity) itemView.getContext()); @@ -136,7 +137,7 @@ public void bind(EventBean event, int position) { }); } else { binding.imgUsedEvent.setVisibility(View.VISIBLE); - mB.a(binding.imgIcon, 0); + binding.imgIcon.setColorFilter(MaterialColors.getColor(binding.tvTitle, com.google.android.material.R.attr.colorOutlineVariant)); } } } diff --git a/app/src/main/java/dev/aldi/sayuti/editor/manage/ManageLocalLibraryActivity.java b/app/src/main/java/dev/aldi/sayuti/editor/manage/ManageLocalLibraryActivity.java index bbb1df9686..66b5f996e3 100644 --- a/app/src/main/java/dev/aldi/sayuti/editor/manage/ManageLocalLibraryActivity.java +++ b/app/src/main/java/dev/aldi/sayuti/editor/manage/ManageLocalLibraryActivity.java @@ -38,8 +38,6 @@ import mod.hey.studios.build.BuildSettings; import mod.hey.studios.util.Helper; import mod.jbk.util.AddMarginOnApplyWindowInsetsListener; - -import pro.sketchware.R; import pro.sketchware.databinding.ManageLocallibrariesBinding; import pro.sketchware.databinding.ViewItemLocalLibBinding; import pro.sketchware.databinding.ViewItemLocalLibSearchBinding; diff --git a/app/src/main/java/mod/agus/jcoderz/editor/event/ManageEvent.java b/app/src/main/java/mod/agus/jcoderz/editor/event/ManageEvent.java index 71d949de8f..e6dcc73647 100644 --- a/app/src/main/java/mod/agus/jcoderz/editor/event/ManageEvent.java +++ b/app/src/main/java/mod/agus/jcoderz/editor/event/ManageEvent.java @@ -334,49 +334,50 @@ public static void c(String eventName, ArrayList list) { public static int d(String str) { return switch (str) { - case "onUpdateProfileComplete" -> R.drawable.event_update_profile; + case "onUpdateProfileComplete" -> R.drawable.ic_mtrl_user_edit; case "FBAdsBanner_onLoggingImpression", "FBAdsInterstitial_onLoggingImpression" -> R.drawable.event_fbads_impression; - case "onEmailVerificationSent" -> R.drawable.event_email_verif_sent; - case "onDateChanged", "onDateSet" -> R.drawable.event_on_date_changed_48dp; - case "onFailureLink" -> R.drawable.event_fb_dynamic_fail; - case "onDeleteUserComplete" -> R.drawable.event_delete_user; - case "onCompletion" -> R.drawable.event_on_file_put_success_48dp; - case "onQueryTextChanged", "onQueryTextSubmit" -> R.drawable.ic_search_color_96dp; - case "onUpdateEmailComplete" -> R.drawable.event_email_updated; - case "onError", "onRestoreInstanceState" -> R.drawable.error_96_yellow; - case "onVerificationCompleted" -> R.drawable.event_verif_success; + case "onEmailVerificationSent" -> R.drawable.ic_mtrl_sms_check; + case "onDateChanged", "onDateSet" -> R.drawable.ic_mtrl_date_changed; + case "onFailureLink" -> R.drawable.ic_mtrl_link_fail; + case "onDeleteUserComplete" -> R.drawable.ic_mtrl_user_remove; + case "onCompletion" -> R.drawable.ic_mtrl_vid_completed; + case "onQueryTextChanged", "onQueryTextSubmit" -> R.drawable.ic_mtrl_search; + case "onUpdateEmailComplete" -> R.drawable.ic_mtrl_email_sent; + case "onRestoreInstanceState" -> R.drawable.ic_mtrl_warning; + case "onError" -> R.drawable.ic_mtrl_vid_error; + case "onVerificationCompleted" -> R.drawable.ic_mtrl_verified_user; case "onSaveInstanceState", "onCreateOptionsMenu", "onCreateContextMenu", "onContextItemSelected", "onOptionsItemSelected" -> R.drawable.bg_event_type_activity; - case "onSuccessLink" -> R.drawable.event_fb_dynamic_success; + case "onSuccessLink" -> R.drawable.ic_mtrl_link_check; case "onPatternLockCleared", "onPatternLockProgress", "onPatternLockStarted", - "onPatternLockComplete" -> R.drawable.event_pattern_lock_view; + "onPatternLockComplete" -> R.drawable.ic_mtrl_pattern; case "FBAdsInterstitial_onAdClicked", "FBAdsBanner_onAdClicked" -> R.drawable.event_fbads_click; - case "onAccountPickerCancelled" -> R.drawable.event_google_revoke; - case "onVerificationFailed" -> R.drawable.event_verif_failed; + case "onAccountPickerCancelled" -> R.drawable.ic_mtrl_user_delete; + case "onVerificationFailed" -> R.drawable.ic_mtrl_gpp_bad; case "onGoogleSignIn" -> R.drawable.event_google_signin; - case "onAccountPicker" -> R.drawable.event_google_result; - case "onFragmentAdded" -> R.drawable.widget_fragment; - case "onTimeSet", "onTimeChanged" -> R.drawable.widget_timer; - case "signInWithPhoneAuthComplete", "onCodeSent" -> R.drawable.event_code_sent; + case "onAccountPicker" -> R.drawable.ic_mtrl_group; + case "onFragmentAdded" -> R.drawable.ic_mtrl_viewpager; + case "onTimeSet", "onTimeChanged" -> R.drawable.ic_mtrl_timer; + case "signInWithPhoneAuthComplete", "onCodeSent" -> R.drawable.ic_mtrl_email_sent; case "FBAdsInterstitial_onInterstitialDismissed" -> R.drawable.event_fbads_dismiss; - case "onRatingChanged" -> R.drawable.star_filled; + case "onRatingChanged" -> R.drawable.ic_mtrl_star; case "FBAdsInterstitial_onInterstitialDisplayed" -> R.drawable.event_fbads_displayed; - case "onLetterSelected" -> R.drawable.event_on_letter_selected; + case "onLetterSelected" -> R.drawable.ic_mtrl_abc_click; case "onScrollChanged", "onPageChanged", "onPageScrolled", "onRecyclerScrolled", "onRecyclerScrollChanged", "onNavigationItemSelected", "onScrolled", "onTabUnselected", "onPageSelected", "onTabSelected", "onTabReselected" -> - R.drawable.event_on_item_long_clicked_48dp; - case "onPrepared" -> R.drawable.event_on_page_started_48dp; + R.drawable.ic_mtrl_touch_long; + case "onPrepared" -> R.drawable.ic_mtrl_vid_prepared; case "FBAdsInterstitial_onError", "FBAdsBanner_onError" -> R.drawable.event_fbads_error; case "FBAdsInterstitial_onAdLoaded", "FBAdsBanner_onAdLoaded" -> R.drawable.event_fbads_loaded; - case "onTabAdded" -> R.drawable.widget_tab_layout; - case "onCompleteRegister" -> R.drawable.event_complete_register; - case "onUpdatePasswordComplete" -> R.drawable.event_password_updated; - case "onUserEarnedReward" -> R.drawable.receive_cash_48; + case "onTabAdded" -> R.drawable.ic_mtrl_post_added; + case "onCompleteRegister" -> R.drawable.ic_mtrl_user_register_complete; + case "onUpdatePasswordComplete" -> R.drawable.ic_mtrl_password; + case "onUserEarnedReward" -> R.drawable.ic_mtrl_payment; default -> EventsHandler.getIcon(str); }; } diff --git a/app/src/main/java/mod/agus/jcoderz/editor/manage/permission/ManagePermissionActivity.java b/app/src/main/java/mod/agus/jcoderz/editor/manage/permission/ManagePermissionActivity.java index bf458429c3..3c9b1b995b 100644 --- a/app/src/main/java/mod/agus/jcoderz/editor/manage/permission/ManagePermissionActivity.java +++ b/app/src/main/java/mod/agus/jcoderz/editor/manage/permission/ManagePermissionActivity.java @@ -1,6 +1,5 @@ package mod.agus.jcoderz.editor.manage.permission; -import android.app.AlertDialog; import android.os.Bundle; import android.os.Parcelable; import android.text.Editable; @@ -15,24 +14,20 @@ import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.RecyclerView; -import com.google.android.material.button.MaterialButton; +import com.besome.sketch.lib.base.BaseAppCompatActivity; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.textfield.TextInputEditText; import com.google.gson.Gson; +import java.util.ArrayList; + +import mod.jbk.util.AddMarginOnApplyWindowInsetsListener; import pro.sketchware.R; import pro.sketchware.databinding.ManagePermissionBinding; import pro.sketchware.databinding.ViewItemPermissionBinding; - -import com.besome.sketch.lib.base.BaseAppCompatActivity; - -import java.util.ArrayList; - import pro.sketchware.utility.FilePathUtil; import pro.sketchware.utility.FileResConfig; import pro.sketchware.utility.FileUtil; -import mod.hey.studios.util.Helper; -import mod.jbk.util.AddMarginOnApplyWindowInsetsListener; public class ManagePermissionActivity extends BaseAppCompatActivity { private PermissionsAdapter adapter; @@ -64,7 +59,7 @@ public void onCreate(Bundle savedInstanceState) { } private void initViews() { - binding.topAppBar.setNavigationOnClickListener(v -> onBackPressed()); + binding.toolbar.setNavigationOnClickListener(v -> onBackPressed()); ViewCompat.setOnApplyWindowInsetsListener(binding.scrollToTopButton, new AddMarginOnApplyWindowInsetsListener(WindowInsetsCompat.Type.navigationBars(), WindowInsetsCompat.CONSUMED)); } @@ -112,18 +107,21 @@ public void onTextChanged(CharSequence newText, int start, int before, int count } public void initButtons() { - binding.resetPermissions.setOnClickListener(view -> { - new MaterialAlertDialogBuilder(this) - .setTitle("Reset permissions") - .setMessage("Are you sure you want to reset all permissions? This cannot be undone!") - .setPositiveButton("Reset", (dialog, which) -> { - FileUtil.writeFile(new FilePathUtil().getPathPermission(numProj), "[]"); - //As FileResConfig only refreshes permissions during ()V, this is required. - frc = new FileResConfig(numProj); - setItems(); - }) - .setNegativeButton("Cancel", (dialog, which) -> dialog.dismiss()) - .show(); + binding.toolbar.setOnMenuItemClickListener(item -> { + if (item.getItemId() == R.id.action_reset) { + new MaterialAlertDialogBuilder(this) + .setTitle("Reset permissions") + .setMessage("Are you sure you want to reset all permissions? This cannot be undone!") + .setPositiveButton("Reset", (dialog, which) -> { + FileUtil.writeFile(new FilePathUtil().getPathPermission(numProj), "[]"); + //As FileResConfig only refreshes permissions during ()V, this is required. + frc = new FileResConfig(numProj); + setItems(); + }) + .setNegativeButton("Cancel", (dialog, which) -> dialog.dismiss()) + .show(); + } + return true; }); binding.scrollToTopButton.setOnClickListener(view -> { binding.scrollToTopButton.hide(); diff --git a/app/src/main/java/mod/agus/jcoderz/editor/manage/resource/ManageResourceActivity.java b/app/src/main/java/mod/agus/jcoderz/editor/manage/resource/ManageResourceActivity.java index 019a6558e6..5665f50255 100644 --- a/app/src/main/java/mod/agus/jcoderz/editor/manage/resource/ManageResourceActivity.java +++ b/app/src/main/java/mod/agus/jcoderz/editor/manage/resource/ManageResourceActivity.java @@ -35,7 +35,6 @@ import mod.bobur.StringEditorActivity; import mod.bobur.XmlToSvgConverter; import mod.hey.studios.code.SrcCodeEditor; -import mod.hey.studios.code.SrcCodeEditorLegacy; import mod.hey.studios.util.Helper; import mod.hilal.saif.activities.tools.ConfigActivity; import mod.jbk.util.AddMarginOnApplyWindowInsetsListener; @@ -345,11 +344,7 @@ private void goEdit(int position) { startActivity(intent); }else if (frc.listFileResource.get(position).endsWith("xml")) { Intent intent = new Intent(); - if (ConfigActivity.isLegacyCeEnabled()) { - intent.setClass(getApplicationContext(), SrcCodeEditorLegacy.class); - } else { - intent.setClass(getApplicationContext(), SrcCodeEditor.class); - } + intent.setClass(getApplicationContext(), SrcCodeEditor.class); intent.putExtra("title", Uri.parse(frc.listFileResource.get(position)).getLastPathSegment()); intent.putExtra("content", frc.listFileResource.get(position)); intent.putExtra("xml", ""); @@ -365,11 +360,7 @@ private void goEdit(int position) { private void goEdit2(int position) { if (frc.listFileResource.get(position).endsWith("xml")) { Intent intent = new Intent(); - if (ConfigActivity.isLegacyCeEnabled()) { - intent.setClass(getApplicationContext(), SrcCodeEditorLegacy.class); - } else { - intent.setClass(getApplicationContext(), SrcCodeEditor.class); - } + intent.setClass(getApplicationContext(), SrcCodeEditor.class); intent.putExtra("title", Uri.parse(frc.listFileResource.get(position)).getLastPathSegment()); intent.putExtra("content", frc.listFileResource.get(position)); intent.putExtra("xml", ""); diff --git a/app/src/main/java/mod/bobur/StringEditorActivity.java b/app/src/main/java/mod/bobur/StringEditorActivity.java index afae9eb914..85b68cef78 100644 --- a/app/src/main/java/mod/bobur/StringEditorActivity.java +++ b/app/src/main/java/mod/bobur/StringEditorActivity.java @@ -26,7 +26,6 @@ import com.google.gson.Gson; import mod.hey.studios.code.SrcCodeEditor; -import mod.hey.studios.code.SrcCodeEditorLegacy; import mod.hey.studios.util.Helper; import mod.hilal.saif.activities.tools.ConfigActivity; @@ -169,7 +168,7 @@ public boolean onOptionsItemSelected(android.view.MenuItem item) { isComingFromSrcCodeEditor = true; XmlUtil.saveXml(getIntent().getStringExtra("content"), convertListMapToXml(listmap)); Intent intent = new Intent(); - intent.setClass(getApplicationContext(), ConfigActivity.isLegacyCeEnabled() ? SrcCodeEditorLegacy.class : SrcCodeEditor.class); + intent.setClass(getApplicationContext(), SrcCodeEditor.class); intent.putExtra("title", getIntent().getStringExtra("title")); intent.putExtra("content", getIntent().getStringExtra("content")); intent.putExtra("xml", getIntent().getStringExtra("xml")); diff --git a/app/src/main/java/mod/hey/studios/activity/managers/java/ManageJavaActivity.java b/app/src/main/java/mod/hey/studios/activity/managers/java/ManageJavaActivity.java index 2238184122..feba1f5360 100644 --- a/app/src/main/java/mod/hey/studios/activity/managers/java/ManageJavaActivity.java +++ b/app/src/main/java/mod/hey/studios/activity/managers/java/ManageJavaActivity.java @@ -48,7 +48,7 @@ import pro.sketchware.utility.FilePathUtil; import pro.sketchware.utility.FileResConfig; import pro.sketchware.utility.FileUtil; -import mod.hey.studios.code.SrcCodeEditorLegacy; +import mod.hey.studios.code.SrcCodeEditor; import mod.hey.studios.util.Helper; import mod.hilal.saif.activities.tools.ConfigActivity; import mod.jbk.util.AddMarginOnApplyWindowInsetsListener; @@ -509,13 +509,7 @@ public boolean isFolder(int position) { public void goEditFile(int position) { Intent intent = new Intent(); - - if (ConfigActivity.isLegacyCeEnabled()) { - intent.setClass(getApplicationContext(), SrcCodeEditorLegacy.class); - } else { - intent.setClass(getApplicationContext(), mod.hey.studios.code.SrcCodeEditor.class); - } - + intent.setClass(getApplicationContext(), SrcCodeEditor.class); intent.putExtra("java", ""); intent.putExtra("title", getFileName(position)); intent.putExtra("content", getItem(position)); diff --git a/app/src/main/java/mod/hey/studios/code/SrcCodeEditorLegacy.java b/app/src/main/java/mod/hey/studios/code/SrcCodeEditorLegacy.java deleted file mode 100644 index 09d8d1d164..0000000000 --- a/app/src/main/java/mod/hey/studios/code/SrcCodeEditorLegacy.java +++ /dev/null @@ -1,92 +0,0 @@ -package mod.hey.studios.code; - -import android.app.Activity; -import android.app.AlertDialog; -import android.content.SharedPreferences; -import android.os.Bundle; -import android.text.InputType; -import android.view.View; -import android.widget.TextView; -import android.widget.Toast; - -import pro.sketchware.R; - -import pro.sketchware.utility.FileUtil; -import mod.hey.studios.lib.code_editor.CodeEditorLayout; -import mod.hey.studios.lib.code_editor.ColorScheme; - -/** - * Legacy code editor - */ -public class SrcCodeEditorLegacy extends Activity { - - private CodeEditorLayout codeEditor; - private SharedPreferences sp; - - private final View.OnClickListener changeTextSize = v -> { - if (v.getId() == R.id.code_editor_zoomin) { - codeEditor.increaseTextSize(); - } else if (v.getId() == R.id.code_editor_zoomout) { - codeEditor.decreaseTextSize(); - } - }; - - - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - sp = getSharedPreferences("code_editor_pref", 0); - - setContentView(R.layout.view_code); - TextView tv_title = findViewById(R.id.text_title); - codeEditor = findViewById(R.id.text_content); - - if (getIntent().hasExtra("java")) { - codeEditor.start(ColorScheme.JAVA()); - } else if (getIntent().hasExtra("xml")) { - codeEditor.start(ColorScheme.XML()); - } - - if (getIntent().hasExtra("title") && getIntent().hasExtra("content")) { - tv_title.setText(getIntent().getStringExtra("title")); - codeEditor.setText(FileUtil.readFile(getIntent().getStringExtra("content"))); - } - - findViewById(R.id.code_editor_zoomin).setOnClickListener(changeTextSize); - findViewById(R.id.code_editor_zoomout).setOnClickListener(changeTextSize); - - codeEditor.onCreateOptionsMenu(findViewById(R.id.codeeditor_more_options)); - codeEditor.getEditText().setInputType(InputType.TYPE_CLASS_TEXT - | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS - | InputType.TYPE_TEXT_FLAG_MULTI_LINE); - } - - @Override - public void onBackPressed() { - boolean exitConfirmationDialogEnabled = sp.getBoolean("exit_confirmation_dialog", false); - if (exitConfirmationDialogEnabled) { - new AlertDialog.Builder(this) - .setTitle("Save Changes?") - .setMessage("Do you want to save your changes? If not, the file will be reverted.") - .setPositiveButton(R.string.common_word_save, (dialog, which) -> { - FileUtil.writeFile(getIntent().getStringExtra("content"), codeEditor.getText()); - Toast.makeText(this, "File saved", Toast.LENGTH_SHORT).show(); - finish(); - }) - .setNeutralButton("Discard", (dialog, which) -> finish()) - .setNegativeButton(R.string.common_word_cancel, null) - .show(); - } else { - super.onBackPressed(); - - FileUtil.writeFile(getIntent().getStringExtra("content"), codeEditor.getText()); - Toast.makeText(this, "File saved", Toast.LENGTH_SHORT).show(); - } - } - - @Override - public void onPause() { - super.onPause(); - codeEditor.onPause(); - } -} diff --git a/app/src/main/java/mod/hey/studios/project/ProjectSettingsDialog.java b/app/src/main/java/mod/hey/studios/project/ProjectSettingsDialog.java index 37018d4484..ece3eb16eb 100644 --- a/app/src/main/java/mod/hey/studios/project/ProjectSettingsDialog.java +++ b/app/src/main/java/mod/hey/studios/project/ProjectSettingsDialog.java @@ -53,10 +53,10 @@ public void show() { binding.removeOldMethods.setOnClickListener(v -> binding.cbRemoveOldMethods.performClick()); binding.useNewMaterialComponentsAppTheme.setOnClickListener(v -> binding.cbUseNewMaterialComponentsAppTheme.performClick()); - binding.enableViewbinding.setTag(ProjectSettings.SETTING_ENABLE_VIEWBINDING); binding.etMinimumSdkVersion.setTag(ProjectSettings.SETTING_MINIMUM_SDK_VERSION); binding.etTargetSdkVersion.setTag(ProjectSettings.SETTING_TARGET_SDK_VERSION); binding.etApplicationClassName.setTag(ProjectSettings.SETTING_APPLICATION_CLASS); + binding.cbEnableViewbinding.setTag(ProjectSettings.SETTING_ENABLE_VIEWBINDING); binding.cbRemoveOldMethods.setTag(ProjectSettings.SETTING_DISABLE_OLD_METHODS); binding.cbUseNewMaterialComponentsAppTheme.setTag(ProjectSettings.SETTING_ENABLE_BRIDGELESS_THEMES); diff --git a/app/src/main/java/mod/hilal/saif/activities/android_manifest/AndroidManifestInjection.java b/app/src/main/java/mod/hilal/saif/activities/android_manifest/AndroidManifestInjection.java index 16658c58fd..31f9683906 100644 --- a/app/src/main/java/mod/hilal/saif/activities/android_manifest/AndroidManifestInjection.java +++ b/app/src/main/java/mod/hilal/saif/activities/android_manifest/AndroidManifestInjection.java @@ -19,13 +19,10 @@ import androidx.appcompat.widget.Toolbar; import com.besome.sketch.editor.manage.library.LibraryItemView; +import com.besome.sketch.lib.base.BaseAppCompatActivity; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.textfield.TextInputEditText; -import com.google.android.material.textfield.TextInputLayout; import com.google.gson.Gson; -import pro.sketchware.R; -import pro.sketchware.databinding.ProgressMsgBoxBinding; -import com.besome.sketch.lib.base.BaseAppCompatActivity; import java.util.ArrayList; import java.util.HashMap; @@ -36,21 +33,20 @@ import a.a.a.jC; import a.a.a.wB; import a.a.a.yq; - import io.github.rosemoe.sora.widget.CodeEditor; import io.github.rosemoe.sora.widget.component.Magnifier; - -import pro.sketchware.utility.SketchwareUtil; -import pro.sketchware.utility.FileUtil; -import pro.sketchware.utility.UI; import mod.hey.studios.code.SrcCodeEditor; -import mod.hey.studios.code.SrcCodeEditorLegacy; import mod.hey.studios.util.Helper; import mod.hilal.saif.activities.tools.ConfigActivity; import mod.hilal.saif.android_manifest.AndroidManifestInjector; import mod.jbk.code.CodeEditorColorSchemes; import mod.jbk.code.CodeEditorLanguages; import mod.remaker.view.CustomAttributeView; +import pro.sketchware.R; +import pro.sketchware.databinding.ProgressMsgBoxBinding; +import pro.sketchware.utility.FileUtil; +import pro.sketchware.utility.SketchwareUtil; +import pro.sketchware.utility.UI; @SuppressLint("SetTextI18n") public class AndroidManifestInjection extends BaseAppCompatActivity { @@ -110,73 +106,72 @@ private void checkAttrs() { private void setupViews() { LinearLayout content = findViewById(R.id.content); LinearLayout cards = findViewById(R.id.cards); - List options = new ArrayList<>(); - + options.add(createOption( - "Application", - "Default properties for the app", - R.drawable.icons8_app_attrs, - v -> { - Intent intent = new Intent(); - intent.setClass(getApplicationContext(), AndroidManifestInjectionDetails.class); - intent.putExtra("sc_id", sc_id); - intent.putExtra("file_name", activityName); - intent.putExtra("type", "application"); - startActivity(intent); - } + "Application", + "Default properties for the app", + R.drawable.icons8_app_attrs, + v -> { + Intent intent = new Intent(); + intent.setClass(getApplicationContext(), AndroidManifestInjectionDetails.class); + intent.putExtra("sc_id", sc_id); + intent.putExtra("file_name", activityName); + intent.putExtra("type", "application"); + startActivity(intent); + } )); options.add(createOption( - "Permissions", - "Add custom Permissions to the app", - R.drawable.event_on_signin_complete_48dp, - v -> { - Intent intent = new Intent(); - intent.setClass(getApplicationContext(), AndroidManifestInjectionDetails.class); - intent.putExtra("sc_id", sc_id); - intent.putExtra("file_name", activityName); - intent.putExtra("type", "permission"); - startActivity(intent); - } + "Permissions", + "Add custom Permissions to the app", + R.drawable.event_on_signin_complete_48dp, + v -> { + Intent intent = new Intent(); + intent.setClass(getApplicationContext(), AndroidManifestInjectionDetails.class); + intent.putExtra("sc_id", sc_id); + intent.putExtra("file_name", activityName); + intent.putExtra("type", "permission"); + startActivity(intent); + } )); options.add(createOption( - "Launcher Activity", - "Change the default Launcher Activity", - R.drawable.recycling_48, - v -> showLauncherActDialog(AndroidManifestInjector.getLauncherActivity(sc_id)) + "Launcher Activity", + "Change the default Launcher Activity", + R.drawable.recycling_48, + v -> showLauncherActDialog(AndroidManifestInjector.getLauncherActivity(sc_id)) )); options.add(createOption( - "All Activities", - "Add attributes for all Activities", - R.drawable.icons8_all_activities_attrs, - v -> { - Intent intent = new Intent(); - intent.setClass(getApplicationContext(), AndroidManifestInjectionDetails.class); - intent.putExtra("sc_id", sc_id); - intent.putExtra("file_name", activityName); - intent.putExtra("type", "all"); - startActivity(intent); - } + "All Activities", + "Add attributes for all Activities", + R.drawable.icons8_all_activities_attrs, + v -> { + Intent intent = new Intent(); + intent.setClass(getApplicationContext(), AndroidManifestInjectionDetails.class); + intent.putExtra("sc_id", sc_id); + intent.putExtra("file_name", activityName); + intent.putExtra("type", "all"); + startActivity(intent); + } )); options.add(createOption( - "App Components", - "Add extra components", - R.drawable.icons8_app_components, - v -> showAppComponentDialog() + "App Components", + "Add extra components", + R.drawable.icons8_app_components, + v -> showAppComponentDialog() )); - + options.forEach(option -> { final int index = options.indexOf(option); option.container.setBackgroundResource(UI.getShapedBackgroundForList(options, index)); cards.addView(option); }); - + act_list = new ListView(this); act_list.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT)); act_list.setDividerHeight(0); content.addView(act_list); } - + private final LibraryItemView createOption(final String title, final String description, final int icon, View.OnClickListener onClick) { var card = new LibraryItemView(this); makeup(card, icon, title, description); @@ -186,11 +181,7 @@ private final LibraryItemView createOption(final String title, final String desc private void showAppComponentDialog() { Intent intent = new Intent(); - if (ConfigActivity.isLegacyCeEnabled()) { - intent.setClass(getApplicationContext(), SrcCodeEditorLegacy.class); - } else { - intent.setClass(getApplicationContext(), SrcCodeEditor.class); - } + intent.setClass(getApplicationContext(), SrcCodeEditor.class); String APP_COMPONENTS_PATH = FileUtil.getExternalStorageDir().concat("/.sketchware/data/").concat(sc_id).concat("/Injection/androidmanifest/app_components.txt"); if (!FileUtil.isExistFile(APP_COMPONENTS_PATH)) FileUtil.writeFile(APP_COMPONENTS_PATH, ""); @@ -504,4 +495,4 @@ public View getView(final int position, View convertView, ViewGroup parent) { return attributeView; } } -} \ No newline at end of file +} diff --git a/app/src/main/java/mod/hilal/saif/activities/tools/AppSettings.java b/app/src/main/java/mod/hilal/saif/activities/tools/AppSettings.java index 7baf8b33d4..182df5f9ba 100644 --- a/app/src/main/java/mod/hilal/saif/activities/tools/AppSettings.java +++ b/app/src/main/java/mod/hilal/saif/activities/tools/AppSettings.java @@ -2,8 +2,6 @@ import static com.besome.sketch.editor.view.ViewEditor.shakeView; -import static pro.sketchware.utility.SketchwareUtil.dpToPx; - import android.content.Intent; import android.net.Uri; import android.os.Build; @@ -19,8 +17,6 @@ import androidx.activity.EdgeToEdge; import androidx.appcompat.app.AlertDialog; -import a.a.a.aB; - import com.besome.sketch.editor.manage.library.LibraryItemView; import com.besome.sketch.help.SystemSettingActivity; import com.besome.sketch.lib.base.BaseAppCompatActivity; @@ -30,26 +26,23 @@ import com.google.android.material.appbar.MaterialToolbar; import com.google.android.material.dialog.MaterialAlertDialogBuilder; -import dev.aldi.sayuti.editor.manage.ManageLocalLibraryActivity; - import java.io.File; import java.util.ArrayList; import java.util.List; +import a.a.a.aB; +import dev.aldi.sayuti.editor.manage.ManageLocalLibraryActivity; import kellinwood.security.zipsigner.ZipSigner; - import mod.alucard.tn.apksigner.ApkSigner; -import mod.hey.studios.code.SrcCodeEditorLegacy; +import mod.hey.studios.code.SrcCodeEditor; import mod.hey.studios.util.Helper; import mod.khaled.logcat.LogReaderActivity; - import pro.sketchware.R; import pro.sketchware.activities.editor.component.ManageCustomComponentActivity; import pro.sketchware.activities.settings.SettingsActivity; import pro.sketchware.databinding.DialogSelectApkToSignBinding; -import pro.sketchware.utility.SketchwareUtil; import pro.sketchware.utility.FileUtil; -import pro.sketchware.utility.UI; +import pro.sketchware.utility.SketchwareUtil; public class AppSettings extends BaseAppCompatActivity { @@ -106,9 +99,7 @@ private void openWorkingDirectory() { .setSingleChoiceItems(new String[]{"Edit", "Delete"}, -1, (actionDialog, which) -> { switch (which) { case 0 -> { - Intent intent = new Intent(getApplicationContext(), ConfigActivity.isLegacyCeEnabled() ? - SrcCodeEditorLegacy.class - : mod.hey.studios.code.SrcCodeEditor.class); + Intent intent = new Intent(getApplicationContext(), SrcCodeEditor.class); intent.putExtra("title", Uri.parse(files[0]).getLastPathSegment()); intent.putExtra("content", files[0]); intent.putExtra("xml", ""); @@ -131,22 +122,18 @@ private void openWorkingDirectory() { } private void setupPreferences() { - preferences.add(createPreference(R.drawable.block_96_blue, "Block manager", "Manage your own blocks to use in Logic Editor", new ActivityLauncher(new Intent(getApplicationContext(), BlocksManager.class)), false)); - preferences.add(createPreference(R.drawable.pull_down_48, "Block selector menu manager", "Manage your own block selector menus", openSettingsActivity(SettingsActivity.BLOCK_SELECTOR_MANAGER_FRAGMENT), false)); - preferences.add(createPreference(R.drawable.collage_48, "Component manager", "Manage your own components", new ActivityLauncher(new Intent(getApplicationContext(), ManageCustomComponentActivity.class)), false)); - preferences.add(createPreference(R.drawable.event_on_item_clicked_48dp, "Event manager", "Manage your own events", openSettingsActivity(SettingsActivity.EVENTS_MANAGER_FRAGMENT), false)); - preferences.add(createPreference(R.drawable.colored_box_96, "Local library manager", "Manage and download local libraries", new ActivityLauncher(new Intent(getApplicationContext(), ManageLocalLibraryActivity.class), new Pair<>("sc_id", "system")), false)); - preferences.add(createPreference(R.drawable.engineering_48, "Mod settings", "Change general mod settings", new ActivityLauncher(new Intent(getApplicationContext(), ConfigActivity.class)), false)); - preferences.add(createPreference(R.drawable.ic_mtrl_palette, getString(R.string.settings_appearance), getString(R.string.settings_appearance_description), openSettingsActivity(SettingsActivity.SETTINGS_APPEARANCE_FRAGMENT), false)); - preferences.add(createPreference(R.mipmap.ic_type_folder, "Open working directory", "Open Sketchware Pro's directory and edit files in it", v -> openWorkingDirectory(), false)); - preferences.add(createPreference(R.drawable.ic_apk_color_96dp, "Sign an APK file with testkey", "Sign an already existing APK file with testkey and signature schemes up to V4", v -> signApkFileDialog(), false)); - preferences.add(createPreference(R.drawable.icons8_app_components, getString(R.string.design_drawer_menu_title_logcat_reader), getString(R.string.design_drawer_menu_subtitle_logcat_reader), new ActivityLauncher(new Intent(getApplicationContext(), LogReaderActivity.class)), false)); - preferences.add(createPreference(R.drawable.ic_mtrl_settings, getString(R.string.main_drawer_title_system_settings), "Auto-save and vibrations", new ActivityLauncher(new Intent(getApplicationContext(), SystemSettingActivity.class)), true)); - preferences.forEach(preference -> { - final int index = preferences.indexOf(preference); - preference.container.setBackgroundResource(UI.getShapedBackgroundForList(preferences, index)); - content.addView(preference); - }); + preferences.add(createPreference(R.drawable.ic_mtrl_block, "Block manager", "Manage your own blocks to use in Logic Editor", new ActivityLauncher(new Intent(getApplicationContext(), BlocksManager.class)))); + preferences.add(createPreference(R.drawable.ic_mtrl_pull_down, "Block selector menu manager", "Manage your own block selector menus", openSettingsActivity(SettingsActivity.BLOCK_SELECTOR_MANAGER_FRAGMENT))); + preferences.add(createPreference(R.drawable.ic_mtrl_component, "Component manager", "Manage your own components", new ActivityLauncher(new Intent(getApplicationContext(), ManageCustomComponentActivity.class)))); + preferences.add(createPreference(R.drawable.ic_mtrl_list, "Event manager", "Manage your own events", openSettingsActivity(SettingsActivity.EVENTS_MANAGER_FRAGMENT))); + preferences.add(createPreference(R.drawable.ic_mtrl_box, "Local library manager", "Manage and download local libraries", new ActivityLauncher(new Intent(getApplicationContext(), ManageLocalLibraryActivity.class), new Pair<>("sc_id", "system")))); + preferences.add(createPreference(R.drawable.ic_mtrl_settings_applications, "Mod settings", "Change general mod settings", new ActivityLauncher(new Intent(getApplicationContext(), ConfigActivity.class)))); + preferences.add(createPreference(R.drawable.ic_mtrl_palette, getString(R.string.settings_appearance), getString(R.string.settings_appearance_description), openSettingsActivity(SettingsActivity.SETTINGS_APPEARANCE_FRAGMENT))); + preferences.add(createPreference(R.drawable.ic_mtrl_folder, "Open working directory", "Open Sketchware Pro's directory and edit files in it", v -> openWorkingDirectory())); + preferences.add(createPreference(R.drawable.ic_mtrl_apk_document, "Sign an APK file with testkey", "Sign an already existing APK file with testkey and signature schemes up to V4", v -> signApkFileDialog())); + preferences.add(createPreference(R.drawable.ic_mtrl_article, getString(R.string.design_drawer_menu_title_logcat_reader), getString(R.string.design_drawer_menu_subtitle_logcat_reader), new ActivityLauncher(new Intent(getApplicationContext(), LogReaderActivity.class)))); + preferences.add(createPreference(R.drawable.ic_mtrl_settings, getString(R.string.main_drawer_title_system_settings), "Auto-save and vibrations", new ActivityLauncher(new Intent(getApplicationContext(), SystemSettingActivity.class)))); + preferences.forEach(preference -> content.addView(preference)); } private View.OnClickListener openSettingsActivity(String fragmentTag) { @@ -157,20 +144,13 @@ private View.OnClickListener openSettingsActivity(String fragmentTag) { }; } - private LibraryItemView createPreference(int icon, String title, String desc, View.OnClickListener listener, boolean lastpreference) { + private LibraryItemView createPreference(int icon, String title, String desc, View.OnClickListener listener) { LibraryItemView preference = new LibraryItemView(this); preference.enabled.setVisibility(View.GONE); preference.icon.setImageResource(icon); preference.title.setText(title); preference.description.setText(desc); preference.setOnClickListener(listener); - LinearLayout.LayoutParams preferenceParams = new LinearLayout.LayoutParams( - LinearLayout.LayoutParams.MATCH_PARENT, - LinearLayout.LayoutParams.WRAP_CONTENT, - 0.0f - ); - preferenceParams.bottomMargin = lastpreference ? dpToPx(25) : dpToPx(0); - preference.setLayoutParams(preferenceParams); return preference; } @@ -277,7 +257,7 @@ public void run() { } runOnUiThread(() -> { - if (callback.errorCount.get() == 0) { + if (ApkSigner.LogCallback.errorCount.get() == 0) { building_dialog.dismiss(); SketchwareUtil.toast("Successfully saved signed APK to: /Internal storage/sketchware/signed_apk/" + Uri.fromFile(new File(outputApkPath)).getLastPathSegment(), diff --git a/app/src/main/java/mod/hilal/saif/activities/tools/ConfigActivity.java b/app/src/main/java/mod/hilal/saif/activities/tools/ConfigActivity.java index ce3302f0f0..6a00e6925f 100644 --- a/app/src/main/java/mod/hilal/saif/activities/tools/ConfigActivity.java +++ b/app/src/main/java/mod/hilal/saif/activities/tools/ConfigActivity.java @@ -47,7 +47,6 @@ public class ConfigActivity extends BaseAppCompatActivity { public static final String SETTING_ROOT_AUTO_INSTALL_PROJECTS = "root-auto-install-projects"; public static final String SETTING_ROOT_AUTO_OPEN_AFTER_INSTALLING = "root-auto-open-after-installing"; public static final String SETTING_BACKUP_FILENAME = "backup-filename"; - public static final String SETTING_LEGACY_CODE_EDITOR = "legacy-ce"; public static final String SETTING_SHOW_BUILT_IN_BLOCKS = "built-in-blocks"; public static final String SETTING_SHOW_EVERY_SINGLE_BLOCK = "show-every-single-block"; public static final String SETTING_USE_NEW_VERSION_CONTROL = "use-new-version-control"; @@ -99,10 +98,6 @@ public static String getBackupFileName() { return DataStore.getInstance().getString(SETTING_BACKUP_FILENAME, "$projectName v$versionName ($pkgName, $versionCode) $time(yyyy-MM-dd'T'HHmmss)"); } - public static boolean isLegacyCeEnabled() { - return DataStore.getInstance().getBoolean(SETTING_LEGACY_CODE_EDITOR, false); - } - public static boolean isSettingEnabled(String keyName) { return DataStore.getInstance().getBoolean(keyName, false); } @@ -154,7 +149,6 @@ private static void restoreDefaultSettings(HashMap settings) { List keys = Arrays.asList(SETTING_ALWAYS_SHOW_BLOCKS, SETTING_BACKUP_DIRECTORY, - SETTING_LEGACY_CODE_EDITOR, SETTING_ROOT_AUTO_INSTALL_PROJECTS, SETTING_ROOT_AUTO_OPEN_AFTER_INSTALLING, SETTING_SHOW_BUILT_IN_BLOCKS, @@ -172,7 +166,7 @@ private static void restoreDefaultSettings(HashMap settings) { public static Object getDefaultValue(String key) { return switch (key) { - case SETTING_ALWAYS_SHOW_BLOCKS, SETTING_LEGACY_CODE_EDITOR, + case SETTING_ALWAYS_SHOW_BLOCKS, SETTING_ROOT_AUTO_INSTALL_PROJECTS, SETTING_SHOW_BUILT_IN_BLOCKS, SETTING_SHOW_EVERY_SINGLE_BLOCK, SETTING_USE_NEW_VERSION_CONTROL, SETTING_USE_ASD_HIGHLIGHTER -> false; diff --git a/app/src/main/java/mod/hilal/saif/events/EventsHandler.java b/app/src/main/java/mod/hilal/saif/events/EventsHandler.java index 54d741dc1b..0e3194ba7d 100644 --- a/app/src/main/java/mod/hilal/saif/events/EventsHandler.java +++ b/app/src/main/java/mod/hilal/saif/events/EventsHandler.java @@ -218,13 +218,13 @@ public static int getIcon(String name) { return switch (name) { case "Import", "onActivityResult", "initializeLogic", "onBackPressed", "onPostCreate", "onStart", "onResume", "onPause", "onStop", "onDestroy", - "onTabLayoutNewTabAdded" -> R.drawable.widget_source; - case " onLongClick" -> R.drawable.check_upload_apk_48dp; - case "onSwipeRefreshLayout" -> R.drawable.widget_swipe_refresh; - case "onPreExecute" -> R.drawable.event_on_stop_tracking_touch_48dp; - case "doInBackground" -> R.drawable.event_on_animation_start_48dp; - case "onProgressUpdate" -> R.drawable.event_on_page_started_48dp; - case "onPostExecute" -> R.drawable.event_on_progress_changed_48dp; + "onTabLayoutNewTabAdded" -> R.drawable.ic_mtrl_code; + case " onLongClick" -> R.drawable.ic_mtrl_touch_long; + case "onSwipeRefreshLayout" -> R.drawable.ic_mtrl_refresh; + case "onPreExecute" -> R.drawable.ic_mtrl_track_started; + case "doInBackground" -> R.drawable.ic_mtrl_sprint; + case "onProgressUpdate" -> R.drawable.ic_mtrl_progress; + case "onPostExecute" -> R.drawable.ic_mtrl_progress_check; default -> { for (int i = 0, cachedCustomEventsSize = cachedCustomEvents.size(); i < cachedCustomEventsSize; i++) { HashMap customEvent = cachedCustomEvents.get(i); diff --git a/app/src/main/java/mod/jbk/editor/manage/library/ExcludeBuiltInLibrariesActivity.java b/app/src/main/java/mod/jbk/editor/manage/library/ExcludeBuiltInLibrariesActivity.java index 0f367be0fb..fa91b838d9 100644 --- a/app/src/main/java/mod/jbk/editor/manage/library/ExcludeBuiltInLibrariesActivity.java +++ b/app/src/main/java/mod/jbk/editor/manage/library/ExcludeBuiltInLibrariesActivity.java @@ -263,7 +263,7 @@ public static List getExcludedLibraries(String @DrawableRes public static int getItemIcon() { - return R.drawable.ic_detail_setting_48dp; + return R.drawable.ic_mtrl_tune; } public static String getItemTitle() { diff --git a/app/src/main/java/mod/jbk/util/OldResourceIdMapper.java b/app/src/main/java/mod/jbk/util/OldResourceIdMapper.java index 1dfea845dc..8cb85e45b4 100644 --- a/app/src/main/java/mod/jbk/util/OldResourceIdMapper.java +++ b/app/src/main/java/mod/jbk/util/OldResourceIdMapper.java @@ -251,7 +251,7 @@ public static int getDrawableFromOldResourceId(int oldId) { case 2131165426 -> R.drawable.circle_bg_white_outline_light_pink; case 2131165427 -> R.drawable.circle_bg_white_outline_orange; case 2131165428 -> R.drawable.circle_bg_white_outline_pink; - case 2131165429 -> R.drawable.circle_bg_white_outline_secondary; + case 2131165429 -> R.drawable.circle_bg_surface; case 2131165430 -> R.drawable.circle_help_48_blue; case 2131165431 -> R.drawable.circle_help_48_gray; case 2131165432 -> R.drawable.circle_stamp; @@ -938,7 +938,6 @@ public static int getDrawableFromOldResourceId(int oldId) { case 2131166114 -> R.drawable.selector_palette_tab_round; case 2131166115 -> R.drawable.selector_plugin; case 2131166116 -> R.drawable.selector_save; - case 2131166117 -> R.drawable.selector_search; case 2131166118 -> R.drawable.selector_show_hint; case 2131166119 -> R.drawable.selector_tab_round; case 2131166120 -> R.drawable.selector_toggle_list_view; diff --git a/app/src/main/java/mod/khaled/logcat/LogReaderActivity.java b/app/src/main/java/mod/khaled/logcat/LogReaderActivity.java index 67178afbe0..318b62c144 100644 --- a/app/src/main/java/mod/khaled/logcat/LogReaderActivity.java +++ b/app/src/main/java/mod/khaled/logcat/LogReaderActivity.java @@ -1,5 +1,7 @@ package mod.khaled.logcat; +import static pro.sketchware.utility.FileUtil.createNewFileIfNotPresent; + import android.content.BroadcastReceiver; import android.content.ClipData; import android.content.ClipboardManager; @@ -8,6 +10,7 @@ import android.content.IntentFilter; import android.os.Build; import android.os.Bundle; +import android.os.Environment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; @@ -26,9 +29,14 @@ import com.besome.sketch.lib.base.BaseAppCompatActivity; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Calendar; import java.util.HashMap; +import java.util.Locale; import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -42,6 +50,7 @@ public class LogReaderActivity extends BaseAppCompatActivity { private final BroadcastReceiver logger = new Logger(); private final Pattern logPattern = Pattern.compile("^(.*\\d) ([VADEIW]) (.*): (.*)"); private String pkgFilter = ""; + private String packageName = "pro.sketchware"; private boolean autoScroll = true; private final ArrayList> mainList = new ArrayList<>(); @@ -66,7 +75,7 @@ private void initialize() { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction("pro.sketchware.ACTION_NEW_DEBUG_LOG"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { - registerReceiver(logger, intentFilter, Context.RECEIVER_NOT_EXPORTED); + registerReceiver(logger, intentFilter, Context.RECEIVER_EXPORTED); } else { registerReceiver(logger, intentFilter); } @@ -85,6 +94,8 @@ private void initialize() { } } else if (id == R.id.action_filter) { showFilterDialog(); + } else if (id == R.id.action_export) { + exportLogcat(mainList); } return true; }); @@ -141,6 +152,28 @@ void showFilterDialog() { builder.show(); } + private void exportLogcat(ArrayList> logs){ + try { + File file = new File(Environment.getExternalStorageDirectory(),".sketchware/logcat/" + packageName +"_"+ Calendar.getInstance(Locale.ENGLISH).getTimeInMillis() + ".txt"); + createNewFileIfNotPresent(file.getAbsolutePath()); + FileWriter writer = new FileWriter(file); + for (int i = 0; i < logs.size(); i++) { + String date = Objects.requireNonNull(logs.get(i).get("date")).toString(); + String type = Objects.requireNonNull(logs.get(i).get("type")).toString(); + String tag = Objects.requireNonNull(logs.get(i).get("header")).toString(); + String body = Objects.requireNonNull(logs.get(i).get("body")).toString(); + + writer.write( date + " " + type + " " + tag + " " + body + "\n"); + } + writer.close(); + SketchwareUtil.toast("Logcat exported successfully"); + + } catch (IOException ex) { + SketchwareUtil.toastError("Something went wrong!"); + } + } + + private class Logger extends BroadcastReceiver { @Override @@ -149,6 +182,7 @@ public void onReceive(Context context, Intent intent) { if (intent.hasExtra("log") && (intent.getStringExtra("log") != null)) { if (intent.hasExtra("packageName")) { map.put("pkgName", intent.getStringExtra("packageName")); + packageName = intent.getStringExtra("packageName"); } map.put("logRaw", intent.getStringExtra("log")); if (intent.getStringExtra("log") == null) return; diff --git a/app/src/main/java/mod/pranav/viewbinding/ViewBindingBuilder.kt b/app/src/main/java/mod/pranav/viewbinding/ViewBindingBuilder.kt index 90c1907c61..c43361b6b9 100644 --- a/app/src/main/java/mod/pranav/viewbinding/ViewBindingBuilder.kt +++ b/app/src/main/java/mod/pranav/viewbinding/ViewBindingBuilder.kt @@ -17,7 +17,8 @@ class ViewBindingBuilder( val name = generateFileNameForLayout(layoutFile.nameWithoutExtension) val rootView = getTopLevelView(layoutFile) val parsed = parseViews(layoutFile) - val views = if (parsed.first() == rootView) parsed.drop(1) else parsed + val views = + if (parsed.isNotEmpty() && parsed.first() == rootView) parsed.drop(1) else parsed val file = File(outputDir, "$name.java") diff --git a/app/src/main/java/pro/sketchware/activities/coloreditor/ColorEditorActivity.java b/app/src/main/java/pro/sketchware/activities/coloreditor/ColorEditorActivity.java index f336d0fc5c..1ffb506985 100644 --- a/app/src/main/java/pro/sketchware/activities/coloreditor/ColorEditorActivity.java +++ b/app/src/main/java/pro/sketchware/activities/coloreditor/ColorEditorActivity.java @@ -30,7 +30,6 @@ import a.a.a.aB; import a.a.a.xB; import mod.hey.studios.code.SrcCodeEditor; -import mod.hey.studios.code.SrcCodeEditorLegacy; import mod.hilal.saif.activities.tools.ConfigActivity; import pro.sketchware.R; import pro.sketchware.activities.coloreditor.adapters.ColorsAdapter; @@ -219,11 +218,7 @@ public boolean onOptionsItemSelected(MenuItem item) { } else if (id == MENU_OPEN_IN_EDITOR) { XmlUtil.saveXml(contentPath, convertListToXml(colorList)); Intent intent = new Intent(); - if (ConfigActivity.isLegacyCeEnabled()) { - intent.setClass(getApplicationContext(), SrcCodeEditorLegacy.class); - } else { - intent.setClass(getApplicationContext(), SrcCodeEditor.class); - } + intent.setClass(getApplicationContext(), SrcCodeEditor.class); intent.putExtra("title", title); intent.putExtra("content", contentPath); intent.putExtra("xml", xmlPath); diff --git a/app/src/main/java/pro/sketchware/activities/editor/view/CodeViewerActivity.java b/app/src/main/java/pro/sketchware/activities/editor/view/CodeViewerActivity.java new file mode 100644 index 0000000000..4bdb0f8e68 --- /dev/null +++ b/app/src/main/java/pro/sketchware/activities/editor/view/CodeViewerActivity.java @@ -0,0 +1,83 @@ +package pro.sketchware.activities.editor.view; + +import static pro.sketchware.utility.ThemeUtils.isDarkThemeEnabled; + +import android.os.Build; +import android.os.Bundle; +import android.graphics.Typeface; + +import androidx.annotation.Nullable; + +import com.besome.sketch.lib.base.BaseAppCompatActivity; + +import io.github.rosemoe.sora.langs.java.JavaLanguage; +import io.github.rosemoe.sora.widget.schemes.EditorColorScheme; +import io.github.rosemoe.sora.widget.schemes.SchemeDarcula; + +import mod.hey.studios.util.Helper; +import mod.jbk.code.CodeEditorColorSchemes; +import mod.jbk.code.CodeEditorLanguages; + +import pro.sketchware.databinding.ActivityCodeViewerBinding; +import pro.sketchware.utility.EditorUtils; + +public class CodeViewerActivity extends BaseAppCompatActivity { + + public static final String SCHEME_XML = "xml"; + public static final String SCHEME_JAVA = "java"; + + private ActivityCodeViewerBinding binding; + + @Override + public void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + binding = ActivityCodeViewerBinding.inflate(getLayoutInflater()); + setContentView(binding.getRoot()); + var code = getIntent().getStringExtra("code"); + var scheme = getIntent().getStringExtra("scheme"); + var scId = getIntent().getStringExtra("sc_id"); + binding.toolbar.setNavigationOnClickListener(Helper.getBackPressedClickListener(this)); + binding.toolbar.setSubtitle(scId); + binding.editor.setTypefaceText(Typeface.MONOSPACE); + binding.editor.setTextSize(14); + binding.editor.setText(code); + binding.editor.setEditable(false); + binding.editor.setWordwrap(false); + loadColorScheme(scheme); + binding.editor.setColorScheme(EditorUtils.getMaterialStyledScheme(binding.editor)); + } + + private void loadColorScheme(final String scheme) { + if (scheme.equals(SCHEME_XML)) { + loadXmlScheme(); + } else { + loadJavaScheme(); + } + } + + private void loadJavaScheme() { + binding.editor.setEditorLanguage(new JavaLanguage()); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + if (isDarkThemeEnabled(this)) { + binding.editor.setColorScheme(new SchemeDarcula()); + } else { + binding.editor.setColorScheme(new EditorColorScheme()); + } + } else { + binding.editor.setColorScheme(new EditorColorScheme()); + } + } + + private void loadXmlScheme() { + binding.editor.setEditorLanguage(CodeEditorLanguages.loadTextMateLanguage(CodeEditorLanguages.SCOPE_NAME_XML)); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + if (isDarkThemeEnabled(this)) { + binding.editor.setColorScheme(CodeEditorColorSchemes.loadTextMateColorScheme(CodeEditorColorSchemes.THEME_DRACULA)); + } else { + binding.editor.setColorScheme(CodeEditorColorSchemes.loadTextMateColorScheme(CodeEditorColorSchemes.THEME_GITHUB)); + } + } else { + binding.editor.setColorScheme(CodeEditorColorSchemes.loadTextMateColorScheme(CodeEditorColorSchemes.THEME_GITHUB)); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/pro/sketchware/activities/importicon/adapters/IconAdapter.java b/app/src/main/java/pro/sketchware/activities/importicon/adapters/IconAdapter.java index 0e00eddabb..79f519e368 100644 --- a/app/src/main/java/pro/sketchware/activities/importicon/adapters/IconAdapter.java +++ b/app/src/main/java/pro/sketchware/activities/importicon/adapters/IconAdapter.java @@ -12,10 +12,9 @@ import androidx.recyclerview.widget.ListAdapter; import androidx.recyclerview.widget.RecyclerView; -import pro.sketchware.databinding.ImportIconListItemBinding; - import java.io.File; +import pro.sketchware.databinding.ImportIconListItemBinding; import pro.sketchware.utility.SvgUtils; public class IconAdapter extends ListAdapter, IconAdapter.ViewHolder> { @@ -76,6 +75,7 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) { String filePath = getItem(position).second + File.separator + selected_icon_type + ".svg"; svgUtils.loadImage(holder.itemBinding.img, filePath); holder.itemBinding.img.setColorFilter(selected_color, PorterDuff.Mode.SRC_IN); + holder.itemBinding.title.setText(getItem(position).first); } @Override diff --git a/app/src/main/java/pro/sketchware/activities/main/fragments/projects/ProjectsFragment.java b/app/src/main/java/pro/sketchware/activities/main/fragments/projects/ProjectsFragment.java index 222a426366..a817680e41 100644 --- a/app/src/main/java/pro/sketchware/activities/main/fragments/projects/ProjectsFragment.java +++ b/app/src/main/java/pro/sketchware/activities/main/fragments/projects/ProjectsFragment.java @@ -50,7 +50,7 @@ import pro.sketchware.databinding.MyprojectsBinding; import pro.sketchware.databinding.SortProjectDialogBinding; -public class ProjectsFragment extends DA implements View.OnClickListener { +public class ProjectsFragment extends DA { private MyprojectsBinding binding; private ProjectsAdapter projectsAdapter; private DB preference; @@ -101,13 +101,6 @@ public void restoreProject() { new BackupRestoreManager(getActivity(), this).restore(); } - @Override - public void onClick(View v) { - if (v.getId() == R.id.create_new_project) { - toProjectSettingsActivity(); - } - } - @Override public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { binding = MyprojectsBinding.inflate(inflater, parent, false); @@ -125,7 +118,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat preference = new DB(requireContext(), "project"); ExtendedFloatingActionButton fab = requireActivity().findViewById(R.id.create_new_project); - fab.setOnClickListener(this); + fab.setOnClickListener((v) -> toProjectSettingsActivity()); Insetter.builder() .margin(WindowInsetsCompat.Type.navigationBars()) .applyToView(fab); diff --git a/app/src/main/java/pro/sketchware/fragments/settings/block/selector/BlockSelectorAdapter.java b/app/src/main/java/pro/sketchware/fragments/settings/block/selector/BlockSelectorAdapter.java index 179ee22739..fe7a88bc1b 100644 --- a/app/src/main/java/pro/sketchware/fragments/settings/block/selector/BlockSelectorAdapter.java +++ b/app/src/main/java/pro/sketchware/fragments/settings/block/selector/BlockSelectorAdapter.java @@ -1,7 +1,6 @@ package pro.sketchware.fragments.settings.block.selector; import android.view.LayoutInflater; -import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; @@ -9,7 +8,6 @@ import androidx.recyclerview.widget.ListAdapter; import androidx.recyclerview.widget.RecyclerView; -import pro.sketchware.R; import pro.sketchware.databinding.LayoutBlockSelectorBinding; import pro.sketchware.utility.UI; @@ -92,4 +90,4 @@ public boolean areContentsTheSame(@NonNull Selector oldItem, @NonNull Selector n return oldItem.equals(newItem); } } -} \ No newline at end of file +} diff --git a/app/src/main/java/pro/sketchware/fragments/settings/block/selector/details/BlockSelectorDetailsAdapter.java b/app/src/main/java/pro/sketchware/fragments/settings/block/selector/details/BlockSelectorDetailsAdapter.java index 0b4369f411..7a149c28ef 100644 --- a/app/src/main/java/pro/sketchware/fragments/settings/block/selector/details/BlockSelectorDetailsAdapter.java +++ b/app/src/main/java/pro/sketchware/fragments/settings/block/selector/details/BlockSelectorDetailsAdapter.java @@ -1,7 +1,6 @@ package pro.sketchware.fragments.settings.block.selector.details; import android.view.LayoutInflater; -import android.view.View; import android.view.ViewGroup; import androidx.annotation.NonNull; @@ -9,7 +8,6 @@ import androidx.recyclerview.widget.ListAdapter; import androidx.recyclerview.widget.RecyclerView; -import pro.sketchware.R; import pro.sketchware.databinding.LayoutBlockSelectorBinding; import pro.sketchware.fragments.settings.block.selector.BlockSelectorAdapter.OnClickListener; import pro.sketchware.fragments.settings.block.selector.BlockSelectorAdapter.OnLongClickListener; @@ -86,4 +84,4 @@ public boolean areContentsTheSame(@NonNull String oldItem, @NonNull String newIt return oldItem.equals(newItem); } } -} \ No newline at end of file +} diff --git a/app/src/main/java/pro/sketchware/fragments/settings/events/EventsManagerFragment.java b/app/src/main/java/pro/sketchware/fragments/settings/events/EventsManagerFragment.java index 9c1ec27ec7..126122d45b 100644 --- a/app/src/main/java/pro/sketchware/fragments/settings/events/EventsManagerFragment.java +++ b/app/src/main/java/pro/sketchware/fragments/settings/events/EventsManagerFragment.java @@ -13,29 +13,26 @@ import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; +import com.github.angads25.filepicker.model.DialogProperties; +import com.github.angads25.filepicker.view.FilePickerDialog; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.gson.Gson; -import pro.sketchware.R; -import pro.sketchware.databinding.DialogAddNewListenerBinding; -import pro.sketchware.databinding.FragmentEventsManagerBinding; -import pro.sketchware.databinding.LayoutEventItemBinding; -import pro.sketchware.utility.SketchwareUtil; -import pro.sketchware.utility.FileUtil; -import pro.sketchware.utility.UI; -import pro.sketchware.fragments.settings.events.details.EventsManagerDetailsFragment; - import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; -import com.github.angads25.filepicker.model.DialogProperties; -import com.github.angads25.filepicker.view.FilePickerDialog; - -import mod.hey.studios.util.Helper; - import a.a.a.qA; +import mod.hey.studios.util.Helper; +import pro.sketchware.R; +import pro.sketchware.databinding.DialogAddNewListenerBinding; +import pro.sketchware.databinding.FragmentEventsManagerBinding; +import pro.sketchware.databinding.LayoutEventItemBinding; +import pro.sketchware.fragments.settings.events.details.EventsManagerDetailsFragment; +import pro.sketchware.utility.FileUtil; +import pro.sketchware.utility.SketchwareUtil; +import pro.sketchware.utility.UI; public class EventsManagerFragment extends qA { diff --git a/app/src/main/java/pro/sketchware/fragments/settings/events/details/EventsManagerDetailsFragment.java b/app/src/main/java/pro/sketchware/fragments/settings/events/details/EventsManagerDetailsFragment.java index 1efe86a338..b8e186a879 100644 --- a/app/src/main/java/pro/sketchware/fragments/settings/events/details/EventsManagerDetailsFragment.java +++ b/app/src/main/java/pro/sketchware/fragments/settings/events/details/EventsManagerDetailsFragment.java @@ -11,22 +11,20 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.gson.Gson; -import pro.sketchware.R; -import pro.sketchware.databinding.FragmentEventsManagerDetailsBinding; -import pro.sketchware.databinding.LayoutEventItemBinding; -import pro.sketchware.utility.FileUtil; -import pro.sketchware.utility.UI; -import pro.sketchware.fragments.settings.events.EventsManagerConstants; -import pro.sketchware.fragments.settings.events.creator.EventsManagerCreatorFragment; - import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; +import a.a.a.qA; import mod.hey.studios.util.Helper; import mod.jbk.util.OldResourceIdMapper; - -import a.a.a.qA; +import pro.sketchware.R; +import pro.sketchware.databinding.FragmentEventsManagerDetailsBinding; +import pro.sketchware.databinding.LayoutEventItemBinding; +import pro.sketchware.fragments.settings.events.EventsManagerConstants; +import pro.sketchware.fragments.settings.events.creator.EventsManagerCreatorFragment; +import pro.sketchware.utility.FileUtil; +import pro.sketchware.utility.UI; public class EventsManagerDetailsFragment extends qA { @@ -115,7 +113,7 @@ public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { @Override public void onBindViewHolder(@NonNull ViewHolder holder, int position) { HashMap item = dataArray.get(position); - + holder.itemView.setBackgroundResource(UI.getShapedBackgroundForList(dataArray, position)); if (listName.isEmpty()) { diff --git a/app/src/main/java/pro/sketchware/menu/ExtraMenuBean.java b/app/src/main/java/pro/sketchware/menu/ExtraMenuBean.java index c295ede585..0f61998e43 100644 --- a/app/src/main/java/pro/sketchware/menu/ExtraMenuBean.java +++ b/app/src/main/java/pro/sketchware/menu/ExtraMenuBean.java @@ -37,7 +37,6 @@ import mod.hey.studios.util.Helper; import mod.hilal.saif.activities.tools.ConfigActivity; import mod.hilal.saif.asd.AsdDialog; -import mod.hilal.saif.asd.asdforall.AsdAllEditor; import mod.hilal.saif.asd.old.AsdOldDialog; import pro.sketchware.R; @@ -123,21 +122,12 @@ public void afterTextChanged(Editable s) { } private void codeMenu(Ss menu) { - if (ConfigActivity.isLegacyCeEnabled()) { - AsdOldDialog asdOldDialog = new AsdOldDialog(logicEditor); - asdOldDialog.setCon(menu.getArgValue().toString()); - asdOldDialog.show(); - /* p2 as true is for number */ - asdOldDialog.saveLis(logicEditor, false, menu, asdOldDialog); - asdOldDialog.cancelLis(logicEditor, asdOldDialog); - } else { - AsdDialog asdDialog = new AsdDialog(logicEditor); - asdDialog.setCon(menu.getArgValue().toString()); - asdDialog.show(); - /* p2 as true is for number */ - asdDialog.saveLis(logicEditor, false, menu, asdDialog); - asdDialog.cancelLis(asdDialog); - } + AsdDialog asdDialog = new AsdDialog(logicEditor); + asdDialog.setCon(menu.getArgValue().toString()); + asdDialog.show(); + /* p2 as true is for number */ + asdDialog.saveLis(logicEditor, false, menu, asdDialog); + asdDialog.cancelLis(asdDialog); } public void defineMenuSelector(Ss ss) { @@ -749,10 +739,10 @@ private void defaultMenus(Ss menu) { }); dialog.a(Helper.getResString(R.string.common_word_cancel), Helper.getDialogDismissListener(dialog)); dialog.configureDefaultButton("Code Editor", v -> { - AsdAllEditor editor = new AsdAllEditor(logicEditor); + AsdDialog editor = new AsdDialog(logicEditor); editor.setCon(menu.getArgValue().toString()); editor.show(); - editor.saveLis(logicEditor, menu); + editor.saveLis(logicEditor, false, menu, editor);; editor.cancelLis(editor); dialog.dismiss(); }); @@ -798,19 +788,11 @@ private void asdDialog(Ss ss, String message) { }); dialog.a(Helper.getResString(R.string.common_word_cancel), Helper.getDialogDismissListener(dialog)); dialog.configureDefaultButton("Code Editor", v -> { - if (ConfigActivity.isLegacyCeEnabled()) { - AsdOldDialog asdOldDialog = new AsdOldDialog(logicEditor); - asdOldDialog.setCon(edittext.getText().toString()); - asdOldDialog.show(); - asdOldDialog.saveLis(logicEditor, false, ss, asdOldDialog); - asdOldDialog.cancelLis(logicEditor, asdOldDialog); - } else { - AsdDialog asdDialog = new AsdDialog(logicEditor); - asdDialog.setCon(edittext.getText().toString()); - asdDialog.show(); - asdDialog.saveLis(logicEditor, false, ss, asdDialog); - asdDialog.cancelLis(asdDialog); - } + AsdDialog asdDialog = new AsdDialog(logicEditor); + asdDialog.setCon(edittext.getText().toString()); + asdDialog.show(); + asdDialog.saveLis(logicEditor, false, ss, asdDialog); + asdDialog.cancelLis(asdDialog); dialog.dismiss(); }); dialog.show(); diff --git a/app/src/main/java/pro/sketchware/utility/EditorUtils.java b/app/src/main/java/pro/sketchware/utility/EditorUtils.java new file mode 100644 index 0000000000..07607ac7ba --- /dev/null +++ b/app/src/main/java/pro/sketchware/utility/EditorUtils.java @@ -0,0 +1,31 @@ +package pro.sketchware.utility; + +import androidx.annotation.NonNull; + +import com.google.android.material.color.MaterialColors; + +import io.github.rosemoe.sora.widget.CodeEditor; +import io.github.rosemoe.sora.widget.schemes.EditorColorScheme; + +public class EditorUtils { + EditorUtils() { + } + + @NonNull + public static EditorColorScheme getMaterialStyledScheme(final CodeEditor editor) { + var scheme = editor.getColorScheme(); + var primary = MaterialColors.getColor(editor, com.google.android.material.R.attr.colorPrimary); + var surface = MaterialColors.getColor(editor, com.google.android.material.R.attr.colorSurface); + var onSurface = MaterialColors.getColor(editor, com.google.android.material.R.attr.colorOnSurface); + var onSurfaceVariant = MaterialColors.getColor(editor, com.google.android.material.R.attr.colorOnSurfaceVariant); + scheme.setColor(EditorColorScheme.KEYWORD, primary); + scheme.setColor(EditorColorScheme.FUNCTION_NAME, primary); + scheme.setColor(EditorColorScheme.WHOLE_BACKGROUND, surface); + scheme.setColor(EditorColorScheme.CURRENT_LINE, surface); + scheme.setColor(EditorColorScheme.LINE_NUMBER_PANEL, surface); + scheme.setColor(EditorColorScheme.LINE_NUMBER_BACKGROUND, surface); + scheme.setColor(EditorColorScheme.TEXT_NORMAL, onSurface); + scheme.setColor(EditorColorScheme.SELECTION_INSERT, onSurfaceVariant); + return scheme; + } +} diff --git a/app/src/main/java/pro/sketchware/utility/FileUtil.java b/app/src/main/java/pro/sketchware/utility/FileUtil.java index a754665cff..a028e95699 100644 --- a/app/src/main/java/pro/sketchware/utility/FileUtil.java +++ b/app/src/main/java/pro/sketchware/utility/FileUtil.java @@ -143,7 +143,7 @@ public static String getFileExtension(String filePath) { return filePath.substring(last + 1); } - private static void createNewFileIfNotPresent(String path) { + public static void createNewFileIfNotPresent(String path) { int lastSep = path.lastIndexOf(File.separator); if (lastSep > 0) { String dirPath = path.substring(0, lastSep); diff --git a/app/src/main/java/pro/sketchware/utility/UI.java b/app/src/main/java/pro/sketchware/utility/UI.java index 4af98183a6..442b422a68 100644 --- a/app/src/main/java/pro/sketchware/utility/UI.java +++ b/app/src/main/java/pro/sketchware/utility/UI.java @@ -77,7 +77,7 @@ public static void addSystemWindowInsetToPadding( return windowInsets; }); } - + @DrawableRes public static int getShapedBackgroundForList(final List list, final int position) { if (list.size() == 1) { @@ -90,4 +90,4 @@ public static int getShapedBackgroundForList(final List list, final int p return R.drawable.shape_middle; } } -} \ No newline at end of file +} diff --git a/app/src/main/res/drawable/circle_bg_white_outline_secondary.xml b/app/src/main/res/drawable/circle_bg_surface.xml similarity index 57% rename from app/src/main/res/drawable/circle_bg_white_outline_secondary.xml rename to app/src/main/res/drawable/circle_bg_surface.xml index 1039c35163..138656c5cc 100644 --- a/app/src/main/res/drawable/circle_bg_white_outline_secondary.xml +++ b/app/src/main/res/drawable/circle_bg_surface.xml @@ -3,8 +3,5 @@ android:shape="ring" android:thicknessRatio="2" android:useLevel="false"> - - + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_mtrl_abc_click.xml b/app/src/main/res/drawable/ic_mtrl_abc_click.xml new file mode 100644 index 0000000000..024aff152e --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_abc_click.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_add_circle.xml b/app/src/main/res/drawable/ic_mtrl_add_circle.xml new file mode 100644 index 0000000000..83990ce1f8 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_add_circle.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_admob.xml b/app/src/main/res/drawable/ic_mtrl_admob.xml index 6a4a4f6221..5c76e718a8 100644 --- a/app/src/main/res/drawable/ic_mtrl_admob.xml +++ b/app/src/main/res/drawable/ic_mtrl_admob.xml @@ -1,14 +1,14 @@ - - - - - - - + diff --git a/app/src/main/res/drawable/ic_mtrl_anim_cancel.xml b/app/src/main/res/drawable/ic_mtrl_anim_cancel.xml new file mode 100644 index 0000000000..2cea2c2127 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_anim_cancel.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_anim_end.xml b/app/src/main/res/drawable/ic_mtrl_anim_end.xml new file mode 100644 index 0000000000..02928d3f86 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_anim_end.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_bind.xml b/app/src/main/res/drawable/ic_mtrl_bind.xml new file mode 100644 index 0000000000..1aa4d90eb8 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_bind.xml @@ -0,0 +1,15 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_bluetooth_connected.xml b/app/src/main/res/drawable/ic_mtrl_bluetooth_connected.xml new file mode 100644 index 0000000000..8da22e583d --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_bluetooth_connected.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_bt_cancel.xml b/app/src/main/res/drawable/ic_mtrl_bt_cancel.xml new file mode 100644 index 0000000000..4c1cbd5cc0 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_bt_cancel.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_bt_error.xml b/app/src/main/res/drawable/ic_mtrl_bt_error.xml new file mode 100644 index 0000000000..9d8b64aab3 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_bt_error.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_bt_received.xml b/app/src/main/res/drawable/ic_mtrl_bt_received.xml new file mode 100644 index 0000000000..3331da6cf3 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_bt_received.xml @@ -0,0 +1,14 @@ + + > + + + diff --git a/app/src/main/res/drawable/ic_mtrl_bt_sent.xml b/app/src/main/res/drawable/ic_mtrl_bt_sent.xml new file mode 100644 index 0000000000..c0a8f8c5ee --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_bt_sent.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_cancel.xml b/app/src/main/res/drawable/ic_mtrl_cancel.xml new file mode 100644 index 0000000000..9c8c43cfe0 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_cancel.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_database_added.xml b/app/src/main/res/drawable/ic_mtrl_database_added.xml new file mode 100644 index 0000000000..d7c5e43316 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_database_added.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_database_edit.xml b/app/src/main/res/drawable/ic_mtrl_database_edit.xml new file mode 100644 index 0000000000..985d1d4eca --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_database_edit.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_database_moved.xml b/app/src/main/res/drawable/ic_mtrl_database_moved.xml new file mode 100644 index 0000000000..17a615b633 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_database_moved.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_database_off.xml b/app/src/main/res/drawable/ic_mtrl_database_off.xml new file mode 100644 index 0000000000..ec0467f1ef --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_database_off.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_date_changed.xml b/app/src/main/res/drawable/ic_mtrl_date_changed.xml new file mode 100644 index 0000000000..79ae52fd88 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_date_changed.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_design.xml b/app/src/main/res/drawable/ic_mtrl_design.xml new file mode 100644 index 0000000000..6e172de54b --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_design.xml @@ -0,0 +1,11 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_downloading.xml b/app/src/main/res/drawable/ic_mtrl_downloading.xml new file mode 100644 index 0000000000..105aefecb1 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_downloading.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_email_sent.xml b/app/src/main/res/drawable/ic_mtrl_email_sent.xml new file mode 100644 index 0000000000..e851724ae6 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_email_sent.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_file_picked.xml b/app/src/main/res/drawable/ic_mtrl_file_picked.xml new file mode 100644 index 0000000000..1c4c2b3eb9 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_file_picked.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_gpp_bad.xml b/app/src/main/res/drawable/ic_mtrl_gpp_bad.xml new file mode 100644 index 0000000000..334ecec542 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_gpp_bad.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_group.xml b/app/src/main/res/drawable/ic_mtrl_group.xml new file mode 100644 index 0000000000..1bb939d3ad --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_group.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_label.xml b/app/src/main/res/drawable/ic_mtrl_label.xml new file mode 100644 index 0000000000..a0d0886ce5 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_label.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_link.xml b/app/src/main/res/drawable/ic_mtrl_link.xml new file mode 100644 index 0000000000..71d4078200 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_link.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_link_check.xml b/app/src/main/res/drawable/ic_mtrl_link_check.xml new file mode 100644 index 0000000000..9779981680 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_link_check.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_link_fail.xml b/app/src/main/res/drawable/ic_mtrl_link_fail.xml new file mode 100644 index 0000000000..88523224d4 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_link_fail.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_load_failed.xml b/app/src/main/res/drawable/ic_mtrl_load_failed.xml new file mode 100644 index 0000000000..e2421516ed --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_load_failed.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_loaded.xml b/app/src/main/res/drawable/ic_mtrl_loaded.xml new file mode 100644 index 0000000000..11b29c9460 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_loaded.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_loc_click.xml b/app/src/main/res/drawable/ic_mtrl_loc_click.xml new file mode 100644 index 0000000000..878eacb611 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_loc_click.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_location_changed.xml b/app/src/main/res/drawable/ic_mtrl_location_changed.xml new file mode 100644 index 0000000000..d06b5be5b8 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_location_changed.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_map_ready.xml b/app/src/main/res/drawable/ic_mtrl_map_ready.xml new file mode 100644 index 0000000000..0ae9ed1532 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_map_ready.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_moreblock.xml b/app/src/main/res/drawable/ic_mtrl_moreblock.xml index abc17947d5..7b0015a8f6 100644 --- a/app/src/main/res/drawable/ic_mtrl_moreblock.xml +++ b/app/src/main/res/drawable/ic_mtrl_moreblock.xml @@ -1,11 +1,11 @@ + android:viewportHeight="729.3"> - + diff --git a/app/src/main/res/drawable/ic_mtrl_password.xml b/app/src/main/res/drawable/ic_mtrl_password.xml index 159fc63337..1f59e098fc 100644 --- a/app/src/main/res/drawable/ic_mtrl_password.xml +++ b/app/src/main/res/drawable/ic_mtrl_password.xml @@ -5,6 +5,8 @@ android:viewportHeight="960" android:tint="?attr/colorControlNormal"> + + android:pathData="M120,680L840,680Q857,680 868.5,691.5Q880,703 880,720Q880,737 868.5,748.5Q857,760 840,760L120,760Q103,760 91.5,748.5Q80,737 80,720Q80,703 91.5,691.5Q103,680 120,680ZM160,458L141,492Q135,503 123,506Q111,509 100,503Q89,497 86,485Q83,473 89,462L108,428L70,428Q57,428 48.5,419.5Q40,411 40,398Q40,385 48.5,376.5Q57,368 70,368L108,368L89,336Q83,325 86,313Q89,301 100,295Q111,289 123,292Q135,295 141,306L160,338L179,306Q185,295 197,292Q209,289 220,295Q231,301 234,313Q237,325 231,336L212,368L250,368Q263,368 271.5,376.5Q280,385 280,398Q280,411 271.5,419.5Q263,428 250,428L212,428L231,462Q237,473 234,485Q231,497 220,503Q209,509 197,506Q185,503 179,492L160,458ZM480,458L461,492Q455,503 443,506Q431,509 420,503Q409,497 406,485Q403,473 409,462L428,428L390,428Q377,428 368.5,419.5Q360,411 360,398Q360,385 368.5,376.5Q377,368 390,368L428,368L409,336Q403,325 406,313Q409,301 420,295Q431,289 443,292Q455,295 461,306L480,338L499,306Q505,295 517,292Q529,289 540,295Q551,301 554,313Q557,325 551,336L532,368L570,368Q583,368 591.5,376.5Q600,385 600,398Q600,411 591.5,419.5Q583,428 570,428L532,428L551,462Q557,473 554,485Q551,497 540,503Q529,509 517,506Q505,503 499,492L480,458ZM800,458L781,492Q775,503 763,506Q751,509 740,503Q729,497 726,485Q723,473 729,462L748,428L710,428Q697,428 688.5,419.5Q680,411 680,398Q680,385 688.5,376.5Q697,368 710,368L748,368L729,336Q723,325 726,313Q729,301 740,295Q751,289 763,292Q775,295 781,306L800,338L819,306Q825,295 837,292Q849,289 860,295Q871,301 874,313Q877,325 871,336L852,368L890,368Q903,368 911.5,376.5Q920,385 920,398Q920,411 911.5,419.5Q903,428 890,428L852,428L871,462Q877,473 874,485Q871,497 860,503Q849,509 837,506Q825,503 819,492L800,458Z" + android:fillColor="#FFFFFF"/> + diff --git a/app/src/main/res/drawable/ic_mtrl_payment.xml b/app/src/main/res/drawable/ic_mtrl_payment.xml new file mode 100644 index 0000000000..63940366c0 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_payment.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_pic_cancel.xml b/app/src/main/res/drawable/ic_mtrl_pic_cancel.xml new file mode 100644 index 0000000000..6c667d733d --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_pic_cancel.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_pic_taken.xml b/app/src/main/res/drawable/ic_mtrl_pic_taken.xml new file mode 100644 index 0000000000..fe230a64c0 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_pic_taken.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_pick_cancel.xml b/app/src/main/res/drawable/ic_mtrl_pick_cancel.xml new file mode 100644 index 0000000000..979407b70f --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_pick_cancel.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_post_added.xml b/app/src/main/res/drawable/ic_mtrl_post_added.xml new file mode 100644 index 0000000000..75b7e814b0 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_post_added.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_preview.xml b/app/src/main/res/drawable/ic_mtrl_preview.xml new file mode 100644 index 0000000000..49b02ac8a2 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_preview.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_preview_off.xml b/app/src/main/res/drawable/ic_mtrl_preview_off.xml new file mode 100644 index 0000000000..19f4d534e3 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_preview_off.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_prog_max.xml b/app/src/main/res/drawable/ic_mtrl_prog_max.xml new file mode 100644 index 0000000000..bd031df5db --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_prog_max.xml @@ -0,0 +1,17 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_prog_min.xml b/app/src/main/res/drawable/ic_mtrl_prog_min.xml index 6b86ff82d7..bf63577423 100644 --- a/app/src/main/res/drawable/ic_mtrl_prog_min.xml +++ b/app/src/main/res/drawable/ic_mtrl_prog_min.xml @@ -5,9 +5,9 @@ android:viewportHeight="960" android:tint="?attr/colorControlNormal"> diff --git a/app/src/main/res/drawable/ic_mtrl_progress_check.xml b/app/src/main/res/drawable/ic_mtrl_progress_check.xml new file mode 100644 index 0000000000..3c5a390f9a --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_progress_check.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_reset.xml b/app/src/main/res/drawable/ic_mtrl_reset.xml index dbd38d7110..3a3d88c348 100644 --- a/app/src/main/res/drawable/ic_mtrl_reset.xml +++ b/app/src/main/res/drawable/ic_mtrl_reset.xml @@ -1,10 +1,10 @@ - + android:viewportHeight="960" + android:tint="?attr/colorControlNormal"> + diff --git a/app/src/main/res/drawable/ic_mtrl_rotate.xml b/app/src/main/res/drawable/ic_mtrl_rotate.xml new file mode 100644 index 0000000000..1045b172e9 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_rotate.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_sensor.xml b/app/src/main/res/drawable/ic_mtrl_sensor.xml new file mode 100644 index 0000000000..b0e5443db7 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_sensor.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_sensor_cancel.xml b/app/src/main/res/drawable/ic_mtrl_sensor_cancel.xml new file mode 100644 index 0000000000..042afa5b42 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_sensor_cancel.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_settings_applications.xml b/app/src/main/res/drawable/ic_mtrl_settings_applications.xml new file mode 100644 index 0000000000..c45a5af785 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_settings_applications.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_signin.xml b/app/src/main/res/drawable/ic_mtrl_signin.xml new file mode 100644 index 0000000000..d071a3620b --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_signin.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_sms_check.xml b/app/src/main/res/drawable/ic_mtrl_sms_check.xml new file mode 100644 index 0000000000..95f88c1fe8 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_sms_check.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_speech.xml b/app/src/main/res/drawable/ic_mtrl_speech.xml new file mode 100644 index 0000000000..0c6603ccb4 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_speech.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_speech_cancel.xml b/app/src/main/res/drawable/ic_mtrl_speech_cancel.xml new file mode 100644 index 0000000000..c69262dcb3 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_speech_cancel.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_sprint.xml b/app/src/main/res/drawable/ic_mtrl_sprint.xml new file mode 100644 index 0000000000..755cc6d7c4 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_sprint.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_target.xml b/app/src/main/res/drawable/ic_mtrl_target.xml new file mode 100644 index 0000000000..a094e36f6c --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_target.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_text_change.xml b/app/src/main/res/drawable/ic_mtrl_text_change.xml new file mode 100644 index 0000000000..fa4306f74e --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_text_change.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_text_select.xml b/app/src/main/res/drawable/ic_mtrl_text_select.xml new file mode 100644 index 0000000000..b69db51ca4 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_text_select.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_touch_long.xml b/app/src/main/res/drawable/ic_mtrl_touch_long.xml new file mode 100644 index 0000000000..efa1eb8fb2 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_touch_long.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_track_started.xml b/app/src/main/res/drawable/ic_mtrl_track_started.xml new file mode 100644 index 0000000000..f11216822c --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_track_started.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_uploaded.xml b/app/src/main/res/drawable/ic_mtrl_uploaded.xml new file mode 100644 index 0000000000..6b0a2c8d90 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_uploaded.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_uploading.xml b/app/src/main/res/drawable/ic_mtrl_uploading.xml new file mode 100644 index 0000000000..b2bc9d187b --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_uploading.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_user_create.xml b/app/src/main/res/drawable/ic_mtrl_user_create.xml new file mode 100644 index 0000000000..3e66364faf --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_user_create.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_user_delete.xml b/app/src/main/res/drawable/ic_mtrl_user_delete.xml new file mode 100644 index 0000000000..1ee6c4f5f3 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_user_delete.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_user_edit.xml b/app/src/main/res/drawable/ic_mtrl_user_edit.xml new file mode 100644 index 0000000000..e08dd56ef9 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_user_edit.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_user_register_complete.xml b/app/src/main/res/drawable/ic_mtrl_user_register_complete.xml new file mode 100644 index 0000000000..bc79a4e135 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_user_register_complete.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_user_remove.xml b/app/src/main/res/drawable/ic_mtrl_user_remove.xml new file mode 100644 index 0000000000..ddc15889be --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_user_remove.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_verified_user.xml b/app/src/main/res/drawable/ic_mtrl_verified_user.xml new file mode 100644 index 0000000000..9c4e014650 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_verified_user.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_mtrl_vid_completed.xml b/app/src/main/res/drawable/ic_mtrl_vid_completed.xml new file mode 100644 index 0000000000..f7c6c15e66 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_vid_completed.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_vid_error.xml b/app/src/main/res/drawable/ic_mtrl_vid_error.xml new file mode 100644 index 0000000000..91deee5737 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_vid_error.xml @@ -0,0 +1,15 @@ + + + + diff --git a/app/src/main/res/drawable/ic_mtrl_vid_prepared.xml b/app/src/main/res/drawable/ic_mtrl_vid_prepared.xml new file mode 100644 index 0000000000..a1d4311301 --- /dev/null +++ b/app/src/main/res/drawable/ic_mtrl_vid_prepared.xml @@ -0,0 +1,15 @@ + + + + diff --git a/app/src/main/res/drawable/search_icon_tinted.xml b/app/src/main/res/drawable/search_icon_tinted.xml deleted file mode 100644 index cfab6631ca..0000000000 --- a/app/src/main/res/drawable/search_icon_tinted.xml +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/app/src/main/res/drawable/selector_search.xml b/app/src/main/res/drawable/selector_search.xml deleted file mode 100644 index 4ca8a00840..0000000000 --- a/app/src/main/res/drawable/selector_search.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_code_viewer.xml b/app/src/main/res/layout/activity_code_viewer.xml new file mode 100644 index 0000000000..d103d137bd --- /dev/null +++ b/app/src/main/res/layout/activity_code_viewer.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + diff --git a/app/src/main/res/layout/android_manifest_injection.xml b/app/src/main/res/layout/android_manifest_injection.xml index 469c14e177..cea7d003b2 100644 --- a/app/src/main/res/layout/android_manifest_injection.xml +++ b/app/src/main/res/layout/android_manifest_injection.xml @@ -9,14 +9,7 @@ android:layout_height="wrap_content" android:fitsSystemWindows="true"> - - - + + + + + app:contentPadding="12dp" + app:strokeWidth="0dp"> + android:gravity="center_vertical"> @@ -137,7 +151,7 @@ android:layout_width="20dp" android:layout_height="20dp" android:layout_marginEnd="8dp" - android:src="@drawable/ic_mtrl_touch" + android:src="@drawable/ic_arrow_drop_down_24px" app:tint="?attr/colorControlNormal" /> @@ -148,9 +162,9 @@ + android:translationY="180dp" /> diff --git a/app/src/main/res/layout/event_grid_item.xml b/app/src/main/res/layout/event_grid_item.xml index e5e1045b91..25e7d89f5d 100644 --- a/app/src/main/res/layout/event_grid_item.xml +++ b/app/src/main/res/layout/event_grid_item.xml @@ -37,7 +37,8 @@ android:layout_height="12dp" android:layout_alignParentTop="true" android:layout_alignParentRight="true" - android:src="@drawable/ic_add_green_circle_24dp" /> + app:tint="?colorCoolGreen" + android:src="@drawable/ic_mtrl_add_circle" /> @@ -44,4 +45,4 @@ android:src="@drawable/ic_add_white_36dp" tools:ignore="ContentDescription" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/fr_logic_list.xml b/app/src/main/res/layout/fr_logic_list.xml index 088205d9d7..541358f23e 100644 --- a/app/src/main/res/layout/fr_logic_list.xml +++ b/app/src/main/res/layout/fr_logic_list.xml @@ -27,11 +27,12 @@ @@ -48,7 +49,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" - android:paddingBottom="80dp" + android:paddingTop="8dp" + android:paddingBottom="64dp" android:scrollbars="vertical" android:splitMotionEvents="false" tools:itemCount="5" diff --git a/app/src/main/res/layout/fr_logic_list_item.xml b/app/src/main/res/layout/fr_logic_list_item.xml index de53e43195..071d822d2b 100644 --- a/app/src/main/res/layout/fr_logic_list_item.xml +++ b/app/src/main/res/layout/fr_logic_list_item.xml @@ -1,13 +1,11 @@ + android:layout_marginVertical="6dp"> + android:layout_marginVertical="6dp"> + android:layout_height="wrap_content" + app:tint="?colorOnError"/> - \ No newline at end of file + diff --git a/app/src/main/res/layout/fr_logic_list_item_component_event.xml b/app/src/main/res/layout/fr_logic_list_item_component_event.xml index 5490470648..4ef165eee9 100644 --- a/app/src/main/res/layout/fr_logic_list_item_component_event.xml +++ b/app/src/main/res/layout/fr_logic_list_item_component_event.xml @@ -2,6 +2,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="124dp" android:layout_height="90dp" + xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_marginHorizontal="2dp" android:clickable="true" android:focusable="true" @@ -27,7 +28,7 @@ android:id="@+id/icon" android:layout_width="32dp" android:layout_height="32dp" - tools:src="@drawable/event_on_child_added_48dp" /> + tools:src="@drawable/ic_mtrl_database_added" /> diff --git a/app/src/main/res/layout/fr_logic_list_item_event_preview.xml b/app/src/main/res/layout/fr_logic_list_item_event_preview.xml index e2cd578f2b..82e7f78604 100644 --- a/app/src/main/res/layout/fr_logic_list_item_event_preview.xml +++ b/app/src/main/res/layout/fr_logic_list_item_event_preview.xml @@ -1,14 +1,17 @@ + android:padding="4dp"> + android:layout_width="18dp" + android:layout_height="18dp" + android:src="@drawable/ic_mtrl_database_added" + android:scaleType="fitCenter" + app:tint="?colorSecondary"/> diff --git a/app/src/main/res/layout/fr_logic_list_preview_with_event_item.xml b/app/src/main/res/layout/fr_logic_list_preview_with_event_item.xml index 981d705e5e..afb482f76c 100644 --- a/app/src/main/res/layout/fr_logic_list_preview_with_event_item.xml +++ b/app/src/main/res/layout/fr_logic_list_preview_with_event_item.xml @@ -1,5 +1,6 @@ + app:tint="?colorSecondary"/> diff --git a/app/src/main/res/layout/fragment_events_manager.xml b/app/src/main/res/layout/fragment_events_manager.xml index 2c099e4434..13c0aedfc6 100644 --- a/app/src/main/res/layout/fragment_events_manager.xml +++ b/app/src/main/res/layout/fragment_events_manager.xml @@ -63,9 +63,7 @@ android:id="@+id/activity_events_icon" android:layout_width="25dp" android:layout_height="25dp" - android:src="@drawable/ic_mtrl_code" - app:tint="?attr/colorPrimary" - android:tintMode="src_in" /> + android:src="@drawable/ic_mtrl_code" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/import_icon.xml b/app/src/main/res/layout/import_icon.xml index c662727f62..1ac80b6cc6 100644 --- a/app/src/main/res/layout/import_icon.xml +++ b/app/src/main/res/layout/import_icon.xml @@ -39,4 +39,4 @@ android:text="Filter" app:icon="@drawable/ic_mtrl_tune" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/import_icon_list_item.xml b/app/src/main/res/layout/import_icon_list_item.xml index 6371e5b751..6d2f6617a2 100644 --- a/app/src/main/res/layout/import_icon_list_item.xml +++ b/app/src/main/res/layout/import_icon_list_item.xml @@ -5,18 +5,28 @@ android:id="@+id/icon_bg" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_margin="8dp" android:gravity="center" android:orientation="vertical" - android:padding="15dp"> + android:foreground="?attr/selectableItemBackground" + android:padding="12dp"> - \ No newline at end of file + + + diff --git a/app/src/main/res/layout/layout_event_item.xml b/app/src/main/res/layout/layout_event_item.xml index d8ecc81579..1122da89c4 100644 --- a/app/src/main/res/layout/layout_event_item.xml +++ b/app/src/main/res/layout/layout_event_item.xml @@ -4,7 +4,7 @@ android:padding="15dp" android:layout_marginRight="12dp" android:layout_marginLeft="12dp" - android:layout_marginBottom="5dp" + android:layout_marginBottom="3dp" android:orientation="horizontal"> - \ No newline at end of file + diff --git a/app/src/main/res/layout/logic_editor.xml b/app/src/main/res/layout/logic_editor.xml index 6ef47dc75a..5865beb059 100644 --- a/app/src/main/res/layout/logic_editor.xml +++ b/app/src/main/res/layout/logic_editor.xml @@ -23,6 +23,7 @@ android:layout_height="wrap_content" app:title="Activity" app:subtitle="onCreate" + app:subtitleTextColor="?colorSecondary" app:navigationIcon="?attr/homeAsUpIndicator" /> + app:cardBackgroundColor="@color/transparent" + app:shapeAppearance="?attr/shapeAppearanceCornerLarge" + app:strokeWidth="0dp"> + app:menu="@menu/manage_collection_items_menu" /> diff --git a/app/src/main/res/layout/manage_file.xml b/app/src/main/res/layout/manage_file.xml index 9dc20f04a1..f6522b92af 100644 --- a/app/src/main/res/layout/manage_file.xml +++ b/app/src/main/res/layout/manage_file.xml @@ -12,21 +12,12 @@ android:layout_height="wrap_content" android:fitsSystemWindows="true"> - - - - - - - + + + + - - - + + + + - \ No newline at end of file + diff --git a/app/src/main/res/layout/manage_java_item_hs.xml b/app/src/main/res/layout/manage_java_item_hs.xml index af4b6b6691..637edd8290 100644 --- a/app/src/main/res/layout/manage_java_item_hs.xml +++ b/app/src/main/res/layout/manage_java_item_hs.xml @@ -5,7 +5,7 @@ android:layout_height="wrap_content" android:layout_marginTop="8dp" app:cardBackgroundColor="@android:color/transparent" - app:cardCornerRadius="24dp" + app:shapeAppearance="?attr/shapeAppearanceCornerMedium" app:rippleColor="?attr/colorControlHighlight" app:strokeWidth="0dp"> diff --git a/app/src/main/res/layout/manage_library.xml b/app/src/main/res/layout/manage_library.xml index e3986969a2..77f984d1e7 100644 --- a/app/src/main/res/layout/manage_library.xml +++ b/app/src/main/res/layout/manage_library.xml @@ -11,21 +11,12 @@ android:layout_height="wrap_content" android:fitsSystemWindows="true"> - - - + android:src="@drawable/ic_mtrl_web" /> + + + + + + + - - - - - + android:src="@drawable/ic_mtrl_id" /> + android:src="@drawable/ic_mtrl_id" /> + android:src="@drawable/ic_mtrl_file" /> + android:src="@drawable/ic_mtrl_devices" /> + app:cardBackgroundColor="@color/transparent" + app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Large" + app:strokeWidth="0dp"> + android:paddingVertical="8dp"> + android:layout_height="28dp" + app:tint="?attr/colorPrimary" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/manage_library_exclude_builtin_libraries.xml b/app/src/main/res/layout/manage_library_exclude_builtin_libraries.xml index 99670f3d3a..d3c7108322 100644 --- a/app/src/main/res/layout/manage_library_exclude_builtin_libraries.xml +++ b/app/src/main/res/layout/manage_library_exclude_builtin_libraries.xml @@ -76,7 +76,8 @@ android:layout_height="32dp" android:layout_marginRight="8dp" android:padding="4dp" - android:src="@drawable/ic_warning_96dp" /> + app:tint="?colorAmber" + android:src="@drawable/ic_mtrl_warning" /> + android:src="@drawable/ic_mtrl_label" /> + android:src="@drawable/ic_mtrl_web" /> + android:src="@drawable/ic_mtrl_link" /> + android:src="@drawable/ic_mtrl_id" /> + android:src="@drawable/ic_mtrl_key" /> + android:src="@drawable/ic_mtrl_link" /> + android:src="@drawable/ic_mtrl_link" /> + android:src="@drawable/ic_mtrl_id" /> + android:src="@drawable/ic_mtrl_key" /> + android:src="@drawable/ic_mtrl_link" /> + android:src="@drawable/ic_mtrl_id" /> + android:src="@drawable/ic_mtrl_file" /> + android:src="@drawable/ic_mtrl_file" /> + android:src="@drawable/ic_mtrl_star" /> + android:src="@drawable/ic_mtrl_devices" /> + android:src="@drawable/ic_mtrl_design" /> + android:src="@drawable/ic_mtrl_link" /> + android:src="@drawable/ic_mtrl_id" /> + android:src="@drawable/ic_mtrl_key" /> + android:src="@drawable/ic_mtrl_link" /> + android:src="@drawable/ic_mtrl_map" /> + android:src="@drawable/ic_mtrl_key" /> + android:src="@drawable/ic_mtrl_delete" /> \ No newline at end of file diff --git a/app/src/main/res/layout/manage_library_setting_admob_test_device_item.xml b/app/src/main/res/layout/manage_library_setting_admob_test_device_item.xml index 8c1c09b85d..0ee4c10d8a 100644 --- a/app/src/main/res/layout/manage_library_setting_admob_test_device_item.xml +++ b/app/src/main/res/layout/manage_library_setting_admob_test_device_item.xml @@ -10,7 +10,7 @@ + android:src="@drawable/ic_mtrl_devices" /> + android:src="@drawable/ic_mtrl_delete" /> \ No newline at end of file diff --git a/app/src/main/res/layout/manage_permission.xml b/app/src/main/res/layout/manage_permission.xml index 20bbeb3cdd..bed941b629 100644 --- a/app/src/main/res/layout/manage_permission.xml +++ b/app/src/main/res/layout/manage_permission.xml @@ -10,31 +10,23 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:fitsSystemWindows="true" - app:liftOnScroll="false" - app:elevation="0dp"> + app:elevation="0dp" + app:liftOnScroll="false"> - - - - + android:layout_height="?attr/actionBarSize" + app:menu="@menu/permission_manager_menu" + app:navigationIcon="?attr/homeAsUpIndicator" + app:title="Permissions Manager" /> @@ -42,15 +34,11 @@ android:id="@+id/searchInputLayout" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginEnd="8dp" android:layout_weight="1" android:hint="Search for permissions" android:importantForAutofill="noExcludeDescendants" - app:boxCornerRadiusBottomEnd="50dp" - app:boxCornerRadiusBottomStart="50dp" - app:boxCornerRadiusTopEnd="50dp" - app:boxCornerRadiusTopStart="50dp" - app:startIconDrawable="@drawable/search_icon_grey"> + app:boxBackgroundMode="outline" + app:startIconDrawable="@drawable/ic_mtrl_search"> - @@ -85,8 +63,8 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" - android:paddingBottom="120dp" android:paddingTop="8dp" + android:paddingBottom="120dp" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:listitem="@layout/view_item_permission" /> @@ -99,4 +77,4 @@ android:layout_marginBottom="20dp" android:text="Scroll to the top" app:icon="@drawable/ic_arrow_drop_up_grey600_24dp" /> - \ No newline at end of file + diff --git a/app/src/main/res/layout/manage_sound.xml b/app/src/main/res/layout/manage_sound.xml index f19b25437f..69c9b94a9f 100644 --- a/app/src/main/res/layout/manage_sound.xml +++ b/app/src/main/res/layout/manage_sound.xml @@ -10,26 +10,32 @@ android:layout_height="wrap_content" android:fitsSystemWindows="true"> - - - + + + + - - - + + + + + android:focusable="true"> - \ No newline at end of file + diff --git a/app/src/main/res/layout/manage_view_list_item.xml b/app/src/main/res/layout/manage_view_list_item.xml index 64dbb179e0..3a63892528 100644 --- a/app/src/main/res/layout/manage_view_list_item.xml +++ b/app/src/main/res/layout/manage_view_list_item.xml @@ -1,21 +1,21 @@ + android:foreground="?android:attr/selectableItemBackground" + android:clickable="true" + app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Large"> - - - - - + app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Medium" + app:strokeWidth="0dp"> + app:strokeWidth="0dp"> + app:shapeAppearanceOverlay="@style/ShapeAppearance.Material3.Corner.Medium" + app:strokeWidth="0dp"> - - - - - - \ No newline at end of file + + diff --git a/app/src/main/res/layout/program_info.xml b/app/src/main/res/layout/program_info.xml index 1052790b97..50ba32d303 100644 --- a/app/src/main/res/layout/program_info.xml +++ b/app/src/main/res/layout/program_info.xml @@ -48,20 +48,8 @@ app:layout_constraintTop_toBottomOf="@id/app_name" tools:text="Version 1.0.0" /> - -