From 6d7751c400774b45cea6c9f3ad0c4573411c1c4f Mon Sep 17 00:00:00 2001 From: zxd191990 <1713664308@qq.com> Date: Mon, 24 May 2021 18:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AEchangelist=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 6 +- README.OPENSOURCE | 2 +- README.md | 4 +- .../sample/utils/MyToast.java | 55 ------------------- 4 files changed, 5 insertions(+), 62 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a5f583..62c8f79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,2 @@ -## 0.0.2-SNAPSHOT -* optimization: Optimize code -## v0.0.1_alpha -* refactor: For module library to openharmony +## 0.0.1-SNAPSHOT +ohos第一个版本,完整实现了原库的全部api diff --git a/README.OPENSOURCE b/README.OPENSOURCE index 0a8eb13..f43e8cc 100644 --- a/README.OPENSOURCE +++ b/README.OPENSOURCE @@ -3,7 +3,7 @@ "Name": " ExpandableTextView ", "License": " Apache License ", "License File": " LICENSE ", - "Version Number": " 0.1.3 ", + "Version Number": " v0.1.3 ", "Upstream URL": " https://github.com/Manabu-GT/ExpandableTextView ", "Description": " ExpandableTextView is an library that allows developers to easily create an TextView which can expand/collapse just like the Google Play's app description. Feel free to use it all you want in your apps provided that you cite this project. " } diff --git a/README.md b/README.md index 4a82e41..838f709 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ allprojects { 2.在entry模块的build.gradle文件中, ```gradle dependencies { - implementation('com.gitee.chinasoft_ohos:ExpandableTextView:0.0.2-SNAPSHOT') + implementation('com.gitee.chinasoft_ohos:ExpandableTextView:0.0.1-SNAPSHOT') ...... } ``` @@ -113,7 +113,7 @@ CloudTest代码测试无异常 #### 版本迭代 -- 0.0.2-SNAPSHOT +- 0.0.1-SNAPSHOT #### 版权和许可信息 diff --git a/entry/src/main/java/com/ms/square/ohos/expandabletextview/sample/utils/MyToast.java b/entry/src/main/java/com/ms/square/ohos/expandabletextview/sample/utils/MyToast.java index b661893..1cb12e6 100644 --- a/entry/src/main/java/com/ms/square/ohos/expandabletextview/sample/utils/MyToast.java +++ b/entry/src/main/java/com/ms/square/ohos/expandabletextview/sample/utils/MyToast.java @@ -33,65 +33,19 @@ import ohos.app.Context; * description 自定义Toast */ public class MyToast { - public static final int LENGTH_LONG = 4000; public static final int LENGTH_SHORT = 2000; private static ToastDialog toastDialog; public enum ToastLayout { - DEFAULT, CENTER, TOP, BOTTOM, } - public static void showShort(Context mContext, String content) { - createTost(mContext, content, LENGTH_SHORT, ToastLayout.DEFAULT); - } - - public static void showLong(Context mContext, String content) { - createTost(mContext, content, LENGTH_LONG, ToastLayout.DEFAULT); - } - - public static void show(Context mContext, String content) { - createTost(mContext, content, LENGTH_SHORT, ToastLayout.DEFAULT); - } - - public static void show(Context mContext, String content, int duration) { - createTost(mContext, content, duration, ToastLayout.DEFAULT); - } - public static void show(Context mContext, String content, ToastLayout layout) { createTost(mContext, content, LENGTH_SHORT, layout); } - public static void show(Context mContext, String content, int duration, ToastLayout layout) { - createTost(mContext, content, duration, layout); - } - - public static void showShort(Context mContext, int content) { - createTost(mContext, getString(mContext, content), LENGTH_SHORT, ToastLayout.DEFAULT); - } - - public static void showLong(Context mContext, int content) { - createTost(mContext, getString(mContext, content), LENGTH_LONG, ToastLayout.DEFAULT); - } - - public static void show(Context mContext, int content) { - createTost(mContext, getString(mContext, content), LENGTH_SHORT, ToastLayout.DEFAULT); - } - - public static void show(Context mContext, int content, int duration) { - createTost(mContext, getString(mContext, content), duration, ToastLayout.DEFAULT); - } - - public static void show(Context mContext, int content, ToastLayout layout) { - createTost(mContext, getString(mContext, content), LENGTH_SHORT, layout); - } - - public static void show(Context mContext, int content, int duration, ToastLayout layout) { - createTost(mContext, getString(mContext, content), duration, layout); - } - private static void createTost(Context mContext, String content, int duration, ToastLayout layout) { DirectionalLayout toastLayout = new DirectionalLayout(mContext); DirectionalLayout.LayoutConfig textConfig = new DirectionalLayout.LayoutConfig(DirectionalLayout.LayoutConfig.MATCH_CONTENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT); @@ -138,15 +92,6 @@ public class MyToast { return drawable; } - private static String getString(Context mContent, int resId) { - try { - return mContent.getResourceManager().getElement(resId).getString(); - } catch (Exception e) { - e.printStackTrace(); - } - return ""; - } - private static int vp2px(Context context, float vp) { DisplayAttributes attributes = DisplayManager.getInstance().getDefaultDisplay(context).get().getAttributes(); return (int) (attributes.densityPixels * vp); -- Gitee