mirror of
https://github.com/jrpie/Launcher.git
synced 2025-04-19 02:10:54 +02:00
Clean up code in the Settings Activity
Extract all strings to the resource files (helpful for translations in the future), Move and simplify functions.
This commit is contained in:
parent
9e3cac35ae
commit
b8d1880fbc
4 changed files with 118 additions and 92 deletions
|
@ -11,7 +11,7 @@
|
|||
android:id="@+id/heading"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Settings"
|
||||
android:text="@string/settings_title"
|
||||
android:textColor="#cccccc"
|
||||
android:textSize="36sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -24,7 +24,7 @@
|
|||
android:id="@+id/sub_head_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Applications"
|
||||
android:text="@string/settings_sub_title1"
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
@ -54,7 +54,9 @@
|
|||
android:id="@+id/text_up"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Swipe Up"
|
||||
android:paddingLeft="10sp"
|
||||
android:paddingRight="10sp"
|
||||
android:text="@string/settings_choose_up"
|
||||
android:textColor="#ccc"
|
||||
android:textSize="24sp" />
|
||||
|
||||
|
@ -64,7 +66,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:alpha=".8"
|
||||
android:onClick="chooseUpApp"
|
||||
android:text="Choose App" />
|
||||
android:text="@string/settings_choose_btn" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
|
@ -75,7 +77,9 @@
|
|||
android:id="@+id/text_down"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Swipe Down"
|
||||
android:paddingLeft="10sp"
|
||||
android:paddingRight="10sp"
|
||||
android:text="@string/settings_choose_down"
|
||||
android:textColor="#ccc"
|
||||
android:textSize="24sp" />
|
||||
|
||||
|
@ -85,7 +89,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:alpha=".8"
|
||||
android:onClick="chooseDownApp"
|
||||
android:text="Choose App" />
|
||||
android:text="@string/settings_choose_btn" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
|
@ -97,7 +101,9 @@
|
|||
android:id="@+id/text_left"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Swipe Left"
|
||||
android:paddingLeft="10sp"
|
||||
android:paddingRight="10sp"
|
||||
android:text="@string/settings_choose_left"
|
||||
android:textColor="#ccc"
|
||||
android:textSize="24sp" />
|
||||
|
||||
|
@ -107,7 +113,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:alpha=".8"
|
||||
android:onClick="chooseLeftApp"
|
||||
android:text="Choose App" />
|
||||
android:text="@string/settings_choose_btn" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
|
@ -118,7 +124,9 @@
|
|||
android:id="@+id/text_right"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Swipe Right"
|
||||
android:paddingLeft="10sp"
|
||||
android:paddingRight="10sp"
|
||||
android:text="@string/settings_choose_right"
|
||||
android:textColor="#ccc"
|
||||
android:textSize="24sp" />
|
||||
|
||||
|
@ -128,7 +136,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:alpha=".8"
|
||||
android:onClick="chooseRightApp"
|
||||
android:text="Choose App" />
|
||||
android:text="@string/settings_choose_btn" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
|
@ -140,7 +148,9 @@
|
|||
android:id="@+id/text_vol_up"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Volume Up"
|
||||
android:paddingLeft="10sp"
|
||||
android:paddingRight="10sp"
|
||||
android:text="@string/settings_choose_vol_up"
|
||||
android:textColor="#ccc"
|
||||
android:textSize="24sp" />
|
||||
|
||||
|
@ -150,7 +160,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:alpha=".8"
|
||||
android:onClick="chooseVolumeUpApp"
|
||||
android:text="Choose App" />
|
||||
android:text="@string/settings_choose_btn" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
|
@ -161,7 +171,9 @@
|
|||
android:id="@+id/text_vol_down"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Volume Down "
|
||||
android:paddingLeft="10sp"
|
||||
android:paddingRight="10sp"
|
||||
android:text="@string/settings_choose_vol_down"
|
||||
android:textColor="#ccc"
|
||||
android:textSize="24sp" />
|
||||
|
||||
|
@ -171,7 +183,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:alpha=".8"
|
||||
android:onClick="chooseVolumeDownApp"
|
||||
android:text="Choose App" />
|
||||
android:text="@string/settings_choose_btn" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
|
@ -181,7 +193,7 @@
|
|||
android:id="@+id/sub_head_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Actions"
|
||||
android:text="@string/settings_sub_title2"
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp"
|
||||
app:layout_constraintBottom_toBottomOf="@id/buttons"
|
||||
|
@ -193,7 +205,7 @@
|
|||
|
||||
<TableLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
@ -207,18 +219,20 @@
|
|||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
style="@style/Widget.AppCompat.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha=".3"
|
||||
android:onClick="setLauncher"
|
||||
android:text="Select Launcher" />
|
||||
android:text="@string/settings_select_launcher" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.AppCompat.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha=".3"
|
||||
android:onClick="resetSettingsClick"
|
||||
android:text="Reset Settings" />
|
||||
android:text="@string/settings_reset" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
|
@ -228,18 +242,20 @@
|
|||
android:gravity="center">
|
||||
|
||||
<Button
|
||||
style="@style/Widget.AppCompat.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha=".3"
|
||||
android:onClick="chooseLaunchApp"
|
||||
android:text="Launch Apps" />
|
||||
android:text="@string/settings_launch" />
|
||||
|
||||
<Button
|
||||
style="@style/Widget.AppCompat.Button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:alpha=".3"
|
||||
android:onClick="chooseUninstallApp"
|
||||
android:text="Uninstall Apps" />
|
||||
android:text="@string/settings_uninstall" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
|
@ -252,57 +268,53 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="backHome"
|
||||
android:text="Back Home" />
|
||||
android:text="@string/settings_home" />
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
<TableLayout
|
||||
android:id="@+id/about_footer"
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/actionschooser"
|
||||
app:layout_constraintVertical_bias="0.9">
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.95">
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/settings_footer_by"
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="By "
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="openFinnWebsite"
|
||||
android:text=" Finn M Glas"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="openFinnWebsite"
|
||||
android:text="Finn M Glas"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textSize="18sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" | "
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text=" | "
|
||||
android:textColor="#999"
|
||||
android:textSize="18sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="openGithubRepo"
|
||||
android:text="Open Source"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textSize="18sp" />
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="openGithubRepo"
|
||||
android:text="Open Source"
|
||||
android:textColor="?attr/colorAccent"
|
||||
android:textSize="18sp"
|
||||
tools:ignore="HardcodedText" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
Loading…
Add table
Add a link
Reference in a new issue