aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java
diff options
context:
space:
mode:
authorLibravatar Renard 2016-04-05 01:52:13 -0300
committerLibravatar Renard 2016-04-05 01:52:13 -0300
commit90ca8b34d823eed19d26f6611716ca231d60424c (patch)
tree65d389b05acb542f14a8faba8abeaa7b36ae227e /app/src/main/java/org/bienvenidoainternet/baiparser/ThemeManager.java
downloadBaiApp-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.java55
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);
+ }
+
+}