Skip to content

Commit d34cd25

Browse files
committed
Some v2 design changes
1 parent 2a3a3bd commit d34cd25

File tree

11 files changed

+34
-7
lines changed

11 files changed

+34
-7
lines changed
0 Bytes
Binary file not shown.

app/src/main/java/com/marcoscg/dialogsheetsample/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class MainActivity : AppCompatActivity() {
2626
private fun createAndShowDialog() {
2727
val useNewDialogStyle = newStyleCheckBox.isChecked
2828

29-
val dialogSheet = DialogSheet(this@MainActivity, useNewDialogStyle)
29+
val dialogSheet = DialogSheet(this@MainActivity, useNewDialogStyle) // you can also use DialogSheet2 if you want the new style
3030
//.setNewDialogStyle() // You can also set new style by this method, but put it on the first line
3131
.setTitle(R.string.app_name)
3232
.setMessage(R.string.lorem)

app/src/main/res/values/dimens.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<dimen name="dialog_sheet_test_dimen">21dp</dimen>
4+
</resources>

dialogsheet/src/main/java/com/marcoscg/dialogsheet/DialogSheet.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import com.marcoscg.dialogsheet.Utils.orDefault
3535
/**
3636
* Created by @MarcosCGdev on 01/12/2017.
3737
*/
38-
class DialogSheet(private val context: Context, private var useNewStyle: Boolean = false) {
38+
open class DialogSheet(private val context: Context, private var useNewStyle: Boolean = false) {
3939

4040
private var bottomSheetDialog: ExpandedBottomSheetDialog? = null
4141
private var roundedCorners = true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.marcoscg.dialogsheet
2+
3+
import android.content.Context
4+
5+
class DialogSheet2(context: Context) : DialogSheet(context, true)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item android:top="32dp" android:drawable="@drawable/dialog_sheet_main_background"/>
3+
<item android:top="36dp" android:drawable="@drawable/dialog_sheet_main_background"/>
44
</layer-list>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item android:top="32dp" android:drawable="@drawable/dialog_sheet_main_background_round"/>
3+
<item android:top="36dp" android:drawable="@drawable/dialog_sheet_main_background_round"/>
44
</layer-list>

dialogsheet/src/main/res/layout/layout_dialog_sheet_content_v2.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
android:textColor="#000000"
5050
android:ellipsize="end"
5151
android:gravity="center_horizontal"
52-
style="@style/TextAppearance.AppCompat.Title"
52+
android:textSize="22sp"
5353
tools:text="Title"
5454
android:layout_marginBottom="12dp"
5555
android:visibility="gone"/>
@@ -75,7 +75,7 @@
7575
android:layout_marginLeft="24dp"
7676
android:layout_marginRight="24dp"
7777
android:textColor="#757575"
78-
style="@style/TextAppearance.AppCompat.Subhead"
78+
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
7979
tools:text="Looooooooooooooooong and loooooooong message here."
8080
android:visibility="gone"/>
8181

@@ -109,7 +109,9 @@
109109
android:layout_marginStart="8dp"
110110
android:layout_marginRight="24dp"
111111
android:layout_marginEnd="24dp"
112+
android:textAllCaps="false"
112113
android:letterSpacing="0"
114+
android:textSize="@dimen/dialog_sheet_button_text_size"
113115
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
114116
style="@style/Widget.MaterialComponents.Button.TextButton"/>
115117

@@ -127,7 +129,9 @@
127129
android:layout_marginStart="24dp"
128130
android:layout_marginRight="8dp"
129131
android:layout_marginEnd="8dp"
132+
android:textAllCaps="false"
130133
android:letterSpacing="0"
134+
android:textSize="@dimen/dialog_sheet_button_text_size"
131135
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
132136
style="@style/Widget.MaterialComponents.Button.TextButton"/>
133137

@@ -143,7 +147,9 @@
143147
android:layout_marginBottom="20dp"
144148
android:layout_marginRight="16dp"
145149
android:layout_marginEnd="16dp"
150+
android:textAllCaps="false"
146151
android:letterSpacing="0"
152+
android:textSize="@dimen/dialog_sheet_button_text_size"
147153
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
148154
style="@style/Widget.MaterialComponents.Button"/>
149155

dialogsheet/src/main/res/values/dimens.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
<resources>
33
<dimen name="dialog_sheet_corner_radius">16dp</dimen>
44
<dimen name="dialog_sheet_icon_size">56dp</dimen>
5-
<dimen name="dialog_sheet_v2_icon_size">64dp</dimen>
5+
<dimen name="dialog_sheet_v2_icon_size">60dp</dimen>
6+
<dimen name="dialog_sheet_test_dimen">16dp</dimen>
7+
<dimen name="dialog_sheet_button_text_size">15sp</dimen>
68
</resources>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Attrs -->
4+
<public type="attr" name="dialogSheetAccent" />
5+
6+
<!-- Dimens -->
7+
<public type="dimen" name="dialog_sheet_corner_radius" />
8+
<public type="dimen" name="dialog_sheet_icon_size" />
9+
<public type="dimen" name="dialog_sheet_v2_icon_size" />
10+
</resources>

0 commit comments

Comments
 (0)