diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a5f58307b53bb54e0f94934bebeeaa7b909f3d2..62c8f7971a2d7aedb3d5e2dbe99146647f751db0 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 0a8eb138fa1e3e82d5d4e3f6ab2c97e66a9a5767..f43e8ccc7a28a59b34f444c47220577af52b0a4a 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 4a82e41443630b7369ab68256681878be2265213..838f7099a686b1367a153670e1638da8e5dc85bc 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 b661893edecc970c65941bc947919cc6eb983cbc..1cb12e60d1af5e12a4f7291c8fee0d31fd388a98 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);