diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.java b/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.java deleted file mode 100644 index f9ada218..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2019 Hemanth Savarala. - * - * Licensed under the GNU General Public License v3 - * - * This is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by - * the Free Software Foundation either version 3 of the License, or (at your option) any later version. - * - * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - */ - -package code.name.monkey.retromusic.activities; - -import android.graphics.Color; -import android.os.Bundle; -import android.view.MenuItem; -import android.webkit.WebView; - -import androidx.annotation.NonNull; -import androidx.appcompat.widget.Toolbar; - -import org.jetbrains.annotations.Nullable; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; - -import code.name.monkey.appthemehelper.ThemeStore; -import code.name.monkey.appthemehelper.util.ATHUtil; -import code.name.monkey.appthemehelper.util.ColorUtil; -import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper; -import code.name.monkey.retromusic.R; -import code.name.monkey.retromusic.activities.base.AbsBaseActivity; - -/** Created by hemanths on 2019-09-27. */ -public class LicenseActivity extends AbsBaseActivity { - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - setDrawUnderStatusBar(); - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_license); - setStatusbarColorAuto(); - setNavigationbarColorAuto(); - setLightNavigationBar(true); - Toolbar toolbar = findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - ToolbarContentTintHelper.colorBackButton(toolbar); - toolbar.setBackgroundColor(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface)); - WebView webView = findViewById(R.id.license); - try { - StringBuilder buf = new StringBuilder(); - InputStream json = getAssets().open("oldindex.html"); - BufferedReader in = new BufferedReader(new InputStreamReader(json, StandardCharsets.UTF_8)); - String str; - while ((str = in.readLine()) != null) { - buf.append(str); - } - in.close(); - - // Inject color values for WebView body background and links - final boolean isDark = ATHUtil.INSTANCE.isWindowBackgroundDark(this); - final String backgroundColor = - colorToCSS( - ATHUtil.INSTANCE.resolveColor( - this, R.attr.colorSurface, Color.parseColor(isDark ? "#424242" : "#ffffff"))); - final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000")); - final String changeLog = - buf.toString() - .replace( - "{style-placeholder}", - String.format( - "body { background-color: %s; color: %s; }", backgroundColor, contentColor)) - .replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this))) - .replace( - "{link-color-active}", - colorToCSS( - ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this)))); - - webView.loadData(changeLog, "text/html", "UTF-8"); - } catch (Throwable e) { - webView.loadData( - "

Unable to load

" + e.getLocalizedMessage() + "

", "text/html", "UTF-8"); - } - } - - @Override - public boolean onOptionsItemSelected(@NonNull MenuItem item) { - if (item.getItemId() == android.R.id.home) { - onBackPressed(); - return true; - } - return super.onOptionsItemSelected(item); - } - - private String colorToCSS(int color) { - return String.format( - "rgb(%d, %d, %d)", - Color.red(color), - Color.green(color), - Color.blue(color)); // on API 29, WebView doesn't load with hex colors - } -} diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.kt new file mode 100644 index 00000000..daa02537 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/activities/LicenseActivity.kt @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2019 Hemanth Savarala. + * + * Licensed under the GNU General Public License v3 + * + * This is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by + * the Free Software Foundation either version 3 of the License, or (at your option) any later version. + * + * This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + */ +package code.name.monkey.retromusic.activities + +import android.graphics.Color +import android.os.Bundle +import android.view.MenuItem +import android.webkit.WebView +import androidx.appcompat.widget.Toolbar +import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor +import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark +import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor +import code.name.monkey.appthemehelper.util.ColorUtil.lightenColor +import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper +import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.activities.base.AbsBaseActivity +import java.io.BufferedReader +import java.io.InputStreamReader +import java.nio.charset.StandardCharsets + +/** Created by hemanths on 2019-09-27. */ +class LicenseActivity : AbsBaseActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_license) + val toolbar = findViewById(R.id.toolbar) + setSupportActionBar(toolbar) + ToolbarContentTintHelper.colorBackButton(toolbar) + toolbar.setBackgroundColor(resolveColor(this, R.attr.colorSurface)) + val webView = findViewById(R.id.license) + try { + val buf = StringBuilder() + val json = assets.open("oldindex.html") + val br = BufferedReader(InputStreamReader(json, StandardCharsets.UTF_8)) + var str: String? + while (br.readLine().also { str = it } != null) { + buf.append(str) + } + br.close() + + // Inject color values for WebView body background and links + val isDark = isWindowBackgroundDark(this) + val backgroundColor = colorToCSS( + resolveColor( + this, + R.attr.colorSurface, + Color.parseColor(if (isDark) "#424242" else "#ffffff") + ) + ) + val contentColor = colorToCSS(Color.parseColor(if (isDark) "#ffffff" else "#000000")) + val changeLog = buf.toString() + .replace( + "{style-placeholder}", String.format( + "body { background-color: %s; color: %s; }", backgroundColor, contentColor + ) + ) + .replace("{link-color}", colorToCSS(accentColor(this))) + .replace( + "{link-color-active}", + colorToCSS( + lightenColor(accentColor(this)) + ) + ) + webView.loadData(changeLog, "text/html", "UTF-8") + } catch (e: Throwable) { + webView.loadData( + "

Unable to load

" + e.localizedMessage + "

", "text/html", "UTF-8" + ) + } + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + if (item.itemId == android.R.id.home) { + onBackPressed() + return true + } + return super.onOptionsItemSelected(item) + } + + private fun colorToCSS(color: Int): String { + return String.format( + "rgb(%d, %d, %d)", + Color.red(color), + Color.green(color), + Color.blue(color) + ) // on API 29, WebView doesn't load with hex colors + } +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/LockScreenActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/LockScreenActivity.kt index 792c8365..621bc177 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/LockScreenActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/LockScreenActivity.kt @@ -48,9 +48,7 @@ class LockScreenActivity : AbsMusicServiceActivity() { setContentView(binding.root) hideStatusBar() setStatusbarColorAuto() - setNavigationbarColorAuto() setTaskDescriptionColorAuto() - setLightNavigationBar(true) val config = SlidrConfig.Builder().listener(object : SlidrListener { override fun onSlideStateChanged(state: Int) { diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/LyricsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/LyricsActivity.kt index 5b72c24a..a0263db6 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/LyricsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/LyricsActivity.kt @@ -94,7 +94,6 @@ class LyricsActivity : AbsMusicServiceActivity() { ViewCompat.setTransitionName(binding.container, "lyrics") setStatusbarColorAuto() setTaskDescriptionColorAuto() - setNavigationbarColorAuto() setupWakelock() diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt index 4f96a696..ade445e6 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/MainActivity.kt @@ -37,6 +37,7 @@ import code.name.monkey.retromusic.repository.PlaylistSongsLoader import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.util.AppRater import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.RetroUtil import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.launch import org.koin.android.ext.android.get @@ -55,8 +56,6 @@ class MainActivity : AbsCastActivity(), OnSharedPreferenceChangeListener { setDrawUnderStatusBar() super.onCreate(savedInstanceState) setStatusbarColorAuto() - setNavigationbarColorAuto() - setLightNavigationBar(true) setTaskDescriptionColorAuto() hideStatusBar() updateTabs() diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/PermissionActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/PermissionActivity.kt index f61eb518..34d4a50c 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/PermissionActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/PermissionActivity.kt @@ -41,8 +41,6 @@ class PermissionActivity : AbsMusicServiceActivity() { binding = ActivityPermissionBinding.inflate(layoutInflater) setContentView(binding.root) setStatusbarColorAuto() - setNavigationbarColorAuto() - setLightNavigationBar(true) setTaskDescriptionColorAuto() setupTitle() diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/PlayingQueueActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/PlayingQueueActivity.kt index 70b45c24..8adb96bc 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/PlayingQueueActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/PlayingQueueActivity.kt @@ -19,6 +19,7 @@ import android.os.Bundle import android.view.MenuItem import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.appthemehelper.util.MaterialValueHelper import code.name.monkey.retromusic.R @@ -26,7 +27,6 @@ import code.name.monkey.retromusic.activities.base.AbsMusicServiceActivity import code.name.monkey.retromusic.adapter.song.PlayingQueueAdapter import code.name.monkey.retromusic.databinding.ActivityPlayingQueueBinding import code.name.monkey.retromusic.extensions.accentColor -import code.name.monkey.retromusic.extensions.surfaceColor import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.ThemedFastScroller @@ -59,10 +59,8 @@ open class PlayingQueueActivity : AbsMusicServiceActivity() { super.onCreate(savedInstanceState) binding = ActivityPlayingQueueBinding.inflate(layoutInflater) setContentView(binding.root) - setStatusbarColorAuto() - setNavigationbarColorAuto() + setLightStatusbarAuto(ATHUtil.resolveColor(this, R.attr.colorSurface)) setTaskDescriptionColorAuto() - setLightNavigationBar(true) setupToolbar() setUpRecyclerView() @@ -191,7 +189,7 @@ open class PlayingQueueActivity : AbsMusicServiceActivity() { private fun setupToolbar() { binding.toolbar.subtitle = getUpNextAndQueueTime() - binding.toolbar.setBackgroundColor(surfaceColor()) + //binding.toolbar.setBackgroundColor(surfaceColor()) setSupportActionBar(binding.toolbar) binding.clearQueue.backgroundTintList = ColorStateList.valueOf(accentColor()) ColorStateList.valueOf( diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/PurchaseActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/PurchaseActivity.kt index c611d2f2..2bd7ce42 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/PurchaseActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/PurchaseActivity.kt @@ -47,8 +47,6 @@ class PurchaseActivity : AbsBaseActivity(), BillingProcessor.IBillingHandler { setContentView(binding.root) setStatusbarColor(Color.TRANSPARENT) setLightStatusbar(false) - setNavigationbarColor(Color.BLACK) - setLightNavigationBar(false) binding.toolbar.navigationIcon?.setTint(Color.WHITE) binding.toolbar.setNavigationOnClickListener { onBackPressed() } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt index 54d31bb4..9b314a48 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/SettingsActivity.kt @@ -19,6 +19,7 @@ import android.view.MenuItem import androidx.navigation.NavController import androidx.navigation.NavDestination import code.name.monkey.appthemehelper.ThemeStore +import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.VersionUtils import code.name.monkey.retromusic.R import code.name.monkey.retromusic.activities.base.AbsBaseActivity @@ -36,9 +37,7 @@ class SettingsActivity : AbsBaseActivity(), ColorCallback { super.onCreate(savedInstanceState) binding = ActivitySettingsBinding.inflate(layoutInflater) setContentView(binding.root) - setStatusbarColorAuto() - setNavigationbarColorAuto() - setLightNavigationBar(true) + setLightStatusbarAuto(ATHUtil.resolveColor(this, R.attr.colorSurface)) setupToolbar() } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/ShareInstagramStory.kt b/app/src/main/java/code/name/monkey/retromusic/activities/ShareInstagramStory.kt index b3d31052..a0a71973 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/ShareInstagramStory.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/ShareInstagramStory.kt @@ -61,7 +61,6 @@ class ShareInstagramStory : AbsBaseActivity() { binding = ActivityShareInstagramBinding.inflate(layoutInflater) setContentView(binding.root) setStatusbarColor(Color.TRANSPARENT) - setNavigationbarColor(Color.BLACK) binding.toolbar.setBackgroundColor(Color.TRANSPARENT) setSupportActionBar(binding.toolbar) diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt index 58cddd71..42531086 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/SupportDevelopmentActivity.kt @@ -78,9 +78,7 @@ class SupportDevelopmentActivity : AbsBaseActivity(), BillingProcessor.IBillingH setContentView(R.layout.activity_donation) setStatusbarColorAuto() - setNavigationbarColorAuto() setTaskDescriptionColorAuto() - setLightNavigationBar(true) setupToolbar() diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt index 1394cc93..6288b14b 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/UserInfoActivity.kt @@ -61,9 +61,7 @@ class UserInfoActivity : AbsBaseActivity() { binding = ActivityUserInfoBinding.inflate(layoutInflater) setContentView(binding.root) setStatusbarColorAuto() - setNavigationbarColorAuto() setTaskDescriptionColorAuto() - setLightNavigationBar(true) applyToolbar(binding.toolbar) binding.nameContainer.accentColor() diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java b/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java deleted file mode 100644 index 9e37a8ee..00000000 --- a/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.java +++ /dev/null @@ -1,128 +0,0 @@ -package code.name.monkey.retromusic.activities; - -import android.content.Context; -import android.content.pm.PackageInfo; -import android.content.pm.PackageManager; -import android.graphics.Color; -import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import androidx.core.widget.NestedScrollView; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.Locale; - -import code.name.monkey.appthemehelper.ThemeStore; -import code.name.monkey.appthemehelper.util.ATHUtil; -import code.name.monkey.appthemehelper.util.ColorUtil; -import code.name.monkey.appthemehelper.util.MaterialValueHelper; -import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper; -import code.name.monkey.retromusic.Constants; -import code.name.monkey.retromusic.R; -import code.name.monkey.retromusic.activities.base.AbsBaseActivity; -import code.name.monkey.retromusic.databinding.ActivityWhatsNewBinding; -import code.name.monkey.retromusic.extensions.ColorExtKt; -import code.name.monkey.retromusic.util.PreferenceUtil; -import code.name.monkey.retromusic.util.RetroUtil; - -public class WhatsNewActivity extends AbsBaseActivity { - - private static String colorToCSS(int color) { - return String.format( - Locale.getDefault(), - "rgba(%d, %d, %d, %d)", - Color.red(color), - Color.green(color), - Color.blue(color), - Color.alpha(color)); // on API 29, WebView doesn't load with hex colors - } - - private static void setChangelogRead(@NonNull Context context) { - try { - PackageInfo pInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); - int currentVersion = pInfo.versionCode; - PreferenceUtil.INSTANCE.setLastVersion(currentVersion); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - } - - @Override - protected void onCreate(@Nullable Bundle savedInstanceState) { - setDrawUnderStatusBar(); - super.onCreate(savedInstanceState); - ActivityWhatsNewBinding binding = ActivityWhatsNewBinding.inflate(getLayoutInflater()); - setContentView(binding.getRoot()); - setStatusbarColorAuto(); - setNavigationbarColorAuto(); - setTaskDescriptionColorAuto(); - - binding.toolbar.setBackgroundColor(ATHUtil.INSTANCE.resolveColor(this, R.attr.colorSurface)); - binding.toolbar.setNavigationOnClickListener(v -> onBackPressed()); - ToolbarContentTintHelper.colorBackButton(binding.toolbar); - - try { - StringBuilder buf = new StringBuilder(); - InputStream json = getAssets().open("retro-changelog.html"); - BufferedReader in = new BufferedReader(new InputStreamReader(json, StandardCharsets.UTF_8)); - String str; - while ((str = in.readLine()) != null) { - buf.append(str); - } - in.close(); - - // Inject color values for WebView body background and links - final boolean isDark = ATHUtil.INSTANCE.isWindowBackgroundDark(this); - final int accentColor = ThemeStore.Companion.accentColor(this); - final String backgroundColor = - colorToCSS( - ATHUtil.INSTANCE.resolveColor( - this, R.attr.colorSurface, Color.parseColor(isDark ? "#424242" : "#ffffff"))); - final String contentColor = colorToCSS(Color.parseColor(isDark ? "#ffffff" : "#000000")); - final String textColor = colorToCSS(Color.parseColor(isDark ? "#60FFFFFF" : "#80000000")); - final String accentColorString = colorToCSS(ThemeStore.Companion.accentColor(this)); - final String cardBackgroundColor = colorToCSS(Color.parseColor(isDark ? "#353535" : "#ffffff")); - final String accentTextColor = - colorToCSS( - MaterialValueHelper.getPrimaryTextColor( - this, ColorUtil.INSTANCE.isColorLight(accentColor))); - final String changeLog = - buf.toString() - .replace( - "{style-placeholder}", - String.format( - "body { background-color: %s; color: %s; } li {color: %s;} h3 {color: %s;} .tag {color: %s;} div{background-color: %s;}", - backgroundColor, - contentColor, - textColor, - accentColorString, - accentColorString, - cardBackgroundColor)) - .replace("{link-color}", colorToCSS(ThemeStore.Companion.accentColor(this))) - .replace( - "{link-color-active}", - colorToCSS( - ColorUtil.INSTANCE.lightenColor(ThemeStore.Companion.accentColor(this)))); - binding.webView.loadData(changeLog, "text/html", "UTF-8"); - } catch (Throwable e) { - binding.webView.loadData( - "

Unable to load

" + e.getLocalizedMessage() + "

", "text/html", "UTF-8"); - } - setChangelogRead(this); - binding.tgFab.setOnClickListener(v -> RetroUtil.openUrl(this, Constants.TELEGRAM_CHANGE_LOG)); - ColorExtKt.accentColor(binding.tgFab); - binding.tgFab.shrink(); - binding.container.setOnScrollChangeListener((NestedScrollView.OnScrollChangeListener) (v, scrollX, scrollY, oldScrollX, oldScrollY) -> { - int dy = scrollY - oldScrollY; - if (dy > 0) { - binding.tgFab.shrink(); - } else if (dy < 0) { - binding.tgFab.extend(); - } - }); - } -} diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.kt new file mode 100644 index 00000000..e4e59888 --- /dev/null +++ b/app/src/main/java/code/name/monkey/retromusic/activities/WhatsNewActivity.kt @@ -0,0 +1,132 @@ +package code.name.monkey.retromusic.activities + +import android.content.Context +import android.content.pm.PackageManager +import android.graphics.Color +import android.os.Bundle +import androidx.core.widget.NestedScrollView +import code.name.monkey.appthemehelper.ThemeStore.Companion.accentColor +import code.name.monkey.appthemehelper.util.ATHUtil.isWindowBackgroundDark +import code.name.monkey.appthemehelper.util.ATHUtil.resolveColor +import code.name.monkey.appthemehelper.util.ColorUtil.isColorLight +import code.name.monkey.appthemehelper.util.ColorUtil.lightenColor +import code.name.monkey.appthemehelper.util.MaterialValueHelper.getPrimaryTextColor +import code.name.monkey.appthemehelper.util.ToolbarContentTintHelper +import code.name.monkey.retromusic.Constants +import code.name.monkey.retromusic.R +import code.name.monkey.retromusic.activities.base.AbsBaseActivity +import code.name.monkey.retromusic.databinding.ActivityWhatsNewBinding +import code.name.monkey.retromusic.extensions.accentColor +import code.name.monkey.retromusic.util.PreferenceUtil.lastVersion +import code.name.monkey.retromusic.util.RetroUtil +import java.io.BufferedReader +import java.io.InputStreamReader +import java.nio.charset.StandardCharsets +import java.util.* + +class WhatsNewActivity : AbsBaseActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + val binding = ActivityWhatsNewBinding.inflate(layoutInflater) + setContentView(binding.root) + setLightStatusbarAuto(resolveColor(this, R.attr.colorSurface)) + setTaskDescriptionColorAuto() + binding.toolbar.setNavigationOnClickListener { onBackPressed() } + ToolbarContentTintHelper.colorBackButton(binding.toolbar) + try { + val buf = StringBuilder() + val json = assets.open("retro-changelog.html") + val br = BufferedReader(InputStreamReader(json, StandardCharsets.UTF_8)) + var str: String? + while (br.readLine().also { str = it } != null) { + buf.append(str) + } + br.close() + + // Inject color values for WebView body background and links + val isDark = isWindowBackgroundDark(this) + val accentColor = accentColor(this) + val backgroundColor = colorToCSS( + resolveColor( + this, + R.attr.colorSurface, + Color.parseColor(if (isDark) "#424242" else "#ffffff") + ) + ) + val contentColor = colorToCSS(Color.parseColor(if (isDark) "#ffffff" else "#000000")) + val textColor = colorToCSS(Color.parseColor(if (isDark) "#60FFFFFF" else "#80000000")) + val accentColorString = colorToCSS(accentColor(this)) + val cardBackgroundColor = + colorToCSS(Color.parseColor(if (isDark) "#353535" else "#ffffff")) + val accentTextColor = colorToCSS( + getPrimaryTextColor( + this, isColorLight(accentColor) + ) + ) + val changeLog = buf.toString() + .replace( + "{style-placeholder}", String.format( + "body { background-color: %s; color: %s; } li {color: %s;} h3 {color: %s;} .tag {color: %s;} div{background-color: %s;}", + backgroundColor, + contentColor, + textColor, + accentColorString, + accentColorString, + cardBackgroundColor + ) + ) + .replace("{link-color}", colorToCSS(accentColor(this))) + .replace( + "{link-color-active}", + colorToCSS( + lightenColor(accentColor(this)) + ) + ) + binding.webView.loadData(changeLog, "text/html", "UTF-8") + } catch (e: Throwable) { + binding.webView.loadData( + "

Unable to load

" + e.localizedMessage + "

", "text/html", "UTF-8" + ) + } + setChangelogRead(this) + binding.tgFab.setOnClickListener { + RetroUtil.openUrl( + this, + Constants.TELEGRAM_CHANGE_LOG + ) + } + binding.tgFab.accentColor() + binding.tgFab.shrink() + binding.container.setOnScrollChangeListener { _: NestedScrollView?, _: Int, scrollY: Int, _: Int, oldScrollY: Int -> + val dy = scrollY - oldScrollY + if (dy > 0) { + binding.tgFab.shrink() + } else if (dy < 0) { + binding.tgFab.extend() + } + } + } + + companion object { + private fun colorToCSS(color: Int): String { + return String.format( + Locale.getDefault(), + "rgba(%d, %d, %d, %d)", + Color.red(color), + Color.green(color), + Color.blue(color), + Color.alpha(color) + ) // on API 29, WebView doesn't load with hex colors + } + + private fun setChangelogRead(context: Context) { + try { + val pInfo = context.packageManager.getPackageInfo(context.packageName, 0) + val currentVersion = pInfo.versionCode + lastVersion = currentVersion + } catch (e: PackageManager.NameNotFoundException) { + e.printStackTrace() + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt index a6cfe26a..44dd8d8d 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsSlidingMusicPanelActivity.kt @@ -22,9 +22,10 @@ import android.view.ViewTreeObserver import android.widget.FrameLayout import androidx.core.view.ViewCompat import androidx.core.view.isVisible +import androidx.core.view.updateLayoutParams +import androidx.core.view.updatePadding import androidx.fragment.app.Fragment import androidx.fragment.app.commit -import code.name.monkey.appthemehelper.util.ATHUtil import code.name.monkey.appthemehelper.util.ColorUtil import code.name.monkey.retromusic.R import code.name.monkey.retromusic.RetroBottomSheetBehavior @@ -56,7 +57,8 @@ import code.name.monkey.retromusic.fragments.player.tiny.TinyPlayerFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.CategoryInfo import code.name.monkey.retromusic.util.PreferenceUtil -import code.name.monkey.retromusic.views.BottomNavigationBarTinted +import code.name.monkey.retromusic.util.RetroUtil +import com.google.android.material.bottomnavigation.BottomNavigationView import com.google.android.material.bottomsheet.BottomSheetBehavior.* import org.koin.androidx.viewmodel.ext.android.viewModel @@ -71,18 +73,14 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { private var playerFragment: AbsPlayerFragment? = null private var miniPlayerFragment: MiniPlayerFragment? = null private var nowPlayingScreen: NowPlayingScreen? = null - private var navigationBarColor: Int = 0 private var taskColor: Int = 0 private var lightStatusBar: Boolean = false - private var lightNavigationBar: Boolean = false - private var paletteColor: Int = Color.WHITE protected abstract fun createContentView(): SlidingMusicPanelLayoutBinding private val panelState: Int get() = bottomSheetBehavior.state private lateinit var binding: SlidingMusicPanelLayoutBinding private val bottomSheetCallbackList = object : BottomSheetCallback() { - override fun onSlide(bottomSheet: View, slideOffset: Float) { setMiniPlayerAlphaProgress(slideOffset) binding.dimBackground.show() @@ -123,7 +121,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { chooseFragmentForTheme() setupSlidingUpPanel() setupBottomSheet() - updateColor() val themeColor = resolveColor(android.R.attr.windowBackground, Color.GRAY) binding.dimBackground.setBackgroundColor(ColorUtil.withAlpha(themeColor, 0.5f)) @@ -131,12 +128,18 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { println("dimBackground") collapsePanel() } + binding.bottomNavigationView.apply { + val navbarHeight = RetroUtil.getNavigationBarHeight() + updatePadding(bottom = navbarHeight) + binding.bottomNavigationView.updateLayoutParams { + height = dip(R.dimen.mini_player_height) + navbarHeight + } + } } private fun setupBottomSheet() { bottomSheetBehavior = from(binding.slidingPanel) as RetroBottomSheetBehavior bottomSheetBehavior.addBottomSheetCallback(bottomSheetCallbackList) - bottomSheetBehavior.maxWidth = resources.displayMetrics.widthPixels } override fun onResume() { @@ -179,18 +182,16 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { miniPlayerFragment?.view?.visibility = if (alpha == 0f) View.GONE else View.VISIBLE binding.bottomNavigationView.translationY = progress * 500 binding.bottomNavigationView.alpha = alpha + binding.playerFragmentContainer.alpha = (progress - 0.2F) / 0.2F } open fun onPanelCollapsed() { // restore values super.setLightStatusbar(lightStatusBar) super.setTaskDescriptionColor(taskColor) - super.setNavigationbarColor(navigationBarColor) - super.setLightNavigationBar(lightNavigationBar) } open fun onPanelExpanded() { - onPaletteColorChanged() } private fun setupSlidingUpPanel() { @@ -214,7 +215,7 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { }) } - fun getBottomNavigationView(): BottomNavigationBarTinted { + fun getBottomNavigationView(): BottomNavigationView { return binding.bottomNavigationView } @@ -250,43 +251,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { return false } - private fun onPaletteColorChanged() { - if (panelState == STATE_EXPANDED) { - super.setTaskDescriptionColor(paletteColor) - val isColorLight = ColorUtil.isColorLight(paletteColor) - if (PreferenceUtil.isAdaptiveColor && (nowPlayingScreen == Normal || nowPlayingScreen == Flat)) { - super.setLightNavigationBar(true) - super.setLightStatusbar(isColorLight) - } else if (nowPlayingScreen == Card || nowPlayingScreen == Blur || nowPlayingScreen == BlurCard) { - super.setLightStatusbar(false) - super.setLightNavigationBar(true) - super.setNavigationbarColor(Color.BLACK) - } else if (nowPlayingScreen == Color || nowPlayingScreen == Tiny || nowPlayingScreen == Gradient) { - super.setNavigationbarColor(paletteColor) - super.setLightNavigationBar(isColorLight) - super.setLightStatusbar(isColorLight) - } else if (nowPlayingScreen == Full) { - super.setNavigationbarColor(paletteColor) - super.setLightNavigationBar(isColorLight) - super.setLightStatusbar(false) - } else if (nowPlayingScreen == Classic) { - super.setLightStatusbar(false) - } else if (nowPlayingScreen == Fit) { - super.setLightStatusbar(false) - } else { - super.setLightStatusbar( - ColorUtil.isColorLight( - ATHUtil.resolveColor( - this, - android.R.attr.windowBackground - ) - ) - ) - super.setLightNavigationBar(true) - } - } - } - override fun setLightStatusbar(enabled: Boolean) { lightStatusBar = enabled if (panelState == STATE_COLLAPSED) { @@ -294,20 +258,6 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { } } - override fun setLightNavigationBar(enabled: Boolean) { - lightNavigationBar = enabled - if (panelState == STATE_COLLAPSED) { - super.setLightNavigationBar(enabled) - } - } - - override fun setNavigationbarColor(color: Int) { - navigationBarColor = color - if (panelState == STATE_COLLAPSED) { - super.setNavigationbarColor(color) - } - } - override fun setTaskDescriptionColor(color: Int) { taskColor = color if (panelState == STATE_COLLAPSED) { @@ -330,25 +280,18 @@ abstract class AbsSlidingMusicPanelActivity : AbsMusicServiceActivity() { } } - private fun updateColor() { - libraryViewModel.paletteColor.observe(this, { color -> - this.paletteColor = color - onPaletteColorChanged() - }) - } - fun setBottomBarVisibility(visible: Boolean) { binding.bottomNavigationView.isVisible = visible hideBottomBar(MusicPlayerRemote.playingQueue.isEmpty()) } private fun hideBottomBar(hide: Boolean) { - val heightOfBar = - if (MusicPlayerRemote.isCasting) dip(R.dimen.cast_mini_player_height) else dip(R.dimen.mini_player_height) - val heightOfBarWithTabs = - if (MusicPlayerRemote.isCasting) dip(R.dimen.mini_cast_player_height_expanded) else dip( - R.dimen.mini_player_height_expanded - ) + val heightOfBar = RetroUtil.getNavigationBarHeight() + + if (MusicPlayerRemote.isCasting) dip(R.dimen.cast_mini_player_height) else dip(R.dimen.mini_player_height) + val heightOfBarWithTabs = RetroUtil.getNavigationBarHeight() + + if (MusicPlayerRemote.isCasting) dip(R.dimen.mini_cast_player_height_expanded) else dip( + R.dimen.mini_player_height_expanded + ) val isVisible = binding.bottomNavigationView.isVisible if (hide) { bottomSheetBehavior.isHideable = true diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsThemeActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsThemeActivity.kt index 8d437159..45cf0c0b 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsThemeActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/base/AbsThemeActivity.kt @@ -49,6 +49,7 @@ abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable { setImmersiveFullscreen() registerSystemUiVisibility() toggleScreenOn() + setDrawUnderNavigationBar() //MaterialDialogsUtil.updateMaterialDialogsThemeSingleton(this) } @@ -91,7 +92,7 @@ abstract class AbsThemeActivity : ATHToolbarActivity(), Runnable { RetroUtil.setAllowDrawUnderStatusBar(window) } - fun setDrawUnderNavigationBar() { + private fun setDrawUnderNavigationBar() { RetroUtil.setAllowDrawUnderNavigationBar(window) } diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt index 3780834d..a65b135e 100644 --- a/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/bugreport/BugReportActivity.kt @@ -74,12 +74,10 @@ open class BugReportActivity : AbsThemeActivity() { private var deviceInfo: DeviceInfo? = null override fun onCreate(savedInstanceState: Bundle?) { - setDrawUnderStatusBar() super.onCreate(savedInstanceState) binding = ActivityBugReportBinding.inflate(layoutInflater) setContentView(binding.root) setStatusbarColorAuto() - setNavigationbarColorAuto() setTaskDescriptionColorAuto() initViews() diff --git a/app/src/main/java/code/name/monkey/retromusic/activities/tageditor/AbsTagEditorActivity.kt b/app/src/main/java/code/name/monkey/retromusic/activities/tageditor/AbsTagEditorActivity.kt index 536dea62..361555bb 100755 --- a/app/src/main/java/code/name/monkey/retromusic/activities/tageditor/AbsTagEditorActivity.kt +++ b/app/src/main/java/code/name/monkey/retromusic/activities/tageditor/AbsTagEditorActivity.kt @@ -196,7 +196,6 @@ abstract class AbsTagEditorActivity : AbsBaseActivity() { _binding = bindingInflater.invoke(layoutInflater) setContentView(binding.root) setStatusbarColorAuto() - setNavigationbarColorAuto() setTaskDescriptionColorAuto() saveFab = findViewById(R.id.saveTags) diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt index 2edf2ecc..0ced7780 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/base/AbsMainActivityFragment.kt @@ -34,10 +34,7 @@ abstract class AbsMainActivityFragment(@LayoutRes layout: Int) : AbsMusicService override fun onActivityCreated(savedInstanceState: Bundle?) { super.onActivityCreated(savedInstanceState) setHasOptionsMenu(true) - mainActivity.setNavigationbarColorAuto() - mainActivity.setLightNavigationBar(true) mainActivity.setTaskDescriptionColorAuto() - mainActivity.hideStatusBar() } private fun setStatusBarColor(view: View, color: Int) { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptiveFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptiveFragment.kt index 34f8baf5..382d65f5 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptiveFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/adaptive/AdaptiveFragment.kt @@ -28,6 +28,7 @@ import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor class AdaptiveFragment : AbsPlayerFragment(R.layout.fragment_adaptive_player) { @@ -46,6 +47,7 @@ class AdaptiveFragment : AbsPlayerFragment(R.layout.fragment_adaptive_player) { _binding = FragmentAdaptivePlayerBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(binding.root) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlayerFragment.kt index a4f3df43..6dbd8c06 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/blur/BlurPlayerFragment.kt @@ -32,6 +32,7 @@ import code.name.monkey.retromusic.glide.RetroGlideExtension import code.name.monkey.retromusic.glide.RetroMusicColoredTarget import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor class BlurPlayerFragment : AbsPlayerFragment(R.layout.fragment_blur), @@ -54,6 +55,7 @@ class BlurPlayerFragment : AbsPlayerFragment(R.layout.fragment_blur), _binding = FragmentBlurBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(binding.playerToolbar) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardFragment.kt index 698bf513..172d03bf 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/card/CardFragment.kt @@ -26,6 +26,7 @@ import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.fragments.player.normal.PlayerFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor class CardFragment : AbsPlayerFragment(R.layout.fragment_card_player) { @@ -82,6 +83,7 @@ class CardFragment : AbsPlayerFragment(R.layout.fragment_card_player) { _binding = FragmentCardPlayerBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(binding.playbackControlsFragment.parent as View) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurFragment.kt index 5c5432a8..3c0319d3 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/cardblur/CardBlurFragment.kt @@ -33,7 +33,9 @@ import code.name.monkey.retromusic.glide.RetroGlideExtension import code.name.monkey.retromusic.glide.RetroMusicColoredTarget import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor +import org.koin.android.ext.android.bind class CardBlurFragment : AbsPlayerFragment(R.layout.fragment_card_blur_player), SharedPreferences.OnSharedPreferenceChangeListener { @@ -92,6 +94,7 @@ class CardBlurFragment : AbsPlayerFragment(R.layout.fragment_card_blur_player), _binding = FragmentCardBlurPlayerBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(binding.cardContainer) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt index 461afbcf..eb7c5e0f 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/color/ColorFragment.kt @@ -29,6 +29,7 @@ import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor class ColorFragment : AbsPlayerFragment(R.layout.fragment_color_player) { @@ -61,7 +62,6 @@ class ColorFragment : AbsPlayerFragment(R.layout.fragment_color_player) { _binding?.root?.setBackgroundColor(color.backgroundColor) } animator.start() - serviceActivity?.setLightNavigationBar(ColorUtil.isColorLight(color.backgroundColor)) Handler().post { ToolbarContentTintHelper.colorizeToolbar( binding.playerToolbar, @@ -116,6 +116,7 @@ class ColorFragment : AbsPlayerFragment(R.layout.fragment_color_player) { val playerAlbumCoverFragment = childFragmentManager.findFragmentById(R.id.playerAlbumCoverFragment) as PlayerAlbumCoverFragment playerAlbumCoverFragment.setCallbacks(this) + RetroUtil.drawAboveNavBar(playerToolbar()) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitFragment.kt index 936e380e..81f358b0 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/fit/FitFragment.kt @@ -25,6 +25,7 @@ import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor class FitFragment : AbsPlayerFragment(R.layout.fragment_fit) { @@ -85,6 +86,7 @@ class FitFragment : AbsPlayerFragment(R.layout.fragment_fit) { _binding = FragmentFitBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(playerToolbar()) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlayerFragment.kt index 5cad96de..4c2dedea 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/flat/FlatPlayerFragment.kt @@ -31,6 +31,7 @@ import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor import code.name.monkey.retromusic.views.DrawableGradient @@ -90,6 +91,7 @@ class FlatPlayerFragment : AbsPlayerFragment(R.layout.fragment_flat_player) { _binding = FragmentFlatPlayerBinding.bind(view) setUpPlayerToolbar() setUpSubFragments() + RetroUtil.drawAboveNavBar(binding.playbackControlsFragment) } override fun onShow() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/gradient/GradientPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/gradient/GradientPlayerFragment.kt index 68725bab..803d5171 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/gradient/GradientPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/gradient/GradientPlayerFragment.kt @@ -55,6 +55,7 @@ import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor import com.google.android.material.bottomsheet.BottomSheetBehavior.* diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt index 2be4a5c6..3aed2af3 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialControlsFragment.kt @@ -36,6 +36,7 @@ import code.name.monkey.retromusic.misc.SimpleOnSeekbarChangeListener import code.name.monkey.retromusic.service.MusicService import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor /** diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialFragment.kt index 888f6ad9..c8ce6fd3 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/material/MaterialFragment.kt @@ -26,6 +26,7 @@ import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.fragments.player.normal.PlayerFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor /** @@ -93,6 +94,7 @@ class MaterialFragment : AbsPlayerFragment(R.layout.fragment_material) { _binding = FragmentMaterialBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(playerToolbar()) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerFragment.kt index 50a3a466..c7b082ae 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/normal/PlayerFragment.kt @@ -29,6 +29,7 @@ import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor import code.name.monkey.retromusic.views.DrawableGradient @@ -120,6 +121,7 @@ class PlayerFragment : AbsPlayerFragment(R.layout.fragment_player) { _binding = FragmentPlayerBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(playerToolbar()) } override fun onDestroyView() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlayerFragment.kt index 220ef458..429aea36 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/plain/PlainPlayerFragment.kt @@ -27,6 +27,7 @@ import code.name.monkey.retromusic.fragments.base.goToArtist import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor class PlainPlayerFragment : AbsPlayerFragment(R.layout.fragment_plain_player) { @@ -84,6 +85,7 @@ class PlainPlayerFragment : AbsPlayerFragment(R.layout.fragment_plain_player) { binding.text.setOnClickListener { goToArtist(requireActivity()) } + RetroUtil.drawAboveNavBar(playerToolbar()) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlayerFragment.kt index 1a2b354d..05c03ee8 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/simple/SimplePlayerFragment.kt @@ -25,6 +25,7 @@ import code.name.monkey.retromusic.fragments.base.AbsPlayerFragment import code.name.monkey.retromusic.fragments.player.PlayerAlbumCoverFragment import code.name.monkey.retromusic.helper.MusicPlayerRemote import code.name.monkey.retromusic.model.Song +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor /** @@ -51,6 +52,7 @@ class SimplePlayerFragment : AbsPlayerFragment(R.layout.fragment_simple_player) _binding = FragmentSimplePlayerBinding.bind(view) setUpSubFragments() setUpPlayerToolbar() + RetroUtil.drawAboveNavBar(playerToolbar()) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt b/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt index 630efbce..50b6ddcc 100644 --- a/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt +++ b/app/src/main/java/code/name/monkey/retromusic/fragments/player/tiny/TinyPlayerFragment.kt @@ -39,6 +39,7 @@ import code.name.monkey.retromusic.helper.PlayPauseButtonOnClickHandler import code.name.monkey.retromusic.model.Song import code.name.monkey.retromusic.util.MusicUtil import code.name.monkey.retromusic.util.PreferenceUtil +import code.name.monkey.retromusic.util.RetroUtil import code.name.monkey.retromusic.util.ViewUtil import code.name.monkey.retromusic.util.color.MediaNotificationProcessor import kotlin.math.abs @@ -147,6 +148,7 @@ class TinyPlayerFragment : AbsPlayerFragment(R.layout.fragment_tiny_player), binding.text.setOnClickListener { goToArtist(requireActivity()) } + RetroUtil.drawAboveNavBar(playerToolbar()) } private fun setUpSubFragments() { diff --git a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java old mode 100755 new mode 100644 index f06aade5..a68c3a87 --- a/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java +++ b/app/src/main/java/code/name/monkey/retromusic/util/RetroUtil.java @@ -32,6 +32,7 @@ import android.os.Build; import android.util.DisplayMetrics; import android.view.Display; import android.view.View; +import android.view.ViewGroup; import android.view.Window; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; @@ -40,6 +41,8 @@ import androidx.annotation.ColorInt; import androidx.annotation.DrawableRes; import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowInsetsCompat; import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat; import java.net.InetAddress; @@ -66,10 +69,10 @@ public class RetroUtil { @NonNull public static Bitmap createBitmap(@NonNull Drawable drawable, float sizeMultiplier) { Bitmap bitmap = - Bitmap.createBitmap( - (int) (drawable.getIntrinsicWidth() * sizeMultiplier), - (int) (drawable.getIntrinsicHeight() * sizeMultiplier), - Bitmap.Config.ARGB_8888); + Bitmap.createBitmap( + (int) (drawable.getIntrinsicWidth() * sizeMultiplier), + (int) (drawable.getIntrinsicHeight() * sizeMultiplier), + Bitmap.Config.ARGB_8888); Canvas c = new Canvas(bitmap); drawable.setBounds(0, 0, c.getWidth(), c.getHeight()); drawable.draw(c); @@ -106,9 +109,21 @@ public class RetroUtil { public static int getStatusBarHeight() { int result = 0; int resourceId = - App.Companion.getContext() - .getResources() - .getIdentifier("status_bar_height", "dimen", "android"); + App.Companion.getContext() + .getResources() + .getIdentifier("status_bar_height", "dimen", "android"); + if (resourceId > 0) { + result = App.Companion.getContext().getResources().getDimensionPixelSize(resourceId); + } + return result; + } + + public static int getNavigationBarHeight() { + int result = 0; + int resourceId = + App.Companion.getContext() + .getResources() + .getIdentifier("navigation_bar_height", "dimen", "android"); if (resourceId > 0) { result = App.Companion.getContext().getResources().getDimensionPixelSize(resourceId); } @@ -117,23 +132,23 @@ public class RetroUtil { @Nullable public static Drawable getTintedVectorDrawable( - @NonNull Context context, @DrawableRes int id, @ColorInt int color) { + @NonNull Context context, @DrawableRes int id, @ColorInt int color) { return TintHelper.createTintedDrawable( - getVectorDrawable(context.getResources(), id, context.getTheme()), color); + getVectorDrawable(context.getResources(), id, context.getTheme()), color); } @Nullable public static Drawable getTintedVectorDrawable( - @NonNull Resources res, - @DrawableRes int resId, - @Nullable Resources.Theme theme, - @ColorInt int color) { + @NonNull Resources res, + @DrawableRes int resId, + @Nullable Resources.Theme theme, + @ColorInt int color) { return TintHelper.createTintedDrawable(getVectorDrawable(res, resId, theme), color); } @Nullable public static Drawable getVectorDrawable( - @NonNull Resources res, @DrawableRes int resId, @Nullable Resources.Theme theme) { + @NonNull Resources res, @DrawableRes int resId, @Nullable Resources.Theme theme) { if (Build.VERSION.SDK_INT >= 21) { return res.getDrawable(resId, theme); } @@ -145,7 +160,7 @@ public class RetroUtil { View currentFocus = activity.getCurrentFocus(); if (currentFocus != null) { InputMethodManager inputMethodManager = - (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); + (InputMethodManager) activity.getSystemService(Activity.INPUT_METHOD_SERVICE); if (inputMethodManager != null) { inputMethodManager.hideSoftInputFromWindow(currentFocus.getWindowToken(), 0); } @@ -159,11 +174,11 @@ public class RetroUtil { return true; case "only_wifi": final ConnectivityManager connectivityManager = - (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); + (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = connectivityManager.getActiveNetworkInfo(); return netInfo != null - && netInfo.getType() == ConnectivityManager.TYPE_WIFI - && netInfo.isConnectedOrConnecting(); + && netInfo.getType() == ConnectivityManager.TYPE_WIFI + && netInfo.isConnectedOrConnecting(); case "never": default: return false; @@ -172,7 +187,7 @@ public class RetroUtil { public static boolean isLandscape() { return App.Companion.getContext().getResources().getConfiguration().orientation - == Configuration.ORIENTATION_LANDSCAPE; + == Configuration.ORIENTATION_LANDSCAPE; } @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @@ -183,7 +198,7 @@ public class RetroUtil { public static boolean isTablet() { return App.Companion.getContext().getResources().getConfiguration().smallestScreenWidthDp - >= 600; + >= 600; } public static void openUrl(@NonNull Activity context, @NonNull String str) { @@ -196,16 +211,16 @@ public class RetroUtil { public static void setAllowDrawUnderNavigationBar(Window window) { window.setNavigationBarColor(Color.TRANSPARENT); window - .getDecorView() - .setSystemUiVisibility( - Build.VERSION.SDK_INT >= Build.VERSION_CODES.O - ? View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION - : View.SYSTEM_UI_FLAG_LAYOUT_STABLE - | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN - | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + .getDecorView() + .setSystemUiVisibility( + Build.VERSION.SDK_INT >= Build.VERSION_CODES.O + ? View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION + : View.SYSTEM_UI_FLAG_LAYOUT_STABLE + | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); } public static void setAllowDrawUnderStatusBar(@NonNull Window window) { @@ -213,6 +228,32 @@ public class RetroUtil { .getDecorView() .setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN); + window.setStatusBarColor(Color.TRANSPARENT); + } + + /** + * This will draw our view above the navigation bar instead of behind it by adding margins. + * + * @param view view to draw above Navigation Bar + */ + public static void drawAboveNavBar(View view) { + ViewCompat.setOnApplyWindowInsetsListener(view, (v, insets) -> { + ViewGroup.MarginLayoutParams params = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); + params.bottomMargin = insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom; + return WindowInsetsCompat.CONSUMED; + }); + } + + /** + * This will draw our view above the navigation bar instead of behind it by adding padding. + * + * @param view view to draw above Navigation Bar + */ + public static void drawAboveNavBarWithPadding(View view) { + ViewCompat.setOnApplyWindowInsetsListener(view, (v, insets) -> { + v.setPadding(v.getPaddingLeft(), v.getPaddingTop(), v.getPaddingRight(), insets.getInsets(WindowInsetsCompat.Type.navigationBars()).bottom); + return WindowInsetsCompat.CONSUMED; + }); } public static String getIpAddress(boolean useIPv4) { diff --git a/app/src/main/res/drawable/shadow_blur_theme.xml b/app/src/main/res/drawable/shadow_blur_theme.xml index fad19a4d..2304e611 100644 --- a/app/src/main/res/drawable/shadow_blur_theme.xml +++ b/app/src/main/res/drawable/shadow_blur_theme.xml @@ -2,7 +2,7 @@ \ No newline at end of file diff --git a/app/src/main/res/layout/activity_album_tag_editor.xml b/app/src/main/res/layout/activity_album_tag_editor.xml index 85c265b7..7131ee0c 100755 --- a/app/src/main/res/layout/activity_album_tag_editor.xml +++ b/app/src/main/res/layout/activity_album_tag_editor.xml @@ -1,25 +1,18 @@ - - - - - - - + tools:ignore="UnusedAttribute" + android:fitsSystemWindows="true"> + app:liftOnScroll="true" + android:fitsSystemWindows="true"> - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_bug_report.xml b/app/src/main/res/layout/activity_bug_report.xml index b1216d92..44f7a497 100644 --- a/app/src/main/res/layout/activity_bug_report.xml +++ b/app/src/main/res/layout/activity_bug_report.xml @@ -1,76 +1,63 @@ - + android:fitsSystemWindows="true"> - + android:layout_height="wrap_content" + app:liftOnScroll="true"> - + + + + + android:layout_height="wrap_content" + app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior"> - + android:clipToPadding="false" + android:orientation="vertical"> - - - - - - - + android:layout_marginBottom="8dp" /> - + - + - + - + - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_donation.xml b/app/src/main/res/layout/activity_donation.xml index 28e7c6aa..7953d7c7 100644 --- a/app/src/main/res/layout/activity_donation.xml +++ b/app/src/main/res/layout/activity_donation.xml @@ -4,13 +4,15 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/colorSurface"> + android:background="?attr/colorSurface" + android:fitsSystemWindows="true"> + app:liftOnScroll="true" + android:fitsSystemWindows="true"> + android:fitsSystemWindows="true"> - + android:fitsSystemWindows="true"> - + android:layout_height="wrap_content" + android:fitsSystemWindows="true" + app:liftOnScroll="true"> - - - - - - + app:layout_collapseMode="pin" + app:navigationIcon="@drawable/ic_keyboard_backspace_black" + app:title="@string/queue" + app:titleTextAppearance="@style/ToolbarTextAppearanceNormal" + tools:ignore="UnusedAttribute" /> - + - + - + - - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index c5cc80e5..9677b827 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -1,46 +1,36 @@ - + xmlns:app="http://schemas.android.com/apk/res-auto" + android:background="?attr/colorSurface" + android:fitsSystemWindows="true"> - + android:layout_height="wrap_content" + app:liftOnScroll="true" + android:fitsSystemWindows="true"> - + + + + + android:layout_height="wrap_content" + app:defaultNavHost="true" + app:layout_behavior="com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior" + app:navGraph="@navigation/settings_graph" /> - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_song_tag_editor.xml b/app/src/main/res/layout/activity_song_tag_editor.xml index e6fbdd7a..426d8c28 100755 --- a/app/src/main/res/layout/activity_song_tag_editor.xml +++ b/app/src/main/res/layout/activity_song_tag_editor.xml @@ -3,15 +3,16 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?attr/colorSurface" android:focusable="true" - android:focusableInTouchMode="true"> + android:focusableInTouchMode="true" + android:fitsSystemWindows="true"> + app:liftOnScroll="true" + android:fitsSystemWindows="true"> + android:orientation="vertical" + android:fitsSystemWindows="true"> - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_card_player.xml b/app/src/main/res/layout/fragment_card_player.xml index 3585fd87..8318ede8 100644 --- a/app/src/main/res/layout/fragment_card_player.xml +++ b/app/src/main/res/layout/fragment_card_player.xml @@ -49,8 +49,7 @@ android:layout_height="wrap_content" android:layout_gravity="bottom" android:layout_margin="8dp" - app:cardCornerRadius="8dp" - app:cardUseCompatPadding="true"> + app:cardCornerRadius="8dp"> + android:layout_height="@dimen/toolbar_height"/> diff --git a/app/src/main/res/layout/fragment_mini_player.xml b/app/src/main/res/layout/fragment_mini_player.xml index 2c8cbdff..bd397169 100644 --- a/app/src/main/res/layout/fragment_mini_player.xml +++ b/app/src/main/res/layout/fragment_mini_player.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="56dp" - android:background="?attr/colorSurface" + android:background="@null" android:clickable="true" android:focusable="true" tools:ignore="UnusedAttribute"> diff --git a/app/src/main/res/layout/sliding_music_panel_layout.xml b/app/src/main/res/layout/sliding_music_panel_layout.xml index aefb7fb1..beb86e9d 100644 --- a/app/src/main/res/layout/sliding_music_panel_layout.xml +++ b/app/src/main/res/layout/sliding_music_panel_layout.xml @@ -21,7 +21,7 @@ - \ No newline at end of file diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index 99e61bb2..eb0b26e1 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -14,7 +14,7 @@ - \ No newline at end of file diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml index 57d3cb48..099cfe40 100644 --- a/app/src/main/res/values-v21/styles.xml +++ b/app/src/main/res/values-v21/styles.xml @@ -10,6 +10,7 @@ @android:color/transparent false @style/TextViewStyleIm + @color/window_color_light - - \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index d2db61cf..63e3c427 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -6,6 +6,7 @@ + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 3973baac..55c149c1 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -15,6 +15,9 @@ #202124 #202124 + #353535 + #dddddd + #000000 #00000000 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 3881a4d9..eed073c4 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -7,6 +7,7 @@ none 16dp @style/WindowAnimationTransition + @color/window_color_light - @@ -181,9 +183,9 @@ - - - -