Skip to content

Commit

Permalink
Use icons and align buttons on the main activity
Browse files Browse the repository at this point in the history
fixes #339
  • Loading branch information
TrianguloY committed Sep 26, 2024
1 parent 381f598 commit 9441b14
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 38 deletions.
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/about.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="@color/app"
android:pathData="M11,7h2v2h-2zM11,11h2v6h-2zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />

</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/module.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="@color/app"
android:pathData="M10.5,4.5c0.28,0 0.5,0.22 0.5,0.5v2h6v6h2c0.28,0 0.5,0.22 0.5,0.5s-0.22,0.5 -0.5,0.5h-2v6h-2.12c-0.68,-1.75 -2.39,-3 -4.38,-3s-3.7,1.25 -4.38,3H4v-2.12c1.75,-0.68 3,-2.39 3,-4.38 0,-1.99 -1.24,-3.7 -2.99,-4.38L4,7h6V5c0,-0.28 0.22,-0.5 0.5,-0.5m0,-2C9.12,2.5 8,3.62 8,5H4c-1.1,0 -1.99,0.9 -1.99,2v3.8h0.29c1.49,0 2.7,1.21 2.7,2.7s-1.21,2.7 -2.7,2.7H2V20c0,1.1 0.9,2 2,2h3.8v-0.3c0,-1.49 1.21,-2.7 2.7,-2.7s2.7,1.21 2.7,2.7v0.3H17c1.1,0 2,-0.9 2,-2v-4c1.38,0 2.5,-1.12 2.5,-2.5S20.38,11 19,11V7c0,-1.1 -0.9,-2 -2,-2h-4c0,-1.38 -1.12,-2.5 -2.5,-2.5z" />

</vector>
11 changes: 11 additions & 0 deletions app/src/main/res/drawable/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">

<path
android:fillColor="@color/app"
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98 0,-0.34 -0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.09,-0.16 -0.26,-0.25 -0.44,-0.25 -0.06,0 -0.12,0.01 -0.17,0.03l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.06,-0.02 -0.12,-0.03 -0.18,-0.03 -0.17,0 -0.34,0.09 -0.43,0.25l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98 0,0.33 0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.09,0.16 0.26,0.25 0.44,0.25 0.06,0 0.12,-0.01 0.17,-0.03l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.06,0.02 0.12,0.03 0.18,0.03 0.17,0 0.34,-0.09 0.43,-0.25l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM17.45,11.27c0.04,0.31 0.05,0.52 0.05,0.73 0,0.21 -0.02,0.43 -0.05,0.73l-0.14,1.13 0.89,0.7 1.08,0.84 -0.7,1.21 -1.27,-0.51 -1.04,-0.42 -0.9,0.68c-0.43,0.32 -0.84,0.56 -1.25,0.73l-1.06,0.43 -0.16,1.13 -0.2,1.35h-1.4l-0.19,-1.35 -0.16,-1.13 -1.06,-0.43c-0.43,-0.18 -0.83,-0.41 -1.23,-0.71l-0.91,-0.7 -1.06,0.43 -1.27,0.51 -0.7,-1.21 1.08,-0.84 0.89,-0.7 -0.14,-1.13c-0.03,-0.31 -0.05,-0.54 -0.05,-0.74s0.02,-0.43 0.05,-0.73l0.14,-1.13 -0.89,-0.7 -1.08,-0.84 0.7,-1.21 1.27,0.51 1.04,0.42 0.9,-0.68c0.43,-0.32 0.84,-0.56 1.25,-0.73l1.06,-0.43 0.16,-1.13 0.2,-1.35h1.39l0.19,1.35 0.16,1.13 1.06,0.43c0.43,0.18 0.83,0.41 1.23,0.71l0.91,0.7 1.06,-0.43 1.27,-0.51 0.7,1.21 -1.07,0.85 -0.89,0.7 0.14,1.13zM12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM12,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z" />

</vector>
82 changes: 44 additions & 38 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,47 +61,53 @@
android:padding="@dimen/smallPadding"
android:text="@string/sample_url" />

<Button
style="?android:attr/buttonBarButtonStyle"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:layout_weight="1"
android:drawableStart="@android:drawable/ic_menu_sort_by_size"
android:drawableLeft="@android:drawable/ic_menu_sort_by_size"
android:drawablePadding="@dimen/smallPadding"
android:onClick="openModulesActivity"
android:paddingLeft="@dimen/padding"
android:paddingRight="@dimen/padding"
android:text="@string/a_modules" />
android:layout_height="match_parent"
android:orientation="vertical">

<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/smallPadding"
android:layout_weight="1"
android:drawableStart="@android:drawable/ic_menu_preferences"
android:drawableLeft="@android:drawable/ic_menu_preferences"
android:drawablePadding="@dimen/smallPadding"
android:onClick="openSettings"
android:paddingLeft="@dimen/padding"
android:paddingRight="@dimen/padding"
android:text="@string/a_settings" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/padding"
android:layout_weight="1"
android:drawableStart="@drawable/module"
android:drawableLeft="@drawable/module"
android:drawablePadding="@dimen/smallPadding"
android:onClick="openModulesActivity"
android:paddingLeft="@dimen/padding"
android:paddingRight="@dimen/padding"
android:text="@string/a_modules" />

<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/smallPadding"
android:layout_weight="1"
android:drawableStart="@android:drawable/ic_menu_info_details"
android:drawableLeft="@android:drawable/ic_menu_info_details"
android:drawablePadding="@dimen/smallPadding"
android:onClick="openAbout"
android:paddingLeft="@dimen/padding"
android:paddingRight="@dimen/padding"
android:text="@string/a_about" />
<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/smallPadding"
android:layout_weight="1"
android:drawableStart="@drawable/settings"
android:drawableLeft="@drawable/settings"
android:drawablePadding="@dimen/smallPadding"
android:onClick="openSettings"
android:paddingLeft="@dimen/padding"
android:paddingRight="@dimen/padding"
android:text="@string/a_settings" />

<Button
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/smallPadding"
android:layout_weight="1"
android:drawableStart="@drawable/about"
android:drawableLeft="@drawable/about"
android:drawablePadding="@dimen/smallPadding"
android:onClick="openAbout"
android:paddingLeft="@dimen/padding"
android:paddingRight="@dimen/padding"
android:text="@string/a_about" />
</LinearLayout>

</LinearLayout>
</ScrollView>

0 comments on commit 9441b14

Please sign in to comment.