diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..5952c6e97b31c0457096020ce337c731b5c97b9c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +## 0.0.1-SNAPSHOT +ohos 第一个版本,实现了原库的全部api \ No newline at end of file diff --git a/README.OPENSOURCE b/README.OPENSOURCE new file mode 100644 index 0000000000000000000000000000000000000000..3a4004d6f8a1e7a69ae25640ba5e112d3d047ffc --- /dev/null +++ b/README.OPENSOURCE @@ -0,0 +1,16 @@ +[ + + { + "Name":"loaderviewlibrary", + + "License":"Apache License 2.0", + + "License File":"LICENSE", + + "Version Number":"3.0.0", + + "Upstream URL":"https://github.com/elye/loaderviewlibrary", + + "Description":"为 TextView 和 ImageView 提供在显示任何文本或图像之前显示微光(动画加载器)的能力" + } +] \ No newline at end of file diff --git a/README.md b/README.md index b3e22fd27ffa29ce067180a6c7118015924b9714..cdc541f3026e45fdfa5698b1ab0a128cef4bcf2e 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,49 @@ -# Loader View for Android +# SineView -[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Loader%20View%20for%20Android-brightgreen.svg?style=flat)](http://android-arsenal.com/details/1/4243) +### 项目介绍 -## What It Is -Provide both TextView and ImageView the ability to show shimmer (animation loader) before any text or image is shown. Useful when waiting for data to be loaded from the network. Example below +- 项目名称:loaderviewlibrary -![Loader Image](https://static.wixstatic.com/media/d748c3_28381c0f110f4dc68fcd340b503f86a2~mv2.gif) +- 所属系列:openharmony的第三方组件适配移植 -## Features / Usage +- 功能:为 TextView 和 ImageView 提供在显示任何文本或图像之前显示微光(动画加载器)的能力 + +- 项目移植状态:主功能完成 + +- 调用差异:无 + +- 开发版本:sdk6,DevEco Studio2.2 Beta1 + +- 基线版本:Release 3.0.0 + + +### 效果演示 + + + +### 安装教程 +1.在项目根目录下的build.gradle文件中, + ``` + allprojects { + repositories { + maven { + url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + } + } + } +``` +2.在entry模块的build.gradle文件中, + ``` + dependencies { + ...... + } +``` + +在sdk6,DevEco Studio2.2 Beta1下项目可直接运行 +如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, +并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 + +### 使用说明 1. Loader View for TextView defined in layout XML ```xml @@ -66,42 +102,36 @@ Provide both TextView and ImageView the ability to show shimmer (animation loade android:layout_height="wrap_content" app:custom_color="@android:color/holo_green_dark" /> ``` - + 10. Reset and show shimmer (animation loader) again by calling the below API ```java myLoaderTextView.resetLoader(); myLoaderImageView.resetLoader(); ``` -## Requirement -Android SDK API Version 15 and above. +### 测试信息 -## Importing the Library -On your root `build.gradle`, add `mavenCentral()` to the `allprojects` section. -On your module `build.gradle`, add +CodeCheck代码测试无异常 - dependencies { - implementation 'io.github.elye:loaderviewlibrary:3.0.0' - } +CloudTest代码测试无异常 + +病毒安全检测通过 + +当前版本demo功能与原组件基本无差异 -## What's new in 3.0.0 -1. Moved from JCenter to mavenCenter -2. Fix some null crash issue +### 版本迭代 -**Note: only version 3.0.0 has been moved to mavenCenter** +- 0.0.1-SNAPSHOT -## What's new in 2.0.0 -1. Migrate to AndroidX -2. Fix issue of preventing partial overlay if view reused quickly in RecyclerView +### 版权和许可信息 -## What's new in 1.5.0 -1. Add custom color attribute +``` + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at: + http://www.apache.org/licenses/LICENSE-2.0 -## Licence + 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 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or 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. diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index a07ffff8ec11a392fe9ac5d80293ef75c7a9942c..0000000000000000000000000000000000000000 --- a/app/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 30 - buildToolsVersion '29.0.2' - - defaultConfig { - applicationId "com.elyeproj.sampleloaderview" - minSdkVersion 15 - targetSdkVersion 30 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - testImplementation 'junit:junit:4.13.2' - implementation project(':loaderviewlibrary') - implementation 'androidx.appcompat:appcompat:1.2.0' -} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro deleted file mode 100644 index 7712922297b8c6b9d0d0293dc522159b89b26704..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/elye/Library/Android/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/androidTest/java/com/elyeproj/sampleloaderview/ApplicationTest.java b/app/src/androidTest/java/com/elyeproj/sampleloaderview/ApplicationTest.java deleted file mode 100644 index 20822bbea3a9be74062e890a09b52a8fca9eafd3..0000000000000000000000000000000000000000 --- a/app/src/androidTest/java/com/elyeproj/sampleloaderview/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.elyeproj.sampleloaderview; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml deleted file mode 100644 index f41e818919f351ccb9867a559924c12ea7d5a605..0000000000000000000000000000000000000000 --- a/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/java/com/elyeproj/sampleloaderview/MainActivity.java b/app/src/main/java/com/elyeproj/sampleloaderview/MainActivity.java deleted file mode 100644 index 4dfc2f5496095dcbab64ac126c0412c3106e9961..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/elyeproj/sampleloaderview/MainActivity.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.elyeproj.sampleloaderview; - -import android.os.AsyncTask; -import android.os.Bundle; -import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; -import androidx.appcompat.app.AppCompatActivity; -import com.elyeproj.loaderviewlibrary.LoaderImageView; -import com.elyeproj.loaderviewlibrary.LoaderTextView; - -public class MainActivity extends AppCompatActivity { - - private int WAIT_DURATION = 5000; - private DummyWait dummyWait; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - loadData(); - } - - private void loadData() { - if (dummyWait != null) { - dummyWait.cancel(true); - } - dummyWait = new DummyWait(); - dummyWait.execute(); - } - - private void postLoadData() { - ((TextView)findViewById(R.id.txt_name)).setText("Mr. Donald Trump"); - ((TextView)findViewById(R.id.txt_title)).setText("President of United State (2017 - now)"); - ((TextView)findViewById(R.id.txt_phone)).setText("+001 2345 6789"); - ((TextView)findViewById(R.id.txt_email)).setText("donald.trump@donaldtrump.com"); - ((ImageView)findViewById(R.id.image_icon)).setImageResource(R.drawable.trump); - } - - public void resetLoader(View view) { - ((LoaderTextView)findViewById(R.id.txt_name)).resetLoader(); - ((LoaderTextView)findViewById(R.id.txt_title)).resetLoader(); - ((LoaderTextView)findViewById(R.id.txt_phone)).resetLoader(); - ((LoaderTextView)findViewById(R.id.txt_email)).resetLoader(); - ((LoaderImageView)findViewById(R.id.image_icon)).resetLoader(); - loadData(); - } - - class DummyWait extends AsyncTask { - @Override - protected void onPreExecute() { - super.onPreExecute(); - } - - @Override - protected Void doInBackground(Void... params) { - try { - Thread.sleep(WAIT_DURATION); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return null; - } - - @Override - protected void onPostExecute(Void result) { - super.onPostExecute(result); - postLoadData(); - } - } - - @Override - protected void onDestroy() { - super.onDestroy(); - if (dummyWait != null) { - dummyWait.cancel(true); - } - } -} diff --git a/app/src/main/res/drawable-hdpi/ic_mail_outline_grey_500_18dp.png b/app/src/main/res/drawable-hdpi/ic_mail_outline_grey_500_18dp.png deleted file mode 100644 index 661b099eba79578d93c62b46782d902d6b3040f3..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_mail_outline_grey_500_18dp.png and /dev/null differ diff --git a/app/src/main/res/drawable-hdpi/ic_phone_grey_500_18dp.png b/app/src/main/res/drawable-hdpi/ic_phone_grey_500_18dp.png deleted file mode 100644 index 8ee8d97aee60f02ef48bd31bbbb3ad696349c630..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/drawable-hdpi/ic_phone_grey_500_18dp.png and /dev/null differ 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 8300f2536111bd0f839598a972bfa6c4c22a843e..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - -