Fixed colors
This commit is contained in:
commit
9672a8a23d
23 changed files with 101 additions and 290 deletions
|
@ -1,9 +1,10 @@
|
|||
package code.name.monkey.appthemehelper.common;
|
||||
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
import android.view.Menu;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.widget.Toolbar;
|
||||
import android.view.Menu;
|
||||
|
||||
import code.name.monkey.appthemehelper.ATHActivity;
|
||||
import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
||||
|
@ -12,6 +13,15 @@ import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper;
|
|||
public class ATHToolbarActivity extends ATHActivity {
|
||||
private Toolbar toolbar;
|
||||
|
||||
public static int getToolbarBackgroundColor(Toolbar toolbar) {
|
||||
if (toolbar != null) {
|
||||
if (toolbar.getBackground() instanceof ColorDrawable) {
|
||||
return ((ColorDrawable) toolbar.getBackground()).getColor();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
Toolbar toolbar = getATHToolbar();
|
||||
|
@ -34,13 +44,4 @@ public class ATHToolbarActivity extends ATHActivity {
|
|||
protected Toolbar getATHToolbar() {
|
||||
return toolbar;
|
||||
}
|
||||
|
||||
public static int getToolbarBackgroundColor(Toolbar toolbar) {
|
||||
if (toolbar != null) {
|
||||
if (toolbar.getBackground() instanceof ColorDrawable) {
|
||||
return ((ColorDrawable) toolbar.getBackground()).getColor();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue