diff --git a/app/build.gradle b/app/build.gradle index 8c2a241..290ad1e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -22,14 +22,14 @@ def gitVersion() { } def versionCodeFromGit() { - def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0').substring(1, 2) + def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0').substring(1, 3) def versionCode = gitVersion() + (ext.configuration.buildDate.format("yyMM") + dayInYear + ext.todaysBuilds).toInteger() println "version code " + versionCode return versionCode.toInteger() } def versionNameFromGit() { - def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0').substring(1, 2) + def dayInYear = ext.configuration.buildDate.format("D").padLeft(3, '0').substring(1, 3) def versionName = gitVersion() + ext.configuration.buildDate.format('yyMM') + dayInYear + ext.todaysBuilds println "version name " + versionName return versionName diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt index 0bd0ca8..d0640ba 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/AddSourceActivity.kt @@ -38,10 +38,10 @@ class AddSourceActivity : AppCompatActivity() { private lateinit var appColors: AppColors override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - appColors = AppColors(this@AddSourceActivity) + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_add_source) // TODO: input bubble cursor diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt index b4ddac3..aa0efd5 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/HomeActivity.kt @@ -144,10 +144,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener { } override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - appColors = AppColors(this@HomeActivity) + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_home) handleThemeBinding() diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt index 0f09367..dadf042 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/LoginActivity.kt @@ -44,10 +44,10 @@ class LoginActivity : AppCompatActivity() { private lateinit var appColors: AppColors override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - appColors = AppColors(this@LoginActivity) + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_login) setSupportActionBar(toolbar) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt index e0eb4de..370c559 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/MyApp.kt @@ -87,6 +87,7 @@ class MyApp : MultiDexApplication() { private fun initTheme() { Scoop.waffleCone() .addFlavor(getString(R.string.default_theme), R.style.NoBar, true) + .addFlavor(getString(R.string.default_dark_theme), R.style.NoBarDark, false) .setSharedPreferences(PreferenceManager.getDefaultSharedPreferences(this)) .initialize() } diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt index 991e1ee..82e5a70 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/ReaderActivity.kt @@ -1,6 +1,7 @@ package apps.amine.bou.readerforselfoss import android.content.Context +import android.content.res.Resources import android.os.Bundle import android.preference.PreferenceManager import android.support.v4.app.FragmentManager @@ -53,9 +54,10 @@ class ReaderActivity : AppCompatActivity() { } override fun onCreate(savedInstanceState: Bundle?) { + val appColors = AppColors(this@ReaderActivity) + super.onCreate(savedInstanceState) - val appColors = AppColors(this@ReaderActivity) setContentView(R.layout.activity_reader) Scoop.getInstance() diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt index 307d009..929ade2 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/SourcesActivity.kt @@ -23,10 +23,10 @@ class SourcesActivity : AppCompatActivity() { private lateinit var appColors: AppColors override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - appColors = AppColors(this@SourcesActivity) + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_sources) Scoop.getInstance() diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/fragments/ArticleFragment.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/fragments/ArticleFragment.kt index ae55c5f..b7f7b3b 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/fragments/ArticleFragment.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/fragments/ArticleFragment.kt @@ -66,9 +66,10 @@ class ArticleFragment : Fragment() { } override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) appColors = AppColors(activity!!) + super.onCreate(savedInstanceState) + pageNumber = arguments!!.getInt(ARG_POSITION) allItems = arguments!!.getParcelableArrayList(ARG_ITEMS) } @@ -446,4 +447,6 @@ class ArticleFragment : Fragment() { return fragment } } + + } diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/settings/AppCompatPreferenceActivity.java b/app/src/main/java/apps/amine/bou/readerforselfoss/settings/AppCompatPreferenceActivity.java index 03f443a..4eb1061 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/settings/AppCompatPreferenceActivity.java +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/settings/AppCompatPreferenceActivity.java @@ -33,9 +33,10 @@ public abstract class AppCompatPreferenceActivity extends PreferenceActivity { @Override protected void onCreate(Bundle savedInstanceState) { + new AppColors(this); + getDelegate().installViewFactory(); getDelegate().onCreate(savedInstanceState); - new AppColors(this); super.onCreate(savedInstanceState); }