mirror of
https://github.com/TeamAmaze/AmazeFileManager.git
synced 2026-10-16 20:51:21 +08:00
Refactor: Static Helper for Marquee
This commit is contained in:
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "automatic"
|
||||
}
|
||||
@@ -220,8 +220,7 @@ public class CompressedExplorerAdapter extends RecyclerView.Adapter<CompressedIt
|
||||
|
||||
boolean enableMarquee =
|
||||
sharedPrefs.getBoolean(PreferencesConstants.PREFERENCE_ENABLE_MARQUEE_FILENAME, true);
|
||||
holder.txtTitle.setEllipsize(
|
||||
enableMarquee ? TextUtils.TruncateAt.MARQUEE : TextUtils.TruncateAt.MIDDLE);
|
||||
AnimUtils.configureTitleMarquee(holder.firstLine, enableMarquee);
|
||||
|
||||
final CompressedObjectParcelable rowItem = items.get(position);
|
||||
GradientDrawable gradientDrawable = (GradientDrawable) holder.genericIcon.getBackground();
|
||||
|
||||
@@ -765,8 +765,7 @@ public class RecyclerAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolde
|
||||
mainFragment.adjustListViewForTv(holder, mainFragment.getMainActivity());
|
||||
}
|
||||
});
|
||||
holder.txtTitle.setEllipsize(
|
||||
enableMarquee ? TextUtils.TruncateAt.MARQUEE : TextUtils.TruncateAt.MIDDLE);
|
||||
AnimUtils.configureTitleMarquee(holder.txtTitle, enableMarquee);
|
||||
|
||||
final boolean isBackButton = getItemsDigested().get(position).specialType == TYPE_BACK;
|
||||
if (isBackButton) {
|
||||
|
||||
@@ -71,4 +71,19 @@ public class AnimUtilsTest {
|
||||
ShadowLooper.runUiThreadTasksIncludingDelayedTasks();
|
||||
assertTrue(mock.isSelected());
|
||||
}
|
||||
|
||||
@Test
|
||||
public static void configureTitleMarquee(TextView textView, boolean enableMarquee) {
|
||||
if (enableMarquee) {
|
||||
textView.setSingleLine(true);
|
||||
textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
textView.setSelected(true); // Required for Marquee to move
|
||||
} else {
|
||||
// New custom behavior: Double line wrap!
|
||||
textView.setSingleLine(false);
|
||||
textView.setMaxLines(2);
|
||||
textView.setEllipsize(TextUtils.TruncateAt.END);
|
||||
textView.setSelected(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user