diff options
author | recalculated <recalculated@users.noreply.github.com> | 2016-01-04 15:53:14 -0600 |
---|---|---|
committer | recalculated <recalculated@users.noreply.github.com> | 2016-01-23 12:17:56 -0600 |
commit | 439def2d1cb12aa63c7a1303a9aa68e0cfe8a8e3 (patch) | |
tree | b729eb58c3da6bf3e809b8f9d34ca0c56d03fe74 /app/src/main/java/de/danoeh/antennapod/dialog | |
parent | 6d6a8d2fcda2ba2c8d1ef51049403aa6b25d31f2 (diff) | |
download | AntennaPod-439def2d1cb12aa63c7a1303a9aa68e0cfe8a8e3.zip |
Add material design icons
Includes RSS icon, sync notification icon, icons inside the apply
actions screen, and the drag handle icon in the queue.
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/dialog')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java | 34 |
1 files changed, 18 insertions, 16 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 |