mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-08-31 14:15:14 +00:00
Make a now playing label scroll horizontally
REVIEW: 126739
This commit is contained in:
@@ -32,6 +32,9 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:id="@+id/now_playing_textview"
|
||||
android:ellipsize="marquee"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:gravity="center"
|
||||
android:padding="8dip"
|
||||
|
@@ -89,7 +89,11 @@ public class MprisActivity extends ActionBarActivity {
|
||||
@Override
|
||||
public void run() {
|
||||
String song = mpris.getCurrentSong();
|
||||
((TextView) findViewById(R.id.now_playing_textview)).setText(song);
|
||||
|
||||
TextView nowPlaying = (TextView) findViewById(R.id.now_playing_textview);
|
||||
if (!nowPlaying.getText().toString().equals(song)) {
|
||||
nowPlaying.setText(song);
|
||||
}
|
||||
|
||||
if (mpris.getLength() > -1 && mpris.getPosition() > -1 && !"spotify".equals(mpris.getPlayer().toLowerCase())) {
|
||||
((TextView) findViewById(R.id.time_textview)).setText(milisToProgress(mpris.getLength()));
|
||||
@@ -453,6 +457,7 @@ public class MprisActivity extends ActionBarActivity {
|
||||
|
||||
});
|
||||
|
||||
findViewById(R.id.now_playing_textview).setSelected(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user