Skip to content

Commit d1ad489

Browse files
committed
Version 2.0.7
1 parent 06d8ac1 commit d1ad489

File tree

4 files changed

+24
-31
lines changed

4 files changed

+24
-31
lines changed

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 206
10-
versionName "2.0.6"
9+
versionCode 207
10+
versionName "2.0.7"
1111
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1212
}
1313
buildTypes {

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

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,12 @@ protected void onCreate(Bundle savedInstanceState) {
2323
findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
2424
@Override
2525
public void onClick(View view) {
26-
2726
createAndShowDialog();
28-
2927
}
3028
});
3129
}
3230

3331
private void createAndShowDialog() {
34-
3532
DialogSheet dialogSheet = new DialogSheet(MainActivity.this)
3633
.setTitle(R.string.app_name)
3734
.setMessage(R.string.lorem)
@@ -46,9 +43,7 @@ public void onClick(View view) {
4643
.setNegativeButton(android.R.string.cancel, null)
4744
.setNeutralButton("Neutral", null);
4845

49-
50-
if (((AppCompatCheckBox)findViewById(R.id.customViewCheckBox)).isChecked()) {
51-
46+
if (((AppCompatCheckBox) findViewById(R.id.customViewCheckBox)).isChecked()) {
5247
dialogSheet.setView(R.layout.custom_dialog_view);
5348

5449
// Access dialog custom inflated view
@@ -62,14 +57,13 @@ public void onClick(View view) {
6257
});
6358
}
6459

65-
if (!((AppCompatCheckBox)findViewById(R.id.cornersCheckBox)).isChecked())
60+
if (!((AppCompatCheckBox) findViewById(R.id.cornersCheckBox)).isChecked())
6661
dialogSheet.setRoundedCorners(false);
6762

68-
if (((AppCompatCheckBox)findViewById(R.id.iconCheckBox)).isChecked())
63+
if (((AppCompatCheckBox) findViewById(R.id.iconCheckBox)).isChecked())
6964
dialogSheet.setIconResource(R.mipmap.ic_launcher);
7065

7166
dialogSheet.show();
72-
7367
}
7468

7569
@Override
@@ -80,12 +74,11 @@ public boolean onCreateOptionsMenu(Menu menu) {
8074

8175
@Override
8276
public boolean onOptionsItemSelected(MenuItem item) {
83-
switch (item.getItemId()) {
84-
case R.id.action_github:
85-
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/marcoscgdev/DialogSheet")));
86-
return true;
87-
default:
88-
return super.onOptionsItemSelected(item);
77+
if (item.getItemId() == R.id.action_github) {
78+
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/marcoscgdev/DialogSheet")));
79+
return true;
8980
}
81+
82+
return super.onOptionsItemSelected(item);
9083
}
9184
}

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 206
9-
versionName "2.0.6"
8+
versionCode 207
9+
versionName "2.0.7"
1010
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1111

1212
}

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ public DialogSheet setIconResource(@DrawableRes int icon) {
124124
}
125125

126126
/**
127-
* @deprecated use {@link #setIconDrawable(Drawable)} instead.
128127
* @param icon
129128
* @return
129+
* @deprecated use {@link #setIconDrawable(Drawable)} instead.
130130
*/
131131
@Deprecated
132132
public DialogSheet setIcon(Drawable icon) {
@@ -136,9 +136,9 @@ public DialogSheet setIcon(Drawable icon) {
136136
}
137137

138138
/**
139-
* @deprecated use {@link #setIconBitmap(Bitmap)} instead.
140139
* @param icon
141140
* @return
141+
* @deprecated use {@link #setIconBitmap(Bitmap)} instead.
142142
*/
143143
@Deprecated
144144
public DialogSheet setIcon(Bitmap icon) {
@@ -148,9 +148,9 @@ public DialogSheet setIcon(Bitmap icon) {
148148
}
149149

150150
/**
151-
* @deprecated use {@link #setIconResource(int)} instead.
152151
* @param iconRes
153152
* @return
153+
* @deprecated use {@link #setIconResource(int)} instead.
154154
*/
155155
@Deprecated
156156
public DialogSheet setIcon(@DrawableRes int iconRes) {
@@ -383,9 +383,9 @@ public View getInflatedView() {
383383
}
384384

385385
public void show() {
386-
if (backgroundColor==0)
386+
if (backgroundColor == 0)
387387
backgroundColor = Utils.getAttrColor(context, android.R.attr.windowBackground);
388-
if (backgroundColor!=0) {
388+
if (backgroundColor != 0) {
389389
Drawable bgDrawable = null;
390390
View bgView = bottomSheetDialog.findViewById(R.id.mainDialogContainer);
391391
if (bgView != null)
@@ -395,9 +395,9 @@ public void show() {
395395
bgDrawable.setColorFilter(backgroundColor, PorterDuff.Mode.SRC_IN);
396396
}
397397

398-
if (titleTextColor==0)
398+
if (titleTextColor == 0)
399399
titleTextColor = Utils.getTextColor(backgroundColor);
400-
if (messageTextColor==0)
400+
if (messageTextColor == 0)
401401
messageTextColor = Utils.getTextColorSec(backgroundColor);
402402

403403
titleTextView.setTextColor(titleTextColor);
@@ -406,7 +406,7 @@ public void show() {
406406
setColoredNavBar(coloredNavigationBar);
407407

408408
if (positiveButton.getVisibility() != View.VISIBLE)
409-
((RelativeLayout.LayoutParams)negativeButton.getLayoutParams()).addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
409+
((RelativeLayout.LayoutParams) negativeButton.getLayoutParams()).addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
410410

411411
if (!areButtonsVisible()) {
412412
int bottomPadding = 0;
@@ -419,11 +419,11 @@ public void show() {
419419
topPadding = dpToPx(24);
420420
}
421421

422-
textContainer.setPadding(0,topPadding,0, bottomPadding);
422+
textContainer.setPadding(0, topPadding, 0, bottomPadding);
423423
} else {
424424
if ((titleTextView.getText() == null || TextUtils.isEmpty(titleTextView.getText()))
425425
&& messageTextView.getText() != null && !TextUtils.isEmpty(messageTextView.getText()))
426-
textContainer.setPadding(0,dpToPx(24),0, 0);
426+
textContainer.setPadding(0, dpToPx(24), 0, 0);
427427
}
428428

429429
bottomSheetDialog.show();
@@ -486,7 +486,7 @@ private void setColoredNavBar(boolean coloredNavigationBar) {
486486

487487
if (Build.VERSION.SDK_INT >= 26) {
488488
int flags = bottomSheetDialog.getWindow().getDecorView().getSystemUiVisibility();
489-
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
489+
flags &= ~View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
490490
bottomSheetDialog.getWindow().getDecorView().setSystemUiVisibility(flags);
491491
}
492492
}
@@ -499,7 +499,7 @@ private boolean areButtonsVisible() {
499499
}
500500

501501
private void removePreviousMessageViews() {
502-
for (int i=1; i < messageContainer.getChildCount(); i++) {
502+
for (int i = 1; i < messageContainer.getChildCount(); i++) {
503503
messageContainer.removeViewAt(i);
504504
}
505505
}

0 commit comments

Comments
 (0)