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 var appVersionClick = 0
private var isQuarterChecked = false
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
_binding = FragmentSettingsBinding.inflate(inflater, container, false)
return binding.root
@@ -29,9 +31,18 @@ class SettingsFragment : Fragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val toast2 = Toast.makeText(context, "2", Toast.LENGTH_SHORT)
val toast22 = Toast.makeText(context, "22", Toast.LENGTH_SHORT)
val toast222 = Toast.makeText(context, "222", Toast.LENGTH_SHORT)
var toast2 = makeToast("2")
var toast22 = makeToast("22")
var toast222 = makeToast("222")
// binding.layoutQuarter.setOnClickListener {
// isQuarterChecked = !isQuarterChecked
// binding.switchQuarter.isChecked = isQuarterChecked
// }
binding.switchQuarter.setOnClickListener {
isQuarterChecked = !isQuarterChecked
}
binding.buttonAppVersion.setOnClickListener {
when (appVersionClick) {
@@ -51,6 +62,9 @@ class SettingsFragment : Fragment() {
}
22 -> {
toast222.cancel()
toast2 = makeToast("2")
toast22 = makeToast("22")
toast222 = makeToast("222")
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(Misc.mysteryLink)))
appVersionClick = 0
}
@@ -61,6 +75,8 @@ class SettingsFragment : Fragment() {
binding.appVersionText.text = BuildConfig.VERSION_NAME
}
private fun makeToast(text: String): Toast = Toast.makeText(context, text, Toast.LENGTH_SHORT)
override fun onDestroyView() {
super.onDestroyView()
_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"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="?attr/colorBackground">
<WebView
android:id="@+id/webview"
+4 -2
View File
@@ -3,7 +3,8 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="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
android:id="@+id/toolbar"
@@ -12,7 +13,8 @@
android:fitsSystemWindows="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent">
app:layout_constraintEnd_toEndOf="parent"
android:background="?attr/colorBackground">
<TextView
android:id="@+id/app_title_bar"
+1 -1
View File
@@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragment.EventFragment"
android:background="?android:colorBackground">
android:background="?attr/colorBackground">
<com.google.android.material.tabs.TabLayout
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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?android:colorBackground">
android:background="?attr/colorBackground">
</androidx.constraintlayout.widget.ConstraintLayout>
+38 -17
View File
@@ -3,8 +3,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".fragment.SettingsFragment"
android:background="?android:colorBackground">
android:background="?attr/colorBackground">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
@@ -40,30 +41,50 @@
android:layout_marginHorizontal="16dp"/>
<!-- Academic quarter -->
<androidx.appcompat.widget.LinearLayoutCompat
android:background="@drawable/layout_ripple"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/layout_quarter"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:clickable="true"
android:focusable="true"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
<!-- android:clickable="true"-->
<!-- android:focusable="true"-->
<!-- android:background="@drawable/layout_ripple"-->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_quarter_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_quarter_subtitle"/>
</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"
android:textSize="16sp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_quarter_title"/>
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:thumbTint="@color/switch_thumb"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:text="@string/settings_quarter_subtitle"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- App version -->
<androidx.appcompat.widget.LinearLayoutCompat
+18 -5
View File
@@ -2,15 +2,28 @@
<!-- Base application theme. -->
<style name="Base.Theme.StudIPTimetable" parent="Theme.Material3.DayNight.NoActionBar">
<!-- colour -->
<item name="colorPrimary">@color/primaryLight</item>
<item name="rippleColor">@color/primaryLight</item>
<item name="android:textColor">?attr/colorText</item>
<item name="android:windowBackground">@color/colorBackgroundNight</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="colorText">@color/colorTextNight</item>
<item name="colorTextHint">@color/colorTextHintNight</item>
<item name="colorBackground">@color/colorBackgroundNight</item>
</style>
<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>
</resources>
+3
View File
@@ -2,4 +2,7 @@
<resources>
<attr name="colorNavHighlight" format="color" />
<attr name="colorPrimaryOnContrast" format="color" />
<attr name="colorText" format="color" />
<attr name="colorTextHint" format="color" />
<attr name="colorBackground" format="color" />
</resources>
+13 -4
View File
@@ -6,11 +6,20 @@
<!-- <color name="primaryLight">#0F4759</color>-->
<!-- <color name="primaryDark">#62CCE4</color>-->
<color name="primaryDark">#B82729</color>
<color name="primaryLight">#B2665A</color>
<color name="primaryDay">#B82729</color>
<color name="primaryNight">#B2665A</color>
<color name="highlightDark">#871D1E</color>
<color name="highlightLight">#CB9890</color>
<color name="highlightDay">#871D1E</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="colorPrimaryOnContrastDark">#B77166</color>-->
+2 -2
View File
@@ -14,7 +14,7 @@
<string name="friday">FRIDAY</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="nav_schedule">Schedule</string>
@@ -30,7 +30,7 @@
<string name="settings_quarter_subtitle">Where applicable</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">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam in scelerisque sem. Mauris
+8 -5
View File
@@ -2,25 +2,28 @@
<!-- Base application theme. -->
<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 -->
<item name="fontFamily">@font/lato_regular</item>
<!-- colour -->
<item name="colorPrimary">@color/primaryDark</item>
<item name="rippleColor">@color/primaryDark</item>
<item name="colorPrimary">@color/primaryDay</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>-->
</style>
<style name="Theme.StudIPTimetable" parent="Base.Theme.StudIPTimetable" />
<style name="NavigationViewItemIndicator" parent="Widget.Material3.BottomNavigationView.ActiveIndicator">
<item name="android:color">@color/primaryDark</item>
<item name="android:color">@color/primaryDay</item>
</style>
<style name="SelectableItemTheme">
<!-- <item name="colorControlHighlight">?attr/colorPrimary</item>-->
<item name="colorControlHighlight">@color/primaryLight</item>
<item name="colorControlHighlight">@color/primaryDay</item>
</style>
</resources>