Moved development codes from DevCodeSheet.kt to a (by default) hidden section of SettingsFragment.kt; added further information about the build in that section

This commit is contained in:
denizk0461
2023-05-13 19:31:27 +02:00
parent 7ed230b4b9
commit 2798e0ecbb
9 changed files with 390 additions and 199 deletions
@@ -0,0 +1,6 @@
<vector android:height="24dp" android:tint="#000000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M6.41,6l-1.41,1.41l4.58,4.59l-4.58,4.59l1.41,1.41l6,-6z"/>
<path android:fillColor="@android:color/white" android:pathData="M13,6l-1.41,1.41l4.58,4.59l-4.58,4.59l1.41,1.41l6,-6z"/>
</vector>
+153 -1
View File
@@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context=".fragment.SettingsFragment"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
@@ -37,7 +38,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp">
android:paddingBottom="8dp"
android:animateLayoutChanges="true">
<!-- Stud.IP schedule settings -->
<com.google.android.material.card.MaterialCardView
@@ -262,6 +264,7 @@
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/settings_allergens_title_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
@@ -269,6 +272,7 @@
android:textSize="16sp" />
<TextView
android:id="@+id/settings_allergens_subtitle_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_allergens_subtitle"
@@ -595,6 +599,154 @@
</com.google.android.material.card.MaterialCardView>
<!-- development settings -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/card_experimental_settings"
style="@style/Widget.Material3.CardView.Outlined"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="8dp"
android:layout_marginVertical="4dp">
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="8dp"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_experimental"
android:textSize="22sp" />
<com.google.android.material.divider.MaterialDivider
style="@style/DividerTheme"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"/>
<!-- Hide experiments -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_hide_experiments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_hide_experiments_title"
android:textSize="16sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_hide_experiments_subtitle"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Build time -->
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/button_build_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_build_time"
android:textSize="16sp" />
<TextView
android:id="@+id/build_time_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp" />
</androidx.appcompat.widget.LinearLayoutCompat>
<!-- Dev codes -->
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/selectable_item_background"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/lato_bolditalic"
android:text="@string/settings_dev_codes_title"
android:textSize="16sp" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="4"
android:layout_marginEnd="8dp"
android:hint="@string/settings_dev_codes_hint">
<com.google.android.material.textfield.TextInputEditText
style="@style/Widget.Material3.TextInputEditText.OutlinedBox"
android:maxLines="1"
android:maxLength="6"
android:id="@+id/input_dev_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:fontFamily="@font/ibm_regular"
android:inputType="textNoSuggestions"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
style="@style/Widget.Material3.Button.IconButton.Outlined"
android:id="@+id/button_dev_codes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="0dp"
app:icon="@drawable/double_arrow_right"
app:iconPadding="0dp"
app:strokeColor="?attr/colorOutlineVariant"
app:iconTint="?attr/colorOnSurfaceVariant"/>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.appcompat.widget.LinearLayoutCompat>
</com.google.android.material.card.MaterialCardView>
</androidx.appcompat.widget.LinearLayoutCompat>
</androidx.core.widget.NestedScrollView>
+3
View File
@@ -169,6 +169,7 @@
<string name="settings_schedule">Stud.IP-Stundenplan</string>
<string name="settings_canteen">Mensenangebote</string>
<string name="settings_misc">Sonstiges</string>
<string name="settings_experimental">Experimentelles</string>
<string name="refresh_schedule_title">Aktualisiere deinen Stud.IP-Stundenplan</string>
<string name="refresh_schedule_subtitle">Dies wird alle Anpassungen löschen!</string>
@@ -194,6 +195,8 @@
<string name="settings_allergens_title">Markiere Angebote mit Allergenen mit einem Stern*</string>
<string name="settings_allergens_subtitle">Wird auch für Zusatzstoffe genutzt</string>
<string name="settings_allergens_title_alt">App entwickelt von denizk0461</string>
<string name="settings_allergens_subtitle_alt">Danke, dass du meine App nutzt ☺︎♡</string>
<string name="settings_launch_canteen_title">Wähle, mit welchem Bildschirm die App startet</string>
+15
View File
@@ -173,6 +173,7 @@
<string name="settings_schedule">Stud.IP Schedule</string>
<string name="settings_canteen">Canteen Offers</string>
<string name="settings_misc">Miscellaneous</string>
<string name="settings_experimental">Experimental</string>
<string name="refresh_schedule_title">Refresh your Stud.IP schedule</string>
<string name="refresh_schedule_subtitle">This will clear any customisations!</string>
@@ -198,6 +199,8 @@
<string name="settings_allergens_title">Mark offers with allergens with a star*</string>
<string name="settings_allergens_subtitle">Also applies to additives</string>
<string name="settings_allergens_title_alt">App developed by denizk0461</string>
<string name="settings_allergens_subtitle_alt">Thank you for using my app ☺︎♡</string>
<string name="settings_pref_colour_title">Colour dietary preferences</string>
<string name="settings_pref_colour_subtitle">Icons will be coloured similarly to how they look the website</string> <!-- TODO this text sucks, DE too -->
@@ -215,11 +218,23 @@
<string name="settings_licences_title">View licences</string>
<string name="settings_licences_subtitle">Resources that made this app possible</string>
<string name="settings_unlocked_experiments" translatable="false">Experimental settings have been unlocked.</string>
<string name="settings_hide_experiments" translatable="false">Experimental settings have been hidden.</string>
<string name="sheet_cheat_header" translatable="false">Cheat Codes</string>
<string name="settings_app_version">App Version</string>
<string name="settings_hide_experiments_title" translatable="false">Hide experimental settings</string>
<string name="settings_hide_experiments_subtitle" translatable="false">Show them again via licences button</string>
<string name="settings_build_time" translatable="false">Gradle build code &amp; time</string>
<string name="settings_dev_codes_title" translatable="false">Development codes</string>
<string name="settings_dev_codes_hint" translatable="false">6 chars</string>
<string name="settings_dev_codes_button" translatable="false"></string>
<string name="settings_dev_codes_invalid" translatable="false">This code could not be found.</string>
<string name="settings_app_version_15">keep clicking</string>
<string name="settings_app_version_20" translatable="false">^_^</string>
<string name="settings_app_version_30" translatable="false">^_____^</string>