diff --git a/.gitignore b/.gitignore index 0f41f1b186481904e6048793230a0573ed536e17..c5986840b05025a898d4ea39abbc0fbf237b6270 100644 --- a/.gitignore +++ b/.gitignore @@ -1,57 +1,15 @@ -### Android ### -# Built application files -*.apk -*.ap_ - -# Files for the Dalvik VM -*.dex - -# Java class files -*.class - -# Generated files -bin/ -gen/ - -# Gradle files -.gradle/ -build/ - -# Local configuration file (sdk path, etc) -local.properties - -# Proguard folder generated by Eclipse -proguard/ - - -### Intellij ### -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm - -## Directory-based project format -.idea/ -# if you remove the above rule, at least ignore user-specific stuff: -# .idea/workspace.xml -# .idea/tasks.xml -# and these sensitive or high-churn files: -# .idea/dataSources.ids -# .idea/dataSources.xml -# .idea/sqlDataSources.xml -# .idea/dynamic.xml - -## File-based project format -*.ipr -*.iws *.iml - -## Additional for IntelliJ -out/ - -# generated by mpeltonen/sbt-idea plugin -.idea_modules/ - -# generated by JIRA plugin -atlassian-ide-plugin.xml - -# generated by Crashlytics plugin (for Android Studio and Intellij) -com_crashlytics_export_strings.xml - +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +upload.gradle diff --git a/CHANGELOG.md b/CHANGELOG.md index 94258adc35ba5f87b700119d462d2d776b0a4501..0114b71d0a8537d1fc82d6a53e4853bd2f62ba4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,58 +1,13 @@ -## 1.0.4 -* Fixed issue #37 Broken normal text behaviour - -## 1.0.3 -* Added focused and selected states - -## 1.0.2 -* Added library description file for About AboutLibraries - -## 1.0.1 -* Fixed issue: buggy behavior when an endless button gets re-sized #14 - -## 1.0.0 -* Fixed issue: Button padding are ignored #11 -* Added prefix 'pb_' for all custom attributes to avoid conflict #12 - -## 0.0.7 -* Added api 10 compatibility -* Fixed bug in ProgressGenerator class - -## 0.0.6 -Bug fixes - -## 0.0.5 -* Fixed repository name type from `android-process-buton` to `android-process-button` - -## 0.0.4 -**Attributes** - -Renamed attributes: - - * `progressText` -> `textProgress` - * `completeText` -> `textComplete` - -Added attribute to control button corner roundness: - -* `cornerRadius` - - -**ProcessButton** - -Now button state depends on progress: - -* normal state [0] -* progress state [1-99] -* success state [100] -* error state [-1] *new - -Added abstract `drawProgress` method to simplify creation different progress buttons. - -General code clean-up. - -Thanks to **@avrahamshuk** for contribution. - -## 0.0.3 - -* Fixed bug when all buttons where sharing the same drawable state -* Uploaded proejct to Maven Central +## 0.0.3-SNAPSHOT +* modification: Update copyright + +## 0.0.2-SNAPSHOT +* optimization: Optimize code + +## 0.0.1-SNAPSHOT +ohos 第一个版本 + * 实现了原库的大部分 api + * 因为 "TextField组件特性" 原因,"首次进入账户名文本框边框线为选中状态、高亮蓝色,密码框边框线为灰色" 功能未能实现 + * 因为 "系统组件特性" 原因,"打开process-button组件,然后任选其中一个进度条进入,长按进度按钮不松开,然后在按钮范围之内移动,然后松开" 功能未能实现 + * 因为 "TextField组件特性" 原因,"文本框上移动光标,内容会跟着光标的移动放大文本" 功能未能实现 + * 因为 "TextField组件特性" 原因,"光标展示几秒后会消失、在输入内容时光标会消失" 功能未能实现 \ No newline at end of file diff --git a/README.OPENSOURCE b/README.OPENSOURCE new file mode 100644 index 0000000000000000000000000000000000000000..ed8e562f99b4f9b62f745b5c03cee825cc11fa45 --- /dev/null +++ b/README.OPENSOURCE @@ -0,0 +1,19 @@ +[ + + { + + "Name": "android-process-button", + + "License": "The MIT License (MIT)", + + "License File": "LICENSE", + + "Version Number": "v0.0.7", + + "Upstream URL": "https://github.com/dmytrodanylyk/android-process-button", + + "Description": "带加载进度和Loading状态的Button组件库" + + } + +] \ No newline at end of file diff --git a/README.md b/README.md index 91ec00bd59ec21a9e7afa48cd36786407ec13a32..b17993e39810c698f8019656b298b794ec78f025 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,213 @@ -### Description [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.dmytrodanylyk.android-process-button/library/badge.png?style=flat)](http://goo.gl/GydnKe) [![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Android%20Process%20Button-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/367) +# ohos-process-button + + +#### 项目介绍 +- 项目名称:ohos-process-button +- 所属系列:openharmony的第三方组件适配移植 +- 功能:显示Button各种加载状态 +- 项目移植状态:100% +- 调用差异:无 +- 开发版本:sdk5,DevEco Studio2.1 beta4 +- 基线版本:Release v0.0.7 + +#### 效果演示 + + +#### 安装教程 + +1.在项目根目录下的build.gradle文件中, + ```gradle +allprojects { + repositories { + maven { + url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + } + } +} + ``` + +2.在entry模块的build.gradle文件中, + ```gradle + dependencies { + implementation('com.gitee.chinasoft_ohos:ohos-process-button:0.0.1-SNAPSHOT') + ...... + } +``` -Android Buttons With Built-in Progress Meters. +在sdk5,DevEco Studio2.1 beta4下项目可直接运行 +如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, +并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 -![](screenshots/sample1_small1.gif) -![](screenshots/sample1_small2.gif) +#### 使用说明 -### Wiki +1.使用相关的类: +- ProcessButton - 可拓展的基础类,实现drawProgress抽象方法可实现自己想要的Button效果 +- ActionProcessButton - 用来显示正在loading状态的Button +- GenerateProcessButton - 用来显示当前进度的Button(水平方向) +- SubmitProcessButton - 用来表示当前进度的Button(垂直方向) -- [Home] -- [Screenshots] -- [User Guide] -### Integration +2.使用实例 +初始sample的构建 +``` + public class StateSampleSlice extends Ability implements Component.ClickedListener { + private ActionProcessButton actionProcessButton; + private GenerateProcessButton generateProcessButton; + private SubmitProcessButton submitProcessButton; + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_state_sample_silice); + actionProcessButton = (ActionProcessButton) findComponentById(ResourceTable.Id_state_sample_action); + actionProcessButton.setMode(ActionProcessButton.Mode.ENDLESS); + generateProcessButton = (GenerateProcessButton) findComponentById(ResourceTable.Id_state_sample_generate); + submitProcessButton = (SubmitProcessButton) findComponentById(ResourceTable.Id_state_sample_submit); + + findComponentById(ResourceTable.Id_error_button).setClickedListener(this); + findComponentById(ResourceTable.Id_noramal_button).setClickedListener(this); + findComponentById(ResourceTable.Id_half_button).setClickedListener(this); + findComponentById(ResourceTable.Id_success_button).setClickedListener(this); + } + + @Override + public void onClick(Component component) { + switch (component.getId()) { + case ResourceTable.Id_error_button: + actionProcessButton.setProgress(-1); + generateProcessButton.setProgress(-1); + submitProcessButton.setProgress(-1); + break; + case ResourceTable.Id_noramal_button: + actionProcessButton.setProgress(0); + generateProcessButton.setProgress(0); + submitProcessButton.setProgress(0); + break; + case ResourceTable.Id_half_button: + actionProcessButton.setProgress(50); + generateProcessButton.setProgress(50); + submitProcessButton.setProgress(50); + break; + case ResourceTable.Id_success_button: + actionProcessButton.setProgress(100); + generateProcessButton.setProgress(100); + submitProcessButton.setProgress(100); + break; + } + } + + @Override + protected void onBackground() { + super.onBackground(); + actionProcessButton.setProgress(0); + generateProcessButton.setProgress(0); + submitProcessButton.setProgress(0); + } + + } +``` -The lib is available on Maven Central, you can find it with [Gradle, please] +3:相关属性的使用示例 +``` + + + + + + ``` -dependencies { - compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4' -} + +4:通用的ProcessButton相关方法的使用说明 ``` +void setProgress(int progress); 设置按钮进度 +int getProgress(); 获取按钮进度 + +void setMaxProgress(int mMaxProgress); 设置最大按钮进度 +int getMaxProgress(); 获取最大按钮进度 -### Sample +void setMinProgress(int mMinProgress); 设置最小按钮进度 +int getMinProgress(); 获取最小按钮进度 - - Android app on Google Play - - - DevAppsDirect - +void setNormalText(CharSequence normalText); 设置正常状态下的Button文本 +String getNormalText(); 获取正常状态下的Button文本 -### License +void setLoadingText(CharSequence loadingText); 设置loading状态下的Button文本 +String getLoadingText(); 获取loading状态下的Button文本 + +void setCompleteText(CharSequence completeText); 设置完成后的Button文本 +String getCompleteText(); 获取完成后的Button文本 + +void setErrorText(CharSequence errorText); 设置错误状态的Button文本 +String getErrorText(); 获取错误状态的Button文本 + +void setProgressDrawable(ShapeElement progressDrawable); 设置加载中的Button样式 +ShapeElement getCompleteDrawable(); 获取加载中的Button样式 + +void setCompleteDrawable(ShapeElement completeDrawable); 设置完成后的Button样式 +ShapeElement getCompleteDrawable(); 获取完成后的Button样式 + +void setErrorDrawable(ShapeElement errorDrawable); 设置错误状态的Button样式 +ShapeElement getErrorDrawable(); 获取错误状态的Button样式 + +``` +5:ActionProcessButton使用示例 +``` +ActionProcessButton actionProcessButton = (ActionProcessButton) findComponentById(ResourceTable.Id_btnSignIn); +actionProcessButton.setMode(ActionProcessButton.Mode.ENDLESS);设置ActionProcessButton的loading样式为左右闪动 +actionProcessButton.setMode(ActionProcessButton.Mode.PROGRESS);设置ActionProcessButton的loading样式为Progress进度样式 +actionProcessButton.setColorScheme(int color1, int color2, int color3, int color4);设置ActionProcessButton的闪动样式颜色 + +``` + +#### 测试信息 +CodeCheck代码测试无异常 + +CloudTest代码测试无异常 + +火绒安全病毒安全检测通过 + +当前版本demo功能与原组件基本无差异 + + +#### 版本迭代 + +- 0.0.1-SNAPSHOT + +#### 版权和许可信息 ``` The MIT License (MIT) @@ -56,12 +230,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -``` - -[SmoothProgressBar]:https://github.com/castorflex/SmoothProgressBar -[Home]:https://github.com/dmytrodanylyk/android-process-buton/wiki -[Screenshots]:https://github.com/dmytrodanylyk/android-process-buton/wiki/Screenshots -[User Guide]:https://github.com/dmytrodanylyk/android-process-buton/wiki/User-Guide -[Gradle, Please]:http://gradleplease.appspot.com/ - -[![Analytics](https://ga-beacon.appspot.com/UA-44382495-2/android-process-buton/readme)](https://github.com/igrigorik/ga-beacon) +``` \ No newline at end of file diff --git a/build.gradle b/build.gradle index 25c1465a012f6fb7dc8453adda192fba2eecce2f..3e285905077f8453524f7aaf109135ce504899e5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,26 +1,43 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 5 + } +} buildscript { repositories { + maven { + url 'https://mirrors.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + maven { + url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + } jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.2.2' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath 'com.huawei.ohos:hap:2.4.2.7' + classpath 'com.huawei.ohos:decctest:1.0.0.6' } } -def isReleaseBuild() { - return version.contains("SNAPSHOT") == false -} - allprojects { - version = VERSION_NAME - group = GROUP - repositories { + maven { + url 'https://mirrors.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } + maven { + url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + } jcenter() } -} \ No newline at end of file +} diff --git a/sample/.gitignore b/entry/.gitignore similarity index 100% rename from sample/.gitignore rename to entry/.gitignore diff --git a/entry/build.gradle b/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..e314b9198c4c3232b1011c5ffec482afce0111b2 --- /dev/null +++ b/entry/build.gradle @@ -0,0 +1,15 @@ +apply plugin: 'com.huawei.ohos.hap' + +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 5 + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testCompile'junit:junit:4.12' + compile project(path: ':library') +} diff --git a/entry/src/main/config.json b/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..39bbcbe4ed254a8e9396fa1ba24bbe0ea5151f44 --- /dev/null +++ b/entry/src/main/config.json @@ -0,0 +1,100 @@ +{ + "app": { + "bundleName": "com.dd.sample", + "vendor": "dd", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.dd.sample", + "name": ".MyApplication", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "name": "com.dd.sample.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "ohos_process_button", + "type": "page", + "launchType": "standard" + }, + { + "skills": [ + { + "actions": [ + "action.process_button.state_sample" + ] + } + ], + "orientation": "unspecified", + "name": "com.dd.sample.StateSampleAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "ohos_process_button", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "name": "com.dd.sample.SignInAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "ohos_process_button", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "name": "com.dd.sample.slice.GenerateButtonSlice", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "ohos_process_button", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "name": "com.dd.sample.slice.StateSampleSlice", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "ohos_process_button", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "name": "com.dd.sample.slice.SubmitAbilitySlice", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "ohos_process_button", + "type": "page", + "launchType": "standard" + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/java/com/dd/sample/MainAbility.java b/entry/src/main/java/com/dd/sample/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..71f64247bffd3b4758c968bb86703ea6224049b3 --- /dev/null +++ b/entry/src/main/java/com/dd/sample/MainAbility.java @@ -0,0 +1,92 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +package com.dd.sample; + +import com.dd.sample.slice.GenerateButtonSlice; +import com.dd.sample.slice.StateSampleSlice; +import com.dd.sample.slice.SubmitAbilitySlice; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.aafwk.content.Operation; + +/** + * 主测试页面 + * + * @since 2021-03-01 + */ +public class MainAbility extends Ability { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_ability_main); + + findComponentById(ResourceTable.Id_button_progress).setClickedListener(component -> { + Intent intent2 = new Intent(); + Operation operation = getOperation(SignInAbility.class.getName()); + + intent2.setParam(SignInAbility.EXTRAS_ENDLESS_MODE, false); + intent2.setOperation(operation); + startAbility(intent2); + }); + findComponentById(ResourceTable.Id_endless_progress).setClickedListener(component -> { + Intent intent2 = new Intent(); + Operation operation = getOperation(SignInAbility.class.getName()); + + intent2.setParam(SignInAbility.EXTRAS_ENDLESS_MODE, true); + intent2.setOperation(operation); + startAbility(intent2); + }); + findComponentById(ResourceTable.Id_submit_btn).setClickedListener(component -> { + Intent intent2 = new Intent(); + Operation operation = getOperation(SubmitAbilitySlice.class.getName()); + + intent2.setParam(SignInAbility.EXTRAS_ENDLESS_MODE, true); + intent2.setOperation(operation); + startAbility(intent2); + }); + findComponentById(ResourceTable.Id_generate_btn).setClickedListener(component -> { + Intent intent2 = new Intent(); + Operation operation = getOperation(GenerateButtonSlice.class.getName()); + intent2.setOperation(operation); + startAbility(intent2); + }); + findComponentById(ResourceTable.Id_state_sample).setClickedListener(component -> { + Intent intent2 = new Intent(); + Operation operation = getOperation(StateSampleSlice.class.getName()); + intent2.setOperation(operation); + startAbility(intent2); + }); + } + + private Operation getOperation(String abilityName) { + return new Intent.OperationBuilder() + .withDeviceId("") + .withBundleName(getBundleName()) + .withAbilityName(abilityName) + .build(); + } + + @Override + public void onActive() { + super.onActive(); + } + + @Override + public void onForeground(Intent intent) { + super.onForeground(intent); + } +} diff --git a/entry/src/main/java/com/dd/sample/MyApplication.java b/entry/src/main/java/com/dd/sample/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..882250c1877abfef8561d349ee22bc8da1a428a6 --- /dev/null +++ b/entry/src/main/java/com/dd/sample/MyApplication.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +package com.dd.sample; + +import ohos.aafwk.ability.AbilityPackage; + +/** + * Application + * @since 2021-03-01 + */ +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/entry/src/main/java/com/dd/sample/SignInAbility.java b/entry/src/main/java/com/dd/sample/SignInAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..51c4a89d46d0c64e2f58c157dd6077cdb4a9bef1 --- /dev/null +++ b/entry/src/main/java/com/dd/sample/SignInAbility.java @@ -0,0 +1,74 @@ +package com.dd.sample; + +import com.dd.processbutton.iml.ActionProcessButton; +import com.dd.sample.utils.ProgressGenerator; +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Component; +import ohos.agp.components.TextField; + +public class SignInAbility extends Ability { + static final String EXTRAS_ENDLESS_MODE = "EXTRAS_ENDLESS_MODE"; + + private ActionProcessButton actionProcessButton; + private TextField num; + private TextField pass; + private ProgressGenerator progressGenerator; + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + setUIContent(ResourceTable.Layout_button_progress_slice); + actionProcessButton = (ActionProcessButton) findComponentById(ResourceTable.Id_btnSignIn); + num = (TextField) findComponentById(ResourceTable.Id_user_num); + pass = (TextField) findComponentById(ResourceTable.Id_user_password); + + if (progressGenerator == null) { + progressGenerator = new ProgressGenerator(new ProgressGenerator.OnCompleteListener() { + @Override + public void onComplete() { + Toast.showLong(getContext(), "Loading Complete, button is disabled"); + actionProcessButton.setEnabled(false); + } + }); + } + + boolean booleanParam = intent.getBooleanParam(EXTRAS_ENDLESS_MODE, false); + if (booleanParam) { + actionProcessButton.setMode(ActionProcessButton.Mode.ENDLESS); + } else { + actionProcessButton.setMode(ActionProcessButton.Mode.PROGRESS); + } + actionProcessButton.setClickedListener(new Component.ClickedListener() { + @Override + public void onClick(Component component) { + num.setEnabled(false); + pass.setEnabled(false); + num.clearFocus(); + pass.clearFocus(); + progressGenerator.start(actionProcessButton); + actionProcessButton.setEnabled(false); + } + }); + + } + + @Override + protected void onBackground() { + super.onBackground(); + } + + + @Override + protected void onStop() { + super.onStop(); + progressGenerator.stop(); + actionProcessButton.setProgress(0); + actionProcessButton.setEnabled(true); + num.setText("jondoe"); + pass.setText("123456789"); + num.setEnabled(true); + pass.setEnabled(true); + } + +} diff --git a/sample/src/main/java/com/dd/sample/StateSampleActivity.java b/entry/src/main/java/com/dd/sample/StateSampleAbility.java similarity index 35% rename from sample/src/main/java/com/dd/sample/StateSampleActivity.java rename to entry/src/main/java/com/dd/sample/StateSampleAbility.java index 96909eed4bb0c5ca6366547395ef773e69e87b68..7fb2ae93249803bd66364bd706726ad882c562ca 100644 --- a/sample/src/main/java/com/dd/sample/StateSampleActivity.java +++ b/entry/src/main/java/com/dd/sample/StateSampleAbility.java @@ -1,55 +1,47 @@ package com.dd.sample; -import com.dd.processbutton.iml.ActionProcessButton; import com.dd.processbutton.iml.GenerateProcessButton; import com.dd.processbutton.iml.SubmitProcessButton; -import android.app.Activity; -import android.os.Bundle; -import android.view.View; +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Component; -public class StateSampleActivity extends Activity implements View.OnClickListener { +public class StateSampleAbility extends Ability implements Component.ClickedListener { - private ActionProcessButton mBtnAction; private GenerateProcessButton mBtnGenerate; private SubmitProcessButton mBtnSubmit; @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.ac_states); - - mBtnAction = (ActionProcessButton) findViewById(R.id.btnAction); - mBtnSubmit = (SubmitProcessButton) findViewById(R.id.btnSubmit); - mBtnGenerate = (GenerateProcessButton) findViewById(R.id.btnGenerate); - - findViewById(R.id.btnProgressLoading).setOnClickListener(this); - findViewById(R.id.btnProgressError).setOnClickListener(this); - findViewById(R.id.btnProgressComplete).setOnClickListener(this); - findViewById(R.id.btnProgressNormal).setOnClickListener(this); + protected void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_ac_states); + mBtnSubmit = (SubmitProcessButton) findComponentById(ResourceTable.Id_btnSubmit); + mBtnGenerate = (GenerateProcessButton) findComponentById(ResourceTable.Id_btnGenerate); + + findComponentById(ResourceTable.Id_btnProgressLoading).setClickedListener(this); + findComponentById(ResourceTable.Id_btnProgressError).setClickedListener(this); + findComponentById(ResourceTable.Id_btnProgressComplete).setClickedListener(this); + findComponentById(ResourceTable.Id_btnProgressNormal).setClickedListener(this); } @Override - public void onClick(View v) { - switch (v.getId()) { - case R.id.btnProgressLoading: - mBtnAction.setProgress(50); + public void onClick(Component component) { + switch (component.getId()) { + case ResourceTable.Id_btnProgressLoading: mBtnSubmit.setProgress(50); mBtnGenerate.setProgress(50); break; - case R.id.btnProgressError: - mBtnAction.setProgress(-1); + case ResourceTable.Id_btnProgressError: mBtnSubmit.setProgress(-1); mBtnGenerate.setProgress(-1); break; - case R.id.btnProgressComplete: - mBtnAction.setProgress(100); + case ResourceTable.Id_btnProgressComplete: mBtnSubmit.setProgress(100); mBtnGenerate.setProgress(100); break; - case R.id.btnProgressNormal: - mBtnAction.setProgress(0); + case ResourceTable.Id_btnProgressNormal: mBtnSubmit.setProgress(0); mBtnGenerate.setProgress(0); break; diff --git a/entry/src/main/java/com/dd/sample/StateTextFiled.java b/entry/src/main/java/com/dd/sample/StateTextFiled.java new file mode 100644 index 0000000000000000000000000000000000000000..0d7ed11eabc90955182955017888b7129d266a8f --- /dev/null +++ b/entry/src/main/java/com/dd/sample/StateTextFiled.java @@ -0,0 +1,66 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +package com.dd.sample; + +import ohos.agp.colors.RgbColor; +import ohos.agp.components.AttrSet; +import ohos.agp.components.TextField; +import ohos.agp.components.element.ShapeElement; +import ohos.agp.utils.Color; +import ohos.app.Context; + +/** + * 自定义状态的TextField + * + * @since 2021-03-01 + */ +public class StateTextFiled extends TextField { + private final ShapeElement normalElement = new ShapeElement(); + private final ShapeElement disableElement = new ShapeElement(); + + public StateTextFiled(Context context) { + super(context); + init(); + } + + public StateTextFiled(Context context, AttrSet attrSet) { + super(context, attrSet); + init(); + } + + public StateTextFiled(Context context, AttrSet attrSet, String styleName) { + super(context, attrSet, styleName); + init(); + } + + private void init() { + normalElement.setRgbColor(RgbColor.fromArgbInt(Color.BLACK.getValue())); + disableElement.setRgbColor(RgbColor.fromArgbInt(Color.getIntColor("#eeeeee"))); + this.setMultipleLine(false); + } + + @Override + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + if (enabled) { + setBasement(normalElement); + setTextColor(new Color(Color.getIntColor("#000000"))); + } else { + setBasement(disableElement); + setTextColor(new Color(Color.getIntColor("#6C6C6C"))); + } + } +} diff --git a/entry/src/main/java/com/dd/sample/Toast.java b/entry/src/main/java/com/dd/sample/Toast.java new file mode 100644 index 0000000000000000000000000000000000000000..245c951126e694ef32af38997f4e34a578979579 --- /dev/null +++ b/entry/src/main/java/com/dd/sample/Toast.java @@ -0,0 +1,255 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +package com.dd.sample; + +import ohos.agp.colors.RgbColor; +import ohos.agp.components.DirectionalLayout; +import ohos.agp.components.Text; +import ohos.agp.components.element.ShapeElement; +import ohos.agp.utils.Color; +import ohos.agp.utils.LayoutAlignment; +import ohos.agp.utils.TextAlignment; +import ohos.agp.window.dialog.ToastDialog; +import ohos.agp.window.service.DisplayAttributes; +import ohos.agp.window.service.DisplayManager; +import ohos.app.Context; +import ohos.global.resource.NotExistException; +import ohos.global.resource.WrongTypeException; + +import java.io.IOException; + +/** + * Toast + * + * @since 2021-03-01 + */ +public class Toast { + private static final int LENGTH_LONG = 4000; + private static final int LENGTH_SHORT = 2000; + + /** + * Toast显示的位置枚举类型 + * + * @since 2021-03-01 + */ + public enum ToastLayout { + /** + * 系统默认 + */ + DEFAULT, + /** + * 中间 + */ + CENTER, + /** + * 顶部 + */ + TOP, + /** + * 底部 + */ + BOTTOM, + } + + private Toast() { + } + + /** + * 显示短时间的Toast + * + * @param context 上下文 + * @param content 内容 + */ + public static void showShort(Context context, String content) { + createTost(context, content, LENGTH_SHORT, ToastLayout.DEFAULT); + } + + /** + * 显示长时间的Toast + * + * @param context 上下文 + * @param content 内容 + */ + public static void showLong(Context context, String content) { + createTost(context, content, LENGTH_LONG, ToastLayout.DEFAULT); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + */ + public static void show(Context context, String content) { + createTost(context, content, LENGTH_SHORT, ToastLayout.DEFAULT); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + * @param duration 时间 ms + */ + public static void show(Context context, String content, int duration) { + createTost(context, content, duration, ToastLayout.DEFAULT); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + * @param layout 位置 + */ + public static void show(Context context, String content, ToastLayout layout) { + createTost(context, content, LENGTH_SHORT, layout); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + * @param duration 时间 + * @param layout 位置 + */ + public static void show(Context context, String content, int duration, ToastLayout layout) { + createTost(context, content, duration, layout); + } + + /** + * 显示短时Toast + * + * @param context 上下文 + * @param content 内容 + */ + public static void showShort(Context context, int content) { + createTost(context, getString(context, content), LENGTH_SHORT, ToastLayout.DEFAULT); + } + + /** + * 显示长时Toast + * + * @param context 上下文 + * @param content 内容 + */ + public static void showLong(Context context, int content) { + createTost(context, getString(context, content), LENGTH_LONG, ToastLayout.DEFAULT); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + */ + public static void show(Context context, int content) { + createTost(context, getString(context, content), LENGTH_SHORT, ToastLayout.DEFAULT); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + * @param duration 时间 ms + */ + public static void show(Context context, int content, int duration) { + createTost(context, getString(context, content), duration, ToastLayout.DEFAULT); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + * @param layout 位置 + */ + public static void show(Context context, int content, ToastLayout layout) { + createTost(context, getString(context, content), LENGTH_SHORT, layout); + } + + /** + * 显示Toast + * + * @param context 上下文 + * @param content 内容 + * @param duration 时间 ms + * @param layout 位置 + */ + public static void show(Context context, int content, int duration, ToastLayout layout) { + createTost(context, getString(context, content), duration, layout); + } + + private static void createTost(Context context, String content, int duration, ToastLayout layout) { + DirectionalLayout toastLayout = new DirectionalLayout(context); + DirectionalLayout.LayoutConfig textConfig = new DirectionalLayout.LayoutConfig( + DirectionalLayout.LayoutConfig.MATCH_CONTENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT); + Text text = new Text(context); + text.setText(content); + text.setTextColor(new Color(Color.getIntColor("#000000"))); + text.setPadding(vp2px(context, 16), vp2px(context, 12), vp2px(context, 16), vp2px(context, 12)); + text.setTextSize(vp2px(context, 12)); + text.setBackground(buildDrawableByColorRadius(Color.getIntColor("#eeeeee"), vp2px(context, 20))); + text.setLayoutConfig(textConfig); + text.setTextAlignment(TextAlignment.CENTER); + toastLayout.addComponent(text); + int mLayout = LayoutAlignment.BOTTOM; + switch (layout) { + case TOP: + mLayout = LayoutAlignment.TOP; + break; + case BOTTOM: + mLayout = LayoutAlignment.BOTTOM; + break; + case CENTER: + mLayout = LayoutAlignment.CENTER; + break; + default: + break; + } + ToastDialog toastDialog = new ToastDialog(context); + toastDialog.setComponent(toastLayout); + toastDialog.setSize(DirectionalLayout.LayoutConfig.MATCH_CONTENT, DirectionalLayout.LayoutConfig.MATCH_CONTENT); + toastDialog.setAlignment(mLayout); + toastDialog.setTransparent(true); + toastDialog.setDuration(duration); + toastDialog.show(); + } + + private static ohos.agp.components.element.Element buildDrawableByColorRadius(int color, float radius) { + ShapeElement drawable = new ShapeElement(); + drawable.setShape(0); + drawable.setRgbColor(RgbColor.fromArgbInt(color)); + drawable.setCornerRadius(radius); + return drawable; + } + + private static String getString(Context context, int resId) { + try { + return context.getResourceManager().getElement(resId).getString(); + } catch (NotExistException | WrongTypeException | IOException e) { + e.getMessage(); + } + return ""; + } + + private static int vp2px(Context context, float vp) { + DisplayAttributes attributes = DisplayManager.getInstance().getDefaultDisplay(context).get().getAttributes(); + return (int) (attributes.densityPixels * vp); + } +} diff --git a/entry/src/main/java/com/dd/sample/slice/GenerateButtonSlice.java b/entry/src/main/java/com/dd/sample/slice/GenerateButtonSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..33708c89d7eabaf19d3f47f9c8ff471a982cf6ed --- /dev/null +++ b/entry/src/main/java/com/dd/sample/slice/GenerateButtonSlice.java @@ -0,0 +1,73 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +package com.dd.sample.slice; + +import com.dd.processbutton.iml.GenerateProcessButton; +import com.dd.sample.ResourceTable; +import com.dd.sample.Toast; +import com.dd.sample.utils.ProgressGenerator; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Component; + +/** + * 测试GenerateProcessButton + * + * @since 2021-03-01 + */ +public class GenerateButtonSlice extends Ability { + private GenerateProcessButton generateProcessButton; + private ProgressGenerator progressGenerator; + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + setUIContent(ResourceTable.Layout_generate_button_slice); + generateProcessButton = (GenerateProcessButton) findComponentById(ResourceTable.Id_generate_process_btn); + progressGenerator = new ProgressGenerator(new ProgressGenerator.OnCompleteListener() { + @Override + public void onComplete() { + Toast.showLong(getContext(),"Loading Complete, button is disabled"); + } + }); + generateProcessButton.setClickedListener(new Component.ClickedListener() { + @Override + public void onClick(Component component) { + progressGenerator.start(generateProcessButton); + generateProcessButton.setEnabled(false); + } + }); + } + + @Override + protected void onActive() { + super.onActive(); + } + + @Override + protected void onForeground(Intent intent) { + super.onForeground(intent); + } + + @Override + protected void onStop() { + super.onStop(); + generateProcessButton.setProgress(0); + generateProcessButton.setEnabled(true); + progressGenerator.stop(); + } +} diff --git a/entry/src/main/java/com/dd/sample/slice/StateSampleSlice.java b/entry/src/main/java/com/dd/sample/slice/StateSampleSlice.java new file mode 100644 index 0000000000000000000000000000000000000000..4d29f00603f2b6ce5570d886faf7052321f7f4f2 --- /dev/null +++ b/entry/src/main/java/com/dd/sample/slice/StateSampleSlice.java @@ -0,0 +1,86 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +package com.dd.sample.slice; + +import com.dd.processbutton.iml.ActionProcessButton; +import com.dd.processbutton.iml.GenerateProcessButton; +import com.dd.processbutton.iml.SubmitProcessButton; +import com.dd.sample.ResourceTable; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.agp.components.Component; + +/** + * 各种Button测试集合 + * @since 2021-03-01 + */ +public class StateSampleSlice extends Ability implements Component.ClickedListener { + private ActionProcessButton actionProcessButton; + private GenerateProcessButton generateProcessButton; + private SubmitProcessButton submitProcessButton; + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + super.setUIContent(ResourceTable.Layout_state_sample_silice); + actionProcessButton = (ActionProcessButton) findComponentById(ResourceTable.Id_state_sample_action); + actionProcessButton.setMode(ActionProcessButton.Mode.ENDLESS); + generateProcessButton = (GenerateProcessButton) findComponentById(ResourceTable.Id_state_sample_generate); + submitProcessButton = (SubmitProcessButton) findComponentById(ResourceTable.Id_state_sample_submit); + + findComponentById(ResourceTable.Id_error_button).setClickedListener(this); + findComponentById(ResourceTable.Id_noramal_button).setClickedListener(this); + findComponentById(ResourceTable.Id_half_button).setClickedListener(this); + findComponentById(ResourceTable.Id_success_button).setClickedListener(this); + } + + @Override + public void onClick(Component component) { + switch (component.getId()) { + case ResourceTable.Id_error_button: + actionProcessButton.setProgress(-1); + generateProcessButton.setProgress(-1); + submitProcessButton.setProgress(-1); + break; + case ResourceTable.Id_noramal_button: + actionProcessButton.setProgress(0); + generateProcessButton.setProgress(0); + submitProcessButton.setProgress(0); + break; + case ResourceTable.Id_half_button: + actionProcessButton.setProgress(50); + generateProcessButton.setProgress(50); + submitProcessButton.setProgress(50); + break; + case ResourceTable.Id_success_button: + actionProcessButton.setProgress(100); + generateProcessButton.setProgress(100); + submitProcessButton.setProgress(100); + break; + default: + break; + } + } + + @Override + protected void onBackground() { + super.onBackground(); + actionProcessButton.setProgress(0); + generateProcessButton.setProgress(0); + submitProcessButton.setProgress(0); + } +} diff --git a/entry/src/main/java/com/dd/sample/slice/SubmitAbilitySlice.java b/entry/src/main/java/com/dd/sample/slice/SubmitAbilitySlice.java new file mode 100644 index 0000000000000000000000000000000000000000..e04284ea0dc58b963de4aa0ad4276fed679ff339 --- /dev/null +++ b/entry/src/main/java/com/dd/sample/slice/SubmitAbilitySlice.java @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2021 Huawei Device Co., Ltd. + * 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. + */ + +package com.dd.sample.slice; + +import com.dd.processbutton.iml.SubmitProcessButton; +import com.dd.sample.ResourceTable; +import com.dd.sample.Toast; +import com.dd.sample.utils.ProgressGenerator; + +import ohos.aafwk.ability.Ability; +import ohos.aafwk.content.Intent; +import ohos.agp.components.TextField; + +/** + * 测试SubmitProcessButton + * @since 2021-03-01 + */ +public class SubmitAbilitySlice extends Ability { + private SubmitProcessButton submitProcessButton; + private TextField input; + private ProgressGenerator progressGenerator; + + @Override + protected void onStart(Intent intent) { + super.onStart(intent); + setUIContent(ResourceTable.Layout_submint_ablity_slice); + progressGenerator = new ProgressGenerator(() -> + Toast.showLong(getContext(),"Loading Complete, button is disabled")); + + input = (TextField)findComponentById(ResourceTable.Id_input); + submitProcessButton = (SubmitProcessButton) findComponentById(ResourceTable.Id_sub_btn_sample); + submitProcessButton.setClickedListener(component -> { + progressGenerator.start(submitProcessButton); + submitProcessButton.setEnabled(false); + input.setEnabled(false); + input.clearFocus(); + }); + } + + @Override + protected void onBackground() { + super.onBackground(); + } + + @Override + protected void onStop() { + super.onStop(); + submitProcessButton.setText("SEND"); + submitProcessButton.setProgress(0); + submitProcessButton.setEnabled(true); + input.setText("How are you?"); + input.setEnabled(true); + progressGenerator.stop(); + } +} diff --git a/sample/src/main/java/com/dd/sample/utils/ProgressGenerator.java b/entry/src/main/java/com/dd/sample/utils/ProgressGenerator.java similarity index 44% rename from sample/src/main/java/com/dd/sample/utils/ProgressGenerator.java rename to entry/src/main/java/com/dd/sample/utils/ProgressGenerator.java index d48db5488042bdc28541eb4e41c69faf8bba79e3..52c813c1bbc1d33f31c9a13ee3663cf8b38ae6f7 100644 --- a/sample/src/main/java/com/dd/sample/utils/ProgressGenerator.java +++ b/entry/src/main/java/com/dd/sample/utils/ProgressGenerator.java @@ -2,41 +2,65 @@ package com.dd.sample.utils; import com.dd.processbutton.ProcessButton; -import android.os.Handler; +import ohos.eventhandler.EventHandler; +import ohos.eventhandler.EventRunner; import java.util.Random; public class ProgressGenerator { + private final EventHandler eventHandler = new EventHandler(EventRunner.getMainEventRunner()); - public interface OnCompleteListener { + private Runnable runnable; - public void onComplete(); + public interface OnCompleteListener { + void onComplete(); } - private OnCompleteListener mListener; + private final OnCompleteListener mListener; private int mProgress; + public OnCompleteListener getmListener() { + return mListener; + } + + public int getmProgress() { + return mProgress; + } + + public Random getRandom() { + return random; + } + public ProgressGenerator(OnCompleteListener listener) { mListener = listener; } + public void setmProgress(int mProgress) { + this.mProgress = mProgress; + } + public void start(final ProcessButton button) { - final Handler handler = new Handler(); - handler.postDelayed(new Runnable() { + runnable = new Runnable() { @Override public void run() { mProgress += 10; button.setProgress(mProgress); if (mProgress < 100) { - handler.postDelayed(this, generateDelay()); + eventHandler.postTask(this, generateDelay()); } else { + mProgress = 0; mListener.onComplete(); } } - }, generateDelay()); + }; + eventHandler.postTask(runnable, generateDelay()); + } + + public void stop() { + eventHandler.removeTask(runnable); } - private Random random = new Random(); + private final Random random = new Random(); private int generateDelay() { return random.nextInt(1000); diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..65bb2ac50141afc0701d32db7fd897be9aa983e9 --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,64 @@ +{ + "string": [ + { + "name": "app_name", + "value": "ohos_process_button" + }, + { + "name": "mainability_description", + "value": "Java_Phone_Empty Feature Ability" + }, + { + "name": "action_settings", + "value": "Settings" + }, + { + "name": "dummy_email", + "value": "jondoe@gmail.com" + }, + { + "name": "dummy_password", + "value": "123456789" + }, + { + "name": "Sign_in", + "value": "Sign in" + }, + { + "name": "Success", + "value": "Success" + }, + { + "name": "Loading", + "value": "Loading.." + }, + { + "name": "Question", + "value": "How are you?" + }, + { + "name": "Send", + "value": "Send" + }, + { + "name": "Done", + "value": "Done" + }, + { + "name": "Upload", + "value": "Upload" + }, + { + "name": "Beautiful_Picture", + "value": "Beautiful Picture" + }, + { + "name": "Uploading", + "value": "Uploading" + }, + { + "name": "Loading_Complete", + "value": "Loading Complete, button is disabled" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/graphic/background_ability_button.xml b/entry/src/main/resources/base/graphic/background_ability_button.xml new file mode 100644 index 0000000000000000000000000000000000000000..83e27062f1ff4845725b04a952204f77eee4e9e8 --- /dev/null +++ b/entry/src/main/resources/base/graphic/background_ability_button.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/entry/src/main/resources/base/graphic/background_ability_edit.xml b/entry/src/main/resources/base/graphic/background_ability_edit.xml new file mode 100644 index 0000000000000000000000000000000000000000..f6f017fcff599f9ad6dd6b91b48846e5fb615a3c --- /dev/null +++ b/entry/src/main/resources/base/graphic/background_ability_edit.xml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/entry/src/main/resources/base/graphic/background_ability_main.xml b/entry/src/main/resources/base/graphic/background_ability_main.xml new file mode 100644 index 0000000000000000000000000000000000000000..9eda45c21976766d811a0d3f581e8854fdcdcece --- /dev/null +++ b/entry/src/main/resources/base/graphic/background_ability_main.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/entry/src/main/resources/base/graphic/text_press_background.xml b/entry/src/main/resources/base/graphic/text_press_background.xml new file mode 100644 index 0000000000000000000000000000000000000000..d48a29ad0810f965c1ddb6d60ace11f750dd632d --- /dev/null +++ b/entry/src/main/resources/base/graphic/text_press_background.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/entry/src/main/resources/base/layout/ability_main.xml b/entry/src/main/resources/base/layout/ability_main.xml new file mode 100644 index 0000000000000000000000000000000000000000..16c4427b49d54bf4b4a3ce2c354b3754fbad5ca9 --- /dev/null +++ b/entry/src/main/resources/base/layout/ability_main.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/entry/src/main/resources/base/layout/ac_states.xml b/entry/src/main/resources/base/layout/ac_states.xml new file mode 100644 index 0000000000000000000000000000000000000000..5ce109667947d6cc9bf0ed45ca5b0f59149e9c71 --- /dev/null +++ b/entry/src/main/resources/base/layout/ac_states.xml @@ -0,0 +1,76 @@ + + + + + + + + +