mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2025-01-19 10:53:16 +00:00
Merge pull request #80 from lacerta-doc/improve/bottom_nav_color
システムナビゲーションの色をUIにあわせるようにした
This commit is contained in:
commit
46f119b531
|
@ -1,11 +1,13 @@
|
||||||
package one.nem.lacerta;
|
package one.nem.lacerta;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.fragment.app.FragmentManager;
|
import androidx.fragment.app.FragmentManager;
|
||||||
import androidx.navigation.NavController;
|
import androidx.navigation.NavController;
|
||||||
import androidx.navigation.fragment.NavHostFragment;
|
import androidx.navigation.fragment.NavHostFragment;
|
||||||
import androidx.navigation.ui.NavigationUI;
|
import androidx.navigation.ui.NavigationUI;
|
||||||
|
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -36,6 +38,8 @@ public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "testMessage", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
getWindow().setNavigationBarColor(ContextCompat.getColor(this, one.nem.lacerta.shared.ui.R.color.colorSurfaceVariant));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
35
shared/ui/src/main/res/values-night-v27/themes.xml
Normal file
35
shared/ui/src/main/res/values-night-v27/themes.xml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="Base.Theme.Lacerta" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
|
|
||||||
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
|
<item name="colorOnPrimary">@color/colorOnPrimary</item>
|
||||||
|
<item name="colorSecondary">@color/colorSecondary</item>
|
||||||
|
<item name="colorOnSecondary">@color/colorOnSecondary</item>
|
||||||
|
<item name="colorSurface">@color/colorSurface</item>
|
||||||
|
<item name="colorOnSurface">@color/colorOnSurface</item>
|
||||||
|
<item name="colorSurfaceVariant">@color/colorSurfaceVariant</item>
|
||||||
|
<item name="colorOnSurfaceVariant">@color/colorOnSurfaceVariant</item>
|
||||||
|
<item name="colorSurfaceInverse">@color/colorSurfaceInverse</item>
|
||||||
|
<item name="colorOnSurfaceInverse">@color/colorOnSurfaceInverse</item>
|
||||||
|
<item name="colorPrimaryInverse">@color/colorPrimaryInverse</item>
|
||||||
|
<item name="colorPrimaryContainer">@color/colorPrimaryContainer</item>
|
||||||
|
<item name="colorOnPrimaryContainer">@color/colorOnPrimaryContainer</item>
|
||||||
|
<item name="colorSecondaryContainer">@color/colorSecondaryContainer</item>
|
||||||
|
<item name="colorOnSecondaryContainer">@color/colorOnSecondaryContainer</item>
|
||||||
|
<item name="colorTertiary">@color/colorTertiary</item>
|
||||||
|
<item name="colorOnTertiary">@color/colorOnTertiary</item>
|
||||||
|
<item name="colorTertiaryContainer">@color/colorTertiaryContainer</item>
|
||||||
|
<item name="colorOnTertiaryContainer">@color/colorOnTertiaryContainer</item>
|
||||||
|
<item name="colorError">@color/colorError</item>
|
||||||
|
<item name="colorOnError">@color/colorOnError</item>
|
||||||
|
<item name="colorErrorContainer">@color/colorErrorContainer</item>
|
||||||
|
<item name="colorOnErrorContainer">@color/colorOnErrorContainer</item>
|
||||||
|
<item name="colorOutline">@color/colorOutline</item>
|
||||||
|
<item name="colorOnBackground">@color/colorOnBackground</item>
|
||||||
|
|
||||||
|
<item name="android:windowLightNavigationBar">false</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</resources>
|
35
shared/ui/src/main/res/values-v27/themes.xml
Normal file
35
shared/ui/src/main/res/values-v27/themes.xml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="Base.Theme.Lacerta" parent="Theme.Material3.DayNight.NoActionBar">
|
||||||
|
|
||||||
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
|
<item name="colorOnPrimary">@color/colorOnPrimary</item>
|
||||||
|
<item name="colorSecondary">@color/colorSecondary</item>
|
||||||
|
<item name="colorOnSecondary">@color/colorOnSecondary</item>
|
||||||
|
<item name="colorSurface">@color/colorSurface</item>
|
||||||
|
<item name="colorOnSurface">@color/colorOnSurface</item>
|
||||||
|
<item name="colorSurfaceVariant">@color/colorSurfaceVariant</item>
|
||||||
|
<item name="colorOnSurfaceVariant">@color/colorOnSurfaceVariant</item>
|
||||||
|
<item name="colorSurfaceInverse">@color/colorSurfaceInverse</item>
|
||||||
|
<item name="colorOnSurfaceInverse">@color/colorOnSurfaceInverse</item>
|
||||||
|
<item name="colorPrimaryInverse">@color/colorPrimaryInverse</item>
|
||||||
|
<item name="colorPrimaryContainer">@color/colorPrimaryContainer</item>
|
||||||
|
<item name="colorOnPrimaryContainer">@color/colorOnPrimaryContainer</item>
|
||||||
|
<item name="colorSecondaryContainer">@color/colorSecondaryContainer</item>
|
||||||
|
<item name="colorOnSecondaryContainer">@color/colorOnSecondaryContainer</item>
|
||||||
|
<item name="colorTertiary">@color/colorTertiary</item>
|
||||||
|
<item name="colorOnTertiary">@color/colorOnTertiary</item>
|
||||||
|
<item name="colorTertiaryContainer">@color/colorTertiaryContainer</item>
|
||||||
|
<item name="colorOnTertiaryContainer">@color/colorOnTertiaryContainer</item>
|
||||||
|
<item name="colorError">@color/colorError</item>
|
||||||
|
<item name="colorOnError">@color/colorOnError</item>
|
||||||
|
<item name="colorErrorContainer">@color/colorErrorContainer</item>
|
||||||
|
<item name="colorOnErrorContainer">@color/colorOnErrorContainer</item>
|
||||||
|
<item name="colorOutline">@color/colorOutline</item>
|
||||||
|
<item name="colorOnBackground">@color/colorOnBackground</item>
|
||||||
|
|
||||||
|
<item name="android:windowLightNavigationBar">true</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</resources>
|
|
@ -28,6 +28,7 @@
|
||||||
<item name="colorOutline">@color/colorOutline</item>
|
<item name="colorOutline">@color/colorOutline</item>
|
||||||
<item name="colorOnBackground">@color/colorOnBackground</item>
|
<item name="colorOnBackground">@color/colorOnBackground</item>
|
||||||
|
|
||||||
|
<item name="android:windowLightNavigationBar">true</item>
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user