-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Appearance improvements #2359
Appearance improvements #2359
Changes from all commits
0d73e57
d98db9a
7433839
cffd907
e8e67e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This has to be done after show(). (IMO bad design by the Android devs) |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Divider decoration not needed. The items do this themselves? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Depends on how it's used. Generally the builtin Recyclerview decoration are better performant but in case there is a own one, of course bad to have multiple. |
||
_recyclerList.setItemViewCacheSize(20); | ||
gsantner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
_filesystemViewerAdapter = new GsFileBrowserListAdapter(_dopt, activity); | ||
_recyclerList.setAdapter(_filesystemViewerAdapter); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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(() -> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gsantner You added this postDelayed in 2022. Do you remember why? The code works well without it... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very likely because it was crashing on some devices without it. |
||
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); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be match_parent I guess for better usage? See latest issue