helloworld1 / AnyMemo

Advanced Spaced Repetition flashcard learning software for Android.
http://www.anymemo.org
GNU General Public License v2.0
151 stars 53 forks source link

Updated and Refactored Icons #405

Closed xie-dongping closed 8 years ago

xie-dongping commented 8 years ago

I'm not exactly sure about the colors yet, now the icons are all white.

Should resolve #399.

xie-dongping commented 8 years ago

One moment.

It seem that vector drawable has some problem with Jellybean.

I'll investigate and update the PR tomorrow.

Sorry about that.

helloworld1 commented 8 years ago

No worry. If the jellybean issue is solvable, great. If not, I think we can move our API level to 17 in the next release.

For the colors issue, we should keep the icons white or black and tint the color with DrawableCompat.setTint() in the code. There are 2 caveats:

  1. android:tint in XML only works for api level 21+.
  2. For the drawables needs to be tinted, it needs to call mutate() first on the drawable: Drawable drawable = ContextCompat.getDrawable(context, R.drawable.xxx).mutate(); Drawable tintedDrawable = DrawableCompat.setTint(DrawableCompat.wrap(drawable), R.color.tinted_color);

I think the tinted_color could use a grayer one than white. We can see what Android's default icon is doing there.

xie-dongping commented 8 years ago

Tested now in JellyBean and it works.

I didn't used tinting in code since I wanted to do them declaratively. And the fillColor in vector drawables can directly link to the theme colors, so it wouldn't bloat the code in this case.

For now, I used textColor for the Icons, and since the the textColorPrimary for dark background is pure white, the icons are still pure white. It is a matter of personal taste, so I guess I have better leave it to you. If you would like to change them, the colors.xml should be enough.

Anyway, I know little about the aesthetic aspect. I'll see what you think about it.

helloworld1 commented 8 years ago

The icons looks great to me. Thanks a lot for the good work! There are tweaks needs to be done on the primary color and several icons. I can merge your code in and do additional tweaks.

helloworld1 commented 8 years ago

I have also tweaked the icons and theme a bit today. Let me know if you have any better suggestions.

xie-dongping commented 8 years ago

I think maybe we should make the header thinner so that we can add more entries to the navigation drawer. Let's see if it works out for PR #407.

helloworld1 commented 8 years ago

Maybe 128dp is enough. We can tweak the value navigation_view_header in dimen.xml