├── demo
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values-sw600dp
│ │ │ │ ├── dimens.xml
│ │ │ │ └── is_tablet.xml
│ │ │ ├── values
│ │ │ │ ├── is_tablet.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── integers.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── themes.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values-large
│ │ │ │ └── is_tablet.xml
│ │ │ ├── values-sw720dp
│ │ │ │ └── is_tablet.xml
│ │ │ ├── values-xlarge
│ │ │ │ └── is_tablet.xml
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── drawable-hdpi
│ │ │ │ └── popup_fixed_alert.9.png
│ │ │ ├── drawable-mdpi
│ │ │ │ └── popup_fixed_alert.9.png
│ │ │ ├── anim
│ │ │ │ ├── no_animation.xml
│ │ │ │ ├── dialog_exit.xml
│ │ │ │ └── dialog_enter.xml
│ │ │ ├── drawable-xhdpi
│ │ │ │ └── popup_fixed_alert.9.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ └── popup_fixed_alert.9.png
│ │ │ ├── interpolator
│ │ │ │ ├── decelerate_quart.xml
│ │ │ │ ├── decelerate_cubic.xml
│ │ │ │ └── decelerate_quint.xml
│ │ │ ├── layout
│ │ │ │ ├── activity_main.xml
│ │ │ │ └── controller_home.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── values-v21
│ │ │ │ └── themes.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ └── drawable
│ │ │ │ └── ic_launcher_background.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── mkhytarmkhoian
│ │ │ └── demo
│ │ │ ├── AlertDialogController.kt
│ │ │ ├── views.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── context.kt
│ │ │ ├── BaseAlertDialog.kt
│ │ │ ├── App.java
│ │ │ ├── HomeController.kt
│ │ │ ├── progress
│ │ │ ├── ProgressDialogController.kt
│ │ │ ├── RadialProgressView.kt
│ │ │ └── ProgressDialogView.kt
│ │ │ └── BaseAlertDialogDelegate.kt
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── mkhytarmkhoian
│ │ │ └── demo
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── mkhytarmkhoian
│ │ └── demo
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── conductor-dialog
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ └── values
│ │ │ │ └── strings.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── mkhytarmkhoian
│ │ │ └── conductor
│ │ │ └── dialog
│ │ │ └── DialogController.java
│ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── mkhytarmkhoian
│ │ │ └── conductor
│ │ │ └── dialog
│ │ │ └── ExampleInstrumentedTest.java
│ └── test
│ │ └── java
│ │ └── com
│ │ └── mkhytarmkhoian
│ │ └── conductor
│ │ └── dialog
│ │ └── ExampleUnitTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── .gitignore
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── vcs.xml
├── runConfigurations.xml
├── gradle.xml
├── misc.xml
└── codeStyles
│ └── Project.xml
├── README.md
├── gradle.properties
├── gradlew.bat
└── gradlew
/demo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/conductor-dialog/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':conductor-dialog', ':demo'
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | .idea/
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/conductor-dialog/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | conductor-dialog
3 |
4 |
--------------------------------------------------------------------------------
/demo/src/main/res/values-sw600dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 450dp
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/is_tablet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/values-large/is_tablet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 |
--------------------------------------------------------------------------------
/demo/src/main/res/values-sw600dp/is_tablet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 |
--------------------------------------------------------------------------------
/demo/src/main/res/values-sw720dp/is_tablet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 |
--------------------------------------------------------------------------------
/demo/src/main/res/values-xlarge/is_tablet.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | true
4 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Demo
3 | Loading...
4 |
5 |
--------------------------------------------------------------------------------
/conductor-dialog/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable-hdpi/popup_fixed_alert.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/drawable-hdpi/popup_fixed_alert.9.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable-mdpi/popup_fixed_alert.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/drawable-mdpi/popup_fixed_alert.9.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/anim/no_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/demo/src/main/res/drawable-xhdpi/popup_fixed_alert.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/drawable-xhdpi/popup_fixed_alert.9.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable-xxhdpi/popup_fixed_alert.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MkhytarMkhoian/conductor-dialog/HEAD/demo/src/main/res/drawable-xxhdpi/popup_fixed_alert.9.png
--------------------------------------------------------------------------------
/demo/src/main/res/interpolator/decelerate_quart.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 150
4 | 220
5 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Dec 27 17:36:59 EET 2019
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-5.4.1-all.zip
7 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #0a1331
4 | #303F9F
5 | #22ca46
6 | #FFFFFF
7 |
8 |
--------------------------------------------------------------------------------
/demo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/src/test/java/com/mkhytarmkhoian/demo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.mkhytarmkhoian.demo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/demo/src/main/res/values-v21/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
--------------------------------------------------------------------------------
/demo/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/conductor-dialog/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/demo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/demo/src/androidTest/java/com/mkhytarmkhoian/demo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.mkhytarmkhoian.demo;
2 |
3 | import android.content.Context;
4 | import androidx.test.platform.app.InstrumentationRegistry;
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.mkhytarmkhoian.demo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo/src/main/res/interpolator/decelerate_cubic.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
--------------------------------------------------------------------------------
/demo/src/main/res/interpolator/decelerate_quint.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
22 |
--------------------------------------------------------------------------------
/conductor-dialog/src/androidTest/java/com/mkhytarmkhoian/conductor/dialog/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.mkhytarmkhoian.conductor.dialog;
2 |
3 | import android.content.Context;
4 | import androidx.test.platform.app.InstrumentationRegistry;
5 | import androidx.test.ext.junit.runners.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.mkhytarmkhoian.conductor.dialog.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo/src/main/res/layout/controller_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
20 |
21 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # ConductorDialog
2 | Support Dialog for Conductor library
3 |
4 | ## Installation
5 | Gradle:
6 | ```gradle
7 | repositories {
8 | mavenCentral()
9 | jcenter()
10 | }
11 |
12 | dependencies {
13 | implementation 'com.github.mkhytarmkhoian:conductor-dialog:1.1.0'
14 | }
15 | ```
16 |
17 | Or Maven:
18 | ```xml
19 |
20 | com.github.mkhytarmkhoian
21 | conductor-dialog
22 | 1.1.0
23 | pom
24 |
25 | ```
26 | ## License
27 | ```
28 | Copyright 2020 Lalafo.
29 |
30 | Licensed under the Apache License, Version 2.0 (the "License");
31 | you may not use this file except in compliance with the License.
32 | You may obtain a copy of the License at
33 |
34 | http://www.apache.org/licenses/LICENSE-2.0
35 |
36 | Unless required by applicable law or agreed to in writing, software
37 | distributed under the License is distributed on an "AS IS" BASIS,
38 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
39 | See the License for the specific language governing permissions and
40 | limitations under the License.
41 | ```
42 |
--------------------------------------------------------------------------------
/conductor-dialog/src/test/java/com/mkhytarmkhoian/conductor/dialog/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.conductor.dialog;
18 |
19 | import org.junit.Test;
20 |
21 | import static org.junit.Assert.*;
22 |
23 | /**
24 | * Example local unit test, which will execute on the development machine (host).
25 | *
26 | * @see Testing documentation
27 | */
28 | public class ExampleUnitTest {
29 | @Test
30 | public void addition_isCorrect() {
31 | assertEquals(4, 2 + 2);
32 | }
33 | }
--------------------------------------------------------------------------------
/conductor-dialog/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 29
5 |
6 | compileOptions {
7 | sourceCompatibility JavaVersion.VERSION_1_8
8 | targetCompatibility JavaVersion.VERSION_1_8
9 | }
10 |
11 | defaultConfig {
12 | minSdkVersion 16
13 | targetSdkVersion 29
14 | versionCode 1
15 | versionName project.getProperty("libraryVersion")
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 |
19 | }
20 |
21 | buildTypes {
22 | release {
23 | minifyEnabled false
24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
25 | }
26 | }
27 |
28 | }
29 |
30 | dependencies {
31 | implementation fileTree(dir: 'libs', include: ['*.jar'])
32 | implementation 'com.bluelinelabs:conductor:2.1.5'
33 |
34 | testImplementation 'junit:junit:4.12'
35 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
36 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
37 | }
38 |
39 | apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
40 | apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
41 |
--------------------------------------------------------------------------------
/demo/src/main/res/anim/dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
21 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/demo/src/main/java/com/mkhytarmkhoian/demo/AlertDialogController.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.demo
18 |
19 | import android.app.Dialog
20 | import android.os.Bundle
21 | import androidx.appcompat.app.AlertDialog
22 |
23 | class AlertDialogController(args: Bundle) : BaseAlertDialog(args) {
24 |
25 | companion object {
26 | fun newInstance(): AlertDialogController {
27 | val args = Bundle()
28 | return AlertDialogController(args)
29 | }
30 | }
31 |
32 | override fun onCreateDialog(): Dialog {
33 | return AlertDialog.Builder(activity!!)
34 | .setTitle("Title")
35 | .setMessage("Message")
36 | .setPositiveButton("Ok", null)
37 | .create()
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/demo/src/main/res/anim/dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
18 |
19 |
21 |
30 |
35 |
36 |
--------------------------------------------------------------------------------
/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 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
19 | libraryVersion = 1.1.0
20 | libraryName = ConductorDialog
21 | libraryDescription = Support Dialog for Conductor library
22 |
23 | publishedGroupId = com.github.mkhytarmkhoian
24 | artifact = conductor-dialog
25 |
26 | bintrayRepo = MkhytarMkhoian
27 | bintrayName = conductor-dialog
28 |
29 | siteUrl = https://github.com/MkhytarMkhoian/ConductorDialog
30 | gitUrl = https://github.com/MkhytarMkhoian/ConductorDialog.git
31 |
32 | developerId = MkhytarMkhoian
33 | developerName = Mkhytar Mkhoian
34 | developerEmail = mkhytar.mkhoian@gmail.com
35 |
36 | licenseName = The Apache Software License, Version 2.0
37 | licenseUrl = http://www.apache.org/licenses/LICENSE-2.0.txt
38 | allLicenses = ["Apache-2.0"]
39 |
40 | android.useAndroidX=true
41 | android.enableJetifier=true
--------------------------------------------------------------------------------
/demo/src/main/java/com/mkhytarmkhoian/demo/views.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.demo
18 |
19 | import android.graphics.drawable.Drawable
20 | import android.os.Build
21 | import android.view.View
22 | import android.view.ViewGroup
23 |
24 | @Suppress("DEPRECATION")
25 | fun View.setBackgroundCompat(drawable: Drawable?) {
26 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
27 | background = drawable
28 | } else {
29 | setBackgroundDrawable(drawable)
30 | }
31 | }
32 |
33 | fun View.canTextInput(): Boolean {
34 | var v = this
35 | if (v.onCheckIsTextEditor()) {
36 | return true
37 | }
38 |
39 | if (v !is ViewGroup) {
40 | return false
41 | }
42 |
43 | val vg = v
44 | var i = vg.childCount
45 | while (i > 0) {
46 | i--
47 | v = vg.getChildAt(i)
48 | if (v.canTextInput()) {
49 | return true
50 | }
51 | }
52 |
53 | return false
54 | }
--------------------------------------------------------------------------------
/demo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | apply plugin: 'kotlin-kapt'
5 |
6 | android {
7 | compileSdkVersion 29
8 |
9 | defaultConfig {
10 | applicationId "com.mkhytarmkhoian.demo"
11 | minSdkVersion 16
12 | targetSdkVersion 29
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17 |
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | sourceSets {
28 | main.java.srcDirs += 'src/main/kotlin'
29 | test.java.srcDirs += 'src/unitTests/java'
30 | test.java.srcDirs += 'src/unitTests/kotlin'
31 | test.resources.srcDirs += 'src/unitTests/resources'
32 | }
33 |
34 | }
35 |
36 | dependencies {
37 | implementation fileTree(dir: 'libs', include: ['*.jar'])
38 | implementation 'com.bluelinelabs:conductor:2.1.5'
39 | implementation project(':conductor-dialog')
40 | implementation 'androidx.appcompat:appcompat:1.1.0'
41 |
42 | implementation 'com.facebook.fbui.textlayoutbuilder:textlayoutbuilder:1.5.0'
43 |
44 | implementation 'org.jetbrains.kotlin:kotlin-stdlib:' + kotlin_version
45 |
46 | testImplementation 'junit:junit:4.12'
47 | androidTestImplementation 'androidx.test.ext:junit:1.1.1'
48 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
49 | }
50 |
--------------------------------------------------------------------------------
/demo/src/main/java/com/mkhytarmkhoian/demo/MainActivity.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.demo
18 |
19 | import android.os.Bundle
20 | import androidx.appcompat.app.AppCompatActivity
21 | import com.bluelinelabs.conductor.Conductor
22 | import com.bluelinelabs.conductor.Router
23 | import com.bluelinelabs.conductor.RouterTransaction
24 |
25 | class MainActivity : AppCompatActivity() {
26 |
27 | private lateinit var router: Router
28 |
29 | override fun onCreate(savedInstanceState: Bundle?) {
30 | super.onCreate(savedInstanceState)
31 | setContentView(R.layout.activity_main)
32 |
33 | router = Conductor.attachRouter(this, findViewById(R.id.controller_container), savedInstanceState)
34 | if (!router.hasRootController()) {
35 | router.setRoot(RouterTransaction.with(HomeController()))
36 | }
37 | }
38 |
39 | override fun onBackPressed() {
40 | if (!router.handleBack()) {
41 | super.onBackPressed()
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/demo/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/demo/src/main/java/com/mkhytarmkhoian/demo/context.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.demo
18 |
19 | import android.content.Context
20 | import android.graphics.Point
21 | import android.graphics.drawable.Drawable
22 | import androidx.core.content.ContextCompat
23 | import androidx.appcompat.content.res.AppCompatResources
24 | import android.view.WindowManager
25 |
26 | fun Context.getDrawableCompat(resId: Int): Drawable {
27 | return AppCompatResources.getDrawable(this, resId)!!
28 | }
29 |
30 | fun Context.getColorCompat(id: Int): Int {
31 | return ContextCompat.getColor(this, id)
32 | }
33 |
34 |
35 | fun Context.dpToPx(dp: Float): Int {
36 | val scale = resources.displayMetrics.density
37 | return (dp * scale + 0.5f).toInt()
38 | }
39 |
40 | fun Context.spToPx(sp: Float): Float {
41 | val scale = resources.displayMetrics.scaledDensity
42 | return sp * scale
43 | }
44 |
45 | fun Context.getWindowDimensions(): Point {
46 | val display = (getSystemService(Context.WINDOW_SERVICE) as WindowManager).defaultDisplay
47 | val size = Point()
48 | display.getSize(size)
49 | return size
50 | }
51 |
52 | fun Context.getWindowWidth(): Int {
53 | return getWindowDimensions().x
54 | }
55 |
56 | fun Context.getWindowHeight(): Int {
57 | return getWindowDimensions().y
58 | }
--------------------------------------------------------------------------------
/demo/src/main/java/com/mkhytarmkhoian/demo/BaseAlertDialog.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.demo
18 |
19 | import android.app.Dialog
20 | import android.content.Context
21 | import android.graphics.Rect
22 | import android.graphics.drawable.Drawable
23 | import android.os.Bundle
24 | import android.view.View
25 | import android.view.Window
26 | import com.mkhytarmkhoian.conductor.dialog.DialogController
27 |
28 |
29 | abstract class BaseAlertDialog(args: Bundle) : DialogController(args) {
30 |
31 | protected lateinit var shadowDrawable: Drawable
32 | protected lateinit var backgroundPaddings: Rect
33 |
34 | protected var maxWidth: Int = 0
35 | private val delegate = BaseAlertDialogDelegate()
36 |
37 | override fun onContextAvailable(context: Context) {
38 | super.onContextAvailable(context)
39 | delegate.onContextAvailable(context, this)
40 |
41 | backgroundPaddings = delegate.backgroundPaddings
42 | shadowDrawable = delegate.shadowDrawable
43 | maxWidth = delegate.maxWidth
44 | }
45 |
46 | override fun onCreateDialog(): Dialog {
47 | val dialog = super.onCreateDialog()
48 | return delegate.onCreateDialog(dialog)
49 | }
50 |
51 | override fun setupWindow(view: View?, window: Window?) {
52 | delegate.setupWindow(view, window)
53 | }
54 | }
--------------------------------------------------------------------------------
/demo/src/main/java/com/mkhytarmkhoian/demo/App.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.demo;
18 |
19 | import android.app.Application;
20 | import android.content.Context;
21 | import android.graphics.Point;
22 | import android.view.Display;
23 | import android.view.WindowManager;
24 |
25 | public class App extends Application {
26 |
27 | public static boolean isTablet;
28 | public static boolean isSmallTablet;
29 | public static float density;
30 |
31 |
32 | public static boolean isDebug() {
33 | return BuildConfig.DEBUG;
34 | }
35 |
36 | private static App instance;
37 | public static App getInstance() {
38 | return instance;
39 | }
40 |
41 | @Override public void onCreate() {
42 | super.onCreate();
43 | instance = this;
44 |
45 | isTablet = getResources().getBoolean(R.bool.is_tablet);
46 | density = getResources().getDisplayMetrics().density;
47 | isSmallTablet = isSmallTablet(density);
48 | }
49 |
50 | public boolean isSmallTablet(final float density){
51 | final WindowManager wm = (WindowManager) getApplicationContext().getSystemService(Context.WINDOW_SERVICE);
52 | final Display display = wm.getDefaultDisplay();
53 |
54 | final Point size = new Point();
55 | display.getSize(size);
56 |
57 | final float minSide = Math.min(size.x, size.y) / density;
58 | return minSide <= 700;
59 | }
60 | }
--------------------------------------------------------------------------------
/demo/src/main/java/com/mkhytarmkhoian/demo/HomeController.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2020 Lalafo.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.mkhytarmkhoian.demo
18 |
19 | import android.view.LayoutInflater
20 | import android.view.View
21 | import android.view.ViewGroup
22 | import android.widget.Button
23 | import com.bluelinelabs.conductor.Controller
24 | import com.bluelinelabs.conductor.RouterTransaction
25 | import com.bluelinelabs.conductor.changehandler.SimpleSwapChangeHandler
26 | import com.mkhytarmkhoian.demo.progress.ProgressDialogController
27 |
28 | class HomeController : Controller() {
29 |
30 | private var progressDialog: ProgressDialogController? = null
31 |
32 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup): View {
33 | val view = inflater.inflate(R.layout.controller_home, container, false)
34 |
35 | view.findViewById