Fixed tag editor coloring bugs.

This commit is contained in:
Karim Abou Zeid 2016-01-30 17:59:31 +01:00
commit 3d7d69da36
4 changed files with 19 additions and 8 deletions

View file

@ -59,7 +59,7 @@ public abstract class AbsThemeActivity extends ATHToolbarActivity {
statusBar.setBackgroundColor(color); statusBar.setBackgroundColor(color);
} }
} else if (Build.VERSION.SDK_INT >= 21) { } else if (Build.VERSION.SDK_INT >= 21) {
getWindow().setStatusBarColor(color); getWindow().setStatusBarColor(ColorUtil.darkenColor(color));
setLightStatusbarAuto(color); setLightStatusbarAuto(color);
} }
} }

View file

@ -235,13 +235,8 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
observableScrollView.setPadding(0, Util.getActionBarSize(this), 0, 0); observableScrollView.setPadding(0, Util.getActionBarSize(this), 0, 0);
observableScrollViewCallbacks.onScrollChanged(observableScrollView.getCurrentScrollY(), false, false); observableScrollViewCallbacks.onScrollChanged(observableScrollView.getCurrentScrollY(), false, false);
paletteColorPrimary = getIntent().getIntExtra(EXTRA_PALETTE, ThemeStore.primaryColor(this)); setColors(getIntent().getIntExtra(EXTRA_PALETTE, ThemeStore.primaryColor(this)));
toolbar.setBackgroundColor(paletteColorPrimary); toolbar.setBackgroundColor(paletteColorPrimary);
header.setBackgroundColor(paletteColorPrimary);
setStatusbarColor(paletteColorPrimary);
setNavigationbarColor(paletteColorPrimary);
setTaskDescriptionColor(paletteColorPrimary);
} }
protected void dataChanged() { protected void dataChanged() {
@ -267,7 +262,7 @@ public abstract class AbsTagEditorActivity extends AbsBaseActivity {
setColors(bgColor); setColors(bgColor);
} }
private void setColors(int color) { protected void setColors(int color) {
paletteColorPrimary = color; paletteColorPrimary = color;
observableScrollViewCallbacks.onScrollChanged(observableScrollView.getCurrentScrollY(), false, false); observableScrollViewCallbacks.onScrollChanged(observableScrollView.getCurrentScrollY(), false, false);
header.setBackgroundColor(paletteColorPrimary); header.setBackgroundColor(paletteColorPrimary);

View file

@ -19,6 +19,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.animation.GlideAnimation; import com.bumptech.glide.request.animation.GlideAnimation;
import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.target.SimpleTarget;
import com.kabouzeid.appthemehelper.util.ATHUtil; import com.kabouzeid.appthemehelper.util.ATHUtil;
import com.kabouzeid.appthemehelper.util.ToolbarContentTintHelper;
import com.kabouzeid.gramophone.R; import com.kabouzeid.gramophone.R;
import com.kabouzeid.gramophone.glide.palette.BitmapPaletteTranscoder; import com.kabouzeid.gramophone.glide.palette.BitmapPaletteTranscoder;
import com.kabouzeid.gramophone.glide.palette.BitmapPaletteWrapper; import com.kabouzeid.gramophone.glide.palette.BitmapPaletteWrapper;
@ -278,4 +279,10 @@ public class AlbumTagEditorActivity extends AbsTagEditorActivity implements Text
} }
return scaledBitmap; return scaledBitmap;
} }
@Override
protected void setColors(int color) {
super.setColors(color);
albumTitle.setTextColor(ToolbarContentTintHelper.toolbarTitleColor(this, color));
}
} }

View file

@ -7,6 +7,7 @@ import android.text.Editable;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.widget.EditText; import android.widget.EditText;
import com.kabouzeid.appthemehelper.util.ToolbarContentTintHelper;
import com.kabouzeid.gramophone.R; import com.kabouzeid.gramophone.R;
import com.kabouzeid.gramophone.loader.SongLoader; import com.kabouzeid.gramophone.loader.SongLoader;
@ -132,4 +133,12 @@ public class SongTagEditorActivity extends AbsTagEditorActivity implements TextW
public void afterTextChanged(Editable s) { public void afterTextChanged(Editable s) {
dataChanged(); dataChanged();
} }
@Override
protected void setColors(int color) {
super.setColors(color);
int toolbarTitleColor = ToolbarContentTintHelper.toolbarTitleColor(this, color);
songTitle.setTextColor(toolbarTitleColor);
albumTitle.setTextColor(toolbarTitleColor);
}
} }