diff --git a/.gitignore b/.gitignore index dd9b4a657d47e0297233474fa8e219591e9da405..eeb9500641c774fb1f707fe9a7daad0b40864e4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,54 +1,17 @@ -# Built application files -*.apk -*.ap_ - -# Files for the Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ - -# Gradle files -.gradle/ -build/ -/*/build/ - - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - -# Log Files -*.log - -# Android Studio Navigation editor temp files -.navigation/ - -# Android Studio captures folder -captures/ - - -# Crashlytics configuations -com_crashlytics_export_strings.xml - - -# Signing files -.signing/ - *.iml -.idea - -# OS-specific files +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml .DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -ehthumbs.db -Thumbs.db \ No newline at end of file +/build +/captures +.externalNativeBuild +/entry/.preview +.cxx +upload.gradle +/.idea/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7812812536b3ed1461348e55a8efad8756cd11d5..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: android -jdk: oraclejdk8 - -android: - components: - - tools - - tools - - platform-tools - - build-tools-27.0.0 - - android-27 - - extra-android-m2repository - -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ - -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - - $HOME/.android/build-cache - -script: - ./gradlew build diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..9b958e2f9b9385486660c85dbb78239da5aaf8e1 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1-SNAPSHOT +ohos 第一个版本,完整实现了原库的全部 api + diff --git a/README.OPENSOURCE b/README.OPENSOURCE new file mode 100644 index 0000000000000000000000000000000000000000..dd6a6ef472d51a94d0476e4b6490af7fb7fd092e --- /dev/null +++ b/README.OPENSOURCE @@ -0,0 +1,19 @@ +[ + + { + + "Name": "ReadMoreTextView", + + "License": "Apache License", + + "License File": "LICENSE", + + "Version Number": "2.1.0", + + "Upstream URL": "https://github.com/bravoborja/ReadMoreTextView", + + "Description": "A Custom TextView with trim text" + + } + +] \ No newline at end of file diff --git a/README.md b/README.md index 6a8bb92ace321dc95bffc6876a0d7382ec825e46..4e101bb00c0eb45be4d48e96eea80913e06e1dff 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,79 @@ # ReadMoreTextView -A Custom TextView with trim text +## 项目介绍 -## Download -To add the ReadMoreTextView library to your Android Studio project, simply add the following gradle dependency: -```java -compile 'com.borjabravo:readmoretextview:2.1.0' -``` +- 项目名称: ReadMoreTextView +- 所属系列: openharmony的第三方组件适配移植 +- 功能: 带有修剪文本的自定义文本视图 +- 项目移植状态: 主功能完成 +- 调用差异: 无 +- 开发版本: sdk6,DevEco Studio 2.2 Beta1 +- 基线版本:Releases 2.1.0 -## Usage -To use the ReadMoreTextView on your app, add the following code to your layout: +## 效果演示 + -```xml - -``` -You can customize ReadMoreTextView with: +## 安装教程 +1.在项目根目录下的build.gradle文件中, + ``` +allprojects { + repositories { + maven { + url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + } + } +} + ``` -- app:trimExpandedText: Text that appears when the view is expanded. -- app:trimCollapsedText: Text that appears when the view is collapsed. -- app:trimLength: Trim length to determine when the clickable text is displayed. -- app:showTrimExpandedText: Show the trim text if it's true. -- app:colorClickableText: Text color of trim clickable text. -- app:trimMode: Choose trim mode with two options: trimModeLength or trimModeLines. +2.在entry模块的build.gradle文件中, + ``` + dependencies { + implementation('com.gitee.chinasoft_ohos:ReadMoreTextView:0.0.1-SNAPSHOT') + ...... + } +``` +在sdk6,DevEco Studio 2.2 Beta1下项目可直接运行 +如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, +并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 -## Screenshots +## 使用说明 -![screenshot](screenshots/collapsed.png) -![screenshot](screenshots/expanded.png) +1) 从XML布局文件创建: +``` + xmlns:app="http://schemas.huawei.com/hap/res-auto" + +``` +使用方法: +``` + ReadMoreTextView text1 = (ReadMoreTextView) findComponentById(ResourceTable.Id_text1); + text1.setContent(getString(ResourceTable.String_lorem_ipsum)); +``` -License -======= +## 测试信息 +CodeCheck代码测试无异常 +CloudTest代码测试无异常 + +病毒安全检测通过 + +当前版本demo功能与原组件基本无差异 + +## 版本迭代 +- 0.0.1-SNAPSHOT + +## 版权和许可信息 +``` Copyright 2016 Borja Bravo Licensed under the Apache License, Version 2.0 (the "License"); @@ -49,3 +87,4 @@ License 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. +``` \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 7c556c1c664fadb666613df998ec0fb99c436b0e..0000000000000000000000000000000000000000 --- a/app/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 27 - buildToolsVersion "27.0.0" - - defaultConfig { - applicationId "com.borjabravo.readmoretextview" - minSdkVersion 14 - targetSdkVersion 27 - versionCode 1 - versionName "1.0" - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - - lintOptions { - abortOnError false - } -} - -dependencies { - implementation 'com.android.support:appcompat-v7:27.0.0' - implementation 'com.android.support:design:27.0.0' - implementation project(':readmoretextview') - testImplementation 'junit:junit:4.12' -} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro deleted file mode 100644 index a37606829e07d04d598560933ed2839460958d4a..0000000000000000000000000000000000000000 --- a/app/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Users/borja/Documents/android/adt-bundle-mac-x86_64-20140702/sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml deleted file mode 100644 index 24232d7e4122575e5c1fff11925f382bfe07a454..0000000000000000000000000000000000000000 --- a/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - diff --git a/app/src/main/java/com/borjabravo/readmoretextviewsample/MainActivity.java b/app/src/main/java/com/borjabravo/readmoretextviewsample/MainActivity.java deleted file mode 100644 index 8f504996db772ad881075aa0e918f8689b26c724..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/borjabravo/readmoretextviewsample/MainActivity.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.borjabravo.readmoretextviewsample; - -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.widget.TextView; - -public class MainActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - TextView text1 = findViewById(R.id.text1); - text1.setText(getString(R.string.lorem_ipsum)); - TextView text2 = findViewById(R.id.text2); - text2.setText(getString(R.string.lorem_ipsum2)); - TextView text3 = findViewById(R.id.text3); - text3.setText(getString(R.string.lorem_ipsum3)); - TextView text4 = findViewById(R.id.text4); - text4.setText(getString(R.string.one_line_text)); - } -} diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index 01a64c6c95631fc61c86d2a7e11f5ed75296b5b6..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index cde69bcccec65160d92116f20ffce4fce0b5245c..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index c133a0cbd379f5af6dbf1a899a0293ca5eccfad0..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index bfa42f0e7b91d006d22352c9ff2f134e504e3c1d..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index 324e72cdd7480cb983fa1bcc7ce686e51ef87fe7..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index aee44e138434630332d88b1680f33c4b24c70ab3..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml deleted file mode 100644 index 251fb9fb74a79b9a0a7a571d09bc22ee119b0659..0000000000000000000000000000000000000000 --- a/app/src/main/res/values-v21/styles.xml +++ /dev/null @@ -1,9 +0,0 @@ -> - - - diff --git a/app/src/main/res/values-w820dp/dimens.xml b/app/src/main/res/values-w820dp/dimens.xml deleted file mode 100644 index 63fc816444614bd64f68a372d1f93211628ee51d..0000000000000000000000000000000000000000 --- a/app/src/main/res/values-w820dp/dimens.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 64dp - diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml deleted file mode 100644 index 3ab3e9cbce07f7cdc941fc8ba424c05e83ed80f0..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - #3F51B5 - #303F9F - #FF4081 - diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml deleted file mode 100644 index 812cb7be0a1565a849a29c08fa07fb9901ccb347..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - 16dp - 16dp - 16dp - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml deleted file mode 100644 index 23265b0fe9a32159aa0e6e49eb3770a55c2ccaa1..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,8 +0,0 @@ - - ReadMoreTextViewSample - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras feugiat, nunc eget volutpat viverra, lacus ligula venenatis nulla, in accumsan eros eros nec ipsum. Fusce eget massa id lorem blandit lobortis. Donec lacus ligula, commodo quis eleifend ac, rhoncus sed mi. Curabitur luctus justo vel consequat fermentum. Donec facilisis elit in sem suscipit pharetra. Curabitur porta et dolor eget pretium. Mauris quam augue, interdum nec tempor vitae, consectetur at erat. - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras feugiat, nunc eget volutpat viverra, lacus ligula venenatis nulla, in accumsan eros eros nec ipsum. Fusce eget massa id lorem blandit lobortis. Donec lacus ligula, commodo quis eleifend ac, rhoncus sed mi. - Lorem ipsum dolor sit amet, consectetur adipiscing elit.Cras feugiat, nunc eget volutpat viverra, lacus ligula venenatis nulla, in accumsan eros eros nec ipsum. Fusce eget massa id lorem blandit lobortis. - Show all content - One line text - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml deleted file mode 100644 index 545b9c6d2c45df7938f8ffd5ac2d806dec36f122..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - -