diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-12-04 16:34:32 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-12-19 19:47:37 +0100 |
commit | 6962d139746347aff034e3a84eaecf3e98062160 (patch) | |
tree | 288a65c7ba5c827a9e9435611167eb6179c52790 /app | |
parent | 8083a064a0d94c90c1927932f2cb01bac69af6ad (diff) | |
download | AntennaPod-6962d139746347aff034e3a84eaecf3e98062160.zip |
Updated audio player layout
Diffstat (limited to 'app')
11 files changed, 305 insertions, 459 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 eb7a844db..f124de947 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -11,6 +11,7 @@ import android.support.v4.app.FragmentTransaction; import android.support.v4.app.ListFragment; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.widget.Toolbar; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -21,9 +22,7 @@ import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.Button; import android.widget.ImageButton; -import android.widget.ImageView.ScaleType; import android.widget.ListView; -import android.widget.TextView; import com.squareup.picasso.Picasso; @@ -59,6 +58,7 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc private static final int POS_DESCR = 1; private static final int POS_CHAPTERS = 2; private static final int NUM_CONTENT_FRAGMENTS = 3; + private static final int POS_NONE = -1; final String TAG = "AudioplayerActivity"; private static final String PREFS = "AudioPlayerActivityPreferences"; @@ -78,15 +78,15 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc private Fragment currentlyShownFragment; private int currentlyShownPosition = -1; + private int lastShownPosition = POS_NONE; /** * Used if onResume was called without loadMediaInfo. */ private int savedPosition = -1; - private TextView txtvTitle; private Button butPlaybackSpeed; - private ImageButton butNavLeft; - private ImageButton butNavRight; + private ImageButton butNavChaptersShownotes; + private ImageButton butShowCover; private void resetFragmentView() { FragmentTransaction fT = getSupportFragmentManager().beginTransaction(); @@ -139,9 +139,13 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc } @Override + protected void chooseTheme() { + setTheme(UserPreferences.getNoTitleTheme()); + } + + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - getSupportActionBar().setDisplayShowTitleEnabled(false); detachedFragments = new Fragment[NUM_CONTENT_FRAGMENTS]; } @@ -320,24 +324,32 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc chapterFragment = new ListFragment() { @Override - public void onListItemClick(ListView l, View v, - int position, long id) { - super.onListItemClick(l, v, position, id); - Chapter chapter = (Chapter) this - .getListAdapter().getItem(position); - controller.seekToChapter(chapter); + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + // add padding + final ListView lv = getListView(); + lv.setClipToPadding(false); + final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding); + lv.setPadding(0, vertPadding, 0, vertPadding); } - }; chapterFragment.setListAdapter(new ChapterListAdapter( AudioplayerActivity.this, 0, media - .getChapters(), media + .getChapters(), media, new ChapterListAdapter.Callback() { + @Override + public void onPlayChapterButtonClicked(int position) { + Chapter chapter = (Chapter) + chapterFragment.getListAdapter().getItem(position); + controller.seekToChapter(chapter); + } + } )); } currentlyShownFragment = chapterFragment; break; } if (currentlyShownFragment != null) { + lastShownPosition = currentlyShownPosition; currentlyShownPosition = pos; if (detachedFragments[pos] != null) { if (BuildConfig.DEBUG) @@ -355,78 +367,68 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc } } + /** + * Switches to the fragment that was displayed before the current one or the description fragment + * if no fragment was previously displayed. + */ + public void switchToLastFragment() { + if (lastShownPosition != POS_NONE) { + switchToFragment(lastShownPosition); + } else { + switchToFragment(POS_DESCR); + } + } + private void updateNavButtonDrawable() { final int[] buttonTexts = new int[]{R.string.show_shownotes_label, - R.string.show_chapters_label, R.string.show_cover_label}; + R.string.show_chapters_label}; final TypedArray drawables = obtainStyledAttributes(new int[]{ R.attr.navigation_shownotes, R.attr.navigation_chapters}); final Playable media = controller.getMedia(); - if (butNavLeft != null && butNavRight != null && media != null) { - - butNavRight.setTag(R.id.imageloader_key, null); - butNavLeft.setTag(R.id.imageloader_key, null); + if (butNavChaptersShownotes != null && butShowCover != null && media != null) { + butNavChaptersShownotes.setTag(R.id.imageloader_key, null); + setNavButtonVisibility(); switch (currentlyShownPosition) { case POS_COVER: - butNavLeft.setScaleType(ScaleType.CENTER); - butNavLeft.setImageDrawable(drawables.getDrawable(0)); - butNavLeft.setContentDescription(getString(buttonTexts[0])); - - butNavRight.setImageDrawable(drawables.getDrawable(1)); - butNavRight.setContentDescription(getString(buttonTexts[1])); - + butShowCover.setVisibility(View.GONE); + if (lastShownPosition == POS_CHAPTERS) { + butNavChaptersShownotes.setImageDrawable(drawables.getDrawable(1)); + butNavChaptersShownotes.setContentDescription(getString(buttonTexts[1])); + } else { + butNavChaptersShownotes.setImageDrawable(drawables.getDrawable(0)); + butNavChaptersShownotes.setContentDescription(getString(buttonTexts[0])); + } break; case POS_DESCR: - butNavLeft.setScaleType(ScaleType.CENTER_CROP); - butNavLeft.post(new Runnable() { - - @Override - public void run() { - Picasso.with(AudioplayerActivity.this) - .load(media.getImageUri()) - .fit() - .into(butNavLeft); - } - }); - butNavLeft.setContentDescription(getString(buttonTexts[2])); - - butNavRight.setImageDrawable(drawables.getDrawable(1)); - butNavRight.setContentDescription(getString(buttonTexts[1])); + butShowCover.setVisibility(View.VISIBLE); + butNavChaptersShownotes.setImageDrawable(drawables.getDrawable(1)); + butNavChaptersShownotes.setContentDescription(getString(buttonTexts[1])); break; case POS_CHAPTERS: - butNavLeft.setScaleType(ScaleType.CENTER_CROP); - butNavLeft.post(new Runnable() { - - @Override - public void run() { - Picasso.with(AudioplayerActivity.this) - .load(media.getImageUri()) - .fit() - .into(butNavLeft); - } - - }); - butNavLeft.setContentDescription(getString(buttonTexts[2])); - - butNavRight.setImageDrawable(drawables.getDrawable(0)); - butNavRight.setContentDescription(getString(buttonTexts[0])); + butShowCover.setVisibility(View.VISIBLE); + butNavChaptersShownotes.setImageDrawable(drawables.getDrawable(0)); + butNavChaptersShownotes.setContentDescription(getString(buttonTexts[0])); break; } } + drawables.recycle(); } @Override protected void setupGUI() { super.setupGUI(); resetFragmentView(); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); navList = (ListView) findViewById(R.id.nav_list); - txtvTitle = (TextView) findViewById(R.id.txtvTitle); - butNavLeft = (ImageButton) findViewById(R.id.butNavLeft); - butNavRight = (ImageButton) findViewById(R.id.butNavRight); butPlaybackSpeed = (Button) findViewById(R.id.butPlaybackSpeed); + butNavChaptersShownotes = (ImageButton) findViewById(R.id.butNavChaptersShownotes); + butShowCover = (ImageButton) findViewById(R.id.butCover); drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close) { CharSequence currentTitle = getSupportActionBar().getTitle(); @@ -468,30 +470,23 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc }); drawerToggle.syncState(); - butNavLeft.setOnClickListener(new OnClickListener() { - + butNavChaptersShownotes.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - if (currentlyShownFragment == null - || currentlyShownPosition == POS_DESCR) { - switchToFragment(POS_COVER); - } else if (currentlyShownPosition == POS_COVER) { + if (currentlyShownPosition == POS_CHAPTERS) { switchToFragment(POS_DESCR); - } else if (currentlyShownPosition == POS_CHAPTERS) { - switchToFragment(POS_COVER); + } else if (currentlyShownPosition == POS_DESCR) { + switchToFragment(POS_CHAPTERS); + } else if (currentlyShownPosition == POS_COVER) { + switchToLastFragment(); } } }); - butNavRight.setOnClickListener(new OnClickListener() { - + butShowCover.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { - if (currentlyShownPosition == POS_CHAPTERS) { - switchToFragment(POS_DESCR); - } else { - switchToFragment(POS_CHAPTERS); - } + switchToFragment(POS_COVER); } }); @@ -539,6 +534,22 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc }); } + private void setNavButtonVisibility() { + if (butNavChaptersShownotes != null) { + if (controller != null) { + Playable media = controller.getMedia(); + if (media != null) { + if (media.getChapters() != null || currentlyShownPosition == POS_COVER) { + butNavChaptersShownotes.setVisibility(View.VISIBLE); + return; + } + } + } + butNavChaptersShownotes.setVisibility(View.GONE); + } + + } + @Override protected void onPlaybackSpeedChange() { super.onPlaybackSpeedChange(); @@ -566,13 +577,14 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc if (media == null) { return false; } - txtvTitle.setText(media.getEpisodeTitle()); - if (media.getChapters() != null) { - butNavRight.setVisibility(View.VISIBLE); - } else { - butNavRight.setVisibility(View.INVISIBLE); - } + getSupportActionBar().setTitle(media.getEpisodeTitle()); + + Picasso.with(this) + .load(media.getImageUri()) + .fit() + .into(butShowCover); + setNavButtonVisibility(); if (currentlyShownPosition == -1) { if (!restoreFromPreferences()) { diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index 561188291..099e96be9 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -174,7 +174,6 @@ public abstract class MediaplayerActivity extends ActionBarActivity orientation = getResources().getConfiguration().orientation; getWindow().setFormat(PixelFormat.TRANSPARENT); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Override diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index 727b25296..60eb290b5 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -111,6 +111,7 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void setupGUI() { super.setupGUI(); + getSupportActionBar().setDisplayHomeAsUpEnabled(true); videoOverlay = (LinearLayout) findViewById(R.id.overlay); videoview = (AspectRatioVideoView) findViewById(R.id.videoview); progressIndicator = (ProgressBar) findViewById(R.id.progressIndicator); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java index 9e59a2a1a..67fb4c3b1 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChapterListAdapter.java @@ -14,6 +14,7 @@ import android.view.View; import android.view.View.OnTouchListener; import android.view.ViewGroup; import android.widget.ArrayAdapter; +import android.widget.ImageButton; import android.widget.TextView; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.feed.Chapter; @@ -31,16 +32,18 @@ public class ChapterListAdapter extends ArrayAdapter<Chapter> { private Playable media; private int defaultTextColor; + private final Callback callback; public ChapterListAdapter(Context context, int textViewResourceId, - List<Chapter> objects, Playable media) { + List<Chapter> objects, Playable media, Callback callback) { super(context, textViewResourceId, objects); this.chapters = objects; this.media = media; + this.callback = callback; } @Override - public View getView(int position, View convertView, ViewGroup parent) { + public View getView(final int position, View convertView, ViewGroup parent) { Holder holder; Chapter sc = getItem(position); @@ -56,6 +59,7 @@ public class ChapterListAdapter extends ArrayAdapter<Chapter> { defaultTextColor = holder.title.getTextColors().getDefaultColor(); holder.start = (TextView) convertView.findViewById(R.id.txtvStart); holder.link = (TextView) convertView.findViewById(R.id.txtvLink); + holder.butPlayChapter = (ImageButton) convertView.findViewById(R.id.butPlayChapter); convertView.setTag(holder); } else { holder = (Holder) convertView.getTag(); @@ -122,6 +126,14 @@ public class ChapterListAdapter extends ArrayAdapter<Chapter> { } }); + holder.butPlayChapter.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (callback != null) { + callback.onPlayChapterButtonClicked(position); + } + } + }); Chapter current = ChapterUtils.getCurrentChapter(media); if (current != null) { if (current == sc) { @@ -144,6 +156,7 @@ public class ChapterListAdapter extends ArrayAdapter<Chapter> { TextView title; TextView start; TextView link; + ImageButton butPlayChapter; } @Override @@ -177,4 +190,8 @@ public class ChapterListAdapter extends ArrayAdapter<Chapter> { return super.getItem(position); } + public static interface Callback { + public void onPlayChapterButtonClicked(int position); + } + } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index efe3e7ab4..3076f8136 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.fragment; +import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.support.v4.app.Fragment; @@ -13,6 +14,7 @@ import com.squareup.picasso.Picasso; import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; +import de.danoeh.antennapod.activity.AudioplayerActivity; import de.danoeh.antennapod.activity.AudioplayerActivity.AudioplayerContentFragment; import de.danoeh.antennapod.core.util.playback.Playable; @@ -57,6 +59,15 @@ public class CoverFragment extends Fragment implements Bundle savedInstanceState) { View root = inflater.inflate(R.layout.cover_fragment, container, false); imgvCover = (ImageView) root.findViewById(R.id.imgvCover); + imgvCover.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Activity activity = getActivity(); + if (activity != null && activity instanceof AudioplayerActivity) { + ((AudioplayerActivity)activity).switchToLastFragment(); + } + } + }); viewCreated = true; return root; } diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index c0222de8e..a7c6d62e6 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -12,7 +12,6 @@ import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; -import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; diff --git a/app/src/main/res/layout-land/audioplayer_activity.xml b/app/src/main/res/layout-land/audioplayer_activity.xml deleted file mode 100644 index 1f78902c9..000000000 --- a/app/src/main/res/layout-land/audioplayer_activity.xml +++ /dev/null @@ -1,188 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<android.support.v4.widget.DrawerLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/drawer_layout" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="horizontal"> - - <FrameLayout - android:id="@+id/contentView" - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_weight="0.5"> - </FrameLayout> - - <RelativeLayout - android:layout_width="0dp" - android:layout_height="match_parent" - android:layout_weight="0.5" - android:background="?attr/non_transparent_background" - android:orientation="vertical"> - - <RelativeLayout - android:id="@+id/navBar" - android:layout_width="fill_parent" - android:layout_height="60dp" - android:layout_alignParentTop="true"> - - <ImageButton - android:id="@+id/butNavLeft" - android:contentDescription="@string/show_shownotes_label" - android:layout_width="60dp" - android:layout_height="match_parent" - android:layout_alignParentLeft="true" - android:background="?attr/selectableItemBackground" - android:padding="4dp"/> - - <ImageButton - android:id="@+id/butNavRight" - android:contentDescription="@string/show_chapters_label" - android:layout_width="60dp" - android:layout_height="match_parent" - android:layout_alignParentRight="true" - android:background="?attr/selectableItemBackground" - android:padding="4dp"/> - - <TextView - android:id="@+id/txtvTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginTop="8dp" - android:layout_toLeftOf="@id/butNavRight" - android:layout_toRightOf="@id/butNavLeft" - android:ellipsize="marquee" - android:marqueeRepeatLimit="marquee_forever" - android:maxLines="1" - android:textColor="?android:attr/textColorPrimary" - android:textSize="@dimen/text_size_medium" - android:textStyle="bold"/> - - <TextView - android:id="@+id/txtvFeed" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_below="@id/txtvTitle" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_toLeftOf="@id/butNavRight" - android:layout_toRightOf="@id/butNavLeft" - android:ellipsize="marquee" - android:marqueeRepeatLimit="marquee_forever" - android:maxLines="1" - android:textColor="?android:attr/textColorSecondary" - android:textSize="@dimen/text_size_small"/> - </RelativeLayout> - - <View - android:id="@+id/navBarDivider" - android:layout_width="match_parent" - android:layout_height="1dp" - android:layout_below="@id/navBar" - android:background="@color/bright_blue"/> - - <RelativeLayout - android:id="@+id/player_control" - android:layout_width="match_parent" - android:layout_height="80dp" - android:layout_alignParentBottom="true" - android:background="?attr/overlay_background"> - - <ImageButton - android:id="@+id/butPlay" - android:contentDescription="@string/pause_label" - android:layout_width="80dp" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" - android:background="?attr/selectableItemBackground" - android:src="?attr/av_pause"/> - - <ImageButton - android:id="@+id/butRev" - android:contentDescription="@string/rewind_label" - android:layout_width="60dp" - android:layout_height="match_parent" - android:layout_toLeftOf="@id/butPlay" - android:background="?attr/selectableItemBackground" - android:src="?attr/av_rew_big"/> - - <ImageButton - android:id="@+id/butFF" - android:contentDescription="@string/fast_forward_label" - android:layout_width="60dp" - android:layout_height="match_parent" - android:layout_toRightOf="@id/butPlay" - android:background="?attr/selectableItemBackground" - android:src="?attr/av_ff_big"/> - - <Button - android:id="@+id/butPlaybackSpeed" - android:layout_width="60dp" - android:layout_height="match_parent" - android:layout_toRightOf="@id/butFF" - android:background="?attr/selectableItemBackground" - android:src="?attr/av_fast_forward" - android:textColor="@color/gray" - android:textSize="@dimen/text_size_medium" - android:visibility="gone"/> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/playtime_layout" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_above="@id/player_control" - android:layout_alignParentLeft="true" - android:background="?attr/overlay_drawable"> - - <TextView - android:id="@+id/txtvPosition" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_centerVertical="true" - android:layout_marginLeft="8dp" - android:layout_marginTop="16dp" - android:text="@string/position_default_label" - android:textColor="?android:attr/textColorSecondary" - android:textSize="@dimen/text_size_micro"/> - - <TextView - android:id="@+id/txtvLength" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" - android:layout_alignParentTop="true" - android:layout_centerVertical="true" - android:layout_marginRight="8dp" - android:layout_marginTop="16dp" - android:text="@string/position_default_label" - android:textColor="?android:attr/textColorSecondary" - android:textSize="@dimen/text_size_micro"/> - - <SeekBar - android:id="@+id/sbPosition" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginTop="16dp" - android:layout_toLeftOf="@id/txtvLength" - android:layout_toRightOf="@id/txtvPosition" - android:max="500"/> - </RelativeLayout> - </RelativeLayout> - - </LinearLayout> - - <include layout="@layout/nav_list"/> - -</android.support.v4.widget.DrawerLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/audioplayer_activity.xml b/app/src/main/res/layout/audioplayer_activity.xml index 770ced350..f38273030 100644 --- a/app/src/main/res/layout/audioplayer_activity.xml +++ b/app/src/main/res/layout/audioplayer_activity.xml @@ -1,173 +1,152 @@ <?xml version="1.0" encoding="utf-8"?> -<android.support.v4.widget.DrawerLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent"> - <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/content" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:background="?attr/non_transparent_background" - android:orientation="vertical"> - - <RelativeLayout - android:id="@+id/navBar" - android:layout_width="fill_parent" - android:layout_height="60dp" - android:layout_alignParentTop="true"> - - <ImageButton - android:id="@+id/butNavLeft" - android:contentDescription="@string/show_shownotes_label" - android:layout_width="60dp" - android:layout_height="match_parent" - android:layout_alignParentLeft="true" - android:background="?attr/selectableItemBackground" - android:padding="4dp"/> - - <ImageButton - android:id="@+id/butNavRight" - android:contentDescription="@string/show_chapters_label" - android:layout_width="60dp" - android:layout_height="match_parent" - android:layout_alignParentRight="true" - android:background="?attr/selectableItemBackground" - android:padding="4dp"/> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> - <TextView - android:id="@+id/txtvTitle" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_centerInParent="true" - android:layout_alignParentTop="true" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginTop="8dp" - android:layout_toLeftOf="@id/butNavRight" - android:layout_toRightOf="@id/butNavLeft" - android:ellipsize="marquee" - android:marqueeRepeatLimit="marquee_forever" - android:maxLines="2" - android:textColor="?android:attr/textColorPrimary" - android:textSize="16sp" - android:fontFamily="sans-serif-light" - /> - </RelativeLayout> - - <View - android:id="@+id/navBarDivider" + <android.support.v7.widget.Toolbar + android:id="@+id/toolbar" android:layout_width="match_parent" - android:layout_height="1dp" - android:layout_below="@id/navBar" - android:background="@color/bright_blue"/> - - <RelativeLayout - android:id="@+id/player_control" - android:layout_width="match_parent" - android:layout_height="80dp" - android:layout_alignParentBottom="true" - android:background="?attr/overlay_background"> - - <ImageButton - android:id="@+id/butPlay" - android:contentDescription="@string/pause_label" - android:layout_width="80dp" - android:layout_height="match_parent" - android:layout_centerHorizontal="true" - android:background="?attr/selectableItemBackground" - android:src="?attr/av_pause"/> + android:layout_height="wrap_content" + android:background="?attr/colorPrimary" + android:minHeight="?attr/actionBarSize"> <ImageButton - android:id="@+id/butRev" - android:contentDescription="@string/rewind_label" - android:layout_width="80dp" - android:layout_height="match_parent" - android:layout_toLeftOf="@id/butPlay" + android:id="@+id/butCover" + android:layout_width="32dp" + android:layout_height="32dp" + android:layout_margin="8dp" android:background="?attr/selectableItemBackground" - android:src="?attr/av_rew_big"/> + android:contentDescription="@string/show_cover_label" /> + </android.support.v7.widget.Toolbar> - <ImageButton - android:id="@+id/butFF" - android:contentDescription="@string/fast_forward_label" - android:layout_width="80dp" - android:layout_height="match_parent" - android:layout_toRightOf="@id/butPlay" - android:background="?attr/selectableItemBackground" - android:src="?attr/av_ff_big"/> - - <Button - android:id="@+id/butPlaybackSpeed" - android:contentDescription="@string/set_playback_speed_label" - android:layout_width="80dp" - android:layout_height="match_parent" - android:layout_toRightOf="@id/butFF" - android:background="?attr/selectableItemBackground" - android:src="?attr/av_fast_forward" - android:textColor="@color/gray" - android:textSize="@dimen/text_size_medium" - android:visibility="gone"/> - </RelativeLayout> - - <RelativeLayout - android:id="@+id/playtime_layout" + <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/content" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_above="@id/player_control" - android:layout_alignParentLeft="true" - android:background="?attr/overlay_drawable"> - - <TextView - android:id="@+id/txtvPosition" - android:layout_width="wrap_content" + android:layout_height="match_parent" + android:background="?attr/non_transparent_background" + android:foreground="?android:windowContentOverlay" + android:orientation="vertical"> + + <RelativeLayout + android:id="@+id/player_control" + android:layout_width="match_parent" + android:layout_height="@dimen/audioplayer_playercontrols_length" + android:layout_alignParentBottom="true" + android:background="?attr/overlay_background"> + + <ImageButton + android:id="@+id/butPlay" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="match_parent" + android:layout_centerHorizontal="true" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/pause_label" + android:src="?attr/av_pause" /> + + <ImageButton + android:id="@+id/butRev" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="match_parent" + android:layout_toLeftOf="@id/butPlay" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/rewind_label" + android:src="?attr/av_rew_big" /> + + <ImageButton + android:id="@+id/butFF" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="match_parent" + android:layout_toRightOf="@id/butPlay" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/fast_forward_label" + android:src="?attr/av_ff_big" /> + + <Button + android:id="@+id/butPlaybackSpeed" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="match_parent" + android:layout_toRightOf="@id/butFF" + android:background="?attr/selectableItemBackground" + android:contentDescription="@string/set_playback_speed_label" + android:src="?attr/av_fast_forward" + android:textColor="@color/gray" + android:textSize="@dimen/text_size_medium" + android:visibility="gone" /> + + <ImageButton + android:id="@+id/butNavChaptersShownotes" + android:layout_width="@dimen/audioplayer_playercontrols_length" + android:layout_height="match_parent" + android:layout_toLeftOf="@id/butRev" + android:background="?attr/selectableItemBackground" + android:scaleType="centerInside" /> + </RelativeLayout> + + <RelativeLayout + android:id="@+id/playtime_layout" + android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_above="@id/player_control" android:layout_alignParentLeft="true" - android:layout_centerVertical="true" - android:layout_marginLeft="8dp" - android:layout_marginTop="16dp" - android:text="@string/position_default_label" - android:textColor="?android:attr/textColorSecondary" - android:fontFamily="sans-serif-light" - android:textSize="@dimen/text_size_micro"/> - - <TextView - android:id="@+id/txtvLength" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentRight="true" + android:background="?attr/overlay_drawable"> + + <TextView + android:id="@+id/txtvPosition" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentLeft="true" + android:layout_centerVertical="true" + android:layout_marginLeft="8dp" + android:layout_marginTop="16dp" + android:text="@string/position_default_label" + android:textColor="?android:attr/textColorSecondary" + android:textSize="@dimen/text_size_micro" /> + + <TextView + android:id="@+id/txtvLength" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_alignParentTop="true" + android:layout_centerVertical="true" + android:layout_marginRight="8dp" + android:layout_marginTop="16dp" + android:text="@string/position_default_label" + android:textColor="?android:attr/textColorSecondary" + android:textSize="@dimen/text_size_micro" /> + + <SeekBar + android:id="@+id/sbPosition" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_marginLeft="8dp" + android:layout_marginRight="8dp" + android:layout_marginTop="16dp" + android:layout_toLeftOf="@id/txtvLength" + android:layout_toRightOf="@id/txtvPosition" + android:max="500" /> + </RelativeLayout> + + <FrameLayout + android:id="@+id/contentView" + android:layout_width="match_parent" + android:layout_height="0px" + android:layout_above="@id/playtime_layout" android:layout_alignParentTop="true" - android:layout_centerVertical="true" - android:layout_marginRight="8dp" - android:layout_marginTop="16dp" - android:text="@string/position_default_label" - android:textColor="?android:attr/textColorSecondary" - android:fontFamily="sans-serif-light" - android:textSize="@dimen/text_size_micro"/> - - <SeekBar - android:id="@+id/sbPosition" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_centerVertical="true" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_marginTop="16dp" - android:layout_toLeftOf="@id/txtvLength" - android:layout_toRightOf="@id/txtvPosition" - android:max="500"/> + android:foreground="?android:windowContentOverlay" /> + </RelativeLayout> - <FrameLayout - android:id="@+id/contentView" - android:layout_width="match_parent" - android:layout_height="0px" - android:layout_above="@id/playtime_layout" - android:layout_below="@id/navBarDivider"> - </FrameLayout> - </RelativeLayout> + </LinearLayout> - <include layout="@layout/nav_list"/> + <include layout="@layout/nav_list" /> </android.support.v4.widget.DrawerLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/cover_fragment.xml b/app/src/main/res/layout/cover_fragment.xml index f9c88ac02..e6325da4b 100644 --- a/app/src/main/res/layout/cover_fragment.xml +++ b/app/src/main/res/layout/cover_fragment.xml @@ -11,9 +11,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center" - android:layout_marginTop="8dp" - android:layout_marginBottom="8dp" android:adjustViewBounds="true" - android:scaleType="centerInside" /> + android:scaleType="centerCrop" /> </RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/simplechapter_item.xml b/app/src/main/res/layout/simplechapter_item.xml index 422458d5d..b7f4cdb18 100644 --- a/app/src/main/res/layout/simplechapter_item.xml +++ b/app/src/main/res/layout/simplechapter_item.xml @@ -1,43 +1,61 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingBottom="12dp" - android:paddingTop="12dp"> + android:layout_height="@dimen/listitem_threeline_height" + android:orientation="horizontal"> <TextView android:id="@+id/txtvStart" + style="@style/AntennaPod.TextView.ListItemSecondaryTitle" android:layout_width="wrap_content" android:layout_height="match_parent" - android:layout_alignParentRight="true" - android:layout_centerVertical="true" - android:layout_margin="8dp" - android:textColor="?android:attr/textColorSecondary" - android:textSize="@dimen/text_size_small"/> + android:layout_gravity="center_vertical" + android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding" + android:gravity="center_vertical" /> - <TextView - android:id="@+id/txtvTitle" + <LinearLayout android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" - android:padding="8dp" - android:layout_toLeftOf="@id/txtvStart" - android:textColor="?android:attr/textColorPrimary" - android:textSize="@dimen/text_size_small"/> + android:layout_height="match_parent" + android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" + android:layout_marginLeft="@dimen/listitem_threeline_horizontalpadding" + android:layout_marginRight="@dimen/listitem_threeline_horizontalpadding" + android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" + android:layout_weight="1" + android:gravity="center_vertical" + android:orientation="vertical"> - <TextView - android:id="@+id/txtvLink" - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_alignParentLeft="true" - android:layout_below="@id/txtvTitle" - android:layout_marginLeft="8dp" - android:layout_marginRight="8dp" - android:layout_toLeftOf="@id/txtvStart" + <TextView + android:id="@+id/txtvTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginBottom="4dp" + android:ellipsize="end" + android:maxLines="2" + android:textColor="?android:attr/textColorPrimary" + android:textSize="16sp" /> + + <TextView + android:id="@+id/txtvLink" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:focusable="false" + android:focusableInTouchMode="false" + android:maxLines="1" + android:visibility="gone" /> + + </LinearLayout> + + <include layout="@layout/vertical_list_divider" /> + + <ImageButton xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/butPlayChapter" + android:layout_width="@dimen/listview_secondary_button_width" + android:layout_height="match_parent" + android:background="?attr/selectableItemBackground" + android:clickable="false" + android:contentDescription="@string/chapters_label" android:focusable="false" android:focusableInTouchMode="false" - android:visibility="gone" - android:maxLines="2" /> + android:src="?attr/av_play" /> -</RelativeLayout>
\ No newline at end of file +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/menu/mediaplayer.xml b/app/src/main/res/menu/mediaplayer.xml index 0eb2ab067..288e44401 100644 --- a/app/src/main/res/menu/mediaplayer.xml +++ b/app/src/main/res/menu/mediaplayer.xml @@ -21,7 +21,7 @@ <item android:id="@+id/visit_website_item" android:icon="?attr/location_web_site" - custom:showAsAction="ifRoom|collapseActionView" + custom:showAsAction="collapseActionView" android:title="@string/visit_website_label" android:visible="false"> </item> |