Currently changing the app's colours. fuck i spent so much time changing the fucking status bar colour. like stackoverflow is so damn outdated on this topic

This commit is contained in:
denizk0461
2023-04-13 19:21:53 +02:00
parent fb50711d36
commit 3a2d444956
12 changed files with 114 additions and 41 deletions
@@ -21,6 +21,8 @@ class SettingsFragment : Fragment() {
private val binding get() = _binding!! private val binding get() = _binding!!
private var appVersionClick = 0 private var appVersionClick = 0
private var isQuarterChecked = false
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
_binding = FragmentSettingsBinding.inflate(inflater, container, false) _binding = FragmentSettingsBinding.inflate(inflater, container, false)
return binding.root return binding.root
@@ -29,9 +31,18 @@ class SettingsFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
val toast2 = Toast.makeText(context, "2", Toast.LENGTH_SHORT) var toast2 = makeToast("2")
val toast22 = Toast.makeText(context, "22", Toast.LENGTH_SHORT) var toast22 = makeToast("22")
val toast222 = Toast.makeText(context, "222", Toast.LENGTH_SHORT) var toast222 = makeToast("222")
// binding.layoutQuarter.setOnClickListener {
// isQuarterChecked = !isQuarterChecked
// binding.switchQuarter.isChecked = isQuarterChecked
// }
binding.switchQuarter.setOnClickListener {
isQuarterChecked = !isQuarterChecked
}
binding.buttonAppVersion.setOnClickListener { binding.buttonAppVersion.setOnClickListener {
when (appVersionClick) { when (appVersionClick) {
@@ -51,6 +62,9 @@ class SettingsFragment : Fragment() {
} }
22 -> { 22 -> {
toast222.cancel() toast222.cancel()
toast2 = makeToast("2")
toast22 = makeToast("22")
toast222 = makeToast("222")
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Misc.mysteryLink))) startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Misc.mysteryLink)))
appVersionClick = 0 appVersionClick = 0
} }
@@ -61,6 +75,8 @@ class SettingsFragment : Fragment() {
binding.appVersionText.text = BuildConfig.VERSION_NAME binding.appVersionText.text = BuildConfig.VERSION_NAME
} }
private fun makeToast(text: String): Toast = Toast.makeText(context, text, Toast.LENGTH_SHORT)
override fun onDestroyView() { override fun onDestroyView() {
super.onDestroyView() super.onDestroyView()
_binding = null _binding = null
+5
View File
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true" android:color="?attr/colorText" />
<item android:color="?attr/colorTextHint" />
</selector>
+2 -1
View File
@@ -2,7 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="?attr/colorBackground">
<WebView <WebView
android:id="@+id/webview" android:id="@+id/webview"
+4 -2
View File
@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"> app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:background="?attr/colorBackground">
<com.google.android.material.appbar.AppBarLayout <com.google.android.material.appbar.AppBarLayout
android:id="@+id/toolbar" android:id="@+id/toolbar"
@@ -12,7 +13,8 @@
android:fitsSystemWindows="true" android:fitsSystemWindows="true"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"> app:layout_constraintEnd_toEndOf="parent"
android:background="?attr/colorBackground">
<TextView <TextView
android:id="@+id/app_title_bar" android:id="@+id/app_title_bar"
+1 -1
View File
@@ -5,7 +5,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".fragment.EventFragment" tools:context=".fragment.EventFragment"
android:background="?android:colorBackground"> android:background="?attr/colorBackground">
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/day_tab_layout" android:id="@+id/day_tab_layout"
+1 -1
View File
@@ -2,6 +2,6 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?android:colorBackground"> android:background="?attr/colorBackground">
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
+27 -6
View File
@@ -3,8 +3,9 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".fragment.SettingsFragment" tools:context=".fragment.SettingsFragment"
android:background="?android:colorBackground"> android:background="?attr/colorBackground">
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent" android:layout_width="match_parent"
@@ -40,15 +41,24 @@
android:layout_marginHorizontal="16dp"/> android:layout_marginHorizontal="16dp"/>
<!-- Academic quarter --> <!-- Academic quarter -->
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_quarter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<!-- android:clickable="true"-->
<!-- android:focusable="true"-->
<!-- android:background="@drawable/layout_ripple"-->
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:background="@drawable/layout_ripple"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
android:clickable="true" app:layout_constraintTop_toTopOf="parent"
android:focusable="true" app:layout_constraintStart_toStartOf="parent"
android:paddingHorizontal="16dp" app:layout_constraintBottom_toBottomOf="parent">
android:paddingVertical="8dp">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -65,6 +75,17 @@
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>
<com.google.android.material.materialswitch.MaterialSwitch
android:id="@+id/switch_quarter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:thumbTint="@color/switch_thumb"/>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- App version --> <!-- App version -->
<androidx.appcompat.widget.LinearLayoutCompat <androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_app_version" android:id="@+id/button_app_version"
+18 -5
View File
@@ -2,15 +2,28 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Base.Theme.StudIPTimetable" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Base.Theme.StudIPTimetable" parent="Theme.Material3.DayNight.NoActionBar">
<!-- colour --> <item name="android:textColor">?attr/colorText</item>
<item name="colorPrimary">@color/primaryLight</item> <item name="android:windowBackground">@color/colorBackgroundNight</item>
<item name="rippleColor">@color/primaryLight</item>
<item name="colorNavHighlight">@color/highlightLight</item> <!-- colour -->
<item name="colorPrimary">@color/primaryNight</item>
<item name="rippleColor">@color/primaryNight</item>
<item name="colorNavHighlight">@color/highlightNight</item>
<!-- <item name="colorPrimaryOnContrast">@color/colorPrimaryOnContrastDark</item>--> <!-- <item name="colorPrimaryOnContrast">@color/colorPrimaryOnContrastDark</item>-->
<item name="colorText">@color/colorTextNight</item>
<item name="colorTextHint">@color/colorTextHintNight</item>
<item name="colorBackground">@color/colorBackgroundNight</item>
</style> </style>
<style name="NavigationViewItemIndicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator"> <style name="NavigationViewItemIndicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
<item name="android:color">@color/primaryLight</item> <item name="android:color">@color/primaryNight</item>
</style>
<style name="SelectableItemTheme">
<!-- <item name="colorControlHighlight">?attr/colorPrimary</item>-->
<item name="colorControlHighlight">@color/primaryNight</item>
</style> </style>
</resources> </resources>
+3
View File
@@ -2,4 +2,7 @@
<resources> <resources>
<attr name="colorNavHighlight" format="color" /> <attr name="colorNavHighlight" format="color" />
<attr name="colorPrimaryOnContrast" format="color" /> <attr name="colorPrimaryOnContrast" format="color" />
<attr name="colorText" format="color" />
<attr name="colorTextHint" format="color" />
<attr name="colorBackground" format="color" />
</resources> </resources>
+13 -4
View File
@@ -6,11 +6,20 @@
<!-- <color name="primaryLight">#0F4759</color>--> <!-- <color name="primaryLight">#0F4759</color>-->
<!-- <color name="primaryDark">#62CCE4</color>--> <!-- <color name="primaryDark">#62CCE4</color>-->
<color name="primaryDark">#B82729</color> <color name="primaryDay">#B82729</color>
<color name="primaryLight">#B2665A</color> <color name="primaryNight">#B2665A</color>
<color name="highlightDark">#871D1E</color> <color name="highlightDay">#871D1E</color>
<color name="highlightLight">#CB9890</color> <color name="highlightNight">#CB9890</color>
<color name="colorTextDay">#CB9890</color> // TODO
<color name="colorTextNight">#CDCBCB</color>
<color name="colorTextHintDay">#CB9890</color> // TODO
<color name="colorTextHintNight">#B9B6B6</color>
<color name="colorBackgroundDay">#151414</color> // TODO
<color name="colorBackgroundNight">#151414</color>
<!-- <color name="colorPrimaryOnContrastLight">#E6898B</color>--> <!-- <color name="colorPrimaryOnContrastLight">#E6898B</color>-->
<!-- <color name="colorPrimaryOnContrastDark">#B77166</color>--> <!-- <color name="colorPrimaryOnContrastDark">#B77166</color>-->
+2 -2
View File
@@ -14,7 +14,7 @@
<string name="friday">FRIDAY</string> <string name="friday">FRIDAY</string>
<string name="title_schedule">Your Schedule</string> <string name="title_schedule">Your Schedule</string>
<string name="title_food">Canteen Plans</string> <string name="title_food">Canteen Offers</string>
<string name="title_settings">App Settings</string> <string name="title_settings">App Settings</string>
<string name="nav_schedule">Schedule</string> <string name="nav_schedule">Schedule</string>
@@ -30,7 +30,7 @@
<string name="settings_quarter_subtitle">Where applicable</string> <string name="settings_quarter_subtitle">Where applicable</string>
<string name="settings_app_version">App Version</string> <string name="settings_app_version">App Version</string>
<string name="with_love">with ♡️ from Osterholz\nMade by Deniz \\__*</string> <string name="with_love">with ♡️ from Bremen-Osterholz\nmade by denizk0461 \\__*</string>
<string name="lorem_ipsum"> <string name="lorem_ipsum">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in scelerisque sem. Mauris Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in scelerisque sem. Mauris
+8 -5
View File
@@ -2,25 +2,28 @@
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="Base.Theme.StudIPTimetable" parent="Theme.Material3.DayNight.NoActionBar"> <style name="Base.Theme.StudIPTimetable" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:textColor">?attr/colorText</item>
<item name="android:windowBackground">@color/colorBackgroundDay</item>
<!-- customisation --> <!-- customisation -->
<item name="fontFamily">@font/lato_regular</item> <item name="fontFamily">@font/lato_regular</item>
<!-- colour --> <!-- colour -->
<item name="colorPrimary">@color/primaryDark</item> <item name="colorPrimary">@color/primaryDay</item>
<item name="rippleColor">@color/primaryDark</item> <item name="rippleColor">@color/primaryDay</item>
<item name="colorNavHighlight">@color/highlightDark</item> <item name="colorNavHighlight">@color/highlightDay</item>
<!-- <item name="colorPrimaryOnContrast">@color/colorPrimaryOnContrastLight</item>--> <!-- <item name="colorPrimaryOnContrast">@color/colorPrimaryOnContrastLight</item>-->
</style> </style>
<style name="Theme.StudIPTimetable" parent="Base.Theme.StudIPTimetable" /> <style name="Theme.StudIPTimetable" parent="Base.Theme.StudIPTimetable" />
<style name="NavigationViewItemIndicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator"> <style name="NavigationViewItemIndicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
<item name="android:color">@color/primaryDark</item> <item name="android:color">@color/primaryDay</item>
</style> </style>
<style name="SelectableItemTheme"> <style name="SelectableItemTheme">
<!-- <item name="colorControlHighlight">?attr/colorPrimary</item>--> <!-- <item name="colorControlHighlight">?attr/colorPrimary</item>-->
<item name="colorControlHighlight">@color/primaryLight</item> <item name="colorControlHighlight">@color/primaryDay</item>
</style> </style>
</resources> </resources>