2
0
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:
Mikhail Ivchenko
2016-01-14 15:28:33 +04:00
parent fba3e75cec
commit caa491d1e7
2 changed files with 9 additions and 1 deletions

View File

@@ -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"

View File

@@ -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