Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
Redesign edittext dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
AnGgIt86 committed Sep 28, 2024
1 parent 97bdd77 commit dab99e6
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
18 changes: 18 additions & 0 deletions app/src/main/res/drawable/uwu_bg_dialog_edittext.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<stroke
android:width="1.5dip"
android:color="?attr/colorPrimary" />
<corners
android:radius="8.0dip" />
<padding
android:left="8.0dip"
android:top="8.0dip"
android:right="8.0dip"
android:bottom="8.0dip" />
</shape>
</item>
</layer-list>
35 changes: 35 additions & 0 deletions app/src/main/res/layout/uwu_dialog_edittext.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="48.0dip"
android:layout_marginBottom="48.0dip"
android:overScrollMode="ifContentScrolls">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:textColor="?android:textColorSecondary"
android:id="@android:id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24.0dip"
android:layout_marginRight="24.0dip"
android:layout_marginBottom="48.0dip"
android:layout_marginStart="24.0dip"
android:layout_marginEnd="24.0dip"
style="?android:textAppearanceSmall" />
<EditText
android:background="@drawable/uwu_bg_dialog_edittext"
android:id="@android:id/edit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20.0dip"
android:layout_marginRight="20.0dip"
android:layout_marginTop="8.0dip"
android:minHeight="48.0dip"
android:layout_marginStart="20.0dip"
android:layout_marginEnd="20.0dip" />
</LinearLayout>
</ScrollView>
1 change: 1 addition & 0 deletions app/src/main/res/values-night/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<item name="colorText">@color/colorText_ActionBar</item>
<item name="colorBg">@color/uwu_bg</item>
<item name="changelogStyle">@style/LibChangelog</item>
<item name="editTextPreferenceStyle">@style/AppTheme.EditTextPreference</item>
<item name="elevation">0.0dip</item>
<item name="materialAlertDialogTheme">@style/Uwu.Material3.MaterialAlertDialog</item>
<item name="navigationViewStyle">@style/Widget.MaterialComponents.NavigationView</item>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<item name="colorText">@color/colorText_ActionBar</item>
<item name="colorBg">?attr/colorSurfaceVariant</item>
<item name="changelogStyle">@style/LibChangelog</item>
<item name="editTextPreferenceStyle">@style/AppTheme.EditTextPreference</item>
<item name="elevation">0.0dip</item>
<item name="materialAlertDialogTheme">@style/Uwu.Material3.MaterialAlertDialog</item>
<item name="navigationViewStyle">@style/Widget.MaterialComponents.NavigationView</item>
Expand Down Expand Up @@ -253,4 +254,9 @@
<item name="bottomSheetStyle">@style/Widget.Material3.BottomSheet.Modal</item>
<item name="enableEdgeToEdge">true</item>
</style>

<style name="AppTheme.EditTextPreference" parent="@style/Preference.DialogPreference.EditTextPreference.Material">
<item name="dialogLayout">@layout/uwu_dialog_edittext</item>
<item name="iconSpaceReserved">false</item>
</style>
</resources>

0 comments on commit dab99e6

Please sign in to comment.