diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-12-05 10:17:39 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-12-19 19:47:38 +0100 |
commit | bba448aa69d6d974d3ef19cee02d57f3861fd4cd (patch) | |
tree | 4e8b6e753b68c2a8a8cc54d2e28ecf355c03eb79 /app | |
parent | 594dd8cab9fcbe1eea762f055cb2693ffa8dec46 (diff) | |
download | AntennaPod-bba448aa69d6d974d3ef19cee02d57f3861fd4cd.zip |
Use 2-line TextView in AudioplayerActivity toolbar
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java | 7 | ||||
-rw-r--r-- | app/src/main/res/layout/audioplayer_activity.xml | 39 |
2 files changed, 37 insertions, 9 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java index 897e10d76..821c86044 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -23,6 +23,7 @@ import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ImageButton; import android.widget.ListView; +import android.widget.TextView; import com.squareup.picasso.Picasso; @@ -86,6 +87,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc */ private int savedPosition = -1; + private TextView txtvTitle; private Button butPlaybackSpeed; private ImageButton butNavChaptersShownotes; private ImageButton butShowCover; @@ -432,6 +434,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc butPlaybackSpeed = (Button) findViewById(R.id.butPlaybackSpeed); butNavChaptersShownotes = (ImageButton) findViewById(R.id.butNavChaptersShownotes); butShowCover = (ImageButton) findViewById(R.id.butCover); + txtvTitle = (TextView) findViewById(R.id.txtvTitle); drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close) { CharSequence currentTitle = getSupportActionBar().getTitle(); @@ -588,8 +591,8 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc if (media == null) { return false; } - getSupportActionBar().setTitle(media.getEpisodeTitle()); - + txtvTitle.setText(media.getEpisodeTitle()); + getSupportActionBar().setTitle(""); Picasso.with(this) .load(media.getImageUri()) .fit() diff --git a/app/src/main/res/layout/audioplayer_activity.xml b/app/src/main/res/layout/audioplayer_activity.xml index f38273030..4d04771dd 100644 --- a/app/src/main/res/layout/audioplayer_activity.xml +++ b/app/src/main/res/layout/audioplayer_activity.xml @@ -16,13 +16,38 @@ android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize"> - <ImageButton - android:id="@+id/butCover" - android:layout_width="32dp" - android:layout_height="32dp" - android:layout_margin="8dp" - android:background="?attr/selectableItemBackground" - android:contentDescription="@string/show_cover_label" /> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="horizontal" + android:paddingLeft="8dp" + android:paddingRight="8dp"> + + + <TextView + android:id="@+id/txtvTitle" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_gravity="center_vertical" + android:layout_weight="1" + android:ellipsize="end" + android:gravity="left" + android:maxLines="2" + android:textColor="?android:attr/textColorPrimary" + android:textSize="16sp" /> + + <ImageButton + android:id="@+id/butCover" + android:layout_width="32dp" + android:layout_height="32dp" + android:layout_gravity="center_vertical" + android:layout_marginLeft="8dp" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/show_cover_label" + android:gravity="right" /> + + + </LinearLayout> </android.support.v7.widget.Toolbar> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" |