├── .gitignore
├── CHNAGELOG.md
├── FlycoDialog_Lib
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── flyco
│ │ ├── animation
│ │ ├── Attention
│ │ │ ├── Flash.java
│ │ │ ├── RubberBand.java
│ │ │ ├── ShakeHorizontal.java
│ │ │ ├── ShakeVertical.java
│ │ │ ├── Swing.java
│ │ │ └── Tada.java
│ │ ├── BaseAnimatorSet.java
│ │ ├── BounceEnter
│ │ │ ├── BounceBottomEnter.java
│ │ │ ├── BounceEnter.java
│ │ │ ├── BounceLeftEnter.java
│ │ │ ├── BounceRightEnter.java
│ │ │ └── BounceTopEnter.java
│ │ ├── FadeEnter
│ │ │ └── FadeEnter.java
│ │ ├── FadeExit
│ │ │ └── FadeExit.java
│ │ ├── FallEnter
│ │ │ ├── FallEnter.java
│ │ │ └── FallRotateEnter.java
│ │ ├── FlipEnter
│ │ │ ├── FlipBottomEnter.java
│ │ │ ├── FlipHorizontalEnter.java
│ │ │ ├── FlipHorizontalSwingEnter.java
│ │ │ ├── FlipLeftEnter.java
│ │ │ ├── FlipRightEnter.java
│ │ │ ├── FlipTopEnter.java
│ │ │ ├── FlipVerticalEnter.java
│ │ │ └── FlipVerticalSwingEnter.java
│ │ ├── FlipExit
│ │ │ ├── FlipHorizontalExit.java
│ │ │ └── FlipVerticalExit.java
│ │ ├── Jelly.java
│ │ ├── NewsPaperEnter.java
│ │ ├── SlideEnter
│ │ │ ├── SlideBottomEnter.java
│ │ │ ├── SlideLeftEnter.java
│ │ │ ├── SlideRightEnter.java
│ │ │ └── SlideTopEnter.java
│ │ ├── SlideExit
│ │ │ ├── SlideBottomExit.java
│ │ │ ├── SlideLeftExit.java
│ │ │ ├── SlideRightExit.java
│ │ │ └── SlideTopExit.java
│ │ ├── ZoomEnter
│ │ │ ├── ZoomInBottomEnter.java
│ │ │ ├── ZoomInEnter.java
│ │ │ ├── ZoomInLeftEnter.java
│ │ │ ├── ZoomInRightEnter.java
│ │ │ └── ZoomInTopEnter.java
│ │ └── ZoomExit
│ │ │ ├── ZoomInExit.java
│ │ │ ├── ZoomOutBottomExit.java
│ │ │ ├── ZoomOutExit.java
│ │ │ ├── ZoomOutLeftExit.java
│ │ │ ├── ZoomOutRightExit.java
│ │ │ └── ZoomOutTopExit.java
│ │ └── dialog
│ │ ├── entity
│ │ └── DialogMenuItem.java
│ │ ├── listener
│ │ ├── OnBtnClickL.java
│ │ └── OnOperItemClickL.java
│ │ ├── utils
│ │ ├── CornerUtils.java
│ │ └── StatusBarUtils.java
│ │ ├── view
│ │ └── TriangleView.java
│ │ └── widget
│ │ ├── ActionSheetDialog.java
│ │ ├── MaterialDialog.java
│ │ ├── NormalDialog.java
│ │ ├── NormalListDialog.java
│ │ ├── base
│ │ ├── BaseDialog.java
│ │ ├── BottomBaseDialog.java
│ │ ├── BottomTopBaseDialog.java
│ │ └── TopBaseDialog.java
│ │ ├── internal
│ │ ├── BaseAlertDialog.java
│ │ └── InternalBasePopup.java
│ │ └── popup
│ │ ├── BubblePopup.java
│ │ └── base
│ │ ├── BaseBubblePopup.java
│ │ └── BasePopup.java
│ └── res
│ └── layout
│ ├── popup_base.xml
│ └── popup_bubble.xml
├── Jar
├── nineoldandroids-2.4.0.jar
└── v1.0.0
│ ├── FlycoAnimation_Lib-v1.0.0.jar
│ └── FlycoDialog_Lib-v1.0.0.jar
├── LICENSE
├── README.md
├── README_CN.md
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── h8
│ │ └── DialogIntegrate
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── flyco
│ │ └── dialogsamples
│ │ ├── adapter
│ │ ├── HomeAdapter.java
│ │ └── TestAdapter.java
│ │ ├── extra
│ │ ├── CustomBaseDialog.java
│ │ ├── CustomBubblePopup.java
│ │ ├── IOSTaoBaoDialog.java
│ │ ├── ShareBottomDialog.java
│ │ └── ShareTopDialog.java
│ │ ├── ui
│ │ ├── BubblePopupActivity.java
│ │ ├── CustomPopupActivity.java
│ │ ├── DialogHomeActivity.java
│ │ ├── PopupHomeActivity.java
│ │ └── SimpleHomeActivity.java
│ │ └── utils
│ │ ├── DiaogAnimChoose.java
│ │ └── T.java
│ └── res
│ ├── anim
│ ├── base_dialog_in.xml
│ ├── base_dialog_out.xml
│ ├── dialog_enter.xml
│ └── dialog_exit.xml
│ ├── drawable
│ └── corner_common_border_gray.xml
│ ├── layout
│ ├── ac_bubble_popup.xml
│ ├── ac_custom_popup.xml
│ ├── ac_dialog_home.xml
│ ├── ad_dialog_home.xml
│ ├── dialog_custom_base.xml
│ ├── dialog_ios_taobao.xml
│ ├── dialog_share.xml
│ ├── popup_bubble_image.xml
│ ├── popup_bubble_text.xml
│ └── popup_custom.xml
│ ├── menu
│ └── menu_main.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ ├── ic_winstyle_album.png
│ ├── ic_winstyle_artist.png
│ ├── ic_winstyle_delete.png
│ ├── ic_winstyle_download.png
│ ├── ic_winstyle_favor.png
│ └── ic_winstyle_share.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ ├── bg_popup_shadow.9.png
│ ├── ic_launcher.png
│ ├── ic_portrait.jpg
│ ├── ic_share_qq.png
│ ├── ic_share_sms.png
│ ├── ic_share_wechat_friend.png
│ └── ic_share_wechat_friend_circle.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gif
├── preview_1.gif
├── preview_10.gif
├── preview_11.gif
├── preview_12.gif
├── preview_13.gif
├── preview_14.gif
├── preview_15.gif
├── preview_16.gif
├── preview_17.gif
├── preview_2.gif
├── preview_3.gif
├── preview_4.gif
├── preview_5.gif
├── preview_6.gif
├── preview_7.gif
├── preview_8.gif
├── preview_9.gif
└── preview_popup_1.gif
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screenshot
├── action_sheet_1.png
├── action_sheet_2.png
├── bubble_popup.png
├── material_dialog_1.png
├── material_dialog_2.png
├── material_dialog_3.png
├── normal_dialog_1.png
├── normal_dialog_2.png
├── normal_dialog_3.png
├── normal_dialog_4.png
├── normal_dialog_5.png
├── normal_list_1.png
├── normal_list_2.png
└── normal_list_3.png
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | build
4 | .idea
5 | *.iml
6 | .DS_Store
7 |
--------------------------------------------------------------------------------
/CHNAGELOG.md:
--------------------------------------------------------------------------------
1 | #Change Log
2 | Version 1.0.2 *(2015-09-25)*
3 | ----------------------------
4 | * fix bug:some method invalid in built-in dialog
5 |
6 | Version 1.1.0 *(2015-09-25)*
7 | ----------------------------
8 | * code refactoring
9 | * use Generic Type to make calling method easy
10 | * combine MaterialTipDialog and MaterialDialog to one
11 | * combine NormalTipDialog and NormalDialog to one
12 | * NormalDialog and MaterialDialog supports at most three btns.
13 |
14 | Version 1.1.6 *(2015-11-23)*
15 | ----------------------------
16 | * new added attribute isPopupStyle : show Dialog as PopupWindow
17 |
18 | Version 1.1.8 *(2015-12-19)*
19 | ----------------------------
20 | * new added method cancelText for ActionSheetDialog
21 | * fix bug method setCanceledOnTouchOutside() sometime invalid
22 | * change code style
23 |
24 | Version 1.2.0 *(2015-12-19)*
25 | ----------------------------
26 | * new added base widget - BasePopup
27 | * new added built-in widget - BubblePopup
28 | * BaseDialog support auto dimiss in given delay
29 |
30 | Version 1.2.2 *(2015-12-20)*
31 | ----------------------------
32 | * BasePopup small bug fix
33 |
34 | Version 1.2.6 *(2016-01-07)*
35 | ----------------------------
36 | * Combine FlycoAnimation_Lib into FlycoDialog_Lib
37 | * Fix bug for View in Popup click no response
38 | * Improve the function of BaseBubblePopup
39 |
40 | Version 1.2.8 *(2016-04-28)*
41 | ----------------------------
42 | * bugfix issue14
43 |
44 | Version 1.3.0 *(2016-05-21)*
45 | ----------------------------
46 | * remove the dependence of NineOldAnimation(only support 3.0+)
47 |
48 | Version 1.3.2 *(2016-07-18)*
49 | ----------------------------
50 | * bugfix issue22
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | //apply plugin: 'com.github.dcendents.android-maven'
3 | //apply plugin: 'com.jfrog.bintray'
4 |
5 | // 这个version是区分library版本的,因此当我们需要更新library时记得修改这个version
6 | version = "1.3.2"
7 | android {
8 | compileSdkVersion 23
9 | buildToolsVersion "23.0.3"
10 | resourcePrefix "FlycoDialog_" //这个随便填
11 | defaultConfig {
12 | minSdkVersion 11
13 | targetSdkVersion 23
14 | versionCode 132
15 | versionName version
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | }
28 |
29 | //def siteUrl = 'https://github.com/H07000223' // 项目的主页
30 | //def gitUrl = 'https://github.com/H07000223' // Git仓库的url
31 | //group = "com.flyco.dialog" // Maven Group ID for the artifact,一般填你唯一的包名
32 | //install {
33 | // repositories.mavenInstaller {
34 | // // This generates POM.xml with proper parameters
35 | // pom {
36 | // project {
37 | // packaging 'aar'
38 | // // Add your description here
39 | // name 'Android Dialog Library' //项目描述
40 | // url siteUrl
41 | // // Set your license
42 | // licenses {
43 | // license {
44 | // name 'MIT'
45 | // url 'http://opensource.org/licenses/MIT'
46 | // }
47 | // }
48 | // developers {
49 | // developer {
50 | // id 'H07000223' //填写的一些基本信息
51 | // name 'H07000223'
52 | // email '867318349@qq.com'
53 | // }
54 | // }
55 | // scm {
56 | // connection gitUrl
57 | // developerConnection gitUrl
58 | // url siteUrl
59 | // }
60 | // }
61 | // }
62 | // }
63 | //}
64 | //
65 | //task sourcesJar(type: Jar) {
66 | // from android.sourceSets.main.java.srcDirs
67 | // classifier = 'sources'
68 | //}
69 | //
70 | //artifacts {
71 | // archives sourcesJar
72 | //}
73 | //
74 | //android.libraryVariants.all { variant ->
75 | // println variant.javaCompile.classpath.files
76 | // if (variant.name == 'release') { //我们只需 release 的 javadoc
77 | // task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
78 | // // title = ''
79 | // // description = ''
80 | // source = variant.javaCompile.source
81 | // classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath())
82 | // options {
83 | // encoding "utf-8"
84 | // links "http://docs.oracle.com/javase/7/docs/api/"
85 | // linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference"
86 | // }
87 | // exclude '**/BuildConfig.java'
88 | // exclude '**/R.java'
89 | // }
90 | // task("javadoc${variant.name.capitalize()}Jar", type: Jar, dependsOn: "generate${variant.name.capitalize()}Javadoc") {
91 | // classifier = 'javadoc'
92 | // from tasks.getByName("generate${variant.name.capitalize()}Javadoc").destinationDir
93 | // }
94 | // artifacts {
95 | // archives tasks.getByName("javadoc${variant.name.capitalize()}Jar")
96 | // }
97 | // }
98 | //}
99 | //
100 | //Properties properties = new Properties()
101 | //properties.load(project.rootProject.file('local.properties').newDataInputStream())
102 | //bintray {
103 | // user = properties.getProperty("bintray.user")
104 | // key = properties.getProperty("bintray.apikey")
105 | // configurations = ['archives']
106 | // pkg {
107 | // repo = "maven"
108 | // name = "FlycoDialog_Lib" //发布到JCenter上的项目名字
109 | // websiteUrl = siteUrl
110 | // vcsUrl = gitUrl
111 | // licenses = ["MIT"]
112 | // publish = true
113 | // }
114 | //}
115 |
116 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\AS\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/Attention/Flash.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.Attention;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class Flash extends BaseAnimatorSet {
10 | public Flash() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | animatorSet.playTogether(//
17 | ObjectAnimator.ofFloat(view, "alpha", 1, 0, 1, 0, 1));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/Attention/RubberBand.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.Attention;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class RubberBand extends BaseAnimatorSet {
9 | public RubberBand() {
10 | duration = 1000;
11 | }
12 |
13 | @Override
14 | public void setAnimation(View view) {
15 | animatorSet.playTogether(//
16 | ObjectAnimator.ofFloat(view, "scaleX", 1, 1.25f, 0.75f, 1.15f, 1),//
17 | ObjectAnimator.ofFloat(view, "scaleY", 1, 0.75f, 1.25f, 0.85f, 1));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/Attention/ShakeHorizontal.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.Attention;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.animation.CycleInterpolator;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ShakeHorizontal extends BaseAnimatorSet {
10 | public ShakeHorizontal() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | ObjectAnimator animator = ObjectAnimator.ofFloat(view, "translationX", -10, 10);
17 | animator.setInterpolator(new CycleInterpolator(5));
18 | animatorSet.playTogether(animator);
19 |
20 | /**
21 | *
22 | * 另一种shake实现
23 | * ObjectAnimator.ofFloat(view, "translationX", 0, 25, -25, 25, -25, 15, -15, 6, -6, 0);
24 | *
25 | */
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/Attention/ShakeVertical.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.Attention;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.animation.CycleInterpolator;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ShakeVertical extends BaseAnimatorSet {
10 | public ShakeVertical() {
11 | duration = 1000;
12 | }
13 | @Override
14 | public void setAnimation(View view) {
15 | ObjectAnimator animator = ObjectAnimator.ofFloat(view, "translationY", -10, 10);
16 | animator.setInterpolator(new CycleInterpolator(5));
17 | animatorSet.playTogether(animator);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/Attention/Swing.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.Attention;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class Swing extends BaseAnimatorSet {
9 | public Swing() {
10 | duration = 1000;
11 | }
12 |
13 | @Override
14 | public void setAnimation(View view) {
15 | animatorSet.playTogether(//
16 | ObjectAnimator.ofFloat(view, "alpha", 1, 1, 1, 1, 1, 1, 1, 1),//
17 | ObjectAnimator.ofFloat(view, "rotation", 0, 10, -10, 6, -6, 3, -3, 0));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/Attention/Tada.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.Attention;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class Tada extends BaseAnimatorSet {
9 | public Tada() {
10 | duration = 1000;
11 | }
12 |
13 | @Override
14 | public void setAnimation(View view) {
15 | animatorSet.playTogether(//
16 | ObjectAnimator.ofFloat(view, "scaleX", 1, 0.9f, 0.9f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1),//
17 | ObjectAnimator.ofFloat(view, "scaleY", 1, 0.9f, 0.9f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1.1f, 1),//
18 | ObjectAnimator.ofFloat(view, "rotation", 0, -3, -3, 3, -3, 3, -3, 3, -3, 0));//
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/BaseAnimatorSet.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation;
2 |
3 | import android.animation.Animator;
4 | import android.animation.AnimatorSet;
5 | import android.view.View;
6 | import android.view.animation.Interpolator;
7 |
8 | public abstract class BaseAnimatorSet {
9 | /** 动画时长,系统默认250 */
10 | protected long duration = 500;
11 | protected AnimatorSet animatorSet = new AnimatorSet();
12 | private Interpolator interpolator;
13 | private long delay;
14 | private AnimatorListener listener;
15 |
16 | public abstract void setAnimation(View view);
17 |
18 | protected void start(final View view) {
19 | /** 设置动画中心点:pivotX--->X轴方向动画中心点,pivotY--->Y轴方向动画中心点 */
20 | // ViewHelper.setPivotX(view, view.getMeasuredWidth() / 2.0f);
21 | // ViewHelper.setPivotY(view, view.getMeasuredHeight() / 2.0f);
22 | reset(view);
23 | setAnimation(view);
24 |
25 | animatorSet.setDuration(duration);
26 | if (interpolator != null) {
27 | animatorSet.setInterpolator(interpolator);
28 | }
29 |
30 | if (delay > 0) {
31 | animatorSet.setStartDelay(delay);
32 | }
33 |
34 | if (listener != null) {
35 | animatorSet.addListener(new Animator.AnimatorListener() {
36 | @Override
37 | public void onAnimationStart(Animator animator) {
38 | listener.onAnimationStart(animator);
39 | }
40 |
41 | @Override
42 | public void onAnimationRepeat(Animator animator) {
43 | listener.onAnimationRepeat(animator);
44 | }
45 |
46 | @Override
47 | public void onAnimationEnd(Animator animator) {
48 | listener.onAnimationEnd(animator);
49 | }
50 |
51 | @Override
52 | public void onAnimationCancel(Animator animator) {
53 | listener.onAnimationCancel(animator);
54 | }
55 | });
56 | }
57 |
58 | animatorSet.start();
59 | }
60 |
61 | public static void reset(View view) {
62 | view.setAlpha(1);
63 | view.setScaleX(1);
64 | view.setScaleY(1);
65 | view.setTranslationX(0);
66 | view.setTranslationY(0);
67 | view.setRotation(0);
68 | view.setRotationY(0);
69 | view.setRotationX(0);
70 | }
71 |
72 | /** 设置动画时长 */
73 | public BaseAnimatorSet duration(long duration) {
74 | this.duration = duration;
75 | return this;
76 | }
77 |
78 | /** 设置动画时长 */
79 | public BaseAnimatorSet delay(long delay) {
80 | this.delay = delay;
81 | return this;
82 | }
83 |
84 | /** 设置动画插补器 */
85 | public BaseAnimatorSet interpolator(Interpolator interpolator) {
86 | this.interpolator = interpolator;
87 | return this;
88 | }
89 |
90 | /** 动画监听 */
91 | public BaseAnimatorSet listener(AnimatorListener listener) {
92 | this.listener = listener;
93 | return this;
94 | }
95 |
96 | /** 在View上执行动画 */
97 | public void playOn(View view) {
98 | start(view);
99 | }
100 |
101 | public interface AnimatorListener {
102 | void onAnimationStart(Animator animator);
103 |
104 | void onAnimationRepeat(Animator animator);
105 |
106 | void onAnimationEnd(Animator animator);
107 |
108 | void onAnimationCancel(Animator animator);
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/BounceEnter/BounceBottomEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.BounceEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class BounceBottomEnter extends BaseAnimatorSet {
10 | public BounceBottomEnter() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
17 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1, 1),//
18 | ObjectAnimator.ofFloat(view, "translationY", 250 * dm.density, -30, 10, 0));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/BounceEnter/BounceEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.BounceEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class BounceEnter extends BaseAnimatorSet {
9 |
10 | public BounceEnter() {
11 | duration = 700;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 |
17 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1, 1), //
18 | ObjectAnimator.ofFloat(view, "scaleX", 0.5f, 1.05f, 0.95f, 1),//
19 | ObjectAnimator.ofFloat(view, "scaleY", 0.5f, 1.05f, 0.95f, 1));
20 | /**
21 | *
22 | * 另一种弹性实现:依据sweet-alert-dialog布局文件实现
23 | * ObjectAnimator oa_alpha = ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1).setDuration(90);
24 | *
25 | * AnimatorSet as1 = new AnimatorSet();
26 | * as1.playTogether(oa_alpha, ObjectAnimator.ofFloat(view, "scaleX", 0.7f, 1.05f).setDuration(135),//
27 | * ObjectAnimator.ofFloat(view, "scaleY", 0.7f, 1.05f).setDuration(135));
28 | *
29 | * AnimatorSet as2 = new AnimatorSet();
30 | * as2.playTogether(ObjectAnimator.ofFloat(view, "scaleX", 1.05f, 0.95f).setDuration(105), //
31 | * ObjectAnimator.ofFloat(view, "scaleY", 1.05f, 0.95f).setDuration(105));
32 | *
33 | * AnimatorSet as3 = new AnimatorSet();
34 | * as3.playTogether(ObjectAnimator.ofFloat(view, "scaleX", 0.95f, 1f).setDuration(60),//
35 | * ObjectAnimator.ofFloat(view, "scaleY", 0.95f, 1f).setDuration(60));
36 | *
37 | * animatorSet.playSequentially(as1, as2, as3);
38 | *
39 | *
40 | */
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/BounceEnter/BounceLeftEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.BounceEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class BounceLeftEnter extends BaseAnimatorSet {
10 | public BounceLeftEnter() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 |
17 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
18 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1, 1),//
19 | ObjectAnimator.ofFloat(view, "translationX", -250 * dm.density, 30, -10, 0));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/BounceEnter/BounceRightEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.BounceEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class BounceRightEnter extends BaseAnimatorSet {
10 | public BounceRightEnter() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 |
17 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
18 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1, 1),//
19 | ObjectAnimator.ofFloat(view, "translationX", 250 * dm.density, -30, 10, 0));
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/BounceEnter/BounceTopEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.BounceEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class BounceTopEnter extends BaseAnimatorSet {
10 | public BounceTopEnter() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
17 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1, 1),//
18 | ObjectAnimator.ofFloat(view, "translationY", -250 * dm.density, 30, -10, 0));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FadeEnter/FadeEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FadeEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FadeEnter extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(//
12 | ObjectAnimator.ofFloat(view, "alpha", 0, 1).setDuration(duration));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FadeExit/FadeExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FadeExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FadeExit extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(//
12 | ObjectAnimator.ofFloat(view, "alpha", 1, 0).setDuration(duration));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FallEnter/FallEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FallEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FallEnter extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "scaleX", 2f, 1.5f, 1f).setDuration(duration),//
12 | ObjectAnimator.ofFloat(view, "scaleY", 2f, 1.5f, 1f).setDuration(duration),//
13 | ObjectAnimator.ofFloat(view, "alpha", 0, 1f).setDuration(duration));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FallEnter/FallRotateEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FallEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FallRotateEnter extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "scaleX", 2, 1.5f, 1),//
12 | ObjectAnimator.ofFloat(view, "scaleY", 2, 1.5f, 1),//
13 | ObjectAnimator.ofFloat(view, "rotation", 45, 0),//
14 | ObjectAnimator.ofFloat(view, "alpha", 0, 1));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipBottomEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class FlipBottomEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "rotationX", -90, 0),//
15 | ObjectAnimator.ofFloat(view, "translationY", 200 * dm.density, 0), //
16 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipHorizontalEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FlipHorizontalEnter extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(//
12 | // ObjectAnimator.ofFloat(view, "rotationY", -90, 0));
13 | ObjectAnimator.ofFloat(view, "rotationY", 90, 0));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipHorizontalSwingEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FlipHorizontalSwingEnter extends BaseAnimatorSet {
9 | public FlipHorizontalSwingEnter() {
10 | duration = 1000;
11 | }
12 |
13 | @Override
14 | public void setAnimation(View view) {
15 | animatorSet.playTogether(//
16 | ObjectAnimator.ofFloat(view, "rotationY", 90, -10, 10, 0),//
17 | ObjectAnimator.ofFloat(view, "alpha", 0.25f, 0.5f, 0.75f, 1));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipLeftEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class FlipLeftEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 |
14 | animatorSet.playTogether(//
15 | ObjectAnimator.ofFloat(view, "rotationY", 90, 0),//
16 | ObjectAnimator.ofFloat(view, "translationX", -200 * dm.density, 0), //
17 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipRightEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class FlipRightEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 |
14 | animatorSet.playTogether(//
15 | ObjectAnimator.ofFloat(view, "rotationY", -90, 0),//
16 | ObjectAnimator.ofFloat(view, "translationX", 200 * dm.density, 0), //
17 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipTopEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class FlipTopEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "rotationX", 90, 0),//
15 | ObjectAnimator.ofFloat(view, "translationY", -200 * dm.density, 0), //
16 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipVerticalEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FlipVerticalEnter extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(//
12 | // ObjectAnimator.ofFloat(view, "rotationX", -90, 0));
13 | ObjectAnimator.ofFloat(view, "rotationX", 90, 0));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipEnter/FlipVerticalSwingEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FlipVerticalSwingEnter extends BaseAnimatorSet {
9 | public FlipVerticalSwingEnter() {
10 | duration = 1000;
11 | }
12 |
13 | @Override
14 | public void setAnimation(View view) {
15 | animatorSet.playTogether(//
16 | ObjectAnimator.ofFloat(view, "rotationX", 90, -10, 10, 0),//
17 | ObjectAnimator.ofFloat(view, "alpha", 0.25f, 0.5f, 0.75f, 1));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipExit/FlipHorizontalExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FlipHorizontalExit extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "rotationY", 0, 90),//
12 | ObjectAnimator.ofFloat(view, "alpha", 1, 0));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/FlipExit/FlipVerticalExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.FlipExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class FlipVerticalExit extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "rotationX", 0, 90),//
12 | ObjectAnimator.ofFloat(view, "alpha", 1, 0));
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/Jelly.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | public class Jelly extends BaseAnimatorSet {
7 | public Jelly() {
8 | duration = 700;
9 | }
10 |
11 | @Override
12 | public void setAnimation(View view) {
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "scaleX", 0.3f, 0.5f, 0.9f, 0.8f, 0.9f, 1),//
15 | ObjectAnimator.ofFloat(view, "scaleY", 0.3f, 0.5f, 0.9f, 0.8f, 0.9f, 1),//
16 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/NewsPaperEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | public class NewsPaperEnter extends BaseAnimatorSet {
7 | @Override
8 | public void setAnimation(View view) {
9 | animatorSet.playTogether(//
10 | ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.5f, 1f), //
11 | ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.5f, 1f),//
12 | ObjectAnimator.ofFloat(view, "alpha", 0f, 1f),//
13 | ObjectAnimator.ofFloat(view, "rotation", 1080, 720, 360, 0));
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideEnter/SlideBottomEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideBottomEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationY", 250 * dm.density, 0), //
15 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideEnter/SlideLeftEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideLeftEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationX", -250 * dm.density, 0), //
15 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideEnter/SlideRightEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideRightEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationX", 250 * dm.density, 0), //
15 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideEnter/SlideTopEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideTopEnter extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationY", -250 * dm.density, 0), //
15 | ObjectAnimator.ofFloat(view, "alpha", 0.2f, 1));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideExit/SlideBottomExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideBottomExit extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationY", 0, 250 * dm.density), //
15 | ObjectAnimator.ofFloat(view, "alpha", 1, 0));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideExit/SlideLeftExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideLeftExit extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationX", 0, -250 * dm.density), //
15 | ObjectAnimator.ofFloat(view, "alpha", 1, 0));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideExit/SlideRightExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideRightExit extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationX", 0, 250 * dm.density), //
15 | ObjectAnimator.ofFloat(view, "alpha", 1, 0));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/SlideExit/SlideTopExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.SlideExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.util.DisplayMetrics;
5 | import android.view.View;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class SlideTopExit extends BaseAnimatorSet {
10 | @Override
11 | public void setAnimation(View view) {
12 | DisplayMetrics dm = view.getContext().getResources().getDisplayMetrics();
13 | animatorSet.playTogether(//
14 | ObjectAnimator.ofFloat(view, "translationY", 0, -250 * dm.density), //
15 | ObjectAnimator.ofFloat(view, "alpha", 1, 0));
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomEnter/ZoomInBottomEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomInBottomEnter extends BaseAnimatorSet {
10 | public ZoomInBottomEnter() {
11 | duration = 600;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int h = view.getMeasuredHeight();
18 |
19 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.475f, 1),
20 | ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.475f, 1),
21 | ObjectAnimator.ofFloat(view, "translationY", h, -60, 0), ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1));
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomEnter/ZoomInEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class ZoomInEnter extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(//
12 | ObjectAnimator.ofFloat(view, "scaleX", 0.5f, 1),//
13 | ObjectAnimator.ofFloat(view, "scaleY", 0.5f, 1),//
14 | ObjectAnimator.ofFloat(view, "alpha", 0, 1));//
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomEnter/ZoomInLeftEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomInLeftEnter extends BaseAnimatorSet {
10 | public ZoomInLeftEnter() {
11 | duration = 750;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int w = view.getMeasuredWidth();
18 |
19 | animatorSet.playTogether(//
20 | ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.475f, 1),//
21 | ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.475f, 1),//
22 | ObjectAnimator.ofFloat(view, "translationX", -w, 48, 0),//
23 | ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomEnter/ZoomInRightEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomInRightEnter extends BaseAnimatorSet {
10 | public ZoomInRightEnter() {
11 | duration = 750;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int w = view.getMeasuredWidth();
18 |
19 | animatorSet.playTogether(//
20 | ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.475f, 1),//
21 | ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.475f, 1),//
22 | ObjectAnimator.ofFloat(view, "translationX", w, -48, 0),//
23 | ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomEnter/ZoomInTopEnter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomEnter;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomInTopEnter extends BaseAnimatorSet {
10 | public ZoomInTopEnter() {
11 | duration = 600;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int h = view.getMeasuredHeight();
18 |
19 | animatorSet.playTogether(ObjectAnimator.ofFloat(view, "alpha", 0, 1, 1),//
20 | ObjectAnimator.ofFloat(view, "scaleX", 0.1f, 0.475f, 1),//
21 | ObjectAnimator.ofFloat(view, "scaleY", 0.1f, 0.475f, 1),//
22 | ObjectAnimator.ofFloat(view, "translationY", -h, 60, 0));
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomExit/ZoomInExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class ZoomInExit extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(//
12 | ObjectAnimator.ofFloat(view, "scaleX", 1f, 1.25f, 0),//
13 | ObjectAnimator.ofFloat(view, "scaleY", 1f, 1.25f, 0),//
14 | ObjectAnimator.ofFloat(view, "alpha", 1, 0, 0));//
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomExit/ZoomOutBottomExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomOutBottomExit extends BaseAnimatorSet {
10 | public ZoomOutBottomExit() {
11 | duration = 600;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int h = view.getMeasuredHeight();
18 |
19 | animatorSet.playTogether(//
20 | ObjectAnimator.ofFloat(view, "alpha", 1, 1, 0),//
21 | ObjectAnimator.ofFloat(view, "scaleX", 1, 0.475f, 0.1f),//
22 | ObjectAnimator.ofFloat(view, "scaleY", 1, 0.475f, 0.1f),//
23 | ObjectAnimator.ofFloat(view, "translationY", 0, -60, h));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomExit/ZoomOutExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 |
6 | import com.flyco.animation.BaseAnimatorSet;
7 |
8 | public class ZoomOutExit extends BaseAnimatorSet {
9 | @Override
10 | public void setAnimation(View view) {
11 | animatorSet.playTogether(//
12 | ObjectAnimator.ofFloat(view, "alpha", 1, 0, 0),//
13 | ObjectAnimator.ofFloat(view, "scaleX", 1, 0.3f, 0),//
14 | ObjectAnimator.ofFloat(view, "scaleY", 1, 0.3f, 0));//
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomExit/ZoomOutLeftExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomOutLeftExit extends BaseAnimatorSet {
10 | public ZoomOutLeftExit() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int w = view.getMeasuredWidth();
18 |
19 | animatorSet.playTogether(//
20 | ObjectAnimator.ofFloat(view, "alpha", 1, 1, 0),//
21 | ObjectAnimator.ofFloat(view, "scaleX", 1, 0.475f, 0.1f),//
22 | ObjectAnimator.ofFloat(view, "scaleY", 1, 0.475f, 0.1f),//
23 | ObjectAnimator.ofFloat(view, "translationX", 0, 42, -w));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomExit/ZoomOutRightExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomOutRightExit extends BaseAnimatorSet {
10 | public ZoomOutRightExit() {
11 | duration = 1000;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int w = view.getMeasuredWidth();
18 |
19 | animatorSet.playTogether(//
20 | ObjectAnimator.ofFloat(view, "scaleX", 1, 0.475f, 0.1f),//
21 | ObjectAnimator.ofFloat(view, "scaleY", 1, 0.475f, 0.1f),//
22 | ObjectAnimator.ofFloat(view, "translationX", 0, -42, w),//
23 | ObjectAnimator.ofFloat(view, "alpha", 1, 1, 0));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/animation/ZoomExit/ZoomOutTopExit.java:
--------------------------------------------------------------------------------
1 | package com.flyco.animation.ZoomExit;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.view.View;
5 | import android.view.View.MeasureSpec;
6 |
7 | import com.flyco.animation.BaseAnimatorSet;
8 |
9 | public class ZoomOutTopExit extends BaseAnimatorSet {
10 | public ZoomOutTopExit() {
11 | duration = 600;
12 | }
13 |
14 | @Override
15 | public void setAnimation(View view) {
16 | view.measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
17 | int h = view.getMeasuredHeight();
18 |
19 | animatorSet.playTogether(//
20 | ObjectAnimator.ofFloat(view, "alpha", 1, 1, 0),//
21 | ObjectAnimator.ofFloat(view, "scaleX", 1, 0.475f, 0.1f),//
22 | ObjectAnimator.ofFloat(view, "scaleY", 1, 0.475f, 0.1f),//
23 | ObjectAnimator.ofFloat(view, "translationY", 0, 60, -h));
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/entity/DialogMenuItem.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.entity;
2 |
3 | public class DialogMenuItem {
4 | public String mOperName;
5 | public int mResId;
6 |
7 | public DialogMenuItem(String operName, int resId) {
8 | mOperName = operName;
9 | mResId = resId;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/listener/OnBtnClickL.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.listener;
2 |
3 | public interface OnBtnClickL {
4 | void onBtnClick();
5 | }
6 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/listener/OnOperItemClickL.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.listener;
2 |
3 | import android.view.View;
4 | import android.widget.AdapterView;
5 |
6 | public interface OnOperItemClickL {
7 | void onOperItemClick(AdapterView> parent, View view, int position, long id);
8 | }
9 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/utils/CornerUtils.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.utils;
2 |
3 | import android.graphics.drawable.ColorDrawable;
4 | import android.graphics.drawable.Drawable;
5 | import android.graphics.drawable.GradientDrawable;
6 | import android.graphics.drawable.StateListDrawable;
7 |
8 | /**
9 | * Utils to get corner drawable
10 | */
11 | public class CornerUtils {
12 | public static Drawable cornerDrawable(final int bgColor, float cornerradius) {
13 | final GradientDrawable bg = new GradientDrawable();
14 | bg.setCornerRadius(cornerradius);
15 | bg.setColor(bgColor);
16 |
17 | return bg;
18 | }
19 |
20 | public static Drawable cornerDrawable(final int bgColor, float[] cornerradius) {
21 | final GradientDrawable bg = new GradientDrawable();
22 | bg.setCornerRadii(cornerradius);
23 | bg.setColor(bgColor);
24 |
25 | return bg;
26 | }
27 |
28 | public static Drawable cornerDrawable(final int bgColor, float[] cornerradius, int borderwidth, int bordercolor) {
29 | final GradientDrawable bg = new GradientDrawable();
30 | bg.setCornerRadii(cornerradius);
31 | bg.setStroke(borderwidth, bordercolor);
32 | bg.setColor(bgColor);
33 |
34 | return bg;
35 | }
36 |
37 | /**
38 | * set btn selector with corner drawable for special position
39 | */
40 | public static StateListDrawable btnSelector(float radius, int normalColor, int pressColor, int postion) {
41 | StateListDrawable bg = new StateListDrawable();
42 | Drawable normal = null;
43 | Drawable pressed = null;
44 |
45 | if (postion == 0) {// left btn
46 | normal = cornerDrawable(normalColor, new float[]{0, 0, 0, 0, 0, 0, radius, radius});
47 | pressed = cornerDrawable(pressColor, new float[]{0, 0, 0, 0, 0, 0, radius, radius});
48 | } else if (postion == 1) {// right btn
49 | normal = cornerDrawable(normalColor, new float[]{0, 0, 0, 0, radius, radius, 0, 0});
50 | pressed = cornerDrawable(pressColor, new float[]{0, 0, 0, 0, radius, radius, 0, 0});
51 | } else if (postion == -1) {// only one btn
52 | normal = cornerDrawable(normalColor, new float[]{0, 0, 0, 0, radius, radius, radius, radius});
53 | pressed = cornerDrawable(pressColor, new float[]{0, 0, 0, 0, radius, radius, radius, radius});
54 | } else if (postion == -2) {// for material dialog
55 | normal = cornerDrawable(normalColor, radius);
56 | pressed = cornerDrawable(pressColor, radius);
57 | }
58 |
59 | bg.addState(new int[]{-android.R.attr.state_pressed}, normal);
60 | bg.addState(new int[]{android.R.attr.state_pressed}, pressed);
61 | return bg;
62 | }
63 |
64 | /**
65 | * set ListView item selector with corner drawable for the last position
66 | * (ListView的item点击效果,只处理最后一项圆角处理)
67 | */
68 | public static StateListDrawable listItemSelector(float radius, int normalColor, int pressColor, boolean isLastPostion) {
69 | StateListDrawable bg = new StateListDrawable();
70 | Drawable normal = null;
71 | Drawable pressed = null;
72 |
73 | if (!isLastPostion) {
74 | normal = new ColorDrawable(normalColor);
75 | pressed = new ColorDrawable(pressColor);
76 | } else {
77 | normal = cornerDrawable(normalColor, new float[]{0, 0, 0, 0, radius, radius, radius, radius});
78 | pressed = cornerDrawable(pressColor, new float[]{0, 0, 0, 0, radius, radius, radius, radius});
79 | }
80 |
81 | bg.addState(new int[]{-android.R.attr.state_pressed}, normal);
82 | bg.addState(new int[]{android.R.attr.state_pressed}, pressed);
83 | return bg;
84 | }
85 |
86 | /**
87 | * set ListView item selector with corner drawable for the first and the last position
88 | * (ListView的item点击效果,第一项和最后一项圆角处理)
89 | */
90 | public static StateListDrawable listItemSelector(float radius, int normalColor, int pressColor, int itemTotalSize,
91 | int itemPosition) {
92 | StateListDrawable bg = new StateListDrawable();
93 | Drawable normal = null;
94 | Drawable pressed = null;
95 |
96 | if (itemPosition == 0 && itemPosition == itemTotalSize - 1) {// 只有一项
97 | normal = cornerDrawable(normalColor, new float[]{radius, radius, radius, radius, radius, radius, radius,
98 | radius});
99 | pressed = cornerDrawable(pressColor, new float[]{radius, radius, radius, radius, radius, radius, radius,
100 | radius});
101 | } else if (itemPosition == 0) {
102 | normal = cornerDrawable(normalColor, new float[]{radius, radius, radius, radius, 0, 0, 0, 0,});
103 | pressed = cornerDrawable(pressColor, new float[]{radius, radius, radius, radius, 0, 0, 0, 0});
104 | } else if (itemPosition == itemTotalSize - 1) {
105 | normal = cornerDrawable(normalColor, new float[]{0, 0, 0, 0, radius, radius, radius, radius});
106 | pressed = cornerDrawable(pressColor, new float[]{0, 0, 0, 0, radius, radius, radius, radius});
107 | } else {
108 | normal = new ColorDrawable(normalColor);
109 | pressed = new ColorDrawable(pressColor);
110 | }
111 |
112 | bg.addState(new int[]{-android.R.attr.state_pressed}, normal);
113 | bg.addState(new int[]{android.R.attr.state_pressed}, pressed);
114 | return bg;
115 | }
116 |
117 | }
118 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/utils/StatusBarUtils.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.utils;
2 |
3 | import android.content.Context;
4 | import android.text.TextUtils;
5 | import android.util.Log;
6 |
7 | /**
8 | * StatusBar Utils handle with special FlymeOS4.x/Android4.4.4
9 | * (状态栏工具,处理魅族FlymeOS4.x/Android4.4.4)
10 | */
11 | public class StatusBarUtils {
12 | public static int getHeight(Context context) {
13 | int statusBarHeight = 0;
14 | int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
15 | if (resourceId > 0) {
16 | statusBarHeight = context.getResources().getDimensionPixelSize(resourceId);
17 | }
18 | if (isFlymeOs4x()) {
19 | return 2 * statusBarHeight;
20 | }
21 |
22 | return statusBarHeight;
23 | }
24 |
25 | public static boolean isFlymeOs4x() {
26 | String sysVersion = android.os.Build.VERSION.RELEASE;
27 | if ("4.4.4".equals(sysVersion)) {
28 | String sysIncrement = android.os.Build.VERSION.INCREMENTAL;
29 | String displayId = android.os.Build.DISPLAY;
30 | if (!TextUtils.isEmpty(sysIncrement)) {
31 | return sysIncrement.contains("Flyme_OS_4");
32 | } else {
33 | return displayId.contains("Flyme OS 4");
34 | }
35 | }
36 | return false;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/view/TriangleView.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.view;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Paint;
6 | import android.graphics.Path;
7 | import android.util.AttributeSet;
8 | import android.view.Gravity;
9 | import android.view.View;
10 |
11 | public class TriangleView extends View {
12 | private Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
13 | private Path mPath = new Path();
14 | private int mColor;
15 | /** 三角形朝向 */
16 | private int mGravity;
17 |
18 | public TriangleView(Context context) {
19 | super(context);
20 | }
21 |
22 | public TriangleView(Context context, AttributeSet attrs) {
23 | super(context, attrs);
24 | }
25 |
26 | public void setColor(int color) {
27 | mColor = color;
28 | invalidate();
29 | }
30 |
31 | public void setGravity(int gravity) {
32 | mGravity = gravity;
33 | invalidate();
34 | }
35 |
36 | public int getColor() {
37 | return mColor;
38 | }
39 |
40 | public int getGravity() {
41 | return mGravity;
42 | }
43 |
44 | @Override
45 | protected void onDraw(Canvas canvas) {
46 | super.onDraw(canvas);
47 |
48 | int width = getWidth();
49 | int height = getHeight();
50 |
51 | mPaint.setColor(mColor);
52 |
53 | mPath.reset();
54 | if (mGravity == Gravity.TOP) {//三角形朝上
55 | mPath.moveTo(width / 2, 0);
56 | mPath.lineTo(0, height);
57 | mPath.lineTo(width, height);
58 | mPath.close();
59 | } else if (mGravity == Gravity.BOTTOM) {//三角形朝下
60 | mPath.moveTo(0, 0);
61 | mPath.lineTo(width, 0);
62 | mPath.lineTo(width / 2, height);
63 | mPath.close();
64 | }
65 |
66 |
67 | canvas.drawPath(mPath, mPaint);
68 | }
69 | }
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/MaterialDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.Gravity;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 |
9 | import com.flyco.dialog.utils.CornerUtils;
10 | import com.flyco.dialog.widget.internal.BaseAlertDialog;
11 |
12 | /**
13 | * Dialog like Material Design Dialog
14 | */
15 | public class MaterialDialog extends BaseAlertDialog {
16 |
17 | public MaterialDialog(Context context) {
18 | super(context);
19 |
20 | /** default value*/
21 | mTitleTextColor = Color.parseColor("#DE000000");
22 | mTitleTextSize = 22f;
23 | mContentTextColor = Color.parseColor("#8a000000");
24 | mContentTextSize = 16f;
25 | mLeftBtnTextColor = Color.parseColor("#383838");
26 | mRightBtnTextColor = Color.parseColor("#468ED0");
27 | mMiddleBtnTextColor = Color.parseColor("#00796B");
28 | /** default value*/
29 | }
30 |
31 | @Override
32 | public View onCreateView() {
33 |
34 | /** title */
35 | mTvTitle.setGravity(Gravity.CENTER_VERTICAL);
36 | mTvTitle.setPadding(dp2px(20), dp2px(20), dp2px(20), dp2px(0));
37 | mTvTitle.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
38 | LinearLayout.LayoutParams.WRAP_CONTENT));
39 | mLlContainer.addView(mTvTitle);
40 |
41 | /** content */
42 | mTvContent.setPadding(dp2px(20), dp2px(20), dp2px(20), dp2px(20));
43 | mTvContent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
44 | LinearLayout.LayoutParams.WRAP_CONTENT));
45 | mLlContainer.addView(mTvContent);
46 |
47 | /**btns*/
48 | mLlBtns.setGravity(Gravity.RIGHT);
49 | mLlBtns.addView(mTvBtnLeft);
50 | mLlBtns.addView(mTvBtnMiddle);
51 | mLlBtns.addView(mTvBtnRight);
52 |
53 | mTvBtnLeft.setPadding(dp2px(15), dp2px(8), dp2px(15), dp2px(8));
54 | mTvBtnRight.setPadding(dp2px(15), dp2px(8), dp2px(15), dp2px(8));
55 | mTvBtnMiddle.setPadding(dp2px(15), dp2px(8), dp2px(15), dp2px(8));
56 | mLlBtns.setPadding(dp2px(20), dp2px(0), dp2px(10), dp2px(10));
57 |
58 | mLlContainer.addView(mLlBtns);
59 |
60 | return mLlContainer;
61 | }
62 |
63 | @Override
64 | public void setUiBeforShow() {
65 | super.setUiBeforShow();
66 | /**set background color and corner radius */
67 | float radius = dp2px(mCornerRadius);
68 | mLlContainer.setBackgroundDrawable(CornerUtils.cornerDrawable(mBgColor, radius));
69 | mTvBtnLeft.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, -2));
70 | mTvBtnRight.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, -2));
71 | mTvBtnMiddle.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, -2));
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/NormalDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.Gravity;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 |
9 | import com.flyco.dialog.utils.CornerUtils;
10 | import com.flyco.dialog.widget.internal.BaseAlertDialog;
11 |
12 | @SuppressWarnings("deprecation")
13 | public class NormalDialog extends BaseAlertDialog {
14 | /** title underline */
15 | private View mVLineTitle;
16 | /** vertical line between btns */
17 | private View mVLineVertical;
18 | /** vertical line between btns */
19 | private View mVLineVertical2;
20 | /** horizontal line above btns */
21 | private View mVLineHorizontal;
22 | /** title underline color(标题下划线颜色) */
23 | private int mTitleLineColor = Color.parseColor("#61AEDC");
24 | /** title underline height(标题下划线高度) */
25 | private float mTitleLineHeight = 1f;
26 | /** btn divider line color(对话框之间的分割线颜色(水平+垂直)) */
27 | private int mDividerColor = Color.parseColor("#DCDCDC");
28 |
29 | public static final int STYLE_ONE = 0;
30 | public static final int STYLE_TWO = 1;
31 | private int mStyle = STYLE_ONE;
32 |
33 | public NormalDialog(Context context) {
34 | super(context);
35 |
36 | /** default value*/
37 | mTitleTextColor = Color.parseColor("#61AEDC");
38 | mTitleTextSize = 22f;
39 | mContentTextColor = Color.parseColor("#383838");
40 | mContentTextSize = 17f;
41 | mLeftBtnTextColor = Color.parseColor("#8a000000");
42 | mRightBtnTextColor = Color.parseColor("#8a000000");
43 | mMiddleBtnTextColor = Color.parseColor("#8a000000");
44 | /** default value*/
45 | }
46 |
47 | @Override
48 | public View onCreateView() {
49 | /** title */
50 | mTvTitle.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
51 | LinearLayout.LayoutParams.WRAP_CONTENT));
52 | mLlContainer.addView(mTvTitle);
53 |
54 | /** title underline */
55 | mVLineTitle = new View(mContext);
56 | mLlContainer.addView(mVLineTitle);
57 |
58 | /** content */
59 | mTvContent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
60 | LinearLayout.LayoutParams.WRAP_CONTENT));
61 | mLlContainer.addView(mTvContent);
62 |
63 | mVLineHorizontal = new View(mContext);
64 | mVLineHorizontal.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, 1));
65 | mLlContainer.addView(mVLineHorizontal);
66 |
67 | /** btns */
68 | mTvBtnLeft.setLayoutParams(new LinearLayout.LayoutParams(0, dp2px(45), 1));
69 | mLlBtns.addView(mTvBtnLeft);
70 |
71 | mVLineVertical = new View(mContext);
72 | mVLineVertical.setLayoutParams(new LinearLayout.LayoutParams(1, LinearLayout.LayoutParams.MATCH_PARENT));
73 | mLlBtns.addView(mVLineVertical);
74 |
75 | mTvBtnMiddle.setLayoutParams(new LinearLayout.LayoutParams(0, dp2px(45), 1));
76 | mLlBtns.addView(mTvBtnMiddle);
77 |
78 | mVLineVertical2 = new View(mContext);
79 | mVLineVertical2.setLayoutParams(new LinearLayout.LayoutParams(1, LinearLayout.LayoutParams.MATCH_PARENT));
80 | mLlBtns.addView(mVLineVertical2);
81 |
82 | mTvBtnRight.setLayoutParams(new LinearLayout.LayoutParams(0, dp2px(45), 1));
83 | mLlBtns.addView(mTvBtnRight);
84 |
85 | mLlContainer.addView(mLlBtns);
86 |
87 | return mLlContainer;
88 | }
89 |
90 | @Override
91 | public void setUiBeforShow() {
92 | super.setUiBeforShow();
93 |
94 | /** title */
95 | if (mStyle == STYLE_ONE) {
96 | mTvTitle.setMinHeight(dp2px(48));
97 | mTvTitle.setGravity(Gravity.CENTER_VERTICAL);
98 | mTvTitle.setPadding(dp2px(15), dp2px(5), dp2px(0), dp2px(5));
99 | mTvTitle.setVisibility(mIsTitleShow ? View.VISIBLE : View.GONE);
100 | } else if (mStyle == STYLE_TWO) {
101 | mTvTitle.setGravity(Gravity.CENTER);
102 | mTvTitle.setPadding(dp2px(0), dp2px(15), dp2px(0), dp2px(0));
103 | }
104 |
105 | /** title underline */
106 | mVLineTitle.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
107 | dp2px(mTitleLineHeight)));
108 | mVLineTitle.setBackgroundColor(mTitleLineColor);
109 | mVLineTitle.setVisibility(mIsTitleShow && mStyle == STYLE_ONE ? View.VISIBLE : View.GONE);
110 |
111 | /** content */
112 | if (mStyle == STYLE_ONE) {
113 | mTvContent.setPadding(dp2px(15), dp2px(10), dp2px(15), dp2px(10));
114 | mTvContent.setMinHeight(dp2px(68));
115 | mTvContent.setGravity(mContentGravity);
116 | } else if (mStyle == STYLE_TWO) {
117 | mTvContent.setPadding(dp2px(15), dp2px(7), dp2px(15), dp2px(20));
118 | mTvContent.setMinHeight(dp2px(56));
119 | mTvContent.setGravity(Gravity.CENTER);
120 | }
121 |
122 | /** btns */
123 | mVLineHorizontal.setBackgroundColor(mDividerColor);
124 | mVLineVertical.setBackgroundColor(mDividerColor);
125 | mVLineVertical2.setBackgroundColor(mDividerColor);
126 |
127 | if (mBtnNum == 1) {
128 | mTvBtnLeft.setVisibility(View.GONE);
129 | mTvBtnRight.setVisibility(View.GONE);
130 | mVLineVertical.setVisibility(View.GONE);
131 | mVLineVertical2.setVisibility(View.GONE);
132 | } else if (mBtnNum == 2) {
133 | mTvBtnMiddle.setVisibility(View.GONE);
134 | mVLineVertical.setVisibility(View.GONE);
135 | }
136 |
137 | /**set background color and corner radius */
138 | float radius = dp2px(mCornerRadius);
139 | mLlContainer.setBackgroundDrawable(CornerUtils.cornerDrawable(mBgColor, radius));
140 | mTvBtnLeft.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, 0));
141 | mTvBtnRight.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, 1));
142 | mTvBtnMiddle.setBackgroundDrawable(CornerUtils.btnSelector(mBtnNum == 1 ? radius : 0, mBgColor, mBtnPressColor, -1));
143 | }
144 |
145 | // --->属性设置
146 |
147 | /** set style(设置style) */
148 | public NormalDialog style(int style) {
149 | this.mStyle = style;
150 | return this;
151 | }
152 |
153 | /** set title underline color(设置标题下划线颜色) */
154 | public NormalDialog titleLineColor(int titleLineColor) {
155 | this.mTitleLineColor = titleLineColor;
156 | return this;
157 | }
158 |
159 | /** set title underline height(设置标题下划线高度) */
160 | public NormalDialog titleLineHeight(float titleLineHeight_DP) {
161 | this.mTitleLineHeight = titleLineHeight_DP;
162 | return this;
163 | }
164 |
165 | /** set divider color between btns(设置btn分割线的颜色) */
166 | public NormalDialog dividerColor(int dividerColor) {
167 | this.mDividerColor = dividerColor;
168 | return this;
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/base/BottomBaseDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget.base;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.content.Context;
5 | import android.view.Gravity;
6 | import android.view.View;
7 | import android.view.animation.Animation;
8 | import android.view.animation.TranslateAnimation;
9 | import android.widget.FrameLayout;
10 |
11 | import com.flyco.animation.BaseAnimatorSet;
12 |
13 | public abstract class BottomBaseDialog> extends BottomTopBaseDialog {
14 | public BottomBaseDialog(Context context, View animateView) {
15 | super(context);
16 | mAnimateView = animateView;
17 |
18 | mInnerShowAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
19 | Animation.RELATIVE_TO_SELF, 1f, Animation.RELATIVE_TO_SELF, 0);
20 |
21 | mInnerDismissAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
22 | Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 1);
23 | }
24 |
25 | public BottomBaseDialog(Context context) {
26 | this(context, null);
27 | }
28 |
29 | @Override
30 | protected void onStart() {
31 | super.onStart();
32 | mLlTop.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
33 | FrameLayout.LayoutParams.MATCH_PARENT));
34 | mLlTop.setGravity(Gravity.BOTTOM);
35 | getWindow().setGravity(Gravity.BOTTOM);
36 | mLlTop.setPadding(mLeft, mTop, mRight, mBottom);
37 | }
38 |
39 | @Override
40 | public void onAttachedToWindow() {
41 | super.onAttachedToWindow();
42 | showWithAnim();
43 | }
44 |
45 | @Override
46 | public void dismiss() {
47 | dismissWithAnim();
48 | }
49 |
50 | private BaseAnimatorSet mWindowInAs;
51 | private BaseAnimatorSet mWindowOutAs;
52 |
53 | @Override
54 | protected BaseAnimatorSet getWindowInAs() {
55 | if (mWindowInAs == null) {
56 | mWindowInAs = new WindowInAs();
57 | }
58 | return mWindowInAs;
59 | }
60 |
61 | @Override
62 | protected BaseAnimatorSet getWindowOutAs() {
63 | if (mWindowOutAs == null) {
64 | mWindowOutAs = new WindowOutAs();
65 | }
66 | return mWindowOutAs;
67 | }
68 |
69 |
70 | private class WindowInAs extends BaseAnimatorSet {
71 | @Override
72 | public void setAnimation(View view) {
73 | ObjectAnimator oa1 = ObjectAnimator.ofFloat(view, "scaleX", 1f, 0.9f);
74 | ObjectAnimator oa2 = ObjectAnimator.ofFloat(view, "scaleY", 1f, 0.9f);
75 | animatorSet.playTogether(oa1, oa2);
76 | }
77 | }
78 |
79 | private class WindowOutAs extends BaseAnimatorSet {
80 | @Override
81 | public void setAnimation(View view) {
82 | ObjectAnimator oa1 = ObjectAnimator.ofFloat(view, "scaleX", 0.9f, 1f);
83 | ObjectAnimator oa2 = ObjectAnimator.ofFloat(view, "scaleY", 0.9f, 1f);
84 | animatorSet.playTogether(oa1, oa2);
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/base/BottomTopBaseDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget.base;
2 |
3 | import android.content.Context;
4 | import android.view.MotionEvent;
5 | import android.view.View;
6 | import android.view.animation.Animation;
7 | import android.view.animation.Animation.AnimationListener;
8 |
9 | import com.flyco.animation.BaseAnimatorSet;
10 |
11 | public abstract class BottomTopBaseDialog> extends BaseDialog {
12 | protected View mAnimateView;
13 | private BaseAnimatorSet mWindowInAs;
14 | private BaseAnimatorSet mWindowOutAs;
15 | protected Animation mInnerShowAnim;
16 | protected Animation mInnerDismissAnim;
17 | protected long mInnerAnimDuration = 350;
18 | protected boolean mIsInnerShowAnim;
19 | protected boolean mIsInnerDismissAnim;
20 | protected int mLeft, mTop, mRight, mBottom;
21 |
22 | public BottomTopBaseDialog(Context context) {
23 | super(context);
24 | }
25 |
26 | /** set duration for inner com.flyco.animation of mAnimateView(设置animateView内置动画时长) */
27 | public T innerAnimDuration(long innerAnimDuration) {
28 | mInnerAnimDuration = innerAnimDuration;
29 | return (T) this;
30 | }
31 |
32 | public T padding(int left, int top, int right, int bottom) {
33 | mLeft = left;
34 | mTop = top;
35 | mRight = right;
36 | mBottom = bottom;
37 | return (T) this;
38 | }
39 |
40 | /** show dialog and mAnimateView with inner show com.flyco.animation(设置dialog和animateView显示动画) */
41 | protected void showWithAnim() {
42 | if (mInnerShowAnim != null) {
43 | mInnerShowAnim.setDuration(mInnerAnimDuration);
44 | mInnerShowAnim.setAnimationListener(new AnimationListener() {
45 | @Override
46 | public void onAnimationStart(Animation animation) {
47 | mIsInnerShowAnim = true;
48 | }
49 |
50 | @Override
51 | public void onAnimationRepeat(Animation animation) {
52 |
53 | }
54 |
55 | @Override
56 | public void onAnimationEnd(Animation animation) {
57 | mIsInnerShowAnim = false;
58 | }
59 | });
60 | mLlControlHeight.startAnimation(mInnerShowAnim);
61 | }
62 |
63 | if (mAnimateView != null) {
64 | if (getWindowInAs() != null) {
65 | mWindowInAs = getWindowInAs();
66 | }
67 | mWindowInAs.duration(mInnerAnimDuration).playOn(mAnimateView);
68 | }
69 | }
70 |
71 | /** dimiss dialog and mAnimateView with inner dismiss com.flyco.animation(设置dialog和animateView消失动画) */
72 | protected void dismissWithAnim() {
73 | if (mInnerDismissAnim != null) {
74 | mInnerDismissAnim.setDuration(mInnerAnimDuration);
75 | mInnerDismissAnim.setAnimationListener(new AnimationListener() {
76 | @Override
77 | public void onAnimationStart(Animation animation) {
78 | mIsInnerDismissAnim = true;
79 | }
80 |
81 | @Override
82 | public void onAnimationRepeat(Animation animation) {
83 |
84 | }
85 |
86 | @Override
87 | public void onAnimationEnd(Animation animation) {
88 | mIsInnerDismissAnim = false;
89 | superDismiss();
90 | }
91 | });
92 |
93 | mLlControlHeight.startAnimation(mInnerDismissAnim);
94 | } else {
95 | superDismiss();
96 | }
97 |
98 | if (mAnimateView != null) {
99 | if (getWindowOutAs() != null) {
100 | mWindowOutAs = getWindowOutAs();
101 | }
102 | mWindowOutAs.duration(mInnerAnimDuration).playOn(mAnimateView);
103 | }
104 | }
105 |
106 | @Override
107 | public boolean dispatchTouchEvent(MotionEvent ev) {
108 | if (mIsInnerDismissAnim || mIsInnerShowAnim) {
109 | return true;
110 | }
111 | return super.dispatchTouchEvent(ev);
112 | }
113 |
114 | @Override
115 | public void onBackPressed() {
116 | if (mIsInnerDismissAnim || mIsInnerShowAnim) {
117 | return;
118 | }
119 | super.onBackPressed();
120 | }
121 |
122 | protected abstract BaseAnimatorSet getWindowInAs();
123 |
124 | protected abstract BaseAnimatorSet getWindowOutAs();
125 | }
126 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/base/TopBaseDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget.base;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.content.Context;
5 | import android.view.Gravity;
6 | import android.view.View;
7 | import android.view.animation.Animation;
8 | import android.view.animation.TranslateAnimation;
9 | import android.widget.FrameLayout;
10 |
11 | import com.flyco.animation.BaseAnimatorSet;
12 |
13 | public abstract class TopBaseDialog> extends BottomTopBaseDialog {
14 | public TopBaseDialog(Context context, View animateView) {
15 | super(context);
16 | this.mAnimateView = animateView;
17 |
18 | mInnerShowAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
19 | Animation.RELATIVE_TO_SELF, -1, Animation.RELATIVE_TO_SELF, 0);
20 |
21 | mInnerDismissAnim = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, 0,
22 | Animation.RELATIVE_TO_SELF, 0, Animation.RELATIVE_TO_SELF, -1);
23 | }
24 |
25 | public TopBaseDialog(Context context) {
26 | this(context, null);
27 | }
28 |
29 | @Override
30 | protected void onStart() {
31 | super.onStart();
32 | mLlTop.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
33 | FrameLayout.LayoutParams.MATCH_PARENT));
34 | mLlTop.setGravity(Gravity.TOP);
35 | getWindow().setGravity(Gravity.TOP);
36 | mLlTop.setPadding(mLeft, mTop, mRight, mBottom);
37 | }
38 |
39 | @Override
40 | public void onAttachedToWindow() {
41 | super.onAttachedToWindow();
42 | showWithAnim();
43 | }
44 |
45 | @Override
46 | public void dismiss() {
47 | dismissWithAnim();
48 | }
49 |
50 | private BaseAnimatorSet mWindowInAs;
51 | private BaseAnimatorSet mWindowOutAs;
52 |
53 | @Override
54 | protected BaseAnimatorSet getWindowInAs() {
55 | if (mWindowInAs == null) {
56 | mWindowInAs = new WindowInAs();
57 | }
58 | return mWindowInAs;
59 | }
60 |
61 | @Override
62 | protected BaseAnimatorSet getWindowOutAs() {
63 | if (mWindowOutAs == null) {
64 | mWindowOutAs = new WindowOutAs();
65 | }
66 | return mWindowOutAs;
67 | }
68 |
69 | private class WindowInAs extends BaseAnimatorSet {
70 | @Override
71 | public void setAnimation(View view) {
72 | ObjectAnimator oa1 = ObjectAnimator.ofFloat(view, "scaleX", 1f, 0.9f);
73 | ObjectAnimator oa2 = ObjectAnimator.ofFloat(view, "scaleY", 1f, 0.9f);
74 | animatorSet.playTogether(oa1, oa2);
75 | }
76 | }
77 |
78 | private class WindowOutAs extends BaseAnimatorSet {
79 | @Override
80 | public void setAnimation(View view) {
81 | ObjectAnimator oa1 = ObjectAnimator.ofFloat(view, "scaleX", 0.9f, 1f);
82 | ObjectAnimator oa2 = ObjectAnimator.ofFloat(view, "scaleY", 0.9f, 1f);
83 | animatorSet.playTogether(oa1, oa2);
84 | }
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/internal/InternalBasePopup.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget.internal;
2 |
3 | import android.content.Context;
4 | import android.view.Gravity;
5 | import android.view.View;
6 | import android.view.ViewTreeObserver;
7 |
8 | import com.flyco.dialog.utils.StatusBarUtils;
9 | import com.flyco.dialog.widget.base.BaseDialog;
10 |
11 | /** Base class to help create PopupWindow Style Dialog(实现PopupWindow风格对话框基类) */
12 | public abstract class InternalBasePopup> extends BaseDialog {
13 | protected View mAnchorView;
14 | protected int mX;
15 | protected int mY;
16 | /** BubblePopup位于给定位置上方(Gravity.Top)或者下方(Gravity.Bottom) */
17 | protected int mGravity;
18 | protected float mXOffset;
19 | protected float mYOffset;
20 | protected boolean isLayoutObtain;
21 |
22 | public InternalBasePopup(Context context) {
23 | super(context);
24 | heightScale(1);
25 | dimEnabled(false);
26 | }
27 |
28 | @Override
29 | public void onViewCreated(final View inflate) {
30 | mLlControlHeight.setClipChildren(false);
31 | if (inflate != null) {
32 | inflate.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
33 | @Override
34 | public void onGlobalLayout() {
35 | isLayoutObtain = true;
36 | onLayoutObtain();
37 | }
38 | });
39 | }
40 | }
41 |
42 | @Override
43 | public void onAttachedToWindow() {
44 | super.onAttachedToWindow();
45 | mOnCreateView.setClickable(false);
46 | if (isLayoutObtain) {
47 | onLayoutObtain();
48 | }
49 | }
50 |
51 | /** At this time, we can get view size in dialog(可以获得对话框内视图大小) */
52 | public abstract void onLayoutObtain();
53 |
54 | public abstract T anchorView(View anchorView);
55 |
56 | /** Gravity.Top or Gravity.Bottom of given positon */
57 | public T gravity(int gravity) {
58 | if (gravity != Gravity.TOP && gravity != Gravity.BOTTOM) {
59 | throw new IllegalArgumentException("Gravity must be either Gravity.TOP or Gravity.BOTTOM");
60 | }
61 | mGravity = gravity;
62 | anchorView(mAnchorView);
63 | return (T) this;
64 | }
65 |
66 | public T location(int x, int y) {
67 | mX = x;
68 | mY = y - StatusBarUtils.getHeight(mContext);
69 | return (T) this;
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/popup/BubblePopup.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget.popup;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 |
6 | import com.flyco.dialog.widget.popup.base.BaseBubblePopup;
7 |
8 | /**
9 | * Use dialog to realize bubble style popup(利用Dialog实现泡泡样式的弹窗)
10 | * thanks https://github.com/michaelye/EasyDialog
11 | */
12 | public class BubblePopup extends BaseBubblePopup {
13 |
14 | public BubblePopup(Context context, View wrappedView) {
15 | super(context, wrappedView);
16 | }
17 |
18 | @Override
19 | public View onCreateBubbleView() {
20 | return null;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/popup/base/BaseBubblePopup.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget.popup.base;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.Gravity;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 | import android.widget.RelativeLayout;
9 |
10 | import com.flyco.animation.BounceEnter.BounceLeftEnter;
11 | import com.flyco.animation.FadeExit.FadeExit;
12 | import com.flyco.dialog.R;
13 | import com.flyco.dialog.utils.CornerUtils;
14 | import com.flyco.dialog.utils.StatusBarUtils;
15 | import com.flyco.dialog.view.TriangleView;
16 | import com.flyco.dialog.widget.internal.InternalBasePopup;
17 |
18 | /**
19 | * Use dialog to realize bubble style popup(利用Dialog实现泡泡样式的弹窗)
20 | * thanks https://github.com/michaelye/EasyDialog
21 | */
22 | public abstract class BaseBubblePopup> extends InternalBasePopup {
23 | protected View mWrappedView;
24 | protected LinearLayout mLlContent;
25 | protected TriangleView mTriangleView;
26 | protected RelativeLayout.LayoutParams mLayoutParams;
27 | protected int mBubbleColor;
28 | protected int mCornerRadius;
29 | protected int mMarginLeft;
30 | protected int mMarginRight;
31 | protected int triangleWidth;
32 | protected int triangleHeight;
33 | private RelativeLayout.LayoutParams mTriangleLayoutParams;
34 |
35 | public BaseBubblePopup(Context context) {
36 | super(context);
37 | mWrappedView = onCreateBubbleView();
38 | init();
39 | }
40 |
41 | public BaseBubblePopup(Context context, View wrappedView) {
42 | super(context);
43 | mWrappedView = wrappedView;
44 | init();
45 | }
46 |
47 | private void init() {
48 | showAnim(new BounceLeftEnter());
49 | dismissAnim(new FadeExit());
50 | dimEnabled(false);
51 |
52 | bubbleColor(Color.parseColor("#BB000000"));
53 | cornerRadius(5);
54 | margin(8, 8);
55 | gravity(Gravity.TOP);
56 | triangleWidth(24);
57 | triangleHeight(12);
58 | }
59 |
60 | public abstract View onCreateBubbleView();
61 |
62 | @Override
63 | public View onCreateView() {
64 | View inflate = View.inflate(mContext, R.layout.popup_bubble, null);
65 | mLlContent = (LinearLayout) inflate.findViewById(R.id.ll_content);
66 | mTriangleView = (TriangleView) inflate.findViewById(R.id.triangle_view);
67 | mLlContent.addView(mWrappedView);
68 |
69 | mLayoutParams = (RelativeLayout.LayoutParams) mLlContent.getLayoutParams();
70 | mTriangleLayoutParams = (RelativeLayout.LayoutParams) mTriangleView.getLayoutParams();
71 | //让mOnCreateView充满父控件,防止ViewHelper.setXY导致点击事件无效
72 | inflate.setLayoutParams(new LinearLayout.LayoutParams(
73 | LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
74 | return inflate;
75 | }
76 |
77 | @Override
78 | public void setUiBeforShow() {
79 | mLlContent.setBackgroundDrawable(
80 | CornerUtils.cornerDrawable(mBubbleColor, mCornerRadius));
81 | mLayoutParams.setMargins(mMarginLeft, 0, mMarginRight, 0);
82 | mLlContent.setLayoutParams(mLayoutParams);
83 |
84 | mTriangleView.setColor(mBubbleColor);
85 | mTriangleView.setGravity(mGravity == Gravity.TOP ? Gravity.BOTTOM : Gravity.TOP);
86 |
87 | mTriangleLayoutParams.width = triangleWidth;
88 | mTriangleLayoutParams.height = triangleHeight;
89 | mTriangleView.setLayoutParams(mTriangleLayoutParams);
90 | }
91 |
92 | @Override
93 | public void onLayoutObtain() {
94 | mTriangleView.setX(mX - mTriangleView.getWidth() / 2);
95 |
96 | if (mGravity == Gravity.TOP) {
97 | int y = mY - mTriangleView.getHeight();
98 | mTriangleView.setY(y);
99 | mLlContent.setY(y - mLlContent.getHeight());
100 | } else {
101 | mTriangleView.setY(mY);
102 | mLlContent.setY(mY + mTriangleView.getHeight());
103 | }
104 |
105 | /**
106 | * mX--->三角形中心距离屏幕左边距离
107 | * mDisplayMetrics.widthPixels - mX--->三角形中心距离屏幕右边距离
108 | */
109 | int availableLeft = mX - mLayoutParams.leftMargin;//左侧最大可用距离
110 | int availableRight = mDisplayMetrics.widthPixels - mX - mLayoutParams.rightMargin;//右侧最大可用距离
111 |
112 | int x = 0;
113 | int contentWidth = mLlContent.getWidth();
114 | if (contentWidth / 2 <= availableLeft && contentWidth / 2 <= availableRight) {
115 | x = mX - contentWidth / 2;
116 | } else {
117 | if (availableLeft <= availableRight) {//三角形在屏幕中心的左边
118 | x = mLayoutParams.leftMargin;
119 | } else {//三角形在屏幕中心的右边
120 | x = mDisplayMetrics.widthPixels - (contentWidth + mLayoutParams.rightMargin);
121 | }
122 | }
123 | mLlContent.setX(x);
124 | }
125 |
126 | @Override
127 | public T anchorView(View anchorView) {
128 | if (anchorView != null) {
129 | mAnchorView = anchorView;
130 | int[] location = new int[2];
131 | mAnchorView.getLocationOnScreen(location);
132 |
133 | mX = location[0] + anchorView.getWidth() / 2;
134 | if (mGravity == Gravity.TOP) {
135 | mY = location[1] - StatusBarUtils.getHeight(mContext)
136 | - dp2px(1);
137 | } else {
138 | mY = location[1] - StatusBarUtils.getHeight(mContext)
139 | + anchorView.getHeight() + dp2px(1);
140 | }
141 | }
142 | return (T) this;
143 | }
144 |
145 | public T bubbleColor(int bubbleColor) {
146 | mBubbleColor = bubbleColor;
147 | return (T) this;
148 | }
149 |
150 | public T cornerRadius(float cornerRadius) {
151 | mCornerRadius = dp2px(cornerRadius);
152 | return (T) this;
153 | }
154 |
155 | public T margin(float marginLeft, float marginRight) {
156 | mMarginLeft = dp2px(marginLeft);
157 | mMarginRight = dp2px(marginRight);
158 | return (T) this;
159 | }
160 |
161 | public T triangleWidth(float width) {
162 | triangleWidth = dp2px(width);
163 | return (T) this;
164 | }
165 |
166 | public T triangleHeight(float height) {
167 | triangleHeight = dp2px(height);
168 | return (T) this;
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/java/com/flyco/dialog/widget/popup/base/BasePopup.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialog.widget.popup.base;
2 |
3 | import android.content.Context;
4 | import android.view.Gravity;
5 | import android.view.View;
6 | import android.widget.LinearLayout;
7 |
8 | import com.flyco.dialog.R;
9 | import com.flyco.dialog.utils.StatusBarUtils;
10 | import com.flyco.dialog.widget.internal.InternalBasePopup;
11 |
12 | public abstract class BasePopup> extends InternalBasePopup {
13 | protected View mWrappedView;
14 | protected LinearLayout mLlContent;
15 | protected boolean mAlignCenter;
16 |
17 | public BasePopup(Context context) {
18 | super(context);
19 | mWrappedView = onCreatePopupView();
20 | gravity(Gravity.BOTTOM);
21 | }
22 |
23 | public abstract View onCreatePopupView();
24 |
25 | @Override
26 | public View onCreateView() {
27 | View inflate = View.inflate(mContext, R.layout.popup_base, null);
28 | mLlContent = (LinearLayout) inflate.findViewById(R.id.ll_content);
29 | mLlContent.addView(mWrappedView);
30 |
31 | //让mOnCreateView充满父控件,防止ViewHelper.setXY导致点击事件无效
32 | inflate.setLayoutParams(new LinearLayout.LayoutParams(
33 | LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
34 | return inflate;
35 | }
36 |
37 | public T offset(float xOffset, float yOffset) {
38 | mXOffset = xOffset;
39 | mYOffset = yOffset;
40 | return (T) this;
41 | }
42 |
43 | /** align center of pop and anchorView(弹窗与anchorView中心对齐) */
44 | public T alignCenter(boolean alignCenter) {
45 | mAlignCenter = alignCenter;
46 | return (T) this;
47 | }
48 |
49 | @Override
50 | public T anchorView(View anchorView) {
51 | if (anchorView != null) {
52 | mAnchorView = anchorView;
53 | int[] location = new int[2];
54 | mAnchorView.getLocationOnScreen(location);
55 |
56 | mX = location[0];
57 | if (mGravity == Gravity.TOP) {
58 | mY = location[1] - StatusBarUtils.getHeight(mContext);
59 | } else {
60 | mY = location[1] - StatusBarUtils.getHeight(mContext)
61 | + anchorView.getHeight();
62 | }
63 | }
64 | return (T) this;
65 | }
66 |
67 | /** At this time, we can get view size in dialog(可以获得对话框内视图大小) */
68 | @Override
69 | public void onLayoutObtain() {
70 | int x = mX;
71 | int y = mY;
72 | if (mGravity == Gravity.TOP) {
73 | y = mY - mLlContent.getHeight();
74 | }
75 |
76 | if (mAlignCenter) {
77 | x = mX + mAnchorView.getWidth() / 2 - mLlContent.getWidth() / 2;
78 | }
79 |
80 | x = getX(x);
81 | y = getY(y);
82 |
83 | x = getX(x + dp2px(mXOffset));
84 | y = getY(y + dp2px(mYOffset));
85 |
86 | mLlContent.setX(x);
87 | mLlContent.setY(y);
88 | }
89 |
90 | private int getX(int x) {
91 | if (x < 0) {
92 | x = 0;
93 | }
94 | if (x + mLlContent.getWidth() > mDisplayMetrics.widthPixels) {
95 | x = mDisplayMetrics.widthPixels - mLlContent.getWidth();
96 | }
97 |
98 | return x;
99 | }
100 |
101 | private int getY(int y) {
102 | if (y < 0) {
103 | y = 0;
104 | }
105 | if (y + mLlContent.getHeight() > mMaxHeight) {
106 | y = (int) (mMaxHeight - mLlContent.getHeight());
107 | }
108 |
109 | return y;
110 | }
111 | }
112 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/res/layout/popup_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/FlycoDialog_Lib/src/main/res/layout/popup_bubble.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/Jar/nineoldandroids-2.4.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/Jar/nineoldandroids-2.4.0.jar
--------------------------------------------------------------------------------
/Jar/v1.0.0/FlycoAnimation_Lib-v1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/Jar/v1.0.0/FlycoAnimation_Lib-v1.0.0.jar
--------------------------------------------------------------------------------
/Jar/v1.0.0/FlycoDialog_Lib-v1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/Jar/v1.0.0/FlycoDialog_Lib-v1.0.0.jar
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 H07000223
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # FlycoDialog-Master
2 | [](https://android-arsenal.com/details/1/2430)
3 | #### [中文版](https://github.com/H07000223/FlycoDialog_Master/blob/master/README_CN.md)
4 | An Android Dialog Lib simplify customization. Supprot 2.2+.
5 |
6 | ## Features
7 | - [Built-in Dialog, convenient to use](#Built-in Dialog)
8 | - [Abundant Built-in Animations, convenient to use](#Abundant Built-in Animations)
9 | - [Qucik Customize Dialog](#Qucik Customize Dialog)
10 | - [Qucik Customize Popup](#Qucik Customize Popup)
11 | - [Support Customize Dialog Animation](#Customize Dialog Animation)
12 |
13 | #### [DemoApk Download](http://fir.im/mj9p)
14 |
15 | ## Built-in Dialog
16 | |Dialog|Description|ScreenShot|gif
17 | |:---:|:---:|:---:|:---:|
18 | | NormalDialog | Default(Two Btns) |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_1.gif)
19 | | NormalDialog | Style Two |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_2.gif)
20 | | NormalDialog | Custom Attr |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_3.gif)
21 | | NormalDialog | One Btn |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_4.gif)
22 | | NormalDialog | Three Btns |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_5.gif)
23 | | MaterialDialog | Default(Two Btns) |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_6.gif)
24 | | MaterialDialog | One Btn |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_7.gif)
25 | | MaterialDialog | Three Btns |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_8.gif)
26 | | NormalListDialog | Default |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_9.gif)
27 | | NormalListDialog | Custom Attr |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_10.gif)
28 | | NormalListDialog | No Title|
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_11.gif)
29 | | ActionSheetDialog | Default |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_12.gif)
30 | | ActionSheetDialog | No Title |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_13.gif)
31 |
32 | ## Built-in Popup
33 | |Popup|Description|ScreenShot|gif
34 | |:---:|:---:|:---:|:---:|
35 | | BubblePopup | BubblePopup |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_popup_1.gif)
36 |
37 | >## Change Log
38 |
39 | > v1.3.0(2015-05-21)
40 | - remove the dependence of NineOldAnimation(only support 3.0+)
41 |
42 | > v1.2.6(2015-01-07)
43 | - Combine FlycoAnimation_Lib into FlycoDialog_Lib
44 | - Fix bug for View in Popup click no response
45 | - Improve the function of BaseBubblePopup
46 |
47 | > v1.2.2(2015-12-20)
48 | - BasePopup small bug fix
49 |
50 | > v1.2.0(2015-12-19)
51 | - new added base widget - BasePopup
52 | - new added built-in widget - BubblePopup
53 | - BaseDialog support auto dimiss in given delay
54 |
55 | ## Qucik Customize Dialog
56 | >
57 | - step1:extends BaseDialog(or BottomBaseDialog or TopBaseDialog)
58 | - step2:inflate layout and find views in onCreateView method
59 | - step3:do logic operation in setUiBeforShow method
60 |
61 | ```Java
62 | public class CustomBaseDialog extends BaseDialog {
63 | private TextView tv_cancel;
64 | private TextView tv_exit;
65 |
66 | public CustomBaseDialog(Context context) {
67 | super(context);
68 | }
69 |
70 | @Override
71 | public View onCreateView() {
72 | widthScale(0.85f);
73 | showAnim(new Swing());
74 |
75 | // dismissAnim(this, new ZoomOutExit());
76 | View inflate = View.inflate(context, R.layout.dialog_custom_base, null);
77 | tv_cancel = ViewFindUtils.find(inflate, R.id.tv_cancel);
78 | tv_exit = ViewFindUtils.find(inflate, R.id.tv_exit);
79 | inflate.setBackgroundDrawable(
80 | CornerUtils.cornerDrawable(Color.parseColor("#ffffff"), dp2px(5)));
81 |
82 | return inflate;
83 | }
84 |
85 | @Override
86 | public boolean setUiBeforShow() {
87 | tv_cancel.setOnClickListener(new View.OnClickListener() {
88 | @Override
89 | public void onClick(View v) {
90 | dismiss();
91 | }
92 | });
93 |
94 | tv_exit.setOnClickListener(new View.OnClickListener() {
95 | @Override
96 | public void onClick(View v) {
97 | dismiss();
98 | }
99 | });
100 |
101 | return false;
102 | }
103 | }
104 | ```
105 |
106 | ## Qucik Customize Popup
107 | >
108 | - step1:extends BasePopup
109 | - step2:inflate layout and find views in onCreatePopupView method
110 | - step3:do logic operation in setUiBeforShow method
111 |
112 | ```java
113 | public class SimpleCustomPop extends BasePopup {
114 | public SimpleCustomPop(Context context) {
115 | super(context);
116 | }
117 |
118 | @Override
119 | public View onCreatePopupView() {
120 | return View.inflate(mContext, R.layout.popup_custom, null);
121 | }
122 |
123 | @Override
124 | public void setUiBeforShow() {
125 |
126 | }
127 | }
128 | ```
129 |
130 | ## Gradle
131 |
132 | ```groovy
133 | dependencies{
134 | compile 'com.flyco.dialog:FlycoDialog_Lib:1.2.2@aar'
135 | compile 'com.flyco.animation:FlycoAnimation_Lib:1.0.0@aar'
136 | compile 'com.nineoldandroids:library:2.4.0'
137 | }
138 |
139 | After v1.2.6
140 | dependencies{
141 | compile 'com.flyco.dialog:FlycoDialog_Lib:1.2.8@aar'
142 | compile 'com.nineoldandroids:library:2.4.0'
143 | }
144 |
145 | After v1.3.0
146 | dependencies{
147 | compile 'com.flyco.dialog:FlycoDialog_Lib:1.3.2@aar'
148 | }
149 |
150 | ```
151 |
152 | ## Eclispe(no update)
153 | Eclipse Developers should include jars below into your project.
154 | * [FlycoAnimation_Lib-v1.0.0.jar](https://github.com/H07000223/FlycoDialog_Master/blob/master/Jar/v1.0.0/FlycoAnimation_Lib-v1.0.0.jar)
155 | * [FlycoDialog_Lib-v1.0.0.jar](https://github.com/H07000223/FlycoDialog_Master/blob/master/Jar/v1.0.0/FlycoDialog_Lib-v1.0.0.jar)
156 | * [nineoldandroids-2.4.0.jar](https://github.com/H07000223/FlycoDialog_Master/blob/master/Jar/nineoldandroids-2.4.0.jar)
157 |
158 | ## Thanks
159 | * [NineOldAndroids](https://github.com/JakeWharton/NineOldAndroids)
160 | * [NiftyDialogEffects](https://github.com/sd6352051/NiftyDialogEffects)
161 | * [AndroidViewAnimations](https://github.com/daimajia/AndroidViewAnimations)
162 |
--------------------------------------------------------------------------------
/README_CN.md:
--------------------------------------------------------------------------------
1 | # FlycoDialog-Master
2 | [](https://android-arsenal.com/details/1/2430)
3 |
4 | 一个强大的Android对话框库,简化自定义对话框.支持2.2+.
5 |
6 | ## 特点
7 | - [内置Dialog,方便直接使用](#内置Dialog)
8 | - [丰富的内置动画库,方便直接使用](#丰富的内置动画库)
9 | - [支持快速自定义Dialog](#如何快速自定义Dialog)
10 | - [支持快速自定义Popup](#如何快速自定义Popup)
11 | - [支持自定义Dialog动画](#自定义Dialog动画)
12 |
13 | #### [DemoApk下载](http://fir.im/mj9p)
14 |
15 | ## 内置Dialog
16 | |对话框|描述|截图|gif动画
17 | |:---:|:---:|:---:|:---:|
18 | | NormalDialog | 默认(两个按钮) |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_1.gif)
19 | | NormalDialog | 第二种风格 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_2.gif)
20 | | NormalDialog | 自定义属性 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_3.gif)
21 | | NormalDialog | 一个按钮 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_4.gif)
22 | | NormalDialog | 三个按钮 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_5.gif)
23 | | MaterialDialog | 默认(两个按钮) |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_6.gif)
24 | | MaterialDialog | 一个按钮 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_7.gif)
25 | | MaterialDialog | 三个按钮 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_8.gif)
26 | | NormalListDialog | 默认 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_9.gif)
27 | | NormalListDialog | 自定义属性 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_10.gif)
28 | | NormalListDialog | 无标题 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_11.gif)
29 | | ActionSheetDialog | 默认 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_12.gif)
30 | | ActionSheetDialog | 无标题 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_13.gif)
31 |
32 | ## 内置Popup
33 | |弹窗|描述|截图|gif动画
34 | |:---:|:---:|:---:|:---:|
35 | | 弹窗 | 带三角箭头的提示弹窗 |
|[gif](https://github.com/H07000223/FlycoDialog_Master/blob/master/gif/preview_popup_1.gif)
36 |
37 | >## 更新说明
38 |
39 | > v1.3.0(2015-05-21)
40 | - 删除了对NineOldAnimation库依赖(仅支持3.0+)
41 |
42 | > v1.2.6(2015-01-07)
43 | - 将FlycoAnimation_Lib库合并到FlycoDialog_Lib中
44 | - 修复bug,在Popup中的View设置点击监听无效
45 | - 完善BaseBubblePopup功能
46 |
47 | > v1.2.2(2015-12-20)
48 | - BasePopup 小bug修复
49 |
50 | > v1.2.0(2015-12-19)
51 | - 新增基类BasePopup,用于快速自定义Popwindow样式Dialog
52 | - 新增内置控件BubblePopup
53 | - 新增支持Dialog自动消失技能
54 |
55 | ## 如何快速自定义Dialog
56 | >
57 | - 步骤一:继承BaseDialog(或者BottomBaseDialog或者TopBaseDialog)
58 | - 步骤二:在onCreateView方法填充布局和查找控件
59 | - 步骤三:在setUiBeforShow方法中做一些逻辑操作,例如设置数据,设置监听之类
60 |
61 | ```Java
62 | public class CustomBaseDialog extends BaseDialog {
63 | private TextView tv_cancel;
64 | private TextView tv_exit;
65 |
66 | public CustomBaseDialog(Context context) {
67 | super(context);
68 | }
69 |
70 | @Override
71 | public View onCreateView() {
72 | widthScale(0.85f);
73 | showAnim(new Swing());
74 |
75 | // dismissAnim(this, new ZoomOutExit());
76 | View inflate = View.inflate(context, R.layout.dialog_custom_base, null);
77 | tv_cancel = ViewFindUtils.find(inflate, R.id.tv_cancel);
78 | tv_exit = ViewFindUtils.find(inflate, R.id.tv_exit);
79 | inflate.setBackgroundDrawable(
80 | CornerUtils.cornerDrawable(Color.parseColor("#ffffff"), dp2px(5)));
81 |
82 | return inflate;
83 | }
84 |
85 | @Override
86 | public boolean setUiBeforShow() {
87 | tv_cancel.setOnClickListener(new View.OnClickListener() {
88 | @Override
89 | public void onClick(View v) {
90 | dismiss();
91 | }
92 | });
93 |
94 | tv_exit.setOnClickListener(new View.OnClickListener() {
95 | @Override
96 | public void onClick(View v) {
97 | dismiss();
98 | }
99 | });
100 |
101 | return false;
102 | }
103 | }
104 | ```
105 |
106 | ## 如何快速自定义Popup
107 | >
108 | - 步骤一:继承BasePopup
109 | - 步骤二:在onCreatePopupView方法填充布局和查找控件
110 | - 步骤三:在setUiBeforShow方法中做一些逻辑操作,例如设置数据,设置监听之类
111 |
112 | ```java
113 | public class SimpleCustomPop extends BasePopup {
114 | public SimpleCustomPop(Context context) {
115 | super(context);
116 | }
117 |
118 | @Override
119 | public View onCreatePopupView() {
120 | return View.inflate(mContext, R.layout.popup_custom, null);
121 | }
122 |
123 | @Override
124 | public void setUiBeforShow() {
125 |
126 | }
127 | }
128 | ```
129 |
130 | ## Gradle
131 |
132 | ```groovy
133 | dependencies{
134 | compile 'com.flyco.dialog:FlycoDialog_Lib:1.2.2@aar'
135 | compile 'com.flyco.animation:FlycoAnimation_Lib:1.0.0@aar'
136 | compile 'com.nineoldandroids:library:2.4.0'
137 | }
138 |
139 |
140 | After v1.2.6
141 | dependencies{
142 | compile 'com.flyco.dialog:FlycoDialog_Lib:1.2.8@aar'
143 | compile 'com.nineoldandroids:library:2.4.0'
144 | }
145 |
146 | After v1.3.0
147 | dependencies{
148 | compile 'com.flyco.dialog:FlycoDialog_Lib:1.3.2@aar'
149 | }
150 |
151 | ```
152 |
153 | ## Eclispe(不再维护更新)
154 | Eclipse Developers should include jars below into your project.
155 | * [FlycoAnimation_Lib-v1.0.0.jar](https://github.com/H07000223/FlycoDialog_Master/blob/master/Jar/v1.0.0/FlycoAnimation_Lib-v1.0.0.jar)
156 | * [FlycoDialog_Lib-v1.0.0.jar](https://github.com/H07000223/FlycoDialog_Master/blob/master/Jar/v1.0.0/FlycoDialog_Lib-v1.0.0.jar)
157 | * [nineoldandroids-2.4.0.jar](https://github.com/H07000223/FlycoDialog_Master/blob/master/Jar/nineoldandroids-2.4.0.jar)
158 |
159 | ## Thanks
160 | * [NineOldAndroids](https://github.com/JakeWharton/NineOldAndroids)
161 | * [NiftyDialogEffects](https://github.com/sd6352051/NiftyDialogEffects)
162 | * [AndroidViewAnimations](https://github.com/daimajia/AndroidViewAnimations)
163 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.3"
6 |
7 | defaultConfig {
8 | minSdkVersion 11
9 | targetSdkVersion 23
10 | versionCode 110
11 | versionName "1.1.0"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | compile 'com.android.support:appcompat-v7:23.4.0'
24 | compile 'com.jakewharton:butterknife:7.0.1'
25 |
26 | compile project(':FlycoDialog_Lib')
27 |
28 | // After 1.3.0
29 | // compile 'com.flyco.dialog:FlycoDialog_Lib:1.3.2@aar'
30 |
31 | // compile 'com.flyco.dialog:FlycoDialog_Lib:1.2.8@aar'
32 | // compile 'com.nineoldandroids:library:2.4.0'
33 | }
34 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\AS\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/h8/DialogIntegrate/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.h8.DialogIntegrate;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
23 |
25 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/adapter/HomeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.adapter;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseExpandableListAdapter;
8 | import android.widget.TextView;
9 |
10 | import com.flyco.dialogsamples.R;
11 | import com.flyco.dialogsamples.ui.DialogHomeActivity;
12 |
13 | import butterknife.ButterKnife;
14 |
15 |
16 | public class HomeAdapter extends BaseExpandableListAdapter {
17 | private Context mContext;
18 |
19 | public HomeAdapter(Context context) {
20 | this.mContext = context;
21 | }
22 |
23 | // --->group
24 | @Override
25 | public int getGroupCount() {
26 | return DialogHomeActivity.mGroups.length;
27 | }
28 |
29 | @Override
30 | public Object getGroup(int groupPosition) {
31 | return DialogHomeActivity.mGroups[groupPosition];
32 | }
33 |
34 | @Override
35 | public long getGroupId(int groupPosition) {
36 | return groupPosition;
37 | }
38 |
39 | @Override
40 | public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
41 | if (convertView == null) {
42 | convertView = View.inflate(mContext, R.layout.ad_dialog_home, null);
43 | }
44 |
45 | TextView tv = ButterKnife.findById(convertView, R.id.tv_bubble);
46 | tv.setText(DialogHomeActivity.mGroups[groupPosition]);
47 | return convertView;
48 | }
49 |
50 | // --->child
51 | @Override
52 | public int getChildrenCount(int groupPosition) {
53 | return DialogHomeActivity.mChilds[groupPosition].length;
54 | }
55 |
56 | @Override
57 | public Object getChild(int groupPosition, int childPosition) {
58 | return DialogHomeActivity.mChilds[groupPosition][childPosition];
59 | }
60 |
61 | @Override
62 | public long getChildId(int groupPosition, int childPosition) {
63 | return childPosition;
64 | }
65 |
66 | @Override
67 | public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View convertView,
68 | ViewGroup parent) {
69 | if (convertView == null) {
70 | convertView = View.inflate(mContext, R.layout.ad_dialog_home, null);
71 | }
72 |
73 | TextView tv = ButterKnife.findById(convertView, R.id.tv_bubble);
74 | View v_line = ButterKnife.findById(convertView, R.id.v_line);
75 |
76 | v_line.setVisibility(View.INVISIBLE);
77 | tv.setTextColor(Color.parseColor("#383838"));
78 | tv.setText(DialogHomeActivity.mChilds[groupPosition][childPosition]);
79 |
80 | return convertView;
81 | }
82 |
83 | @Override
84 | public boolean hasStableIds() {
85 | return true;
86 | }
87 |
88 | @Override
89 | public boolean isChildSelectable(int groupPosition, int childPosition) {
90 | return true;
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/adapter/TestAdapter.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.adapter;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.graphics.Color;
6 | import android.util.DisplayMetrics;
7 | import android.util.TypedValue;
8 | import android.view.Gravity;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.BaseAdapter;
12 | import android.widget.ImageView;
13 | import android.widget.LinearLayout;
14 | import android.widget.TextView;
15 |
16 | import com.flyco.dialog.entity.DialogMenuItem;
17 |
18 | import java.util.ArrayList;
19 |
20 | public class TestAdapter extends BaseAdapter {
21 | private Context mContext;
22 | private ArrayList mMenuItems;
23 | private DisplayMetrics mDisplayMetrics;
24 |
25 | public TestAdapter(Context context, ArrayList customBaseItems) {
26 | this.mContext = context;
27 | this.mMenuItems = customBaseItems;
28 |
29 | mDisplayMetrics = new DisplayMetrics();
30 | ((Activity) context).getWindowManager().getDefaultDisplay().getMetrics(mDisplayMetrics);
31 | }
32 |
33 | @Override
34 | public int getCount() {
35 | return mMenuItems.size();
36 | }
37 |
38 | @Override
39 | public Object getItem(int position) {
40 | return null;
41 | }
42 |
43 | @Override
44 | public long getItemId(int position) {
45 | return position;
46 | }
47 |
48 | @Override
49 | public View getView(int position, View convertView, ViewGroup parent) {
50 | final DialogMenuItem item = mMenuItems.get(position);
51 |
52 | LinearLayout ll_item = new LinearLayout(mContext);
53 | ll_item.setOrientation(LinearLayout.HORIZONTAL);
54 | ll_item.setGravity(Gravity.CENTER_VERTICAL);
55 |
56 | ImageView iv_item = new ImageView(mContext);
57 | iv_item.setPadding(0, 0, (int) (15 * mDisplayMetrics.density), 0);
58 | ll_item.addView(iv_item);
59 |
60 | TextView tv_item = new TextView(mContext);
61 | tv_item.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
62 | LinearLayout.LayoutParams.WRAP_CONTENT));
63 | tv_item.setSingleLine(true);
64 | tv_item.setTextColor(Color.parseColor("#303030"));
65 | tv_item.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
66 |
67 | ll_item.addView(tv_item);
68 | ll_item.setPadding(item.mResId == 0 ? (int) (18 * mDisplayMetrics.density) : (int) (16 * mDisplayMetrics.density), (int) (10 * mDisplayMetrics.density), 0,
69 | (int) (10 * mDisplayMetrics.density));
70 |
71 | iv_item.setImageResource(item.mResId);
72 | tv_item.setText(item.mOperName);
73 | iv_item.setVisibility(item.mResId == 0 ? View.GONE : View.VISIBLE);
74 |
75 | return ll_item;
76 | }
77 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/extra/CustomBaseDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.extra;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.view.View;
6 | import android.widget.TextView;
7 |
8 | import com.flyco.animation.Attention.Swing;
9 | import com.flyco.dialog.utils.CornerUtils;
10 | import com.flyco.dialog.widget.base.BaseDialog;
11 | import com.flyco.dialogsamples.R;
12 |
13 | import butterknife.Bind;
14 | import butterknife.ButterKnife;
15 |
16 | public class CustomBaseDialog extends BaseDialog {
17 | @Bind(R.id.tv_cancel) TextView mTvCancel;
18 | @Bind(R.id.tv_exit) TextView mTvExit;
19 |
20 | public CustomBaseDialog(Context context) {
21 | super(context);
22 | }
23 |
24 | @Override
25 | public View onCreateView() {
26 | widthScale(0.85f);
27 | showAnim(new Swing());
28 |
29 | // dismissAnim(this, new ZoomOutExit());
30 | View inflate = View.inflate(mContext, R.layout.dialog_custom_base, null);
31 | ButterKnife.bind(this, inflate);
32 | inflate.setBackgroundDrawable(
33 | CornerUtils.cornerDrawable(Color.parseColor("#ffffff"), dp2px(5)));
34 |
35 | return inflate;
36 | }
37 |
38 | @Override
39 | public void setUiBeforShow() {
40 | mTvCancel.setOnClickListener(new View.OnClickListener() {
41 | @Override
42 | public void onClick(View v) {
43 | dismiss();
44 | }
45 | });
46 | mTvExit.setOnClickListener(new View.OnClickListener() {
47 | @Override
48 | public void onClick(View v) {
49 | dismiss();
50 | }
51 | });
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/extra/CustomBubblePopup.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.extra;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.ImageView;
6 | import android.widget.TextView;
7 |
8 | import com.flyco.dialog.widget.popup.base.BaseBubblePopup;
9 | import com.flyco.dialogsamples.R;
10 | import com.flyco.dialogsamples.utils.T;
11 |
12 | public class CustomBubblePopup extends BaseBubblePopup {
13 |
14 | private ImageView mIvBubble;
15 | private TextView mTvBubble;
16 |
17 | public CustomBubblePopup(Context context) {
18 | super(context);
19 | }
20 |
21 | @Override
22 | public View onCreateBubbleView() {
23 | View inflate = View.inflate(mContext, R.layout.popup_bubble_image, null);
24 | mTvBubble = (TextView) inflate.findViewById(R.id.tv_bubble);
25 | mIvBubble = (ImageView) inflate.findViewById(R.id.iv_bubble);
26 | return inflate;
27 | }
28 |
29 | @Override
30 | public void setUiBeforShow() {
31 | super.setUiBeforShow();
32 |
33 | mTvBubble.setOnClickListener(new View.OnClickListener() {
34 | @Override
35 | public void onClick(View v) {
36 | T.showShort(mContext, "mTvBubble--->");
37 | }
38 | });
39 | mIvBubble.setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View v) {
42 | T.showShort(mContext, "mIvBubble--->");
43 | }
44 | });
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/extra/IOSTaoBaoDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.extra;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.content.Context;
5 | import android.view.View;
6 | import android.widget.LinearLayout;
7 |
8 | import com.flyco.animation.BaseAnimatorSet;
9 | import com.flyco.dialog.widget.base.BottomBaseDialog;
10 | import com.flyco.dialogsamples.R;
11 | import com.flyco.dialogsamples.utils.T;
12 |
13 | import butterknife.Bind;
14 | import butterknife.ButterKnife;
15 |
16 | public class IOSTaoBaoDialog extends BottomBaseDialog {
17 | @Bind(R.id.ll_wechat_friend_circle) LinearLayout mLlWechatFriendCircle;
18 | @Bind(R.id.ll_wechat_friend) LinearLayout mLlWechatFriend;
19 | @Bind(R.id.ll_qq) LinearLayout mLlQq;
20 | @Bind(R.id.ll_sms) LinearLayout mLlSms;
21 |
22 | public IOSTaoBaoDialog(Context context, View animateView) {
23 | super(context, animateView);
24 | }
25 |
26 | public IOSTaoBaoDialog(Context context) {
27 | super(context);
28 | }
29 |
30 | @Override
31 | public View onCreateView() {
32 | View inflate = View.inflate(mContext, R.layout.dialog_ios_taobao, null);
33 | ButterKnife.bind(this, inflate);
34 |
35 | return inflate;
36 | }
37 |
38 | @Override
39 | public void setUiBeforShow() {
40 | mLlWechatFriendCircle.setOnClickListener(new View.OnClickListener() {
41 | @Override
42 | public void onClick(View v) {
43 | T.showShort(mContext, "朋友圈");
44 | dismiss();
45 | }
46 | });
47 | mLlWechatFriend.setOnClickListener(new View.OnClickListener() {
48 | @Override
49 | public void onClick(View v) {
50 | T.showShort(mContext, "微信");
51 | dismiss();
52 | }
53 | });
54 | mLlQq.setOnClickListener(new View.OnClickListener() {
55 | @Override
56 | public void onClick(View v) {
57 | T.showShort(mContext, "QQ");
58 | dismiss();
59 | }
60 | });
61 | mLlSms.setOnClickListener(new View.OnClickListener() {
62 | @Override
63 | public void onClick(View v) {
64 | T.showShort(mContext, "短信");
65 | dismiss();
66 | }
67 | });
68 | }
69 |
70 | private BaseAnimatorSet mWindowInAs;
71 | private BaseAnimatorSet mWindowOutAs;
72 |
73 | @Override
74 | protected BaseAnimatorSet getWindowInAs() {
75 | if (mWindowInAs == null) {
76 | mWindowInAs = new WindowsInAs();
77 | }
78 | return mWindowInAs;
79 | }
80 |
81 | @Override
82 | protected BaseAnimatorSet getWindowOutAs() {
83 | if (mWindowOutAs == null) {
84 | mWindowOutAs = new WindowsOutAs();
85 | }
86 | return mWindowOutAs;
87 | }
88 |
89 | class WindowsInAs extends BaseAnimatorSet {
90 | @Override
91 | public void setAnimation(View view) {
92 | ObjectAnimator rotationX = ObjectAnimator.ofFloat(view, "rotationX", 10, 0f).setDuration(150);
93 | rotationX.setStartDelay(200);
94 | animatorSet.playTogether(
95 | ObjectAnimator.ofFloat(view, "scaleX", 1.0f, 0.8f).setDuration(350),
96 | ObjectAnimator.ofFloat(view, "scaleY", 1.0f, 0.8f).setDuration(350),
97 | // ObjectAnimator.ofFloat(view, "alpha", 1.0f, 0.5f).setDuration(350),
98 | ObjectAnimator.ofFloat(view, "rotationX", 0f, 10).setDuration(200),
99 | rotationX,
100 | ObjectAnimator.ofFloat(view, "translationY", 0, -0.1f * mDisplayMetrics.heightPixels).setDuration(350)
101 | );
102 | }
103 | }
104 |
105 | class WindowsOutAs extends BaseAnimatorSet {
106 | @Override
107 | public void setAnimation(View view) {
108 | ObjectAnimator rotationX = ObjectAnimator.ofFloat(view, "rotationX", 10, 0f).setDuration(150);
109 | rotationX.setStartDelay(200);
110 | animatorSet.playTogether(
111 | ObjectAnimator.ofFloat(view, "scaleX", 0.8f, 1.0f).setDuration(350),
112 | ObjectAnimator.ofFloat(view, "scaleY", 0.8f, 1.0f).setDuration(350),
113 | // ObjectAnimator.ofFloat(view, "alpha", 1.0f, 0.5f).setDuration(350),
114 | ObjectAnimator.ofFloat(view, "rotationX", 0f, 10).setDuration(200),
115 | rotationX,
116 | ObjectAnimator.ofFloat(view, "translationY", -0.1f * mDisplayMetrics.heightPixels, 0).setDuration(350)
117 | );
118 | }
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/extra/ShareBottomDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.extra;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.LinearLayout;
6 |
7 | import com.flyco.animation.FlipEnter.FlipVerticalSwingEnter;
8 | import com.flyco.dialog.widget.base.BottomBaseDialog;
9 | import com.flyco.dialogsamples.R;
10 | import com.flyco.dialogsamples.utils.T;
11 |
12 | import butterknife.Bind;
13 | import butterknife.ButterKnife;
14 |
15 | public class ShareBottomDialog extends BottomBaseDialog {
16 | @Bind(R.id.ll_wechat_friend_circle) LinearLayout mLlWechatFriendCircle;
17 | @Bind(R.id.ll_wechat_friend) LinearLayout mLlWechatFriend;
18 | @Bind(R.id.ll_qq) LinearLayout mLlQq;
19 | @Bind(R.id.ll_sms) LinearLayout mLlSms;
20 |
21 | public ShareBottomDialog(Context context, View animateView) {
22 | super(context, animateView);
23 | }
24 |
25 | public ShareBottomDialog(Context context) {
26 | super(context);
27 | }
28 |
29 | @Override
30 | public View onCreateView() {
31 | showAnim(new FlipVerticalSwingEnter());
32 | dismissAnim(null);
33 | View inflate = View.inflate(mContext, R.layout.dialog_share, null);
34 | ButterKnife.bind(this, inflate);
35 |
36 | return inflate;
37 | }
38 |
39 | @Override
40 | public void setUiBeforShow() {
41 |
42 | mLlWechatFriendCircle.setOnClickListener(new View.OnClickListener() {
43 | @Override
44 | public void onClick(View v) {
45 | T.showShort(mContext, "朋友圈");
46 | dismiss();
47 | }
48 | });
49 | mLlWechatFriend.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 | T.showShort(mContext, "微信");
53 | dismiss();
54 | }
55 | });
56 | mLlQq.setOnClickListener(new View.OnClickListener() {
57 | @Override
58 | public void onClick(View v) {
59 | T.showShort(mContext, "QQ");
60 | dismiss();
61 | }
62 | });
63 | mLlSms.setOnClickListener(new View.OnClickListener() {
64 | @Override
65 | public void onClick(View v) {
66 | T.showShort(mContext, "短信");
67 | dismiss();
68 | }
69 | });
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/extra/ShareTopDialog.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.extra;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.LinearLayout;
6 |
7 | import com.flyco.animation.FlipEnter.FlipVerticalSwingEnter;
8 | import com.flyco.dialog.widget.base.TopBaseDialog;
9 | import com.flyco.dialogsamples.R;
10 | import com.flyco.dialogsamples.utils.T;
11 |
12 | import butterknife.Bind;
13 | import butterknife.ButterKnife;
14 |
15 | public class ShareTopDialog extends TopBaseDialog {
16 | @Bind(R.id.ll_wechat_friend_circle) LinearLayout mLlWechatFriendCircle;
17 | @Bind(R.id.ll_wechat_friend) LinearLayout mLlWechatFriend;
18 | @Bind(R.id.ll_qq) LinearLayout mLlQq;
19 | @Bind(R.id.ll_sms) LinearLayout mLlSms;
20 |
21 | public ShareTopDialog(Context context, View animateView) {
22 | super(context, animateView);
23 | }
24 |
25 | public ShareTopDialog(Context context) {
26 | super(context);
27 | }
28 |
29 | @Override
30 | public View onCreateView() {
31 | showAnim(new FlipVerticalSwingEnter());
32 | dismissAnim(null);
33 | View inflate = View.inflate(mContext, R.layout.dialog_share, null);
34 | ButterKnife.bind(this, inflate);
35 |
36 | return inflate;
37 | }
38 |
39 | @Override
40 | public void setUiBeforShow() {
41 | mLlWechatFriendCircle.setOnClickListener(new View.OnClickListener() {
42 | @Override
43 | public void onClick(View v) {
44 | T.showShort(mContext, "朋友圈");
45 | dismiss();
46 | }
47 | });
48 | mLlWechatFriend.setOnClickListener(new View.OnClickListener() {
49 | @Override
50 | public void onClick(View v) {
51 | T.showShort(mContext, "微信");
52 | dismiss();
53 | }
54 | });
55 | mLlQq.setOnClickListener(new View.OnClickListener() {
56 | @Override
57 | public void onClick(View v) {
58 | T.showShort(mContext, "QQ");
59 | dismiss();
60 | }
61 | });
62 | mLlSms.setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View v) {
65 | T.showShort(mContext, "短信");
66 | dismiss();
67 | }
68 | });
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/ui/BubblePopupActivity.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.ui;
2 |
3 | import android.content.Context;
4 | import android.graphics.Color;
5 | import android.os.Bundle;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.view.Gravity;
8 | import android.view.View;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | import com.flyco.animation.BounceEnter.BounceRightEnter;
13 | import com.flyco.animation.BounceEnter.BounceTopEnter;
14 | import com.flyco.animation.SlideEnter.SlideBottomEnter;
15 | import com.flyco.animation.SlideExit.SlideBottomExit;
16 | import com.flyco.animation.SlideExit.SlideLeftExit;
17 | import com.flyco.animation.SlideExit.SlideTopExit;
18 | import com.flyco.dialog.widget.popup.BubblePopup;
19 | import com.flyco.dialogsamples.R;
20 | import com.flyco.dialogsamples.extra.CustomBubblePopup;
21 | import com.flyco.dialogsamples.utils.T;
22 |
23 | import butterknife.Bind;
24 | import butterknife.ButterKnife;
25 | import butterknife.OnClick;
26 |
27 | public class BubblePopupActivity extends AppCompatActivity {
28 | @Bind(R.id.tv_top_left)
29 | TextView mTvTopLeft;
30 | @Bind(R.id.tv_top_right)
31 | TextView mTvTopRight;
32 | @Bind(R.id.tv_bottom_left)
33 | TextView mTvBottomLeft;
34 | @Bind(R.id.tv_bottom_right)
35 | TextView mTvBottomRight;
36 | @Bind(R.id.tv_center)
37 | TextView mTvCenter;
38 | private Context mContext = this;
39 |
40 | @Override
41 | protected void onCreate(Bundle savedInstanceState) {
42 | super.onCreate(savedInstanceState);
43 | setContentView(R.layout.ac_bubble_popup);
44 | ButterKnife.bind(this);
45 | }
46 |
47 | @OnClick(R.id.tv_center)
48 | void clickCenterBtn() {
49 | View inflate = View.inflate(mContext, R.layout.popup_bubble_image, null);
50 | BubblePopup bubblePopup = new BubblePopup(mContext, inflate);
51 | bubblePopup.anchorView(mTvCenter)
52 | .showAnim(new BounceRightEnter())
53 | .dismissAnim(new SlideLeftExit())
54 | .autoDismiss(true)
55 | .show();
56 | }
57 |
58 | @OnClick(R.id.tv_top_left)
59 | void clickTopLeftBtn() {
60 | View inflate = View.inflate(mContext, R.layout.popup_bubble_text, null);
61 | TextView tv = ButterKnife.findById(inflate, R.id.tv_bubble);
62 | BubblePopup bubblePopup = new BubblePopup(mContext, inflate);
63 | tv.setText("最美的不是下雨天,是曾与你躲过雨的屋檐~");
64 | bubblePopup.anchorView(mTvTopLeft)
65 | .gravity(Gravity.BOTTOM)
66 | .show();
67 |
68 | tv.setOnClickListener(new View.OnClickListener() {
69 | @Override
70 | public void onClick(View v) {
71 | T.showShort(mContext, "tv_bubble");
72 | }
73 | });
74 | }
75 |
76 | @OnClick(R.id.tv_top_right)
77 | void clickTopRightBtn() {
78 | CustomBubblePopup customBubblePopup = new CustomBubblePopup(mContext);
79 | // customBubblePopup.setCanceledOnTouchOutside(false);
80 | customBubblePopup
81 | .gravity(Gravity.BOTTOM)
82 | .anchorView(mTvTopRight)
83 | .triangleWidth(20)
84 | .triangleHeight(10)
85 | .showAnim(null)
86 | .dismissAnim(null)
87 | .show();
88 | }
89 |
90 | @OnClick(R.id.tv_bottom_left)
91 | void clickBottomLeftBtn() {
92 | View inflate = View.inflate(mContext, R.layout.popup_bubble_text, null);
93 | new BubblePopup(mContext, inflate)
94 | .anchorView(mTvBottomLeft)
95 | .showAnim(null)
96 | .dismissAnim(null)
97 | .show();
98 | }
99 |
100 | @OnClick(R.id.tv_bottom_right)
101 | void clickBottomRightBtn() {
102 | View inflate = View.inflate(mContext, R.layout.popup_bubble_image, null);
103 | new BubblePopup(mContext, inflate).anchorView(mTvBottomRight)
104 | .bubbleColor(Color.parseColor("#8BC34A"))
105 | .showAnim(new SlideBottomEnter())
106 | .dismissAnim(new SlideBottomExit())
107 | .show();
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/ui/CustomPopupActivity.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.ui;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.Gravity;
7 | import android.view.View;
8 | import android.widget.LinearLayout;
9 | import android.widget.TextView;
10 |
11 | import com.flyco.animation.BounceEnter.BounceBottomEnter;
12 | import com.flyco.animation.BounceEnter.BounceTopEnter;
13 | import com.flyco.animation.SlideEnter.SlideTopEnter;
14 | import com.flyco.animation.SlideExit.SlideBottomExit;
15 | import com.flyco.animation.SlideExit.SlideTopExit;
16 | import com.flyco.dialog.widget.popup.base.BasePopup;
17 | import com.flyco.dialogsamples.R;
18 | import com.flyco.dialogsamples.utils.T;
19 |
20 | import butterknife.Bind;
21 | import butterknife.ButterKnife;
22 | import butterknife.OnClick;
23 |
24 | public class CustomPopupActivity extends AppCompatActivity {
25 | @Bind(R.id.tv_top_left)
26 | TextView mTvTopLeft;
27 | @Bind(R.id.tv_top_right)
28 | TextView mTvTopRight;
29 | @Bind(R.id.tv_bottom_left)
30 | TextView mTvBottomLeft;
31 | @Bind(R.id.tv_bottom_right)
32 | TextView mTvBottomRight;
33 | @Bind(R.id.tv_center)
34 | TextView mTvCenter;
35 | private Context mContext = this;
36 | private SimpleCustomPop mQuickCustomPopup;
37 |
38 | @Override
39 | protected void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 | setContentView(R.layout.ac_custom_popup);
42 | ButterKnife.bind(this);
43 |
44 | mQuickCustomPopup = new SimpleCustomPop(mContext);
45 | // mQuickCustomPopup.setCanceledOnTouchOutside(false);
46 | }
47 |
48 | @OnClick(R.id.tv_center)
49 | void clickCenterBtn() {
50 | mQuickCustomPopup
51 | .alignCenter(true)
52 | .anchorView(mTvCenter)
53 | .gravity(Gravity.BOTTOM)
54 | .showAnim(new SlideTopEnter())
55 | .dismissAnim(new SlideTopExit())
56 | .offset(0, 0)
57 | .dimEnabled(false)
58 | .show();
59 | }
60 |
61 | @OnClick(R.id.tv_top_left)
62 | void clickTopLeftBtn() {
63 | mQuickCustomPopup
64 | .anchorView(mTvTopLeft)
65 | .gravity(Gravity.BOTTOM)
66 | .offset(0, 0)
67 | .showAnim(new BounceTopEnter())
68 | .dismissAnim(new SlideTopExit())
69 | .dimEnabled(false)
70 | .show();
71 | }
72 |
73 | @OnClick(R.id.tv_top_right)
74 | void clickTopRightBtn() {
75 | mQuickCustomPopup
76 | .anchorView(mTvTopRight)
77 | .offset(-10, 5)
78 | .gravity(Gravity.BOTTOM)
79 | .showAnim(new BounceTopEnter())
80 | .dismissAnim(new SlideTopExit())
81 | .dimEnabled(false)
82 | .show();
83 | }
84 |
85 | @OnClick(R.id.tv_bottom_left)
86 | void clickBottomLeftBtn() {
87 | mQuickCustomPopup
88 | .anchorView(mTvBottomLeft)
89 | .offset(10, -5)
90 | .gravity(Gravity.TOP)
91 | .showAnim(new BounceBottomEnter())
92 | .dismissAnim(new SlideBottomExit())
93 | .dimEnabled(true)
94 | .show();
95 | }
96 |
97 | @OnClick(R.id.tv_bottom_right)
98 | void clickBottomRightBtn() {
99 | mQuickCustomPopup
100 | .showAnim(null)
101 | .dismissAnim(null)
102 | .dimEnabled(true)
103 | .anchorView(mTvBottomRight)
104 | .offset(-10, -5)
105 | .dimEnabled(false)
106 | .gravity(Gravity.TOP)
107 | .show();
108 | }
109 |
110 | class SimpleCustomPop extends BasePopup {
111 |
112 | @Bind(R.id.tv_item_1) TextView mTvItem1;
113 | @Bind(R.id.tv_item_2) TextView mTvItem2;
114 | @Bind(R.id.tv_item_3) TextView mTvItem3;
115 | @Bind(R.id.tv_item_4) TextView mTvItem4;
116 |
117 | public SimpleCustomPop(Context context) {
118 | super(context);
119 | // setCanceledOnTouchOutside(false);
120 | }
121 |
122 | @Override
123 | public View onCreatePopupView() {
124 | View inflate = View.inflate(mContext, R.layout.popup_custom, null);
125 | ButterKnife.bind(this, inflate);
126 | return inflate;
127 | }
128 |
129 | @Override
130 | public void setUiBeforShow() {
131 | mTvItem1.setOnClickListener(new View.OnClickListener() {
132 | @Override
133 | public void onClick(View v) {
134 | T.showShort(mContext, mTvItem1.getText());
135 | }
136 | });
137 | mTvItem2.setOnClickListener(new View.OnClickListener() {
138 | @Override
139 | public void onClick(View v) {
140 | T.showShort(mContext, mTvItem2.getText());
141 | }
142 | });
143 | mTvItem3.setOnClickListener(new View.OnClickListener() {
144 | @Override
145 | public void onClick(View v) {
146 | T.showShort(mContext, mTvItem3.getText());
147 | }
148 | });
149 | mTvItem4.setOnClickListener(new View.OnClickListener() {
150 | @Override
151 | public void onClick(View v) {
152 | T.showShort(mContext, mTvItem4.getText());
153 | }
154 | });
155 | }
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/ui/PopupHomeActivity.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.ui;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.graphics.Color;
6 | import android.os.Bundle;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.util.DisplayMetrics;
9 | import android.util.TypedValue;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.AbsListView;
13 | import android.widget.AdapterView;
14 | import android.widget.BaseAdapter;
15 | import android.widget.ListView;
16 | import android.widget.TextView;
17 |
18 | public class PopupHomeActivity extends AppCompatActivity {
19 | private Context mContext = this;
20 | private final String[] mItems = {"Custom Popup", "BubblePopup"};
21 | private final Class>[] mClazzs = {CustomPopupActivity.class, BubblePopupActivity.class};
22 | private DisplayMetrics mDisplayMetrics;
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | mDisplayMetrics = getResources().getDisplayMetrics();
28 |
29 | ListView lv = new ListView(mContext);
30 | lv.setCacheColorHint(Color.TRANSPARENT);
31 | lv.setBackgroundColor(Color.WHITE);
32 | lv.setFadingEdgeLength(0);
33 | lv.setAdapter(new SimpleHomeAdapter());
34 |
35 | lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
36 | @Override
37 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
38 | Intent intent = new Intent(mContext, mClazzs[position]);
39 | startActivity(intent);
40 | }
41 | });
42 |
43 | setContentView(lv);
44 | }
45 |
46 | class SimpleHomeAdapter extends BaseAdapter {
47 | @Override
48 | public int getCount() {
49 | return mItems.length;
50 | }
51 |
52 | @Override
53 | public Object getItem(int position) {
54 | return null;
55 | }
56 |
57 | @Override
58 | public long getItemId(int position) {
59 | return position;
60 | }
61 |
62 | @Override
63 | public View getView(int position, View convertView, ViewGroup parent) {
64 |
65 | int padding = (int) (mDisplayMetrics.density * 10);
66 |
67 | TextView tv = new TextView(mContext);
68 | tv.setText(mItems[position]);
69 | tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
70 | tv.setTextColor(Color.parseColor("#468ED0"));
71 | // tv.setGravity(Gravity.CENTER);
72 | tv.setPadding(padding, padding, padding, padding);
73 | AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,
74 | AbsListView.LayoutParams.WRAP_CONTENT);
75 | tv.setLayoutParams(lp);
76 | return tv;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/ui/SimpleHomeActivity.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.ui;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.graphics.Color;
6 | import android.os.Bundle;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.util.DisplayMetrics;
9 | import android.util.TypedValue;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.widget.AbsListView;
13 | import android.widget.AdapterView;
14 | import android.widget.BaseAdapter;
15 | import android.widget.ListView;
16 | import android.widget.TextView;
17 |
18 | public class SimpleHomeActivity extends AppCompatActivity {
19 | private Context mContext = this;
20 | private final String[] mItems = {"Dialog", "Popup"};
21 | private final Class>[] mClazzs = {DialogHomeActivity.class, PopupHomeActivity.class};
22 | private DisplayMetrics mDisplayMetrics;
23 |
24 | @Override
25 | protected void onCreate(Bundle savedInstanceState) {
26 | super.onCreate(savedInstanceState);
27 | mDisplayMetrics = getResources().getDisplayMetrics();
28 |
29 | ListView lv = new ListView(mContext);
30 | lv.setCacheColorHint(Color.TRANSPARENT);
31 | lv.setBackgroundColor(Color.WHITE);
32 | lv.setFadingEdgeLength(0);
33 | lv.setAdapter(new SimpleHomeAdapter());
34 |
35 | lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
36 | @Override
37 | public void onItemClick(AdapterView> parent, View view, int position, long id) {
38 | Intent intent = new Intent(mContext, mClazzs[position]);
39 | startActivity(intent);
40 | }
41 | });
42 |
43 | setContentView(lv);
44 | }
45 |
46 | class SimpleHomeAdapter extends BaseAdapter {
47 | @Override
48 | public int getCount() {
49 | return mItems.length;
50 | }
51 |
52 | @Override
53 | public Object getItem(int position) {
54 | return null;
55 | }
56 |
57 | @Override
58 | public long getItemId(int position) {
59 | return position;
60 | }
61 |
62 | @Override
63 | public View getView(int position, View convertView, ViewGroup parent) {
64 |
65 | int padding = (int) (mDisplayMetrics.density * 10);
66 |
67 | TextView tv = new TextView(mContext);
68 | tv.setText(mItems[position]);
69 | tv.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18);
70 | tv.setTextColor(Color.parseColor("#468ED0"));
71 | // tv.setGravity(Gravity.CENTER);
72 | tv.setPadding(padding, padding, padding, padding);
73 | AbsListView.LayoutParams lp = new AbsListView.LayoutParams(AbsListView.LayoutParams.MATCH_PARENT,
74 | AbsListView.LayoutParams.WRAP_CONTENT);
75 | tv.setLayoutParams(lp);
76 | return tv;
77 | }
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/utils/DiaogAnimChoose.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.utils;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.AdapterView;
6 |
7 | import com.flyco.dialogsamples.ui.DialogHomeActivity;
8 | import com.flyco.animation.Attention.Flash;
9 | import com.flyco.animation.Attention.RubberBand;
10 | import com.flyco.animation.Attention.ShakeHorizontal;
11 | import com.flyco.animation.Attention.ShakeVertical;
12 | import com.flyco.animation.Attention.Swing;
13 | import com.flyco.animation.Attention.Tada;
14 | import com.flyco.animation.BaseAnimatorSet;
15 | import com.flyco.animation.BounceEnter.BounceBottomEnter;
16 | import com.flyco.animation.BounceEnter.BounceEnter;
17 | import com.flyco.animation.BounceEnter.BounceLeftEnter;
18 | import com.flyco.animation.BounceEnter.BounceRightEnter;
19 | import com.flyco.animation.BounceEnter.BounceTopEnter;
20 | import com.flyco.animation.FadeEnter.FadeEnter;
21 | import com.flyco.animation.FadeExit.FadeExit;
22 | import com.flyco.animation.FallEnter.FallEnter;
23 | import com.flyco.animation.FallEnter.FallRotateEnter;
24 | import com.flyco.animation.FlipEnter.FlipBottomEnter;
25 | import com.flyco.animation.FlipEnter.FlipHorizontalEnter;
26 | import com.flyco.animation.FlipEnter.FlipHorizontalSwingEnter;
27 | import com.flyco.animation.FlipEnter.FlipLeftEnter;
28 | import com.flyco.animation.FlipEnter.FlipRightEnter;
29 | import com.flyco.animation.FlipEnter.FlipTopEnter;
30 | import com.flyco.animation.FlipEnter.FlipVerticalEnter;
31 | import com.flyco.animation.FlipEnter.FlipVerticalSwingEnter;
32 | import com.flyco.animation.FlipExit.FlipHorizontalExit;
33 | import com.flyco.animation.FlipExit.FlipVerticalExit;
34 | import com.flyco.animation.Jelly;
35 | import com.flyco.animation.NewsPaperEnter;
36 | import com.flyco.animation.SlideEnter.SlideBottomEnter;
37 | import com.flyco.animation.SlideEnter.SlideLeftEnter;
38 | import com.flyco.animation.SlideEnter.SlideRightEnter;
39 | import com.flyco.animation.SlideEnter.SlideTopEnter;
40 | import com.flyco.animation.SlideExit.SlideBottomExit;
41 | import com.flyco.animation.SlideExit.SlideLeftExit;
42 | import com.flyco.animation.SlideExit.SlideRightExit;
43 | import com.flyco.animation.SlideExit.SlideTopExit;
44 | import com.flyco.animation.ZoomEnter.ZoomInBottomEnter;
45 | import com.flyco.animation.ZoomEnter.ZoomInEnter;
46 | import com.flyco.animation.ZoomEnter.ZoomInLeftEnter;
47 | import com.flyco.animation.ZoomEnter.ZoomInRightEnter;
48 | import com.flyco.animation.ZoomEnter.ZoomInTopEnter;
49 | import com.flyco.animation.ZoomExit.ZoomInExit;
50 | import com.flyco.animation.ZoomExit.ZoomOutBottomExit;
51 | import com.flyco.animation.ZoomExit.ZoomOutExit;
52 | import com.flyco.animation.ZoomExit.ZoomOutLeftExit;
53 | import com.flyco.animation.ZoomExit.ZoomOutRightExit;
54 | import com.flyco.animation.ZoomExit.ZoomOutTopExit;
55 | import com.flyco.dialog.listener.OnOperItemClickL;
56 | import com.flyco.dialog.widget.ActionSheetDialog;
57 |
58 | import java.util.ArrayList;
59 |
60 | public class DiaogAnimChoose {
61 | public static void showAnim(final Context context) {
62 | final Class> cs[] = {BounceEnter.class,//
63 | BounceTopEnter.class,//
64 | BounceBottomEnter.class,//
65 | BounceLeftEnter.class,//
66 | BounceRightEnter.class,//
67 | FlipHorizontalEnter.class,//
68 | FlipHorizontalSwingEnter.class,//
69 | FlipVerticalEnter.class,//
70 | FlipVerticalSwingEnter.class,//
71 | FlipTopEnter.class,//
72 | FlipBottomEnter.class,//
73 | FlipLeftEnter.class,//
74 | FlipRightEnter.class,//
75 | FadeEnter.class, //
76 | FallEnter.class,//
77 | FallRotateEnter.class,//
78 | SlideTopEnter.class,//
79 | SlideBottomEnter.class,//
80 | SlideLeftEnter.class, //
81 | SlideRightEnter.class,//
82 | ZoomInEnter.class,//
83 | ZoomInTopEnter.class,//
84 | ZoomInBottomEnter.class,//
85 | ZoomInLeftEnter.class,//
86 | ZoomInRightEnter.class,//
87 |
88 | NewsPaperEnter.class,//
89 | Flash.class,//
90 | ShakeHorizontal.class,//
91 | ShakeVertical.class,//
92 | Jelly.class,//
93 | RubberBand.class,//
94 | Swing.class,//
95 | Tada.class,//
96 | };
97 |
98 | ArrayList itemList = new ArrayList<>();
99 | for (Class> c : cs) {
100 | itemList.add(c.getSimpleName());
101 | }
102 |
103 | final String[] contents = new String[itemList.size()];
104 | final ActionSheetDialog dialog = new ActionSheetDialog(context, //
105 | itemList.toArray(contents), null);
106 | dialog.title("使用内置show动画设置对话框显示动画\r\n指定对话框将显示效果")//
107 | .titleTextSize_SP(14.5f)//
108 | .layoutAnimation(null)//
109 | .cancelText("cancel")
110 | .show();
111 | dialog.setCanceledOnTouchOutside(false);
112 |
113 | dialog.setOnOperItemClickL(new OnOperItemClickL() {
114 | @Override
115 | public void onOperItemClick(AdapterView> parent, View view, int position, long id) {
116 | try {
117 | String animType = contents[position];
118 | ((DialogHomeActivity) context).setBasIn((BaseAnimatorSet) cs[position].newInstance());
119 | T.showShort(context, animType + "设置成功");
120 | dialog.dismiss();
121 | } catch (Exception e) {
122 | e.printStackTrace();
123 | }
124 | }
125 | });
126 | }
127 |
128 | public static void dissmissAnim(final Context context) {
129 | final Class> cs[] = {FlipHorizontalExit.class,//
130 | FlipVerticalExit.class,//
131 | FadeExit.class,//
132 | SlideTopExit.class,//
133 | SlideBottomExit.class,//
134 | SlideLeftExit.class, //
135 | SlideRightExit.class,//
136 | ZoomOutExit.class,//
137 | ZoomOutTopExit.class,//
138 | ZoomOutBottomExit.class,//
139 | ZoomOutLeftExit.class,//
140 | ZoomOutRightExit.class,//
141 | ZoomInExit.class,//
142 | };
143 |
144 | ArrayList itemList = new ArrayList();
145 | for (Class> c : cs) {
146 | itemList.add(c.getSimpleName());
147 | }
148 |
149 | final String[] contents = new String[itemList.size()];
150 | final ActionSheetDialog dialog = new ActionSheetDialog(context, //
151 | itemList.toArray(contents), null);
152 | dialog.title("使用内置dismiss动画设置对话框消失动画\r\n指定对话框将消失效果")//
153 | .titleTextSize_SP(14.5f)//
154 | .cancelText("cancel")
155 | .show();
156 |
157 | dialog.setOnOperItemClickL(new OnOperItemClickL() {
158 | @Override
159 | public void onOperItemClick(AdapterView> parent, View view, int position, long id) {
160 | try {
161 | String animType = contents[position];
162 | ((DialogHomeActivity) context).setBasOut((BaseAnimatorSet) cs[position].newInstance());
163 | T.showShort(context, animType + "设置成功");
164 | dialog.dismiss();
165 | } catch (Exception e) {
166 | e.printStackTrace();
167 | }
168 | }
169 | });
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/app/src/main/java/com/flyco/dialogsamples/utils/T.java:
--------------------------------------------------------------------------------
1 | package com.flyco.dialogsamples.utils;
2 |
3 | import android.content.Context;
4 | import android.widget.Toast;
5 |
6 | /**
7 | * Toast统一管理类
8 | */
9 | public class T {
10 | private static Toast toast;
11 |
12 | /**
13 | * 短时间显示Toast
14 | */
15 | public static void showShort(Context context, CharSequence message) {
16 | if (null == toast) {
17 | toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
18 | // toast.setGravity(Gravity.CENTER, 0, 0);
19 | } else {
20 | toast.setText(message);
21 | }
22 | toast.show();
23 | }
24 |
25 | /**
26 | * 短时间显示Toast
27 | */
28 | public static void showShort(Context context, int message) {
29 | if (null == toast) {
30 | toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
31 | // toast.setGravity(Gravity.CENTER, 0, 0);
32 | } else {
33 | toast.setText(message);
34 | }
35 | toast.show();
36 | }
37 |
38 | /**
39 | * 长时间显示Toast
40 | */
41 | public static void showLong(Context context, CharSequence message) {
42 | if (null == toast) {
43 | toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
44 | // toast.setGravity(Gravity.CENTER, 0, 0);
45 | } else {
46 | toast.setText(message);
47 | }
48 | toast.show();
49 | }
50 |
51 | /**
52 | * 长时间显示Toast
53 | */
54 | public static void showLong(Context context, int message) {
55 | if (null == toast) {
56 | toast = Toast.makeText(context, message, Toast.LENGTH_LONG);
57 | // toast.setGravity(Gravity.CENTER, 0, 0);
58 | } else {
59 | toast.setText(message);
60 | }
61 | toast.show();
62 | }
63 |
64 | /**
65 | * 自定义显示Toast时间
66 | */
67 | public static void show(Context context, CharSequence message, int duration) {
68 | if (null == toast) {
69 | toast = Toast.makeText(context, message, duration);
70 | // toast.setGravity(Gravity.CENTER, 0, 0);
71 | } else {
72 | toast.setText(message);
73 | }
74 | toast.show();
75 | }
76 |
77 | /**
78 | * 自定义显示Toast时间
79 | */
80 | public static void show(Context context, int message, int duration) {
81 | if (null == toast) {
82 | toast = Toast.makeText(context, message, duration);
83 | // toast.setGravity(Gravity.CENTER, 0, 0);
84 | } else {
85 | toast.setText(message);
86 | }
87 | toast.show();
88 | }
89 |
90 | /** Hide the toast, if any. */
91 | public static void hideToast() {
92 | if (null != toast) {
93 | toast.cancel();
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/base_dialog_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
19 |
28 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/base_dialog_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/corner_common_border_gray.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
8 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ac_bubble_popup.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
29 |
30 |
40 |
41 |
52 |
53 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ac_custom_popup.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
29 |
30 |
40 |
41 |
52 |
53 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ac_dialog_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/ad_dialog_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_custom_base.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
20 |
21 |
27 |
28 |
33 |
34 |
43 |
44 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_ios_taobao.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
22 |
23 |
31 |
32 |
36 |
37 |
44 |
45 |
46 |
54 |
55 |
59 |
60 |
67 |
68 |
69 |
70 |
74 |
75 |
83 |
84 |
88 |
89 |
96 |
97 |
98 |
106 |
107 |
111 |
112 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_share.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
22 |
23 |
27 |
28 |
35 |
36 |
37 |
45 |
46 |
50 |
51 |
58 |
59 |
60 |
68 |
69 |
73 |
74 |
81 |
82 |
83 |
91 |
92 |
96 |
97 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_bubble_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_bubble_text.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/popup_custom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
24 |
25 |
29 |
30 |
38 |
39 |
43 |
44 |
52 |
53 |
57 |
58 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_winstyle_album.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-hdpi/ic_winstyle_album.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_winstyle_artist.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-hdpi/ic_winstyle_artist.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_winstyle_delete.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-hdpi/ic_winstyle_delete.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_winstyle_download.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-hdpi/ic_winstyle_download.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_winstyle_favor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-hdpi/ic_winstyle_favor.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_winstyle_share.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-hdpi/ic_winstyle_share.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/bg_popup_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xhdpi/bg_popup_shadow.9.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_portrait.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xhdpi/ic_portrait.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_share_qq.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xhdpi/ic_share_qq.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_share_sms.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xhdpi/ic_share_sms.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_share_wechat_friend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xhdpi/ic_share_wechat_friend.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_share_wechat_friend_circle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xhdpi/ic_share_wechat_friend_circle.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #8BC34A
4 | #689F38
5 | #FF4081
6 | #FFFFFF
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | FlycoDialog
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.1.2'
9 | // classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
10 | // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | // maven {
20 | // url "http://dl.bintray.com/h07000223/maven"
21 | // }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/gif/preview_1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_1.gif
--------------------------------------------------------------------------------
/gif/preview_10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_10.gif
--------------------------------------------------------------------------------
/gif/preview_11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_11.gif
--------------------------------------------------------------------------------
/gif/preview_12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_12.gif
--------------------------------------------------------------------------------
/gif/preview_13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_13.gif
--------------------------------------------------------------------------------
/gif/preview_14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_14.gif
--------------------------------------------------------------------------------
/gif/preview_15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_15.gif
--------------------------------------------------------------------------------
/gif/preview_16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_16.gif
--------------------------------------------------------------------------------
/gif/preview_17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_17.gif
--------------------------------------------------------------------------------
/gif/preview_2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_2.gif
--------------------------------------------------------------------------------
/gif/preview_3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_3.gif
--------------------------------------------------------------------------------
/gif/preview_4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_4.gif
--------------------------------------------------------------------------------
/gif/preview_5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_5.gif
--------------------------------------------------------------------------------
/gif/preview_6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_6.gif
--------------------------------------------------------------------------------
/gif/preview_7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_7.gif
--------------------------------------------------------------------------------
/gif/preview_8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_8.gif
--------------------------------------------------------------------------------
/gif/preview_9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_9.gif
--------------------------------------------------------------------------------
/gif/preview_popup_1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gif/preview_popup_1.gif
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Apr 10 15:27:10 PDT 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/screenshot/action_sheet_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/action_sheet_1.png
--------------------------------------------------------------------------------
/screenshot/action_sheet_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/action_sheet_2.png
--------------------------------------------------------------------------------
/screenshot/bubble_popup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/bubble_popup.png
--------------------------------------------------------------------------------
/screenshot/material_dialog_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/material_dialog_1.png
--------------------------------------------------------------------------------
/screenshot/material_dialog_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/material_dialog_2.png
--------------------------------------------------------------------------------
/screenshot/material_dialog_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/material_dialog_3.png
--------------------------------------------------------------------------------
/screenshot/normal_dialog_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_dialog_1.png
--------------------------------------------------------------------------------
/screenshot/normal_dialog_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_dialog_2.png
--------------------------------------------------------------------------------
/screenshot/normal_dialog_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_dialog_3.png
--------------------------------------------------------------------------------
/screenshot/normal_dialog_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_dialog_4.png
--------------------------------------------------------------------------------
/screenshot/normal_dialog_5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_dialog_5.png
--------------------------------------------------------------------------------
/screenshot/normal_list_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_list_1.png
--------------------------------------------------------------------------------
/screenshot/normal_list_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_list_2.png
--------------------------------------------------------------------------------
/screenshot/normal_list_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/H07000223/FlycoDialog_Master/fdfdd1c10cb2f8519ef9eb90d9e59cd2452055b1/screenshot/normal_list_3.png
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | include ':FlycoDialog_Lib'
3 |
--------------------------------------------------------------------------------