[M] Refactor, Cleanup,...

This commit is contained in:
soraefir
2024-04-03 01:32:02 +02:00
parent 3ea1a86590
commit 4fd4eff258
72 changed files with 16777 additions and 6726 deletions

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:theme="@style/Theme.Beendroid"
android:theme="@style/Theme.Beans"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.tabs.TabLayout
@ -15,21 +15,4 @@
android:layout_height="0dp"
android:layout_weight="1" />
<!-- <androidx.core.widget.NestedScrollView-->
<!-- android:id="@+id/sv"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:scrollbars="vertical">-->
<!-- <androidx.recyclerview.widget.RecyclerView-->
<!-- android:id="@+id/list"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:nestedScrollingEnabled="false"-->
<!-- android:scrollbars="vertical" />-->
<!-- </androidx.core.widget.NestedScrollView>-->
</LinearLayout>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:theme="@style/Theme.Beendroid"
android:theme="@style/Theme.Beans"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:theme="@style/Theme.Beendroid"
android:theme="@style/Theme.Beans"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.SettingsActivity">

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:theme="@style/Theme.Beendroid"
android:theme="@style/Theme.Beans"
android:layout_width="match_parent"
android:layout_height="match_parent">

View File

@ -49,7 +49,7 @@
android:layout_marginBottom="15dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:text="@string/beendroid_is_foss"
android:text="@string/beans_is_foss"
android:textAlignment="center" />
<TextView
@ -60,7 +60,7 @@
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:autoLink="web"
android:text="@string/beendroid_repo"
android:text="@string/beans_repo"
android:textAlignment="center" />
</LinearLayout>

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-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">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/addGroup"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="32dp"
android:layout_marginEnd="32dp"
android:layout_weight="1"
android:contentDescription="TODO" android:text="@string/group_add"
android:src="@drawable/add"
android:backgroundTint="@color/blue"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -6,13 +6,14 @@
android:orientation="vertical"
android:padding="16dp">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/group_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="48dp"
android:autofillHints=""
android:hint="@string/name"
android:inputType="text"
android:autofillHints="" />
android:inputType="text" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -22,11 +23,11 @@
android:id="@+id/colorView"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/black"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/colorR"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/black"/>
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.slider.Slider
@ -64,24 +65,61 @@
app:trackColorActive="@color/blue" />
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.textview.MaterialTextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:labelFor="@id/group_color"
android:text="@string/hashtag"/>
android:text="@string/hashtag" />
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/group_color"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="48dp"
android:autofillHints=""
android:hint="@string/color_rrggbb"
android:inputType="text"
android:maxLength="6" />
</LinearLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/delete"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/cancel"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/btnOk"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnOk"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/ok"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -1,17 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout 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" >
<LinearLayout
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/groups_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</ScrollView>
android:layout_height="wrap_content" />
</ScrollView>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp">
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btnClear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/clear"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>

View File

@ -51,26 +51,6 @@
app:layout_constraintTop_toTopOf="@id/textView"
app:layout_constraintVertical_bias="0.5" />
<LinearLayout
android:id="@+id/sub_item"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="24dp"
android:orientation="vertical"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/checkBox">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_list"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:scrollbars="vertical" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,7 +1,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="net.helcel.beendroid.activity.MainActivity" >
tools:context="net.helcel.beans.activity.MainActivity" >
<item
android:id="@+id/action_edit"

View File

