Add night mode support
This commit is contained in:
@@ -46,7 +46,7 @@ class MainActivity : AppCompatActivity(), BottomNavigationView.OnNavigationItemS
|
||||
if (savedInstanceState == null) displayFragment(TetheringFragment())
|
||||
badge = QBadgeView(this)
|
||||
badge.bindTarget((binding.navigation.getChildAt(0) as BottomNavigationMenuView).getChildAt(1))
|
||||
badge.badgeBackgroundColor = ContextCompat.getColor(this, R.color.colorAccent)
|
||||
badge.badgeBackgroundColor = ContextCompat.getColor(this, R.color.colorSecondary)
|
||||
badge.badgeTextColor = ContextCompat.getColor(this, R.color.primary_text_default_material_light)
|
||||
badge.badgeGravity = Gravity.TOP or Gravity.CENTER_HORIZONTAL
|
||||
badge.setGravityOffset(16f, 0f, true)
|
||||
|
||||
@@ -45,7 +45,7 @@ class ClientsFragment : Fragment(), ServiceConnection {
|
||||
binding.clients.layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
|
||||
binding.clients.itemAnimator = DefaultItemAnimator()
|
||||
binding.clients.adapter = adapter
|
||||
binding.swipeRefresher.setColorSchemeResources(R.color.colorAccent)
|
||||
binding.swipeRefresher.setColorSchemeResources(R.color.colorSecondary)
|
||||
binding.swipeRefresher.setOnRefreshListener {
|
||||
IpNeighbourMonitor.instance?.flush()
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
android:id="@+id/line"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0.1px"
|
||||
android:background="@color/navigationBarColor"
|
||||
android:background="?android:attr/navigationBarColor"
|
||||
android:elevation="9dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="@drawable/ic_content_add"
|
||||
android:tint="@color/colorAccent"/>
|
||||
android:tint="@color/colorSecondary"/>
|
||||
|
||||
<Space
|
||||
android:layout_width="16dp"
|
||||
|
||||
6
mobile/src/main/res/values-night/colors.xml
Normal file
6
mobile/src/main/res/values-night/colors.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#2e7d32</color>
|
||||
<color name="colorPrimaryDark">#005005</color>
|
||||
<color name="colorSecondary">#AEEA00</color>
|
||||
</resources>
|
||||
4
mobile/src/main/res/values-night/styles.xml
Normal file
4
mobile/src/main/res/values-night/styles.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<style name="Theme.MaterialComponents.DayNight.NoActionBar" parent="Theme.MaterialComponents.NoActionBar"/>
|
||||
</resources>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#4CAF50</color>
|
||||
<color name="colorPrimaryDark">#388E3C</color>
|
||||
<color name="colorAccent">#AEEA00</color>
|
||||
<color name="colorPrimaryDark">#087f23</color>
|
||||
<color name="colorSecondary">#AEEA00</color>
|
||||
<color name="navigationBarColor">@android:color/black</color>
|
||||
</resources>
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorAccent">@color/colorAccent</item>
|
||||
<style name="Theme.MaterialComponents.DayNight.NoActionBar" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||
<item name="android:navigationBarColor">@color/navigationBarColor</item>
|
||||
<item name="android:windowLightNavigationBar" tools:ignore="NewApi">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
<item name="colorSecondary">@color/colorSecondary</item>
|
||||
</style>
|
||||
|
||||
<!-- https://android.googlesource.com/platform/packages/apps/Settings/+/7efcc35/res/values/styles.xml -->
|
||||
<style name="wifi_item">
|
||||
<item name="android:layout_marginTop">8dip</item>
|
||||
|
||||
Reference in New Issue
Block a user