diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-12-17 23:14:22 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-12-19 19:47:38 +0100 |
commit | b18e0ccf5b14fc581a62d73fa82d9b7cac65366b (patch) | |
tree | 932bb2c89977b094f8fff7ea7c2067476f933230 /app/src/main | |
parent | 39c1078f22bde43b73234a183a5908f23abf491b (diff) | |
download | AntennaPod-b18e0ccf5b14fc581a62d73fa82d9b7cac65366b.zip |
Improved layout
- Fixed actionbar shadow on 5.0
- Added text to action buttons in ItemlistFragment
- Use ?android:attr/listDivider for horizontal dividers in navigation drawer
Diffstat (limited to 'app/src/main')
5 files changed, 34 insertions, 25 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 5cf382a05..04d5ee8a2 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -96,6 +96,8 @@ public class MainActivity extends ActionBarActivity implements NavDrawerActivity toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); + getSupportActionBar().setElevation(3.0f); + drawerTitle = currentTitle = getTitle(); drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index ecae7e4d7..3a343199a 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -22,6 +22,7 @@ import android.view.ViewGroup; import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.Button; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.ProgressBar; @@ -92,8 +93,8 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba private ImageView imgvCover; private ProgressBar progbarDownload; private ProgressBar progbarLoading; - private ImageButton butAction1; - private ImageButton butAction2; + private Button butAction1; + private Button butAction2; private ImageButton butMore; private PopupMenu popupMenu; @@ -185,8 +186,8 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba imgvCover = (ImageView) header.findViewById(R.id.imgvCover); progbarDownload = (ProgressBar) header.findViewById(R.id.progbarDownload); progbarLoading = (ProgressBar) layout.findViewById(R.id.progbarLoading); - butAction1 = (ImageButton) header.findViewById(R.id.butAction1); - butAction2 = (ImageButton) header.findViewById(R.id.butAction2); + butAction1 = (Button) header.findViewById(R.id.butAction1); + butAction2 = (Button) header.findViewById(R.id.butAction2); butMore = (ImageButton) header.findViewById(R.id.butMoreActions); popupMenu = new PopupMenu(getActivity(), butMore); @@ -307,16 +308,16 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba R.attr.location_web_site}); if (!item.isRead()) { - butAction1.setImageDrawable(drawables.getDrawable(0)); - butAction1.setContentDescription(getActivity().getString(R.string.mark_read_label)); + butAction1.setCompoundDrawablesWithIntrinsicBounds(drawables.getDrawable(0), null, null, null); + butAction1.setText(getActivity().getString(R.string.mark_read_label)); butAction1.setVisibility(View.VISIBLE); } else { butAction1.setVisibility(View.INVISIBLE); } if (item.getLink() != null) { - butAction2.setImageDrawable(drawables.getDrawable(1)); - butAction2.setContentDescription(getActivity().getString(R.string.visit_website_label)); + butAction2.setCompoundDrawablesWithIntrinsicBounds(drawables.getDrawable(1), null, null, null); + butAction2.setText(getActivity().getString(R.string.visit_website_label)); } else { butAction2.setEnabled(false); } @@ -328,22 +329,22 @@ public class ItemFragment extends Fragment implements LoaderManager.LoaderCallba R.attr.av_download, R.attr.action_stream, R.attr.content_discard, R.attr.navigation_cancel}); if (!media.isDownloaded()) { - butAction2.setImageDrawable(drawables.getDrawable(2)); - butAction2.setContentDescription(getActivity().getString(R.string.stream_label)); + butAction2.setCompoundDrawablesWithIntrinsicBounds(drawables.getDrawable(2), null, null, null); + butAction2.setText(getActivity().getString(R.string.stream_label)); } else { - butAction2.setImageDrawable(drawables.getDrawable(3)); - butAction2.setContentDescription(getActivity().getString(R.string.remove_episode_lable)); + butAction2.setCompoundDrawablesWithIntrinsicBounds(drawables.getDrawable(3), null, null, null); + butAction2.setText(getActivity().getString(R.string.remove_episode_lable)); } if (isDownloading) { - butAction1.setImageDrawable(drawables.getDrawable(4)); - butAction1.setContentDescription(getActivity().getString(R.string.cancel_download_label)); + butAction1.setCompoundDrawablesWithIntrinsicBounds(drawables.getDrawable(4), null, null, null); + butAction1.setText(getActivity().getString(R.string.cancel_download_label)); } else if (media.isDownloaded()) { - butAction1.setImageDrawable(drawables.getDrawable(0)); - butAction1.setContentDescription(getActivity().getString(R.string.play_label)); + butAction1.setCompoundDrawablesWithIntrinsicBounds(drawables.getDrawable(0), null, null, null); + butAction1.setText(getActivity().getString(R.string.play_label)); } else { - butAction1.setImageDrawable(drawables.getDrawable(1)); - butAction1.setContentDescription(getActivity().getString(R.string.download_label)); + butAction1.setCompoundDrawablesWithIntrinsicBounds(drawables.getDrawable(1), null, null, null); + butAction1.setText(getActivity().getString(R.string.download_label)); } drawables.recycle(); diff --git a/app/src/main/res/layout/feeditem_fragment_header.xml b/app/src/main/res/layout/feeditem_fragment_header.xml index bac34d07f..14bc669bf 100644 --- a/app/src/main/res/layout/feeditem_fragment_header.xml +++ b/app/src/main/res/layout/feeditem_fragment_header.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" android:id="@+id/header" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -68,25 +67,32 @@ <LinearLayout android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" + android:layout_marginRight="8dp" android:orientation="horizontal"> - <ImageButton + <Button android:id="@+id/butAction1" android:layout_width="0dp" android:layout_height="48dp" + android:layout_gravity="center_vertical" + android:layout_marginRight="8dp" android:layout_weight="1" android:background="?attr/selectableItemBackground" + android:ellipsize="end" android:paddingTop="4dp" - tools:ignore="ContentDescription" /> + android:textSize="@dimen/text_size_small" /> - <ImageButton + <Button android:id="@+id/butAction2" android:layout_width="0dp" android:layout_height="48dp" + android:layout_gravity="center_vertical" + android:layout_marginLeft="8dp" android:layout_weight="1" android:background="?attr/selectableItemBackground" + android:ellipsize="end" android:paddingTop="4dp" - tools:ignore="ContentDescription" /> + android:textSize="@dimen/text_size_small" /> </LinearLayout> diff --git a/app/src/main/res/layout/nav_list.xml b/app/src/main/res/layout/nav_list.xml index 93e9f737e..a22520b2d 100644 --- a/app/src/main/res/layout/nav_list.xml +++ b/app/src/main/res/layout/nav_list.xml @@ -25,7 +25,7 @@ android:layout_width="@dimen/drawer_width" android:layout_height="1dp" android:layout_centerVertical="true" - android:background="@color/gray" /> + android:background="?android:attr/listDivider" /> <LinearLayout android:id="@+id/nav_settings" diff --git a/app/src/main/res/layout/nav_section_item.xml b/app/src/main/res/layout/nav_section_item.xml index 6eb26291e..3682ca811 100644 --- a/app/src/main/res/layout/nav_section_item.xml +++ b/app/src/main/res/layout/nav_section_item.xml @@ -10,5 +10,5 @@ android:layout_width="match_parent" android:layout_height="1dp" android:layout_centerVertical="true" - android:background="@color/gray" /> + android:background="?android:attr/listDivider" /> </RelativeLayout>
\ No newline at end of file |