Skip to content

Commit

Permalink
Some v2 design changes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscgdev committed Nov 7, 2020
1 parent 2a3a3bd commit d34cd25
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 7 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class MainActivity : AppCompatActivity() {
private fun createAndShowDialog() {
val useNewDialogStyle = newStyleCheckBox.isChecked

val dialogSheet = DialogSheet(this@MainActivity, useNewDialogStyle)
val dialogSheet = DialogSheet(this@MainActivity, useNewDialogStyle) // you can also use DialogSheet2 if you want the new style
//.setNewDialogStyle() // You can also set new style by this method, but put it on the first line
.setTitle(R.string.app_name)
.setMessage(R.string.lorem)
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="dialog_sheet_test_dimen">21dp</dimen>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import com.marcoscg.dialogsheet.Utils.orDefault
/**
* Created by @MarcosCGdev on 01/12/2017.
*/
class DialogSheet(private val context: Context, private var useNewStyle: Boolean = false) {
open class DialogSheet(private val context: Context, private var useNewStyle: Boolean = false) {

private var bottomSheetDialog: ExpandedBottomSheetDialog? = null
private var roundedCorners = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.marcoscg.dialogsheet

import android.content.Context

class DialogSheet2(context: Context) : DialogSheet(context, true)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="32dp" android:drawable="@drawable/dialog_sheet_main_background"/>
<item android:top="36dp" android:drawable="@drawable/dialog_sheet_main_background"/>
</layer-list>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="32dp" android:drawable="@drawable/dialog_sheet_main_background_round"/>
<item android:top="36dp" android:drawable="@drawable/dialog_sheet_main_background_round"/>
</layer-list>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
android:textColor="#000000"
android:ellipsize="end"
android:gravity="center_horizontal"
style="@style/TextAppearance.AppCompat.Title"
android:textSize="22sp"
tools:text="Title"
android:layout_marginBottom="12dp"
android:visibility="gone"/>
Expand All @@ -75,7 +75,7 @@
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:textColor="#757575"
style="@style/TextAppearance.AppCompat.Subhead"
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
tools:text="Looooooooooooooooong and loooooooong message here."
android:visibility="gone"/>

Expand Down Expand Up @@ -109,7 +109,9 @@
android:layout_marginStart="8dp"
android:layout_marginRight="24dp"
android:layout_marginEnd="24dp"
android:textAllCaps="false"
android:letterSpacing="0"
android:textSize="@dimen/dialog_sheet_button_text_size"
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
style="@style/Widget.MaterialComponents.Button.TextButton"/>

Expand All @@ -127,7 +129,9 @@
android:layout_marginStart="24dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:textAllCaps="false"
android:letterSpacing="0"
android:textSize="@dimen/dialog_sheet_button_text_size"
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
style="@style/Widget.MaterialComponents.Button.TextButton"/>

Expand All @@ -143,7 +147,9 @@
android:layout_marginBottom="20dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:textAllCaps="false"
android:letterSpacing="0"
android:textSize="@dimen/dialog_sheet_button_text_size"
android:textAppearance="@style/TextAppearance.MaterialComponents.Button"
style="@style/Widget.MaterialComponents.Button"/>

Expand Down
4 changes: 3 additions & 1 deletion dialogsheet/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
<resources>
<dimen name="dialog_sheet_corner_radius">16dp</dimen>
<dimen name="dialog_sheet_icon_size">56dp</dimen>
<dimen name="dialog_sheet_v2_icon_size">64dp</dimen>
<dimen name="dialog_sheet_v2_icon_size">60dp</dimen>
<dimen name="dialog_sheet_test_dimen">16dp</dimen>
<dimen name="dialog_sheet_button_text_size">15sp</dimen>
</resources>
10 changes: 10 additions & 0 deletions dialogsheet/src/main/res/values/public.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Attrs -->
<public type="attr" name="dialogSheetAccent" />

<!-- Dimens -->
<public type="dimen" name="dialog_sheet_corner_radius" />
<public type="dimen" name="dialog_sheet_icon_size" />
<public type="dimen" name="dialog_sheet_v2_icon_size" />
</resources>
Binary file modified screenshots/sc_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d34cd25

Please sign in to comment.