Skip to content

Commit 93cb21a

Browse files
fullscreen dialog
fullscreen or normal dialog window added
1 parent 0b290d3 commit 93cb21a

File tree

10 files changed

+26
-55
lines changed

10 files changed

+26
-55
lines changed

.idea/caches/gradle_models.ser

178 KB
Binary file not shown.

.idea/gradle.xml

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

.idea/misc.xml

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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Provides you easily create various pop-up dialogs that you can use.
4646
cancelable(boolean bool) // set cancelable to fast-dialog
4747
decimalEditText() // set EditText to decimalEditText
4848
setTextMaxLenght(int lenght) // set EditText max lenght
49+
setFullScreen(boolean bool) // set fullscreen to dialog window. default true
4950
changeColor(int colorButtonsAndTitle,int colorButtonsAndTitleText,int colorPrimaryText) // change fast-dialog colors
5051
setInputText(String str) // set EditText input
5152
//Animations

app/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,5 @@ dependencies {
2222
implementation fileTree(include: ['*.jar'], dir: 'libs')
2323
implementation 'com.android.support:appcompat-v7:28.0.0'
2424
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
25-
testImplementation 'junit:junit:4.12'
26-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
27-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
2825
implementation project(':fastdialog')
2926
}

app/src/main/java/ka/enes/com/sample/MainActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public void err(View view){
3131
FastDialog.e(this)
3232
.setText("Error Dialog")
3333
.hideTitle()
34+
.setFullScreen(false)
3435
.create()
3536
.show();
3637
}
@@ -85,7 +86,7 @@ public void onClick(View view) {
8586
dialog.dismissListener(new DismissListener() {
8687
@Override
8788
public void onDismiss(DialogInterface dialog) {
88-
FastDialog.i(MainActivity.this).setText("Closed").create().show();
89+
FastDialog.i(MainActivity.this).setText("Closed").setFullScreen(false).create().show();
8990
}
9091
});
9192
dialog.show();

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.2.1'
10+
classpath 'com.android.tools.build:gradle:3.3.0'
1111

1212

1313
// NOTE: Do not place your application dependencies here; they belong

fastdialog/build.gradle

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,5 @@ android {
2626

2727
dependencies {
2828
implementation fileTree(dir: 'libs', include: ['*.jar'])
29-
testImplementation 'junit:junit:4.12'
30-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
31-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
3229
implementation "com.airbnb.android:lottie:2.7.0"
3330
}

fastdialog/src/main/java/karpuzoglu/enes/com/fastdialog/FastDialogBuilder.java

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public class FastDialogBuilder {
3636
private NegativeClick negativeClick;
3737
private DismissListener dismissListener;
3838
private boolean isDecimal = false;
39+
private boolean fullScreen = true;
3940
private Type type;
4041

4142

@@ -44,23 +45,17 @@ public FastDialogBuilder(@NonNull Context context,@NonNull Type dialogType){
4445
this.type = dialogType;
4546
createDialog(dialogType);
4647
}
48+
public FastDialogBuilder setFullScreen(boolean set){
49+
fullScreen = set;
50+
return this;
51+
}
4752
private FastDialogBuilder createDialog(Type type){
4853
dialog =new Dialog(context);
4954
if (type == Type.PROGRESS){
5055
dialog.setContentView(R.layout.progress_dialog);
51-
WindowManager.LayoutParams lWindowParams = new WindowManager.LayoutParams();
52-
lWindowParams.copyFrom(getDialog().getWindow().getAttributes());
53-
lWindowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
54-
lWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
55-
dialog.getWindow().setAttributes(lWindowParams);
5656
tvProgress = dialog.findViewById(R.id.wait_text);
5757
}else{
5858
dialog.setContentView(R.layout.warning_dialog);
59-
WindowManager.LayoutParams lWindowParams = new WindowManager.LayoutParams();
60-
lWindowParams.copyFrom(getDialog().getWindow().getAttributes());
61-
lWindowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
62-
lWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
63-
dialog.getWindow().setAttributes(lWindowParams);
6459
tvTitle = dialog.findViewById(R.id.warning_dialog_title);
6560
lawWarning = dialog.findViewById(R.id.warning_dialog_animation);
6661
tvWarning = dialog.findViewById(R.id.warning_dialog_text);
@@ -251,6 +246,13 @@ public FastDialogBuilder setTextMaxLenght(int lenght){
251246
return this;
252247
}
253248
public FastDialog create(){
249+
if (fullScreen){
250+
WindowManager.LayoutParams lWindowParams = new WindowManager.LayoutParams();
251+
lWindowParams.copyFrom(getDialog().getWindow().getAttributes());
252+
lWindowParams.width = WindowManager.LayoutParams.MATCH_PARENT;
253+
lWindowParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
254+
dialog.getWindow().setAttributes(lWindowParams);
255+
}
254256
return new FastDialog(this);
255257
}
256258
public Dialog getDialog(){
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Tue Feb 05 13:18:45 EET 2019
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

0 commit comments

Comments
 (0)