mirror of
https://github.com/KDE/kdeconnect-android
synced 2025-09-02 15:15:09 +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:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:id="@+id/now_playing_textview"
|
android:id="@+id/now_playing_textview"
|
||||||
|
android:ellipsize="marquee"
|
||||||
|
android:marqueeRepeatLimit="marquee_forever"
|
||||||
|
android:scrollHorizontally="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="8dip"
|
android:padding="8dip"
|
||||||
|
@@ -89,7 +89,11 @@ public class MprisActivity extends ActionBarActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
String song = mpris.getCurrentSong();
|
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())) {
|
if (mpris.getLength() > -1 && mpris.getPosition() > -1 && !"spotify".equals(mpris.getPlayer().toLowerCase())) {
|
||||||
((TextView) findViewById(R.id.time_textview)).setText(milisToProgress(mpris.getLength()));
|
((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
|
@Override
|
||||||
|
Reference in New Issue
Block a user