diff --git a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java index e884212e0d..eab5a082ce 100644 --- a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java +++ b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java @@ -145,12 +145,6 @@ public void onNothingSelected(AdapterView parent) { .setView(scrollView) .create(); - final Window window = dialog.getWindow(); - if (window != null) { - window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); - window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT); - } - final GsCallback.a0 submit = () -> { final String query = searchEditText.getText().toString(); if (dialogCallback != null && !TextUtils.isEmpty(query)) { @@ -187,5 +181,11 @@ public void onNothingSelected(AdapterView parent) { }); dialog.show(); + + final Window window = dialog.getWindow(); + if (window != null) { + window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); + window.setLayout(WindowManager.LayoutParams.WRAP_CONTENT, WindowManager.LayoutParams.WRAP_CONTENT); + } } } diff --git a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java index 9454954859..6a61548411 100644 --- a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java +++ b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java @@ -96,12 +96,6 @@ public void afterTextChanged(final Editable arg0) { .setNegativeButton(android.R.string.cancel, (dialogInterface, i) -> dialogInterface.dismiss()) .create(); - final Window window = dialog.getWindow(); - if (window != null) { - window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); - window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.MATCH_PARENT); - } - expandableListView.setOnGroupClickListener((parent, view, groupPosition, id) -> { final FitFile groupItem = (FitFile) parent.getExpandableListAdapter().getGroup(groupPosition); if (groupItem.children.isEmpty()) { @@ -144,6 +138,11 @@ public void afterTextChanged(final Editable arg0) { }); dialog.show(); + final Window window = dialog.getWindow(); + if (window != null) { + window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); + window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT); + } } private static List filter(final List searchResults, String query) { diff --git a/app/src/main/java/net/gsantner/opoc/frontend/GsSearchOrCustomTextDialog.java b/app/src/main/java/net/gsantner/opoc/frontend/GsSearchOrCustomTextDialog.java index b0316b5d5c..1814a7e401 100644 --- a/app/src/main/java/net/gsantner/opoc/frontend/GsSearchOrCustomTextDialog.java +++ b/app/src/main/java/net/gsantner/opoc/frontend/GsSearchOrCustomTextDialog.java @@ -339,6 +339,7 @@ public static void showMultiChoiceDialogWithSearchFilterUI(final Activity activi }); dialog.show(); + final Window win = dialog.getWindow(); if (win != null) { if (dopt.isSearchEnabled) { diff --git a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserDialog.java b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserDialog.java index e3d716ac5e..6134b3639a 100644 --- a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserDialog.java +++ b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserDialog.java @@ -149,9 +149,10 @@ public void onViewCreated(final View root, final @Nullable Bundle savedInstanceS root.setBackgroundColor(rcolor(_dopt.backgroundColor)); - final LinearLayoutManager lam = (LinearLayoutManager) _recyclerList.getLayoutManager(); - final DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activity, lam.getOrientation()); - _recyclerList.addItemDecoration(dividerItemDecoration); + // final LinearLayoutManager lam = (LinearLayoutManager) _recyclerList.getLayoutManager(); + // final DividerItemDecoration dividerItemDecoration = new DividerItemDecoration(activity, lam.getOrientation()); + // _recyclerList.addItemDecoration(dividerItemDecoration); + _recyclerList.setItemViewCacheSize(20); _filesystemViewerAdapter = new GsFileBrowserListAdapter(_dopt, activity); _recyclerList.setAdapter(_filesystemViewerAdapter); diff --git a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java index 1b47ecc848..74d648ea70 100644 --- a/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java +++ b/app/src/main/java/net/gsantner/opoc/frontend/filebrowser/GsFileBrowserListAdapter.java @@ -184,15 +184,14 @@ public void onBindViewHolder(@NonNull FilesystemViewerViewHolder holder, int pos } } - holder.description.setTextColor(ContextCompat.getColor(_context, _dopt.secondaryTextColor)); + final boolean isFile = file.isFile(); - holder.image.postDelayed(() -> { - holder.image.setImageResource(isSelected ? _dopt.selectedItemImage : (!file.isFile() ? _dopt.folderImage : _dopt.fileImage)); - holder.description.setText(!_dopt.descModtimeInsteadOfParent || holder.title.getText().toString().equals("..") + holder.description.setText(!_dopt.descModtimeInsteadOfParent || holder.title.getText().toString().equals("..") ? descriptionFile.getAbsolutePath() : formatFileDescription(file, _prefApp.getString("pref_key__file_description_format", ""))); - }, 60); + holder.description.setTextColor(ContextCompat.getColor(_context, _dopt.secondaryTextColor)); + holder.image.setImageResource(isSelected ? _dopt.selectedItemImage : isFile ? _dopt.fileImage : _dopt.folderImage); holder.image.setColorFilter(ContextCompat.getColor(_context, - isSelected ? _dopt.accentColor : (!file.isFile() ? _dopt.folderColor : _dopt.fileColor)), + isSelected ? _dopt.accentColor : isFile? _dopt.fileColor : _dopt.folderColor), android.graphics.PorterDuff.Mode.SRC_ATOP); if (!isSelected && isFavourite) { holder.image.setColorFilter(0xFFE3B51B); diff --git a/app/src/main/res/layout/expandable_list_group_item.xml b/app/src/main/res/layout/expandable_list_group_item.xml index 39f16817d1..1130179bc5 100644 --- a/app/src/main/res/layout/expandable_list_group_item.xml +++ b/app/src/main/res/layout/expandable_list_group_item.xml @@ -7,6 +7,9 @@ android:drawablePadding="5dp" android:gravity="center_vertical" android:paddingLeft="10dp" + android:paddingStart="10dp" + android:paddingEnd="5dp" + android:paddingRight="5dp" android:paddingTop="10dp" android:paddingBottom="10dp" android:textAppearance="?android:attr/textAppearanceListItem" /> diff --git a/app/src/main/res/layout/widget_layout.xml b/app/src/main/res/layout/widget_layout.xml index daa1f912cb..19b08a0553 100644 --- a/app/src/main/res/layout/widget_layout.xml +++ b/app/src/main/res/layout/widget_layout.xml @@ -60,7 +60,7 @@ android:layout_below="@id/widget_main" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" - android:layout_marginTop="4dp" + android:layout_marginTop="5dp" android:layout_marginEnd="10dp" android:layout_marginRight="10dp" android:background="@drawable/fab_circle" @@ -75,7 +75,7 @@ android:layout_below="@+id/widget_new_note" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" - android:layout_marginTop="4dp" + android:layout_marginTop="5dp" android:layout_marginEnd="10dp" android:layout_marginRight="10dp" android:background="@drawable/fab_circle" @@ -90,7 +90,7 @@ android:layout_below="@+id/widget_todo" android:layout_alignParentEnd="true" android:layout_alignParentRight="true" - android:layout_marginTop="4dp" + android:layout_marginTop="5dp" android:layout_marginEnd="10dp" android:layout_marginRight="10dp" android:background="@drawable/fab_circle" diff --git a/app/thirdparty/java/other/writeily/widget/WrMarkorWidgetProvider.java b/app/thirdparty/java/other/writeily/widget/WrMarkorWidgetProvider.java index 5948888276..dc34e556e5 100644 --- a/app/thirdparty/java/other/writeily/widget/WrMarkorWidgetProvider.java +++ b/app/thirdparty/java/other/writeily/widget/WrMarkorWidgetProvider.java @@ -20,6 +20,9 @@ import android.os.Build; import android.widget.RemoteViews; +import androidx.annotation.ColorInt; +import androidx.core.content.ContextCompat; + import net.gsantner.markor.ApplicationObject; import net.gsantner.markor.R; import net.gsantner.markor.activity.MainActivity; @@ -41,6 +44,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a final int staticFlags = PendingIntent.FLAG_UPDATE_CURRENT | (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M ? PendingIntent.FLAG_IMMUTABLE : 0); final int mutableFlags = PendingIntent.FLAG_UPDATE_CURRENT | (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? PendingIntent.FLAG_MUTABLE : 0); + final @ColorInt int color = ContextCompat.getColor(context, R.color.white); // Perform this loop procedure for each App Widget that belongs to this provider for (final int appWidgetId : appWidgetIds) { @@ -57,6 +61,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a .setAction(Intent.ACTION_SEND) .putExtra(Intent.EXTRA_TEXT, ""); views.setOnClickPendingIntent(R.id.widget_new_note, PendingIntent.getActivity(context, requestCode++, openShare, staticFlags)); + views.setInt(R.id.widget_new_note, "setColorFilter", color); // Open Folder final Intent goToFolder = new Intent(context, MainActivity.class) @@ -70,6 +75,7 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a .putExtra(Document.EXTRA_FILE, appSettings.getTodoFile()) .putExtra(Document.EXTRA_FILE_LINE_NUMBER, Document.EXTRA_FILE_LINE_NUMBER_LAST); views.setOnClickPendingIntent(R.id.widget_todo, PendingIntent.getActivity(context, requestCode++, openTodo, staticFlags)); + views.setInt(R.id.widget_todo, "setColorFilter", color); // Open QuickNote final Intent openQuickNote = new Intent(context, OpenFromShortcutOrWidgetActivity.class) @@ -77,12 +83,14 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] a .putExtra(Document.EXTRA_FILE, appSettings.getQuickNoteFile()) .putExtra(Document.EXTRA_FILE_LINE_NUMBER, Document.EXTRA_FILE_LINE_NUMBER_LAST); views.setOnClickPendingIntent(R.id.widget_quicknote, PendingIntent.getActivity(context, requestCode++, openQuickNote, staticFlags)); + views.setInt(R.id.widget_quicknote, "setColorFilter", color); // Open Notebook final Intent goHome = new Intent(context, MainActivity.class) .setAction(Intent.ACTION_VIEW) .putExtra(Document.EXTRA_FILE, appSettings.getNotebookDirectory()); views.setOnClickPendingIntent(R.id.widget_main, PendingIntent.getActivity(context, requestCode++, goHome, staticFlags)); + views.setInt(R.id.widget_main, "setColorFilter", color); // ListView final Intent notesListIntent = new Intent(context, WrFilesWidgetService.class)