diff options
author | Tom Hennen <TomHennen@users.noreply.github.com> | 2016-01-23 14:58:42 -0500 |
---|---|---|
committer | Tom Hennen <TomHennen@users.noreply.github.com> | 2016-01-23 14:58:42 -0500 |
commit | 7e9e3bb9468c4829bac94fc5d3f8165d86d02bdb (patch) | |
tree | 5cbb5303b44b7cd43d2e80bdfbf4a8e31f9574cd /app | |
parent | b916c950f0d073f64f14d35f2761fc0d363facee (diff) | |
parent | 439def2d1cb12aa63c7a1303a9aa68e0cfe8a8e3 (diff) | |
download | AntennaPod-7e9e3bb9468c4829bac94fc5d3f8165d86d02bdb.zip |
Merge pull request #1524 from recalculated/icons
Material in-app icons
Diffstat (limited to 'app')
3 files changed, 38 insertions, 41 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java index 16909cbb3..6432ebd4e 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.dialog; import android.content.res.TypedArray; import android.graphics.Color; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.support.v4.app.ActivityCompat; import android.support.v4.app.Fragment; @@ -126,9 +127,6 @@ public class EpisodesApplyActionFragment extends Fragment { textColor = ta.getColor(0, Color.GRAY); ta.recycle(); - menu.findItem(R.id.sort).setIcon(new IconDrawable(getActivity(), - FontAwesomeIcons.fa_sort).color(textColor).actionBarSize()); - mSelectToggle = menu.findItem(R.id.select_toggle); mSelectToggle.setOnMenuItemClickListener(item -> { if (checkedIds.size() == episodes.size()) { @@ -138,23 +136,27 @@ public class EpisodesApplyActionFragment extends Fragment { } return true; }); - - menu.findItem(R.id.select_options).setIcon(new IconDrawable(getActivity(), - FontAwesomeIcons.fa_caret_down).color(textColor).actionBarSize()); } @Override public void onPrepareOptionsMenu (Menu menu) { - Icon icon; - if(checkedIds.size() == episodes.size()) { - icon = FontAwesomeIcons.fa_check_square_o; - } else if(checkedIds.size() == 0) { - icon = FontAwesomeIcons.fa_square_o; - } else { - icon = FontAwesomeIcons.fa_minus_square_o; - } - mSelectToggle.setIcon(new IconDrawable(getActivity(), icon).color(textColor).actionBarSize()); - + /* + * Prepare icon for select toggle button + */ + + // Find icon attribute + int[] icon = new int[1]; + if(checkedIds.size() == episodes.size()) icon[0] = R.attr.ic_check_box; + else if(checkedIds.size() == 0) icon[0] = R.attr.ic_check_box_outline; + else icon[0] = R.attr.ic_indeterminate_check_box; + + // Get Drawable from attribute + TypedArray a = getActivity().obtainStyledAttributes(icon); + Drawable iconDrawable = a.getDrawable(0); + a.recycle(); + + // Set icon + mSelectToggle.setIcon(iconDrawable); } @Override diff --git a/app/src/main/res/layout/queue_listitem.xml b/app/src/main/res/layout/queue_listitem.xml index 99e96c9fb..8de80e355 100644 --- a/app/src/main/res/layout/queue_listitem.xml +++ b/app/src/main/res/layout/queue_listitem.xml @@ -12,17 +12,19 @@ android:layout_height="@dimen/listitem_threeline_height" android:background="?attr/selectableItemBackground" android:orientation="horizontal" - android:paddingLeft="8dp" android:gravity="center_vertical" + android:layout_marginLeft="8dp" + android:layout_marginStart="8dp" tools:background="@android:color/darker_gray" > <ImageView android:id="@+id/drag_handle" - android:layout_width="wrap_content" - android:layout_height="48dp" + android:layout_width="104dp" + android:layout_height="64dp" android:layout_marginLeft="-16dp" - android:layout_marginRight="-20dp" - android:gravity="center" + android:layout_marginStart="-16dp" + android:layout_marginRight="-72dp" + android:layout_marginEnd="-72dp" android:contentDescription="@string/drag_handle_content_description" android:scaleType="fitXY" android:src="?attr/dragview_background" @@ -32,26 +34,22 @@ <RelativeLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="8dp"> + android:layout_marginLeft="8dp" + android:layout_marginStart="8dp"> <TextView android:id="@+id/txtvPlaceholder" android:layout_width="@dimen/thumbnail_length_queue_item" android:layout_height="@dimen/thumbnail_length_queue_item" - android:layout_marginBottom="@dimen/listitem_threeline_verticalpadding" - android:layout_marginTop="@dimen/listitem_threeline_verticalpadding" - android:layout_gravity="center_vertical" + android:layout_centerVertical="true" android:gravity="center" android:background="@color/light_gray" android:maxLines="3" android:ellipsize="end"/> <ImageView android:id="@+id/imgvCover" - android:layout_width="64dp" - android:layout_height="64dp" - android:layout_alignLeft="@id/txtvPlaceholder" - android:layout_alignTop="@id/txtvPlaceholder" - android:layout_alignRight="@id/txtvPlaceholder" - android:layout_alignBottom="@id/txtvPlaceholder" + android:layout_width="@dimen/thumbnail_length_queue_item" + android:layout_height="@dimen/thumbnail_length_queue_item" + android:layout_centerVertical="true" android:contentDescription="@string/cover_label" tools:src="@drawable/ic_stat_antenna_default" tools:background="@android:color/holo_green_dark"/> diff --git a/app/src/main/res/menu/episodes_apply_action_options.xml b/app/src/main/res/menu/episodes_apply_action_options.xml index 88bef8d1f..90cba0966 100644 --- a/app/src/main/res/menu/episodes_apply_action_options.xml +++ b/app/src/main/res/menu/episodes_apply_action_options.xml @@ -4,11 +4,10 @@ <item android:id="@+id/sort" + android:icon="?attr/ic_sort" android:title="@string/sort" app:showAsAction="always"> <menu> - <item android:id="@+id/sort_title" - android:title="@string/sort_title"/> <item android:id="@+id/sort_title_a_z" android:title="@string/sort_title_a_z"/> <item android:id="@+id/sort_title_z_a" @@ -25,18 +24,12 @@ </item> <item - android:id="@+id/select_toggle" - android:title="@string/select_all_label" - app:showAsAction="always"/> - - <item android:id="@+id/select_options" - android:title="@string/all_label" + android:icon="?attr/ic_filter" + android:title="@string/filter" app:showAsAction="always"> <menu> - <item android:id="@+id/select_label" - android:title="@string/select_label"/> <item android:id="@+id/check_all" android:title="@string/all_label"/> <item android:id="@+id/check_none" @@ -52,4 +45,8 @@ </menu> </item> + <item + android:id="@+id/select_toggle" + android:title="@string/select_all_label" + app:showAsAction="always"/> </menu> |