From 89bf352915e8b04cf88b464e7f66d3cd1b37dddf Mon Sep 17 00:00:00 2001 From: VTB204255 Date: Tue, 2 Apr 2019 16:40:12 +0300 Subject: [PATCH 1/3] update build tools and fix package names --- example/build.gradle | 12 ++++++------ .../momanii/hani/supernova_emoji/MainActivity.java | 6 +++--- example/src/main/res/layout/activity_main.xml | 6 +++--- supernova-emoji-library/build.gradle | 12 ++++++------ .../{Actions => actions}/EmojIconActions.java | 8 ++++---- .../{Helper => helper}/EmojiAdapter.java | 2 +- .../{Helper => helper}/EmojiconEditText.java | 2 +- .../{Helper => helper}/EmojiconGridView.java | 2 +- .../{Helper => helper}/EmojiconHandler.java | 2 +- .../EmojiconMultiAutoCompleteTextView.java | 2 +- .../{Helper => helper}/EmojiconRecents.java | 2 +- .../{Helper => helper}/EmojiconRecentsGridView.java | 2 +- .../{Helper => helper}/EmojiconRecentsManager.java | 2 +- .../{Helper => helper}/EmojiconSpan.java | 2 +- .../{Helper => helper}/EmojiconTextView.java | 2 +- .../{Helper => helper}/EmojiconsPopup.java | 3 +-- .../src/main/res/layout/emojicon_item.xml | 2 +- 17 files changed, 34 insertions(+), 35 deletions(-) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Actions => actions}/EmojIconActions.java (97%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiAdapter.java (98%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconEditText.java (98%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconGridView.java (98%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconHandler.java (99%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconMultiAutoCompleteTextView.java (98%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconRecents.java (93%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconRecentsGridView.java (97%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconRecentsManager.java (98%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconSpan.java (98%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconTextView.java (98%) rename supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/{Helper => helper}/EmojiconsPopup.java (99%) diff --git a/example/build.gradle b/example/build.gradle index e19cef2..e734180 100644 --- a/example/build.gradle +++ b/example/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 25 - buildToolsVersion '25.0.2' + compileSdkVersion 28 + buildToolsVersion "28.0.3" defaultConfig { applicationId "momanii.hani.supernova_emoji" - minSdkVersion 9 - targetSdkVersion 25 + minSdkVersion 14 + targetSdkVersion 28 versionCode 1 versionName "1.0" } @@ -19,6 +19,6 @@ android { } dependencies { - compile project(':supernova-emoji-library') - //compile 'com.android.support:appcompat-v7:25.3.1' + implementation project(':supernova-emoji-library') + implementation 'com.android.support:appcompat-v7:28.0.0' } diff --git a/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java b/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java index d9a5fdb..c16fa38 100644 --- a/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java +++ b/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java @@ -8,9 +8,9 @@ import android.widget.CompoundButton; import android.widget.ImageView; -import hani.momanii.supernova_emoji_library.Actions.EmojIconActions; -import hani.momanii.supernova_emoji_library.Helper.EmojiconEditText; -import hani.momanii.supernova_emoji_library.Helper.EmojiconTextView; +import hani.momanii.supernova_emoji_library.actions.EmojIconActions; +import hani.momanii.supernova_emoji_library.helper.EmojiconEditText; +import hani.momanii.supernova_emoji_library.helper.EmojiconTextView; public class MainActivity extends AppCompatActivity { diff --git a/example/src/main/res/layout/activity_main.xml b/example/src/main/res/layout/activity_main.xml index ed956de..babab68 100644 --- a/example/src/main/res/layout/activity_main.xml +++ b/example/src/main/res/layout/activity_main.xml @@ -29,7 +29,7 @@ android:src="@android:drawable/ic_menu_send" /> - - - - Date: Wed, 3 Apr 2019 09:17:53 +0300 Subject: [PATCH 2/3] update build tools and fix package names --- build.gradle | 7 ++++++- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 5608ef8..9b3a973 100644 --- a/build.gradle +++ b/build.gradle @@ -2,10 +2,13 @@ buildscript { repositories { + mavenCentral() jcenter() + google() + } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' + classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' classpath "com.github.dcendents:android-maven-gradle-plugin:1.3" // NOTE: Do not place your application dependencies here; they belong @@ -15,7 +18,9 @@ buildscript { allprojects { repositories { + mavenCentral() jcenter() + google() } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d66e0a1..7e38cc6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=http\://nexus/repository/gradle/gradle-4.6-all.zip From 15169a89fb99e0955a61b3fc4a78c9c091aaa3b4 Mon Sep 17 00:00:00 2001 From: Bernhard Date: Mon, 18 Nov 2019 15:15:31 +0200 Subject: [PATCH 3/3] Added standalone emoji picker popup --- .gitignore | 2 + build.gradle | 6 +- .../hani/supernova_emoji/MainActivity.java | 21 ++ example/src/main/res/layout/activity_main.xml | 44 +++-- gradle/wrapper/gradle-wrapper.properties | 3 +- supernova-emoji-library/build.gradle | 8 + .../helper/EmojiAdapter.java | 18 +- .../helper/EmojiconGridView.java | 12 +- .../helper/EmojiconPicker.kt | 187 ++++++++++++++++++ .../helper/EmojiconRecentsGridView.java | 27 +-- .../helper/EmojiconsPopup.java | 44 ++--- .../src/main/res/layout/emojicons.xml | 82 ++++---- 12 files changed, 342 insertions(+), 112 deletions(-) create mode 100644 supernova-emoji-library/src/main/java/hani/momanii/supernova_emoji_library/helper/EmojiconPicker.kt diff --git a/.gitignore b/.gitignore index 2b07ed6..1c414bf 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ example/src/main/gen .DS_Store /build /captures + +.idea/ diff --git a/build.gradle b/build.gradle index 9b3a973..6c92ae6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.kotlin_version = '1.3.50' repositories { mavenCentral() jcenter() @@ -8,9 +9,10 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.2.1' + classpath 'com.android.tools.build:gradle:3.5.2' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' - classpath "com.github.dcendents:android-maven-gradle-plugin:1.3" + classpath "com.github.dcendents:android-maven-gradle-plugin:2.1" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java b/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java index c16fa38..ad168f7 100644 --- a/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java +++ b/example/src/main/java/momanii/hani/supernova_emoji/MainActivity.java @@ -1,15 +1,19 @@ package momanii.hani.supernova_emoji; +import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; +import android.view.View.OnClickListener; +import android.widget.Button; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.ImageView; import hani.momanii.supernova_emoji_library.actions.EmojIconActions; import hani.momanii.supernova_emoji_library.helper.EmojiconEditText; +import hani.momanii.supernova_emoji_library.helper.EmojiconPicker; import hani.momanii.supernova_emoji_library.helper.EmojiconTextView; public class MainActivity extends AppCompatActivity { @@ -29,6 +33,7 @@ protected void onCreate(Bundle savedInstanceState) { rootView = findViewById(R.id.root_view); emojiButton = (ImageView) findViewById(R.id.emoji_btn); + Button dialog_trigger = (Button) findViewById(R.id.dialog_trigger); submitButton = (ImageView) findViewById(R.id.submit_btn); mCheckBox = (CheckBox) findViewById(R.id.use_system_default); emojiconEditText = (EmojiconEditText) findViewById(R.id.emojicon_edit_text); @@ -64,6 +69,22 @@ public void onClick(View v) { textView.setText(newText); } }); + + dialog_trigger.setOnClickListener(new OnClickListener() { + @Override + public void onClick(final View v) { + EmojiconPicker picker = new EmojiconPicker(); + picker.create(v.getContext(), true); + picker.setOnEmojiSelectedListener(new EmojiconPicker.OnSelectedListener() { + @Override + public void onSelected(@NonNull View view, @NonNull String emoji) { + textView.setText(emoji); + } + }); + picker.show(v); + + } + }); } diff --git a/example/src/main/res/layout/activity_main.xml b/example/src/main/res/layout/activity_main.xml index babab68..87da5e8 100644 --- a/example/src/main/res/layout/activity_main.xml +++ b/example/src/main/res/layout/activity_main.xml @@ -1,33 +1,31 @@ + xmlns:emojicon="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/root_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="#ffffff" + android:paddingTop="@dimen/activity_vertical_margin" + tools:context="momanii.hani.supernova_emoji.MainActivity"> + android:src="@mipmap/smiley" /> + android:src="@android:drawable/ic_menu_send" /> + emojicon:emojiconSize="28sp" /> + emojicon:emojiconSize="28sp" /> + android:text="Use System Default?" /> + + +