Skip to content

Commit

Permalink
Appearance improvements (PR gsantner#2359 closes gsantner#2358)
Browse files Browse the repository at this point in the history
(cherry picked from commit c4ba9e7)
  • Loading branch information
harshad1 authored and elyahw committed Sep 26, 2024
1 parent 5671b08 commit 66ee7ce
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ 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_HIDDEN);
window.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
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);

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down Expand Up @@ -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<FitFile> filter(final List<FitFile> searchResults, String query) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ public static void showMultiChoiceDialogWithSearchFilterUI(final Activity activi
});

dialog.show();

final Window win = dialog.getWindow();
if (win != null) {
if (dopt.isSearchEnabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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("..")
? descriptionFile.getAbsolutePath() : formatFileDescription(file, _prefApp.getString("pref_key__file_description_format", "")));
}, 60);
holder.description.setText(!_dopt.descModtimeInsteadOfParent || holder.title.getText().toString().equals("..")
? descriptionFile.getAbsolutePath() : formatFileDescription(file, _prefApp.getString("pref_key__file_description_format", "")));
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);
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/layout/widget_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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"
Expand Down

0 comments on commit 66ee7ce

Please sign in to comment.