├── .github
├── README.md
└── images
│ └── screenshot.png
├── .gitignore
├── EasyAlertsAndroidStudioProject~
├── .gradle
│ ├── 5.4.1
│ │ ├── executionHistory
│ │ │ ├── executionHistory.bin
│ │ │ └── executionHistory.lock
│ │ ├── fileChanges
│ │ │ └── last-build.bin
│ │ ├── fileContent
│ │ │ └── fileContent.lock
│ │ ├── fileHashes
│ │ │ ├── fileHashes.bin
│ │ │ ├── fileHashes.lock
│ │ │ └── resourceHashesCache.bin
│ │ ├── gc.properties
│ │ └── javaCompile
│ │ │ ├── classAnalysis.bin
│ │ │ ├── jarAnalysis.bin
│ │ │ ├── javaCompile.lock
│ │ │ └── taskHistory.bin
│ ├── buildOutputCleanup
│ │ ├── buildOutputCleanup.lock
│ │ ├── cache.properties
│ │ └── outputFiles.bin
│ └── vcs-1
│ │ └── gc.properties
├── .idea
│ ├── .gitignore
│ ├── .name
│ ├── caches
│ │ ├── build_file_checksums.ser
│ │ └── gradle_models.ser
│ ├── codeStyles
│ │ └── Project.xml
│ ├── compiler.xml
│ ├── gradle.xml
│ ├── jarRepositories.xml
│ ├── libraries
│ │ ├── Gradle____unity_libs_classes_jar.xml
│ │ ├── Gradle__androidx_annotation_annotation_1_0_0.xml
│ │ ├── Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml
│ │ ├── Gradle__androidx_arch_core_core_common_2_0_0.xml
│ │ ├── Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml
│ │ ├── Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml
│ │ ├── Gradle__androidx_collection_collection_1_0_0.xml
│ │ ├── Gradle__androidx_constraintlayout_constraintlayout_1_1_3_aar.xml
│ │ ├── Gradle__androidx_constraintlayout_constraintlayout_solver_1_1_3.xml
│ │ ├── Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml
│ │ ├── Gradle__androidx_core_core_1_0_0_aar.xml
│ │ ├── Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml
│ │ ├── Gradle__androidx_customview_customview_1_0_0_aar.xml
│ │ ├── Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml
│ │ ├── Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml
│ │ ├── Gradle__androidx_fragment_fragment_1_0_0_aar.xml
│ │ ├── Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml
│ │ ├── Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml
│ │ ├── Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_common_2_0_0.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml
│ │ ├── Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml
│ │ ├── Gradle__androidx_loader_loader_1_0_0_aar.xml
│ │ ├── Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml
│ │ ├── Gradle__androidx_print_print_1_0_0_aar.xml
│ │ ├── Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml
│ │ ├── Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml
│ │ ├── Gradle__androidx_test_espresso_espresso_core_3_2_0_aar.xml
│ │ ├── Gradle__androidx_test_espresso_espresso_idling_resource_3_2_0_aar.xml
│ │ ├── Gradle__androidx_test_monitor_1_2_0_aar.xml
│ │ ├── Gradle__androidx_test_runner_1_2_0_aar.xml
│ │ ├── Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml
│ │ ├── Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml
│ │ ├── Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml
│ │ ├── Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml
│ │ ├── Gradle__com_google_code_findbugs_jsr305_2_0_1.xml
│ │ ├── Gradle__com_squareup_javawriter_2_1_1.xml
│ │ ├── Gradle__javax_inject_javax_inject_1.xml
│ │ ├── Gradle__junit_junit_4_12.xml
│ │ ├── Gradle__net_sf_kxml_kxml2_2_3_0.xml
│ │ ├── Gradle__org_hamcrest_hamcrest_core_1_3.xml
│ │ ├── Gradle__org_hamcrest_hamcrest_integration_1_3.xml
│ │ └── Gradle__org_hamcrest_hamcrest_library_1_3.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── modules
│ │ ├── app
│ │ │ └── EasyAndroidAlerts.app.iml
│ │ └── unity
│ │ │ └── EasyAndroidAlerts.unity.iml
│ ├── runConfigurations.xml
│ ├── vcs.xml
│ └── workspace.xml
├── EasyAndroidAlerts.iml
├── app
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── nrjwolf
│ │ │ └── androidtools
│ │ │ └── easyandroidalerts
│ │ │ └── ExampleInstrumentedTest.java
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── nrjwolf
│ │ │ │ └── androidtools
│ │ │ │ └── easyandroidalerts
│ │ │ │ └── MainActivity.java
│ │ └── res
│ │ │ ├── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── drawable
│ │ │ └── ic_launcher_background.xml
│ │ │ ├── layout
│ │ │ └── activity_main.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── 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
│ │ │ └── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ └── test
│ │ └── java
│ │ └── nrjwolf
│ │ └── androidtools
│ │ └── easyandroidalerts
│ │ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── local.properties
├── settings.gradle
└── unity
│ ├── .gitignore
│ ├── build.gradle
│ ├── consumer-rules.pro
│ ├── libs
│ └── classes.jar
│ ├── proguard-rules.pro
│ └── src
│ ├── androidTest
│ └── java
│ │ └── nrjwolf
│ │ └── androidtools
│ │ └── unity
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── nrjwolf
│ │ │ └── androidtools
│ │ │ └── unity
│ │ │ ├── JavaMessageHandler.java
│ │ │ ├── NativeAlerts.java
│ │ │ └── UnityBridge.java
│ └── res
│ │ └── values
│ │ └── strings.xml
│ └── test
│ └── java
│ └── nrjwolf
│ └── androidtools
│ └── unity
│ └── ExampleUnitTest.java
├── LICENSE.md
├── LICENSE.md.meta
├── Plugins.meta
├── Plugins
├── EasyAndroidAlerts.meta
└── EasyAndroidAlerts
│ ├── Android.meta
│ ├── Android
│ ├── EasyAndroidAlerts.aar
│ └── EasyAndroidAlerts.aar.meta
│ ├── Runtime.meta
│ └── Runtime
│ ├── EasyAndroidAlerts.cs
│ ├── EasyAndroidAlerts.cs.meta
│ ├── Nrjwolf.Tools.EasyAndroidAlerts.asmdef
│ └── Nrjwolf.Tools.EasyAndroidAlerts.asmdef.meta
├── package.json
└── package.json.meta
/.github/README.md:
--------------------------------------------------------------------------------
1 | # Unity Android Easy Alerts
2 |
3 | ### Installation
4 |
5 | Add this as a package to your project by adding the below as an entry to the dependencies in the `/Packages/manifest.json` file:
6 |
7 | ```json
8 | "nrjwolf.games.easyandroidalerts": "https://github.com/Nrjwolf/unity-android-easy-native-alerts.git"
9 | ```
10 | For more information on adding git repositories as a package see the [Git support on Package Manager](https://docs.unity3d.com/Manual/upm-git.html) in the Unity Documentation.
11 |
12 | ### Example
13 | ``` c#
14 | using System.Collections;
15 | using System.Collections.Generic;
16 | using Nrjwolf.Tools.AndroidEasyAlerts;
17 | using UnityEngine;
18 |
19 | public class EasyNativeAlertsExample : MonoBehaviour
20 | {
21 | void OnGUI()
22 | {
23 | GUI.matrix = Matrix4x4.Scale(new Vector3(3.5f, 3.5f, 3.5f));
24 | GUILayout.Label($"Easy native alerts");
25 |
26 | if (GUILayout.Button($"IsCanceledOnTouchOutside: {AndroidEasyAlerts.IsCanceledOnTouchOutside}"))
27 | {
28 | AndroidEasyAlerts.IsCanceledOnTouchOutside = !AndroidEasyAlerts.IsCanceledOnTouchOutside;
29 | }
30 | if (GUILayout.Button("Call Alert"))
31 | {
32 | AndroidEasyAlerts.ShowAlert("Title", "Your message",
33 | new AlertButton("IDK", () => AndroidEasyAlerts.ShowToast("Clicked IDK", false), ButtonStyle.NEUTRAL),
34 | new AlertButton("Cancel", () => AndroidEasyAlerts.ShowToast("Clicked Cancel", false), ButtonStyle.NEGATIVE),
35 | new AlertButton("Ok", () => AndroidEasyAlerts.ShowToast("Clicked Ok", false), ButtonStyle.POSITIVE)
36 | );
37 | }
38 | else if (GUILayout.Button("Show long toast"))
39 | {
40 | AndroidEasyAlerts.ShowToast("long toast", true);
41 | }
42 | else if (GUILayout.Button("Show short toast"))
43 | {
44 | AndroidEasyAlerts.ShowToast("short toast", false);
45 | }
46 | }
47 | }
48 | ```
49 |
50 | 
51 |
52 | For IOS check another my plugin https://github.com/Nrjwolf/unity-ios-easy-native-alert
53 | Do not forgot to ⭐️ it.
54 |
55 | ---
56 |
57 | >Telegram : https://t.me/nrjwolf_games
58 | >Discord : https://discord.gg/jwPVsat
59 | >Reddit : https://www.reddit.com/r/Nrjwolf/
60 | >Twitter : https://twitter.com/nrjwolf
61 |
--------------------------------------------------------------------------------
/.github/images/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/.github/images/screenshot.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.DS_Store
2 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/executionHistory/executionHistory.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/executionHistory/executionHistory.bin
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/executionHistory/executionHistory.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/executionHistory/executionHistory.lock
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileChanges/last-build.bin:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileContent/fileContent.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileContent/fileContent.lock
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileHashes/fileHashes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileHashes/fileHashes.bin
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileHashes/fileHashes.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileHashes/fileHashes.lock
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileHashes/resourceHashesCache.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/fileHashes/resourceHashesCache.bin
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/gc.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/gc.properties
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/classAnalysis.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/classAnalysis.bin
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/jarAnalysis.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/jarAnalysis.bin
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/javaCompile.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/javaCompile.lock
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/taskHistory.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/5.4.1/javaCompile/taskHistory.bin
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/buildOutputCleanup/buildOutputCleanup.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/buildOutputCleanup/buildOutputCleanup.lock
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/buildOutputCleanup/cache.properties:
--------------------------------------------------------------------------------
1 | #Thu Apr 30 23:03:55 WITA 2020
2 | gradle.version=5.4.1
3 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/buildOutputCleanup/outputFiles.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/buildOutputCleanup/outputFiles.bin
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.gradle/vcs-1/gc.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.gradle/vcs-1/gc.properties
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/.name:
--------------------------------------------------------------------------------
1 | EasyAndroidAlerts
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/caches/gradle_models.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/.idea/caches/gradle_models.ser
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
22 |
23 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle____unity_libs_classes_jar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_annotation_annotation_1_0_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_collection_collection_1_0_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_1_1_3_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_constraintlayout_constraintlayout_solver_1_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_core_core_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_test_espresso_espresso_core_3_2_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_test_espresso_espresso_idling_resource_3_2_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_test_monitor_1_2_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_test_runner_1_2_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_2_0_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__com_squareup_javawriter_2_1_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__junit_junit_4_12.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__net_sf_kxml_kxml2_2_3_0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__org_hamcrest_hamcrest_integration_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/libraries/Gradle__org_hamcrest_hamcrest_library_1_3.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/modules/app/EasyAndroidAlerts.app.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | generateDebugSources
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/modules/unity/EasyAndroidAlerts.unity.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | generateDebugSources
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/.idea/workspace.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 | true
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 | true
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 | 1588259016288
207 |
208 |
209 | 1588259016288
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
224 |
225 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 |
235 |
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/EasyAndroidAlerts.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.2"
6 | defaultConfig {
7 | applicationId "nrjwolf.androidtools.easyandroidalerts"
8 | minSdkVersion 16
9 | targetSdkVersion 29
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(dir: 'libs', include: ['*.jar'])
24 | implementation 'com.android.support:appcompat-v7:24.2.1'
25 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
26 | testImplementation 'junit:junit:4.12'
27 | androidTestImplementation 'androidx.test:runner:1.2.0'
28 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
29 | implementation project(path: ':unity')
30 | }
31 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/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 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/androidTest/java/nrjwolf/androidtools/easyandroidalerts/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.easyandroidalerts;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("nrjwolf.androidtools.easyandroidalerts", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/java/nrjwolf/androidtools/easyandroidalerts/MainActivity.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.easyandroidalerts;
2 |
3 | import androidx.appcompat.app.AlertDialog;
4 | import androidx.appcompat.app.AppCompatActivity;
5 |
6 | import android.content.DialogInterface;
7 | import android.os.Bundle;
8 | import android.util.Log;
9 | import android.view.View;
10 | import android.widget.Button;
11 |
12 | import nrjwolf.androidtools.unity.NativeAlerts;
13 |
14 | public class MainActivity extends AppCompatActivity {
15 |
16 | NativeAlerts NativeAlerts;
17 |
18 | Button alertButton;
19 |
20 | @Override
21 | protected void onCreate(Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_main);
24 |
25 | // create NativeAlerts
26 | NativeAlerts = new NativeAlerts();
27 |
28 | // get buttons
29 | alertButton = (Button) findViewById(R.id.btnalert);
30 |
31 | alertButton.setOnClickListener(new View.OnClickListener() {
32 | @Override
33 | public void onClick(View v) {
34 | Log.i("App", NativeAlerts.getMessage());
35 |
36 | AlertDialog alertDialog = new AlertDialog.Builder(MainActivity.this).create();
37 | alertDialog.setTitle("Alert");
38 | alertDialog.setMessage("Alert message to be shown");
39 | alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK",
40 | new DialogInterface.OnClickListener() {
41 | public void onClick(DialogInterface dialog, int which) {
42 | dialog.dismiss();
43 | }
44 | });
45 | alertDialog.show();
46 | }
47 | });
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
34 |
35 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | EasyAndroidAlerts
3 |
4 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/app/src/test/java/nrjwolf/androidtools/easyandroidalerts/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.easyandroidalerts;
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 | }
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/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 | google()
6 | jcenter()
7 |
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.5.0'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 |
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Apr 30 23:03:38 WITA 2020
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 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
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 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/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 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
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 Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/local.properties:
--------------------------------------------------------------------------------
1 | ## This file is automatically generated by Android Studio.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file should *NOT* be checked into Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 | #
7 | # Location of the SDK. This is only used by Gradle.
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=/Users/nrjwolf/Library/Android/sdk
11 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':unity'
2 | rootProject.name='EasyAndroidAlerts'
3 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.2"
6 |
7 |
8 | defaultConfig {
9 | minSdkVersion 16
10 | targetSdkVersion 29
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 | consumerProguardFiles 'consumer-rules.pro'
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | }
25 |
26 | dependencies {
27 | compileOnly files('libs/classes.jar')
28 | }
29 |
30 | task copyPlugin(type: Copy) {
31 | dependsOn assemble
32 | from ("build/outputs/aar")
33 | into ("../../Plugins/EasyAndroidAlerts/Android")
34 | include (project.name + "-release.aar")
35 | rename(project.name + "-release.aar", 'EasyAndroidAlerts.aar')
36 | }
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/consumer-rules.pro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/unity/consumer-rules.pro
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/libs/classes.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/EasyAlertsAndroidStudioProject~/unity/libs/classes.jar
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/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 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/src/androidTest/java/nrjwolf/androidtools/unity/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.unity;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.platform.app.InstrumentationRegistry;
6 | import androidx.test.ext.junit.runners.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
24 |
25 | assertEquals("nrjwolf.androidtools.unity.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/src/main/java/nrjwolf/androidtools/unity/JavaMessageHandler.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.unity;
2 |
3 | public interface JavaMessageHandler {
4 | void onButtonClicked(String buttonId);
5 | }
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/src/main/java/nrjwolf/androidtools/unity/NativeAlerts.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.unity;
2 | import android.app.Activity;
3 | import android.app.AlertDialog;
4 | import android.content.DialogInterface;
5 | import android.util.Log;
6 | import android.widget.Toast;
7 |
8 | import com.unity3d.player.UnityPlayer;
9 |
10 | public class NativeAlerts {
11 | private static final NativeAlerts ourInstance = new NativeAlerts();
12 | public static NativeAlerts getInstance() {
13 | return ourInstance;
14 | }
15 | private static final String PLUGIN_TAG = "EasyNativeAlerts";
16 | public static Activity getUnityActivity() {
17 | return UnityPlayer.currentActivity;
18 | }
19 | public NativeAlerts() {
20 | Log("plugin started");
21 | }
22 | private void Log(String message) {
23 | Log.i(PLUGIN_TAG, message);
24 | }
25 |
26 | public boolean isCanceledOnTouchOutside = true;
27 |
28 | public void createAlert(String title, String message, String[] buttonTitles, int[] buttonStyles) {
29 | AlertDialog alertDialog = new AlertDialog.Builder(getUnityActivity()).create();
30 | alertDialog.setTitle(title);
31 | alertDialog.setMessage(message);
32 | alertDialog.setCanceledOnTouchOutside(isCanceledOnTouchOutside);
33 |
34 | // Add buttons
35 | for (int i = 0; i < buttonTitles.length; i++) {
36 | final String id = buttonTitles[i] + i; // unique id
37 | final int buttonStyle = buttonStyles[i]; // style
38 |
39 | alertDialog.setButton(buttonStyle, buttonTitles[i],
40 | new DialogInterface.OnClickListener() {
41 | public void onClick(DialogInterface dialog, int which) {
42 | dialog.dismiss();
43 | UnityBridge.sendMessageToUnity(id); // send id to unity
44 | }
45 | });
46 | }
47 | alertDialog.show();
48 | }
49 |
50 | public void showToast (String message, boolean isLong ) {
51 | Toast.makeText(getUnityActivity(), message, isLong ? Toast.LENGTH_LONG : Toast.LENGTH_SHORT).show();
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/src/main/java/nrjwolf/androidtools/unity/UnityBridge.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.unity;
2 | import android.os.Handler;
3 |
4 | public class UnityBridge {
5 | private static JavaMessageHandler javaMessageHandler;
6 | private static Handler unityMainThreadHandler;
7 |
8 | public static void registerMessageHandler(JavaMessageHandler handler) {
9 | javaMessageHandler = handler;
10 | if (unityMainThreadHandler == null) {
11 | unityMainThreadHandler = new Handler();
12 | }
13 | }
14 |
15 | public static void runOnUnityThread(Runnable runnable) {
16 | if(unityMainThreadHandler != null && runnable != null) {
17 | unityMainThreadHandler.post(runnable);
18 | }
19 | }
20 |
21 | public static void sendMessageToUnity(final String buttonId) {
22 | runOnUnityThread(new Runnable() {
23 |
24 | @Override
25 | public void run() {
26 | if (javaMessageHandler != null) {
27 | javaMessageHandler.onButtonClicked(buttonId);
28 | }
29 | }
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | unity
3 |
4 |
--------------------------------------------------------------------------------
/EasyAlertsAndroidStudioProject~/unity/src/test/java/nrjwolf/androidtools/unity/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package nrjwolf.androidtools.unity;
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 | }
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Nrjwolf
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 |
--------------------------------------------------------------------------------
/LICENSE.md.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d0ae91b67d93848888926789b23ecaaa
3 | TextScriptImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/Plugins.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 61fcd03ad914d438a9d4c1c39a727516
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 2c1d5284de477400990f6a431b25d750
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Android.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 413923ba103cb42cd895a0dfb0296c69
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Android/EasyAndroidAlerts.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Nrjwolf/unity-android-easy-native-alerts/7ba03f9853f2b682620ac760b19846a9502ddee3/Plugins/EasyAndroidAlerts/Android/EasyAndroidAlerts.aar
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Android/EasyAndroidAlerts.aar.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: f097c051a4cd04ff2beff8b300c4ff14
3 | PluginImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | iconMap: {}
7 | executionOrder: {}
8 | defineConstraints: []
9 | isPreloaded: 0
10 | isOverridable: 1
11 | isExplicitlyReferenced: 0
12 | validateReferences: 1
13 | platformData:
14 | - first:
15 | Android: Android
16 | second:
17 | enabled: 1
18 | settings: {}
19 | - first:
20 | Any:
21 | second:
22 | enabled: 0
23 | settings: {}
24 | - first:
25 | Editor: Editor
26 | second:
27 | enabled: 0
28 | settings:
29 | DefaultValueInitialized: true
30 | userData:
31 | assetBundleName:
32 | assetBundleVariant:
33 |
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Runtime.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: c37dd5792f7f340c2a5afc6a2667c1d8
3 | folderAsset: yes
4 | DefaultImporter:
5 | externalObjects: {}
6 | userData:
7 | assetBundleName:
8 | assetBundleVariant:
9 |
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Runtime/EasyAndroidAlerts.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using UnityEngine;
4 |
5 | namespace Nrjwolf.Tools.AndroidEasyAlerts
6 | {
7 | public enum ButtonStyle
8 | {
9 | POSITIVE = -1,
10 | NEGATIVE = -2,
11 | NEUTRAL = -3,
12 | }
13 |
14 | public class AlertButton
15 | {
16 | public Nrjwolf.Tools.AndroidEasyAlerts.ButtonStyle Style;
17 | public string Title;
18 | public Action Callback;
19 | internal string m_Id;
20 |
21 | public AlertButton(string title, Action callback, ButtonStyle style = ButtonStyle.NEUTRAL)
22 | {
23 | Title = title;
24 | Callback = callback;
25 | Style = style;
26 | }
27 | }
28 |
29 | #if UNITY_ANDROID && !UNITY_EDITOR
30 | public class JavaMessageHandler : AndroidJavaProxy
31 | {
32 | private JavaMessageHandler() : base("nrjwolf.androidtools.unity.JavaMessageHandler") { }
33 | public void onButtonClicked(string buttonId)
34 | {
35 | var buttons = AndroidEasyAlerts.m_CurrentAlertButtons;
36 | if (buttons == null || buttons.Length == 0) return;
37 |
38 | Debug.Log($"Clicked {buttonId}");
39 | foreach (var alertButton in buttons)
40 | {
41 | if (alertButton.m_Id == buttonId)
42 | {
43 | alertButton.Callback?.Invoke();
44 | break;
45 | }
46 | }
47 | }
48 |
49 | [RuntimeInitializeOnLoadMethod]
50 | private static void Initialize()
51 | {
52 | new AndroidJavaClass("nrjwolf.androidtools.unity.UnityBridge").CallStatic("registerMessageHandler", new JavaMessageHandler());
53 | }
54 | }
55 | #endif
56 |
57 | public class AndroidEasyAlerts
58 | {
59 | #if UNITY_ANDROID && !UNITY_EDITOR
60 | private const string k_PluginNativeAlerts = "nrjwolf.androidtools.unity.NativeAlerts";
61 | private static AndroidJavaClass m_PluginClass;
62 | private static AndroidJavaObject m_PluginInstance;
63 |
64 | private static AndroidJavaClass PluginClass { get { return m_PluginClass != null ? m_PluginClass : m_PluginClass = new AndroidJavaClass(k_PluginNativeAlerts); } }
65 | private static AndroidJavaObject PluginInstance { get { return m_PluginInstance != null ? m_PluginInstance : m_PluginInstance = PluginClass.CallStatic("getInstance"); } }
66 |
67 | internal static AlertButton[] m_CurrentAlertButtons;
68 |
69 | /// Will dialog close when you will click outside (true is default)
70 | public static bool IsCanceledOnTouchOutside { get; set; } = true;
71 |
72 | public static void ShowAlert(string title, string message, params AlertButton[] buttons)
73 | {
74 | var buttonTitles = buttons.Select(x => x.Title).ToArray();
75 | var buttonStyles = buttons.Select(x => (int)x.Style).ToArray();
76 | PluginInstance.Set("isCanceledOnTouchOutside", AndroidEasyAlerts.IsCanceledOnTouchOutside);
77 | PluginInstance.Call("createAlert", title, message, buttonTitles, buttonStyles);
78 |
79 | // create unique button id (same method as in .aar)
80 | for (int i = 0; i < buttons.Length; i++)
81 | {
82 | var item = buttons[i];
83 | item.m_Id = item.Title + i;
84 | }
85 |
86 | // cache current buttons
87 | m_CurrentAlertButtons = buttons;
88 | }
89 |
90 | public static void ShowToast(string text, bool isLongDuration = false) => PluginInstance.Call("showToast", text, isLongDuration);
91 | #else
92 | /// Will dialog close when you will click outside (true is default)
93 | public static bool IsCanceledOnTouchOutside { get; set; } = true;
94 | public static void ShowAlert(string title, string message, params AlertButton[] buttons) { }
95 | public static void ShowToast(string text, bool isLongDuration = false) { }
96 | #endif
97 | }
98 | }
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Runtime/EasyAndroidAlerts.cs.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 78e5d6d96c76a4571b1a16382a55fe07
3 | MonoImporter:
4 | externalObjects: {}
5 | serializedVersion: 2
6 | defaultReferences: []
7 | executionOrder: 0
8 | icon: {instanceID: 0}
9 | userData:
10 | assetBundleName:
11 | assetBundleVariant:
12 |
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Runtime/Nrjwolf.Tools.EasyAndroidAlerts.asmdef:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Nrjwolf.Tools.EasyAndroidAlerts",
3 | "references": [],
4 | "includePlatforms": [],
5 | "excludePlatforms": [],
6 | "allowUnsafeCode": false,
7 | "overrideReferences": false,
8 | "precompiledReferences": [],
9 | "autoReferenced": true,
10 | "defineConstraints": [],
11 | "versionDefines": []
12 | }
--------------------------------------------------------------------------------
/Plugins/EasyAndroidAlerts/Runtime/Nrjwolf.Tools.EasyAndroidAlerts.asmdef.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: d86cf2ea6d0cb4d8598467f0d0271bc7
3 | AssemblyDefinitionImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "nrjwolf.games.easyandroidalerts",
3 | "version": "1.0.0",
4 | "displayName": "Easy Android Native Alerts",
5 | "description": "Use it to show native android alerts",
6 | "unity": "2018.2"
7 | }
--------------------------------------------------------------------------------
/package.json.meta:
--------------------------------------------------------------------------------
1 | fileFormatVersion: 2
2 | guid: 554a1b0505dc04f75bd6ea4ff5d7efc6
3 | PackageManifestImporter:
4 | externalObjects: {}
5 | userData:
6 | assetBundleName:
7 | assetBundleVariant:
8 |
--------------------------------------------------------------------------------