@ -1,13 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="entries_theme" >
<string-array name="entries_theme">
<item>@string/system</item>
<item>@string/light</item>
<item>@string/dark</item>
</string-array>
<string-array name="entries_stats" >
<string-array name="entries_stats">
<item>@string/counters</item>
<item>@string/percentages</item>
</string-array>
<string-array name="entries_onoff">
<item>@string/on</item>
<item>@string/off</item>
</string-array>
</resources>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">BeenDroid</string>
<string name="app_name">Beans</string>
<string name="app_version">1.0</string>
<string name="action_settings">Settings</string>
<string name="action_stat">Stats</string>
@ -13,16 +13,25 @@
<string name="counters">Prefer counters (#)</string>
<string name="percentages">Prefer percentages (%)</string>
<string name="licenses">Licenses</string>
<string name="key_group">Groups</string>
<string name="key_regional">Regional</string>
<string name="about">About</string>
<string name="beendroid_is_foss">BeenDroid is free and open source software, licensed under the GNU General Public License (version 3 or later)</string>
<string name="beendroid_repo">Project repository: https://git.helcel.net/helcel/beendroid\n Feel free to report issues or contribute to the project.</string>
<string name="beans_is_foss">Beans is free and open source software, licensed under the GNU General Public License (version 3 or later)</string>
<string name="beans_repo">Project repository: https://git.helcel.net/helcel/beans\n Feel free to report issues or contribute to the project.</string>
<string name="foss_licenses">Free and open source dependencies and licenses</string>
<string name="about_beendroid">About the BeenDroid application</string>
<string name="about_beans">About the Beans application</string>
<string name="delete_group">Are your sure you want to delete this group and remove all its country mappings?</string>
<string name="group_add">Add</string>
<string name="add">Add</string>
<string name="clear">Clear</string>
<string name="logo">Logo</string>
<string name="name">Name</string>
<string name="rate">%1$d/%2$d</string>
<string name="percentage">%1$d&#65285;</string>
<string name="color_rrggbb">RRGGBB</string>
<string name="hashtag">#</string>
<string name="on">On</string>
<string name="off">Off</string>
<string name="delete">Delete</string>
<string name="cancel">Cancel</string>
<string name="ok">Ok</string>
</resources>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="hashtag">#</string>
</resources>

View File

@ -1,5 +1,5 @@
<resources>
<style name="Theme.Beendroid" parent="Theme.Material3.DayNight">
<style name="Theme.Beans" parent="Theme.Material3.DayNight">
<item name="colorPrimary">@color/blue</item>
<item name="background">@color/darkgray</item>
<item name="android:colorPrimary">?attr/colorPrimary</item>

View File

@ -1,41 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@style/Theme.Beendroid">
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:theme="@style/Theme.Beans">
<ListPreference
app:defaultValue="@string/off"
app:enabled="true"
app:key="@string/key_theme"
app:icon="@drawable/palette"
app:title="@string/key_theme"
app:useSimpleSummaryProvider="true"
app:entries="@array/entries_theme"
app:entryValues="@array/entries_theme"
app:defaultValue="@string/system" />
app:entries="@array/entries_onoff"
app:entryValues="@array/entries_onoff"
app:icon="@drawable/edit"
app:key="@string/key_group"
app:title="@string/key_group"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="@string/off"
app:enabled="true"
app:entries="@array/entries_onoff"
app:entryValues="@array/entries_onoff"
app:icon="@drawable/edit"
app:key="@string/key_regional"
app:title="@string/key_regional"
app:useSimpleSummaryProvider="true" />
<ListPreference
app:defaultValue="@string/counters"
app:enabled="true"
app:key="@string/key_stats"
app:icon="@drawable/stats"
app:title="@string/key_stats"
app:useSimpleSummaryProvider="true"
app:entries="@array/entries_stats"
app:entryValues="@array/entries_stats"
app:defaultValue="@string/counters" />
app:icon="@drawable/stats"
app:key="@string/key_stats"
app:title="@string/key_stats"
app:useSimpleSummaryProvider="true" />
<Preference
android:summary="@string/foss_licenses"
app:enabled="true"
app:key="@string/licenses"
app:icon="@drawable/licenses"
app:title="@string/licenses"
android:summary="@string/foss_licenses"/>
app:key="@string/licenses"
app:title="@string/licenses" />
<Preference
android:summary="@string/about_beans"
app:enabled="true"
app:key="@string/about"
app:icon="@drawable/about"
app:title="@string/about"
android:summary="@string/about_beendroid"/>
app:key="@string/about"
app:title="@string/about" />
</PreferenceScreen>