diff --git a/UIViews/src/main/java/com/programmersbox/uiviews/SettingsFragment.kt b/UIViews/src/main/java/com/programmersbox/uiviews/SettingsFragment.kt index 9a3056213..44d8c3259 100644 --- a/UIViews/src/main/java/com/programmersbox/uiviews/SettingsFragment.kt +++ b/UIViews/src/main/java/com/programmersbox/uiviews/SettingsFragment.kt @@ -159,6 +159,13 @@ class SettingsFragment : PreferenceFragmentCompat() { }?.let(AppCompatDelegate::setDefaultNightMode) true } + + when (p.value) { + "system" -> AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM + "light" -> AppCompatDelegate.MODE_NIGHT_NO + "dark" -> AppCompatDelegate.MODE_NIGHT_YES + else -> null + }?.let(AppCompatDelegate::setDefaultNightMode) } findPreference("battery_alert")?.let { s -> diff --git a/UIViews/src/main/res/layout/fragment_all.xml b/UIViews/src/main/res/layout/fragment_all.xml index d6ef7daf0..fab001f87 100644 --- a/UIViews/src/main/res/layout/fragment_all.xml +++ b/UIViews/src/main/res/layout/fragment_all.xml @@ -48,6 +48,7 @@ + app:backgroundTint="@color/colorAccent" + app:layout_behavior="@string/hide_bottom_view_on_scroll_behavior" /> + android:visibility="gone" + tools:visibility="visible"> + android:src="@drawable/ic_baseline_cloud_off_24" /> + android:layout_height="wrap_content" + android:layout_below="@id/offline_icon" + android:layout_centerHorizontal="true" + android:gravity="center" + android:text="@string/you_re_offline" /> diff --git a/mangaworld/src/main/java/com/programmersbox/mangaworld/ReadActivity.kt b/mangaworld/src/main/java/com/programmersbox/mangaworld/ReadActivity.kt index 5d10b27c9..27966cd7a 100644 --- a/mangaworld/src/main/java/com/programmersbox/mangaworld/ReadActivity.kt +++ b/mangaworld/src/main/java/com/programmersbox/mangaworld/ReadActivity.kt @@ -221,15 +221,18 @@ class ReadActivity : AppCompatActivity() { @SuppressLint("SetTextI18n") private fun batterySetup() { val batteryInformation = findViewById(R.id.batteryInformation) + + val normalBatteryColor = colorFromTheme(R.attr.colorOnBackground, Color.WHITE) + batteryInformation.startDrawable = IconicsDrawable(this, GoogleMaterial.Icon.gmd_battery_std).apply { - colorInt = Color.WHITE + colorInt = normalBatteryColor sizePx = batteryInformation.textSize.roundToInt() } Flowables.combineLatest( batteryLevelAlert .map { it <= batteryAlertPercent } - .map { if (it) Color.RED else Color.WHITE } + .map { if (it) Color.RED else normalBatteryColor } .toLatestFlowable(), batteryInfoItem .map { diff --git a/novel_sources/src/main/java/com/programmersbox/novel_sources/novels/WuxiaWorld.kt b/novel_sources/src/main/java/com/programmersbox/novel_sources/novels/WuxiaWorld.kt index f65632a64..f6a9445cf 100644 --- a/novel_sources/src/main/java/com/programmersbox/novel_sources/novels/WuxiaWorld.kt +++ b/novel_sources/src/main/java/com/programmersbox/novel_sources/novels/WuxiaWorld.kt @@ -7,8 +7,12 @@ import io.reactivex.Single object WuxiaWorld : ApiService { + //TODO: Add search + override val baseUrl: String get() = "https://wuxiaworld.online" + override val canScroll: Boolean get() = true + override fun getRecent(page: Int): Single> = Single.create { val pop = "/wuxia-list?view=list&page=$page" "$baseUrl$pop".toJsoup() diff --git a/novel_sources/src/test/java/com/programmersbox/novel_sources/ExampleUnitTest.kt b/novel_sources/src/test/java/com/programmersbox/novel_sources/ExampleUnitTest.kt index a1933f497..38aacb35f 100644 --- a/novel_sources/src/test/java/com/programmersbox/novel_sources/ExampleUnitTest.kt +++ b/novel_sources/src/test/java/com/programmersbox/novel_sources/ExampleUnitTest.kt @@ -10,11 +10,11 @@ import org.junit.Test * See [testing documentation](http://d.android.com/tools/testing). */ class ExampleUnitTest { + @Test fun novelTest2() { - val f = WuxiaWorld.getList().blockingGet().first() - .toInfoModel().blockingGet() + val f = WuxiaWorld.getList(2).blockingGet() println(f) diff --git a/novelworld/src/main/java/com/programmersbox/novelworld/ReadingActivity.kt b/novelworld/src/main/java/com/programmersbox/novelworld/ReadingActivity.kt index c604e06f0..86fd04977 100644 --- a/novelworld/src/main/java/com/programmersbox/novelworld/ReadingActivity.kt +++ b/novelworld/src/main/java/com/programmersbox/novelworld/ReadingActivity.kt @@ -68,15 +68,18 @@ class ReadingActivity : AppCompatActivity() { @SuppressLint("SetTextI18n") private fun batterySetup() { val batteryInformation = binding.batteryInformation + + val normalBatteryColor = colorFromTheme(R.attr.colorOnBackground, Color.WHITE) + batteryInformation.startDrawable = IconicsDrawable(this, GoogleMaterial.Icon.gmd_battery_std).apply { - colorInt = Color.WHITE + colorInt = normalBatteryColor sizePx = batteryInformation.textSize.roundToInt() } Flowables.combineLatest( batteryLevelAlert .map { it <= batteryAlertPercent } - .map { if (it) Color.RED else Color.WHITE } + .map { if (it) Color.RED else normalBatteryColor } .toLatestFlowable(), batteryInfoItem .map {