Skip to content

Commit

Permalink
v1.2.2
Browse files Browse the repository at this point in the history
• Fixed the spacing between Positive and Negative buttons when added programatically.
  • Loading branch information
kishannareshpal committed Dec 11, 2018
1 parent bfa7256 commit 434a6aa
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "v1.2.1"
versionName "v1.2.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
4 changes: 2 additions & 2 deletions superdialog/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.kishannareshpal'
version = 'v1.2.1'
version = 'v1.2.2'

android {
compileSdkVersion 28
Expand All @@ -12,7 +12,7 @@ android {
minSdkVersion 17
targetSdkVersion 28
versionCode 1
versionName "v1.2.1"
versionName "v1.2.2"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
changeMessageGravity(gravity);

// Add space between positive and negative button when both are visible.
if (negativeText != null && positiveText != null){
space.setVisibility(View.VISIBLE);
}
addSpaceBetweenButtons();

// Setup Positive Button
changePositiveText(positiveText);
Expand Down Expand Up @@ -254,6 +252,13 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c



// Setup Space between buttons
private void addSpaceBetweenButtons(){
if (negativeText != null && positiveText != null){
space.setVisibility(View.VISIBLE);
}
}

// Setup Cancelable
private void changeCancelable(boolean cancelable){
setCancelable(cancelable);
Expand All @@ -265,6 +270,12 @@ private void changePositiveText(String positiveText){
btn_positive.setVisibility(View.VISIBLE);
btn_positive.setText(positiveText);

if (negativeText != null){
space.setVisibility(View.VISIBLE);
} else {
space.setVisibility(View.GONE);
}

} else {
btn_positive.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -309,6 +320,13 @@ private void changeNegativeText(String negativeText){
if (negativeText != null){
btn_negative.setVisibility(View.VISIBLE);
btn_negative.setText(negativeText);

if (positiveText != null){
space.setVisibility(View.VISIBLE);
} else {
space.setVisibility(View.GONE);
}

} else {
btn_negative.setVisibility(View.GONE);
}
Expand Down

0 comments on commit 434a6aa

Please sign in to comment.