diff options
author | Renard | 2016-04-05 01:52:13 -0300 |
---|---|---|
committer | Renard | 2016-04-05 01:52:13 -0300 |
commit | 90ca8b34d823eed19d26f6611716ca231d60424c (patch) | |
tree | 65d389b05acb542f14a8faba8abeaa7b36ae227e /app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java | |
download | BaiApp-90ca8b34d823eed19d26f6611716ca231d60424c.tar.gz BaiApp-90ca8b34d823eed19d26f6611716ca231d60424c.tar.xz BaiApp-90ca8b34d823eed19d26f6611716ca231d60424c.zip |
Initial commit
Diffstat (limited to 'app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java')
-rw-r--r-- | app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java b/app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java new file mode 100644 index 0000000..7f0be86 --- /dev/null +++ b/app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java @@ -0,0 +1,55 @@ +package org.bienvenidoainternet.baiparser; + +import android.content.res.TypedArray; +import android.graphics.Color; + +/** + * Created by Renard on 16-03-2016. + */ +public class ThemeManager { + private MainActivity ac; + private int currentThemeId; + public ThemeManager(MainActivity ac){ + this.ac = ac; + this.currentThemeId = ac.getCurrentThemeId(); + } + + public int getSageColor(){ + TypedArray a = ac.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.sageColor}); + return a.getColor(0, Color.CYAN); + } + + public int getMarginColor(){ + TypedArray a = ac.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.marginColor}); + return a.getColor(0, Color.CYAN); + } + + public void updateThemeId(int id){ + this.currentThemeId = id; + } + + public int getNameColor() { + TypedArray a = ac.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.nameColor}); + return a.getColor(0, Color.CYAN); + } + + public int getTripcodeColor() { + TypedArray a = ac.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.tripcodeColor}); + return a.getColor(0, Color.CYAN); + } + + public int getPrimaryColor(){ + TypedArray a = ac.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.colorPrimary}); + return a.getColor(0, Color.CYAN); + } + public int getPrimaryDarkColor(){ + TypedArray a = ac.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.colorPrimaryDark}); + return a.getColor(0, Color.CYAN); + } + + public boolean isDarkTheme(){ + TypedArray a = ac.getTheme().obtainStyledAttributes(currentThemeId, new int[]{R.attr.isDarkTheme}); + return a.getBoolean(0, false); + } + +} |