Skip to content

Commit 869d947

Browse files
committed
Version 2.0.9
Some bugs fixed and text size support
1 parent d742d9a commit 869d947

File tree

9 files changed

+153
-12
lines changed

9 files changed

+153
-12
lines changed
2 Bytes
Binary file not shown.

.idea/caches/gradle_models.ser

19.9 KB
Binary file not shown.

.idea/codeStyles/Project.xml

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "com.marcoscg.dialogsheetsample"
77
minSdkVersion 14
88
targetSdkVersion 28
9-
versionCode 208
10-
versionName "2.0.8"
9+
versionCode 209
10+
versionName "2.0.9"
1111
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
jcenter()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.4.1'
9+
classpath 'com.android.tools.build:gradle:3.5.3'
1010

1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files

dialogsheet/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ android {
55
defaultConfig {
66
minSdkVersion 14
77
targetSdkVersion 28
8-
versionCode 208
9-
versionName "2.0.8"
8+
versionCode 209
9+
versionName "2.0.9"
1010
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1111

1212
}

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import android.support.v7.widget.AppCompatImageView;
2222
import android.support.v7.widget.AppCompatTextView;
2323
import android.text.TextUtils;
24+
import android.util.TypedValue;
2425
import android.view.View;
2526
import android.view.WindowManager;
2627
import android.widget.LinearLayout;
@@ -363,8 +364,29 @@ public DialogSheet setMessageTypeface(Typeface typeface) {
363364
}
364365

365366
public DialogSheet setButtonsTypeface(Typeface typeface) {
367+
positiveButton.setTypeface(typeface);
366368
negativeButton.setTypeface(typeface);
367-
negativeButton.setTypeface(typeface);
369+
neutralButton.setTypeface(typeface);
370+
371+
return this;
372+
}
373+
374+
public DialogSheet setTitleTextSize(int sizeSp) {
375+
titleTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, sizeSp);
376+
377+
return this;
378+
}
379+
380+
public DialogSheet setMessageTextSize(int sizeSp) {
381+
messageTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, sizeSp);
382+
383+
return this;
384+
}
385+
386+
public DialogSheet setButtonsTextSize(int sizeSp) {
387+
positiveButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, sizeSp);
388+
negativeButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, sizeSp);
389+
neutralButton.setTextSize(TypedValue.COMPLEX_UNIT_SP, sizeSp);
368390

369391
return this;
370392
}
@@ -471,9 +493,9 @@ private void init(Context context) {
471493
int posButtonTextColor = Color.WHITE;
472494

473495
if (accentColor != -1) {
474-
bottomSheetDialog = new ExpandedBottomSheetDialog(context, R.style.DialogSheetTheme);
496+
bottomSheetDialog = new ExpandedBottomSheetDialog(context, R.style.DialogSheetTheme_Colored);
475497
posButtonTextColor = Utils.getTextColor(accentColor);
476-
} else bottomSheetDialog = new ExpandedBottomSheetDialog(context);
498+
} else bottomSheetDialog = new ExpandedBottomSheetDialog(context, R.style.DialogSheetTheme);
477499

478500
bottomSheetDialog.setContentView(R.layout.layout_bottomdialog);
479501

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22

33
<style name="DialogSheetTheme" parent="Theme.MaterialComponents.Light.BottomSheetDialog">
4-
<item name="colorPrimary">?dialogSheetAccent</item>
5-
<item name="colorAccent">?dialogSheetAccent</item>
64
<item name="android:windowIsFloating">false</item>
75
<item name="android:colorBackground">@android:color/transparent</item>
86
<item name="android:statusBarColor" tools:targetApi="21">@android:color/transparent</item>
97
</style>
108

9+
<style name="DialogSheetTheme.Colored" parent="DialogSheetTheme">
10+
<item name="colorPrimary">?dialogSheetAccent</item>
11+
<item name="colorAccent">?dialogSheetAccent</item>
12+
</style>
13+
1114
</resources>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Apr 19 15:29:42 CEST 2019
1+
#Fri Dec 20 17:48:23 CET 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

0 commit comments

Comments
 (0)