Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add SetTitleTextSize, SetContentTextSize, SetButtonsTextSize and SetTypeface #208

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
eb72495
Gradle update & added gitignore file
F0RIS Mar 22, 2017
275a6ee
Moved improvement from another project
F0RIS Mar 22, 2017
691fe6e
Added ability to set buttons stroke. Refactored & improved sample. Ad…
F0RIS Mar 22, 2017
d1d7cc0
Added sample with custom view, minor fixes. Updated README
F0RIS Mar 22, 2017
7ac5464
Update README.md
F0RIS Mar 23, 2017
94836d3
Updated dependecy for maven repository
F0RIS Mar 29, 2017
c3c8ff6
Changed info for maven. Release 1.5
F0RIS Mar 29, 2017
0f34066
Minor fix & Release 1.5.1
F0RIS Apr 18, 2017
ae801fe
Fixed issue #10
F0RIS Oct 7, 2017
b4d2371
Added ability to hide confirm button
F0RIS Oct 7, 2017
8f846f8
Release 1.5.2
F0RIS Oct 8, 2017
24fb3be
Added setting text size. Enabled HTML tags processing
F0RIS Apr 15, 2018
0a95652
Minor fixes
F0RIS Apr 17, 2018
dbfada5
Release 1.5.3
F0RIS Apr 20, 2018
8fe1a16
Uploaded new demo
F0RIS Apr 21, 2018
b3be293
Update alert_dialog.xml
ayodyadas Jul 9, 2018
4117dc6
Merge pull request #21 from ayodyadas/patch-1
F0RIS Aug 9, 2018
48a342a
Release 1.5.4
F0RIS Aug 9, 2018
0108925
Updated materialish-progress library. Release 1.5.5
F0RIS Aug 10, 2018
67e3247
[b] fix message text cut off
luongvo Sep 24, 2018
5078c88
Merge pull request #26 from iotlinkadmin/fix_message_content_cut_off_…
F0RIS Sep 24, 2018
80505e5
Updated buildToolsVersion
F0RIS Sep 24, 2018
409b0a6
change compile to implementation
tfkbudi Oct 5, 2018
eda1e2e
change doc from using compile to implementation
tfkbudi Oct 5, 2018
484428a
Merge pull request #27 from tfkbudi/move-compile-to-implementation
F0RIS Oct 6, 2018
1540930
Renamed custom attribute pivotX and pivotY to avoid conflicts with th…
carvalho2707 May 16, 2019
7e43e57
Merge pull request #36 from carvalho2707/fix_duplicated_attributes
F0RIS May 16, 2019
437a706
Added feature to hide keyboard automatically
carvalho2707 May 18, 2019
4636e7e
Merge pull request #38 from carvalho2707/hide_keyboard
F0RIS May 19, 2019
d961487
Custom button colors & settingstroke. Release 1.6.0
F0RIS Jun 17, 2019
73e070f
Merge branch 'master' of https://github.com/F0RIS/sweet-alert-dialog
F0RIS Jun 17, 2019
4bcd575
Release 1.6.1
F0RIS Jun 17, 2019
d37422b
Fixed cutting of buttons text. R 1.6.2
F0RIS Jun 25, 2019
a8ef691
update gradle files
sajjadintel Feb 15, 2020
6bea095
add SetTitleTextSize, SetContentTextSize, SetButtonsTextSize and SetT…
sajjadintel Feb 15, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Created by .ignore support plugin (hsz.mobi)
### Android template
# Built application files
*.apk
*.ap_

# Files for the ART/Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/
out/

# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log

# Android Studio Navigation editor temp files
.navigation/

# Android Studio captures folder
captures/

# Intellij
*.iml
.idea/

# Keystore files
*.jks

75 changes: 58 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,36 @@ Sweet Alert Dialog
===================
SweetAlert for Android, a beautiful and clever alert dialog

