Merge branch 'master' into 329-close-open-milestone

This commit is contained in:
6543
2020-04-11 06:44:30 +00:00
6 changed files with 50 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import org.mian.gitnex.R;
import org.mian.gitnex.helpers.FontsOverride;
import org.mian.gitnex.helpers.TimeHelper;
import org.mian.gitnex.util.TinyDB;
/**
@@ -20,6 +21,18 @@ public abstract class BaseActivity extends AppCompatActivity {
if(tinyDb.getInt("themeId") == 1) {
setTheme(R.style.AppThemeLight);
}
else if(tinyDb.getInt("themeId") == 2) {
boolean timeSetterFlag = TimeHelper.timeBetweenHours(18, 6); // 6pm to 6am
if(timeSetterFlag) {
setTheme(R.style.AppTheme);
}
else {
setTheme(R.style.AppThemeLight);
}
}
else {
setTheme(R.style.AppTheme);
}