Skip to content

Commit

Permalink
fix issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
lguipeng committed Dec 6, 2015
1 parent 06a35ce commit e8d5a04
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
Binary file removed apk/notes_v2.0.0_201509181346.apk
Binary file not shown.
5 changes: 4 additions & 1 deletion app/src/main/java/com/lguipeng/notes/ui/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ private void initTheme(){
ThemeUtils.changTheme(this, theme);
}

public int getColor(@ColorRes int res){
public int getCompactColor(@ColorRes int res){
if (res <= 0)
throw new IllegalArgumentException("resource id can not be less 0");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){
getColor(res);
}
return getResources().getColor(res);
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/lguipeng/notes/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void onDrawerClosed(View drawerView) {
};
mDrawerToggle.setDrawerIndicatorEnabled(true);
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerLayout.setScrimColor(getColor(R.color.drawer_scrim_color));
mDrawerLayout.setScrimColor(getCompactColor(R.color.drawer_scrim_color));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static void initToolbar(Toolbar toolbar, BaseActivity activity){
return;
toolbar.setBackgroundColor(activity.getColorPrimary());
toolbar.setTitle(R.string.app_name);
toolbar.setTitleTextColor(activity.getColor(R.color.action_bar_title_color));
toolbar.setTitleTextColor(activity.getCompactColor(R.color.action_bar_title_color));
toolbar.collapseActionView();
activity.setSupportActionBar(toolbar);
if (activity.getSupportActionBar() != null){
Expand Down

0 comments on commit e8d5a04

Please sign in to comment.