#### This is the most advanced and contemporary fork of the apparently dead project
**Added:**
- Ability to set custom view
- More convenient interface to bind listeners (like in AlertDialog)
- Third neutral button with own listener, colors, methods and etc.
- Ability to disable buttons
- Ability to set buttons stroke width
- Dark style of dialogs
- Ability to make dialogs without buttons
- Support of HTML tags
- Ability to set text size
- Ability to set buttons color

Some screenshots of the new features:

<img src="https://cloud.githubusercontent.com/assets/10178982/24260517/c6f72da6-0ffc-11e7-9a16-67fea4010a34.jpg" width="30%"/>

<img src="https://user-images.githubusercontent.com/10178982/59605653-eee87d80-9117-11e9-9421-b116536c9388.png" width="30%"/>

#### Known issues:
- [ ] Bug with buttons height if custom view too big and need scrollview
- [ ] Buttons can handle only one line strings

[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Sweet%20Alert%20Dialog-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1065)

[中文版](https://github.com/pedant/sweet-alert-dialog/blob/master/README.zh.md)

Inspired by JavaScript [SweetAlert](http://tristanedwards.me/sweetalert)

[Demo Download](https://github.com/pedant/sweet-alert-dialog/releases/download/v1.1/sweet-alert-sample-v1.1.apk)
[Demo Download](https://github.com/F0RIS/sweet-alert-dialog/releases/download/1.5.3/sample-v1.5.3.apk)

## ScreenShot
![image](https://github.com/pedant/sweet-alert-dialog/raw/master/change_type.gif)
Expand All @@ -19,9 +42,9 @@ The simplest way to use SweetAlertDialog is to add the library as aar dependency
**Maven**

<dependency>
<groupId>cn.pedant.sweetalert</groupId>
<groupId>com.github.f0ris.sweetalert</groupId>
<artifactId>library</artifactId>
<version>1.3</version>
<version>1.6.2</version>
<type>aar</type>
</dependency>

Expand All @@ -32,7 +55,7 @@ The simplest way to use SweetAlertDialog is to add the library as aar dependency
}

dependencies {
compile 'cn.pedant.sweetalert:library:1.3'
implementation 'com.github.f0ris.sweetalert:library:1.6.2'
}

## Usage
Expand Down Expand Up @@ -115,7 +138,17 @@ A message with a custom icon:
.setCustomImage(R.drawable.custom_img)
.show();

Bind the listener to confirm button:
A message with a custom view:

final EditText editText = new EditText(this);
new SweetAlertDialog(this, SweetAlertDialog.NORMAL_TYPE)
.setTitleText("Custom view")
.setConfirmText("Ok")
.setCustomView(editText)
.show();


Different ways to bind the listener to button:

new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
Expand All @@ -127,24 +160,32 @@ Bind the listener to confirm button:
sDialog.dismissWithAnimation();
}
})
.show();

Show the cancel button and bind listener to it:

new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
.setTitleText("Are you sure?")
.setContentText("Won't be able to recover this file!")
.setCancelText("No,cancel plx!")
.setConfirmText("Yes,delete it!")
.showCancelButton(true)
.setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
.setCancelButton("Cancel", new SweetAlertDialog.OnSweetClickListener() {
@Override
public void onClick(SweetAlertDialog sDialog) {
sDialog.cancel();
sDialog.dismissWithAnimation();
}
})
.show();


Disable button

final SweetAlertDialog disabledBtnDialog = new SweetAlertDialog(this, SweetAlertDialog.NORMAL_TYPE)
.setTitleText("Title")
.setContentText("Disabled button dialog")
.setConfirmText("Confirm")
.setCancelText("Cancel")

disabledBtnDialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
disabledBtnDialog.getButton(SweetAlertDialog.BUTTON_CONFIRM).setEnabled(false);
}
});
disabledBtnDialog.show();


**Change** the dialog style upon confirming:

new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE)
Expand Down
192 changes: 0 additions & 192 deletions README.zh.md

This file was deleted.

15 changes: 12 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
buildscript {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.1'
classpath 'com.android.tools.build:gradle:3.5.3'
}
}

ext {
compileSdkVersion = 21
buildToolsVersion = "19.1.0"
compileSdkVersion = 28
}

allprojects {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
Loading