Skip to content

Commit

Permalink
auto scrolling title and description logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan09811 authored Apr 27, 2024
1 parent bd19f39 commit 4834074
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ public ItemHolder(@NonNull View itemView) {
super(itemView);
}

new Handler().postDelayed(new Runnable() {
@Override
public void run() {
// Set the ellipsize property and make the TextViews selectable to start the marquee
((AppCompatTextView) itemView.findViewById(R.id.title)).setEllipsize(TextUtils.TruncateAt.MARQUEE);
((AppCompatTextView) itemView.findViewById(R.id.title)).setSelected(true);

((AppCompatTextView) itemView.findViewById(R.id.description)).setEllipsize(TextUtils.TruncateAt.MARQUEE);
((AppCompatTextView) itemView.findViewById(R.id.description)).setSelected(true);
}
}, 3000);

public void apply(GameMetadata game) {
((AppCompatTextView) itemView.findViewById(R.id.title))
.setText(game.getTitle());
Expand Down

0 comments on commit 4834074

Please sign in to comment.