From 4fa416e8430146ece84730e0285ffe6940f2c3dd Mon Sep 17 00:00:00 2001 From: 17351781990 <827990754@qq.com> Date: Tue, 29 Jun 2021 15:43:57 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=80=91=E5=8E=BB=E9=99=A4=E6=97=A5=E5=BF=97=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/vanniktech/emoji/sample/CustomViewAbility.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/entry/src/main/java/com/vanniktech/emoji/sample/CustomViewAbility.java b/entry/src/main/java/com/vanniktech/emoji/sample/CustomViewAbility.java index 7ac191e6..1fb29c23 100644 --- a/entry/src/main/java/com/vanniktech/emoji/sample/CustomViewAbility.java +++ b/entry/src/main/java/com/vanniktech/emoji/sample/CustomViewAbility.java @@ -80,7 +80,7 @@ public class CustomViewAbility extends Ability implements Component.ClickedListe mTriggerBtn = (Button) findComponentById(ResourceTable.Id_custom_trigger_btn); mEditField = (EmojiconTextField) findComponentById(ResourceTable.Id_edit_field); mEditField.setTag(EmojiconsPopup.SET_TEXT_TAG); - setCursorElement(mEditField,"#FFFF0000", 28); + setCursorElement(mEditField, "#FFFF0000", 28); mEmojiLayout = (StackLayout) findComponentById(ResourceTable.Id_emoji_layout); @@ -94,20 +94,16 @@ public class CustomViewAbility extends Ability implements Component.ClickedListe mEditField.addTextObserver(new Text.TextObserver() { @Override public void onTextUpdated(String s, int i, int i1, int i2) { - System.out.println("*****************"+s); if (mKeyboardLabel == -1) { if (EmojiUtil.containsChar(s)) { if (s.length() == 0) { - System.out.println("*****************------------1"); mEditField.setText(""); mTextStr = ""; } else { - System.out.println("*****************------------2"); mEditField.setText(mTextStr); } } else { if (s.length() > 2) { - System.out.println("*****************------------3"); mEditField.setText(s.substring(s.length() - 2)); } mTextStr = s; @@ -148,7 +144,7 @@ public class CustomViewAbility extends Ability implements Component.ClickedListe public boolean onTouchEvent(Component component, TouchEvent touchEvent) { switch (touchEvent.getAction()) { case TouchEvent.PRIMARY_POINT_DOWN: - if (mKeyboardLabel == -1 || mKeyboardLabel == 0){ + if (mKeyboardLabel == -1 || mKeyboardLabel == 0) { setBaseElement(mEditField, "#FF4081"); mKeyboardLabel = -1; mTextStr = mEditField.getText(); @@ -210,7 +206,7 @@ public class CustomViewAbility extends Ability implements Component.ClickedListe * 设置输入框的底线颜色 * * @param textField 输入框 - * @param colorStr 颜色 + * @param colorStr 颜色 */ private void setBaseElement(TextField textField, String colorStr) { ShapeElement shapeElement = new ShapeElement(); -- Gitee From 6610b59a43a71144625326c218dbed41afb08a5c Mon Sep 17 00:00:00 2001 From: 17351781990 <827990754@qq.com> Date: Tue, 29 Jun 2021 16:55:40 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E3=80=91=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E5=85=B3?= =?UTF-8?q?=E9=94=AE=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.OPENSOURCE | 4 +- README.md | 16 ++---- build.gradle | 2 +- .../emoji/Actions/EmojIconActions.java | 4 +- .../com/vanniktech/emoji/EmojiconsPopup.java | 2 +- .../main/resources/base/layout/emojicons.xml | 2 +- .../{emoji_activity.png => emoji_ability.png} | Bin ...vity_focus.png => emoji_ability_focus.png} | Bin .../emoji/sample/slice/MainAbilitySlice.java | 8 +-- .../resources/base/graphic/ic_keyboard.xml | 16 +++--- .../resources/base/graphic/ic_message.xml | 14 +++--- .../main/resources/base/graphic/ic_send.xml | 16 +++--- .../main/resources/base/graphic/ic_swap.xml | 16 +++--- .../resources/base/layout/ability_main.xml | 6 +-- .../resources/base/layout/dialog_swap.xml | 46 ------------------ 15 files changed, 51 insertions(+), 101 deletions(-) rename emoji/src/main/resources/base/media/{emoji_activity.png => emoji_ability.png} (100%) rename emoji/src/main/resources/base/media/{emoji_activity_focus.png => emoji_ability_focus.png} (100%) delete mode 100644 entry/src/main/resources/base/layout/dialog_swap.xml diff --git a/README.OPENSOURCE b/README.OPENSOURCE index 15be45f7..6514d443 100644 --- a/README.OPENSOURCE +++ b/README.OPENSOURCE @@ -8,9 +8,9 @@ "License File": "LICENSE", - "Version Number": "master", + "Version Number": "0.7.0", - "Upstream URL": "https://hub.fastgit.org/vanniktech/Emoji", + "Upstream URL": "https://github.com/vanniktech/Emoji", "Description": "为你的应用添加Emoji支持" diff --git a/README.md b/README.md index 1560f612..36fc1fcb 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ allprojects { /** * Constructor * - * @param ctx The context of current activity. + * @param ctx The context of current ability. * @param rootView 放入软键盘的父布局 * @param width emoji软键盘的宽 * @param height emoji软键盘的高 @@ -170,17 +170,7 @@ CloudTest代码测试无异常 ## 版权和许可信息 ``` -Copyright 2017 Zyao89 +Copyright (C) 2016 - Niklas Baudy, Ruben Gees, Mario Đanić and contributors -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. +Licensed under the Apache License, Version 2.0 ``` \ No newline at end of file diff --git a/build.gradle b/build.gradle index 10e25db8..159c6ce2 100644 --- a/build.gradle +++ b/build.gradle @@ -23,7 +23,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.huawei.ohos:hap:2.4.5.0' + classpath 'com.huawei.ohos:hap:2.4.4.2' classpath 'com.huawei.ohos:decctest:1.2.4.1' } } diff --git a/emoji/src/main/java/com/vanniktech/emoji/Actions/EmojIconActions.java b/emoji/src/main/java/com/vanniktech/emoji/Actions/EmojIconActions.java index 6c7d33ba..a4e46802 100644 --- a/emoji/src/main/java/com/vanniktech/emoji/Actions/EmojIconActions.java +++ b/emoji/src/main/java/com/vanniktech/emoji/Actions/EmojIconActions.java @@ -44,7 +44,7 @@ public class EmojIconActions implements Component.FocusChangedListener { /** * Constructor * - * @param ctx The context of current activity. + * @param ctx The context of current ability. * @param rootView The top most layout in your view hierarchy. The difference of this view and the screen height will be used to calculate the keyboard height. * @param width 宽 * @param height 高 @@ -62,7 +62,7 @@ public class EmojIconActions implements Component.FocusChangedListener { /** * Constructor * - * @param ctx The context of current activity. + * @param ctx The context of current ability. * @param rootView The top most layout in your view hierarchy. The difference of this view and the screen height will be used to calculate the keyboard height. * @param width 宽 * @param height 高 diff --git a/emoji/src/main/java/com/vanniktech/emoji/EmojiconsPopup.java b/emoji/src/main/java/com/vanniktech/emoji/EmojiconsPopup.java index f5aa0812..80518052 100644 --- a/emoji/src/main/java/com/vanniktech/emoji/EmojiconsPopup.java +++ b/emoji/src/main/java/com/vanniktech/emoji/EmojiconsPopup.java @@ -208,7 +208,7 @@ public class EmojiconsPopup extends DirectionalLayout implements PageSlider.Page setImg(mEmojiTabs[3], ResourceTable.Media_emoji_food_focus); break; case 4: - setImg(mEmojiTabs[4], ResourceTable.Media_emoji_activity_focus); + setImg(mEmojiTabs[4], ResourceTable.Media_emoji_ability_focus); break; case 5: setImg(mEmojiTabs[5], ResourceTable.Media_emoji_travel_focus); diff --git a/emoji/src/main/resources/base/layout/emojicons.xml b/emoji/src/main/resources/base/layout/emojicons.xml index f0569a97..9283486d 100644 --- a/emoji/src/main/resources/base/layout/emojicons.xml +++ b/emoji/src/main/resources/base/layout/emojicons.xml @@ -73,7 +73,7 @@ ohos:id="$+id:emojis_tab_4_sport" ohos:height="25vp" ohos:width="0vp" - ohos:image_src="$media:emoji_activity" + ohos:image_src="$media:emoji_ability" ohos:layout_alignment="vertical_center" ohos:margin="5vp" ohos:scale_mode="zoom_center" diff --git a/emoji/src/main/resources/base/media/emoji_activity.png b/emoji/src/main/resources/base/media/emoji_ability.png similarity index 100% rename from emoji/src/main/resources/base/media/emoji_activity.png rename to emoji/src/main/resources/base/media/emoji_ability.png diff --git a/emoji/src/main/resources/base/media/emoji_activity_focus.png b/emoji/src/main/resources/base/media/emoji_ability_focus.png similarity index 100% rename from emoji/src/main/resources/base/media/emoji_activity_focus.png rename to emoji/src/main/resources/base/media/emoji_ability_focus.png diff --git a/entry/src/main/java/com/vanniktech/emoji/sample/slice/MainAbilitySlice.java b/entry/src/main/java/com/vanniktech/emoji/sample/slice/MainAbilitySlice.java index 8e19d557..7632b25d 100644 --- a/entry/src/main/java/com/vanniktech/emoji/sample/slice/MainAbilitySlice.java +++ b/entry/src/main/java/com/vanniktech/emoji/sample/slice/MainAbilitySlice.java @@ -148,14 +148,14 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL mMorePop = (Text) findComponentById(ResourceTable.Id_pop_text); mSwapPop = (DirectionalLayout) findComponentById(ResourceTable.Id_pop_swap); Text iosSwap = (Text) findComponentById(ResourceTable.Id_swap_ios); - Text googleSwap = (Text) findComponentById(ResourceTable.Id_swap_google); + Text gooSwap = (Text) findComponentById(ResourceTable.Id_swap_goo); Text twitterSwap = (Text) findComponentById(ResourceTable.Id_swap_twitter); Text compatSwap = (Text) findComponentById(ResourceTable.Id_swap_compat); Text facebookSwap = (Text) findComponentById(ResourceTable.Id_swap_facebook); facebookSwap.setClickedListener(this); compatSwap.setClickedListener(this); twitterSwap.setClickedListener(this); - googleSwap.setClickedListener(this); + gooSwap.setClickedListener(this); iosSwap.setClickedListener(this); // title @@ -163,7 +163,7 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL mTitleSwap = (Image) findComponentById(ResourceTable.Id_title_swap); mTitleMessage = (Image) findComponentById(ResourceTable.Id_title_message); - mMaterialBtn = (Button) findComponentById(ResourceTable.Id_main_activity_material_button); + mMaterialBtn = (Button) findComponentById(ResourceTable.Id_main_material_button); mMaterialBtn.setText("\uD83D\uDE18\uD83D\uDE02\uD83E\uDD8C"); checkBox = (Checkbox) findComponentById(ResourceTable.Id_main_check); @@ -404,7 +404,7 @@ public class MainAbilitySlice extends AbilitySlice implements Component.ClickedL } break; case ResourceTable.Id_swap_ios: - case ResourceTable.Id_swap_google: + case ResourceTable.Id_swap_goo: case ResourceTable.Id_swap_twitter: case ResourceTable.Id_swap_compat: case ResourceTable.Id_swap_facebook: diff --git a/entry/src/main/resources/base/graphic/ic_keyboard.xml b/entry/src/main/resources/base/graphic/ic_keyboard.xml index e796e4ca..dfccfed9 100644 --- a/entry/src/main/resources/base/graphic/ic_keyboard.xml +++ b/entry/src/main/resources/base/graphic/ic_keyboard.xml @@ -1,9 +1,11 @@ - + + + ohos:fillColor="#FF000000" + ohos:pathData="M20,5L4,5c-1.1,0 -1.99,0.9 -1.99,2L2,17c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,7c0,-1.1 -0.9,-2 -2,-2zM11,8h2v2h-2L11,8zM11,11h2v2h-2v-2zM8,8h2v2L8,10L8,8zM8,11h2v2L8,13v-2zM7,13L5,13v-2h2v2zM7,10L5,10L5,8h2v2zM16,17L8,17v-2h8v2zM16,13h-2v-2h2v2zM16,10h-2L14,8h2v2zM19,13h-2v-2h2v2zM19,10h-2L17,8h2v2z"/> diff --git a/entry/src/main/resources/base/graphic/ic_message.xml b/entry/src/main/resources/base/graphic/ic_message.xml index 398842ef..41b9da47 100644 --- a/entry/src/main/resources/base/graphic/ic_message.xml +++ b/entry/src/main/resources/base/graphic/ic_message.xml @@ -1,9 +1,9 @@ - + + ohos:fillColor="#FFFFFF" + ohos:pathData="M20,2L4,2c-1.1,0 -1.99,0.9 -1.99,2L2,22l4,-4h14c1.1,0 2,-0.9 2,-2L22,4c0,-1.1 -0.9,-2 -2,-2zM18,14L6,14v-2h12v2zM18,11L6,11L6,9h12v2zM18,8L6,8L6,6h12v2z"/> diff --git a/entry/src/main/resources/base/graphic/ic_send.xml b/entry/src/main/resources/base/graphic/ic_send.xml index 92584d6b..2160952c 100644 --- a/entry/src/main/resources/base/graphic/ic_send.xml +++ b/entry/src/main/resources/base/graphic/ic_send.xml @@ -1,9 +1,11 @@ - + + + ohos:fillColor="#FF000000" + ohos:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/> diff --git a/entry/src/main/resources/base/graphic/ic_swap.xml b/entry/src/main/resources/base/graphic/ic_swap.xml index 7ac3d56b..03cfe3d9 100644 --- a/entry/src/main/resources/base/graphic/ic_swap.xml +++ b/entry/src/main/resources/base/graphic/ic_swap.xml @@ -1,9 +1,11 @@ - + + + ohos:fillColor="#FFFFFF" + ohos:pathData="M6.99,11L3,15l3.99,4v-3H14v-2H6.99v-3zM21,9l-3.99,-4v3H10v2h7.01v3L21,9z"/> diff --git a/entry/src/main/resources/base/layout/ability_main.xml b/entry/src/main/resources/base/layout/ability_main.xml index e3a86e6b..8aaa6ac2 100644 --- a/entry/src/main/resources/base/layout/ability_main.xml +++ b/entry/src/main/resources/base/layout/ability_main.xml @@ -50,7 +50,7 @@