Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
MarsadMaqsood committed Jan 23, 2022
1 parent e1543b8 commit 164ca4b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Stylish Alert Dialogs for Android.
<url>https://jitpack.io</url>
</repository>
</repositories>

<dependency>
<groupId>com.github.MarsadMaqsood</groupId>
<artifactId>StylishDialogs</artifactId>
Expand Down Expand Up @@ -64,7 +64,7 @@ pDialog.setTitleText("Loading")
.setCancellable(false)
//.setCancelledOnTouchOutside(false)
.show();

```
---
**Kotlin**
Expand All @@ -75,7 +75,7 @@ pDialog.setTitleText("Loading")
.setCancellable(false)
//.setCancelledOnTouchOutside(false)
.show()

```


Expand Down Expand Up @@ -107,7 +107,7 @@ getButton(/*StylishAlertDialog.Button)Type*/)
getButton(/*StylishAlertDialog.Button)Type*/).setBackgroundTintList()
setCancellable(boolean cancellable)
setCancelledOnTouchOutside(boolean cancelledOnTouchOutside)

setCustomView(View view, boolean withContent)
```
thanks to the project [materialish-progress](https://github.com/pnikosis/materialish-progress)

Expand All @@ -120,7 +120,7 @@ Simple basic message:
new StylishAlertDialog(this)
.setTitleText("Here's a message!")
.show();
```
```
___
**Kotlin**
```kotlin
Expand All @@ -136,7 +136,7 @@ Title with a text under:
.setTitleText("Here's a message!")
.setContentText("It's pretty, isn't it?")
.show();
```
```
___
**Kotlin**
```kotlin
Expand All @@ -161,7 +161,7 @@ Error message:
.setTitleText("Oops...")
.setContentText("Something went wrong!")
.show()
```
```

Warning message:

Expand Down Expand Up @@ -208,7 +208,7 @@ Message with a custom icon:
.setContentText("Here's a custom image.")
.setCustomImage(R.drawable.custom_img)
.show();
```
```
---
**Kotlin**
```kotlin
Expand Down Expand Up @@ -292,7 +292,7 @@ Disable button
.changeAlertType(StylishAlertDialog.SUCCESS);
}
}).show();

```
---
**Kotlin**
Expand Down Expand Up @@ -347,7 +347,7 @@ Disable button
.changeAlertType(StylishAlertDialog.SUCCESS)
}
.show()
```
```

**Proguard-Rules**
```pro
Expand All @@ -360,7 +360,7 @@ Disable button
## License

The MIT License (MIT)

Copyright (c) 2021 Marsad Maqsood

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand All @@ -369,10 +369,10 @@ Disable button
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down
7 changes: 3 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
buildToolsVersion "32.0.0"

defaultConfig {
applicationId "com.marsad.stylishdialogs"
Expand All @@ -31,11 +31,10 @@ android {

dependencies {

implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation project(path: ':stylishdialogs')
implementation "androidx.multidex:multidex:2.0.1"
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ protected void onCreate(Bundle savedInstanceState) {
.setConfirmButton("Dismiss", StylishAlertDialog::dismissWithAnimation)
.show()


);

findViewById(R.id.successMsgDialog)
Expand Down
2 changes: 1 addition & 1 deletion stylishdialogs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ android {

dependencies {
implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.4.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class StylishAlertDialog extends Dialog implements View.OnClickListener {
private boolean mHideKeyBoardOnDismiss = true;
private int contentTextSize = 0;
private float strokeWidth = 0;
private boolean isWithContent;

public StylishAlertDialog(Context context) {
this(context, NORMAL);
Expand Down Expand Up @@ -208,7 +209,7 @@ protected void onCreate(Bundle savedInstanceState) {

setTitleText(mTitleText);
setContentText(mContentText);
setCustomView(mCustomView);
setCustomView(mCustomView, isWithContent);
setCancelText(mCancelText);
setConfirmText(mConfirmText);
setNeutralText(mNeutralText);
Expand Down Expand Up @@ -680,12 +681,13 @@ protected void onStart() {
*
* @param view
*/
public StylishAlertDialog setCustomView(View view) {
public StylishAlertDialog setCustomView(View view, boolean withContent) {
isWithContent = withContent;
mCustomView = view;
if (mCustomView != null && mCustomViewContainer != null) {
mCustomViewContainer.addView(view);
mCustomViewContainer.setVisibility(View.VISIBLE);
mContentTextView.setVisibility(View.GONE);
mContentTextView.setVisibility(withContent ? View.VISIBLE : View.GONE);
}
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private void init() {
@Override
public void draw(Canvas canvas) {
super.draw(canvas);
// todo: changed int to float
// todo: changed int to float
float totalW = getWidth();
float totalH = getHeight();
// rotate canvas first
Expand Down

0 comments on commit 164ca4b

Please sign in to comment.