diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..886eae6b9a2b61a3a47cf1b9fc44beb15696db7f --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ +## 0.0.1-SNAPSHOT +ohos 第一个版本 + * 实现了原库的全部功能 + * 因为使用了jsUI开发,没有library文件 + * 状态栏和标题栏因系统差异,未和原库保持一致 + * 按钮因button设置color无效,使用了text无点击效果,未和原库保持一致 + + diff --git a/LICENSE b/LICENSE index 8dada3edaf50dbc082c9a125058f25def75e625a..9c8f3ea0871e0bfe81da0fa6e7c1d7d156dc380e 100644 --- a/LICENSE +++ b/LICENSE @@ -198,4 +198,4 @@ 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. + limitations under the License. \ No newline at end of file diff --git a/README.OPENSOURCE b/README.OPENSOURCE new file mode 100644 index 0000000000000000000000000000000000000000..2e37febc03cb4a2f72f68ea405bf50f4df6bf445 --- /dev/null +++ b/README.OPENSOURCE @@ -0,0 +1,18 @@ +[ + { + + "Name": "EasyCountDownTextureView", + + "License": "Apache License 2.0", + + "License File": "LICENSE", + + "Version Number": "v1.1" + + "Upstream URL": "https://github.com/CaMnter/EasyCountDownTextureView", + + "Description": "该组件是一个倒计时组件,用户可以自定义设置组件的宽,高,字体颜色,背景颜色,以及间距,组件内部可以停止或开始定时器,也可以对定时器的时间进行设置,倒计时结束之后会有一个结束的回调函数来通知用户倒计时结束。" + + } + +] \ No newline at end of file diff --git a/README.md b/README.md index f5fab6b8171e582149a0bd51a6840fe8af5fcafe..a28c1247c5db48c85c28d5ef33a010814493f43d 100755 --- a/README.md +++ b/README.md @@ -1,162 +1,120 @@ -EasyCountDownTextureView -== - -
- -![Language](https://img.shields.io/badge/language-Java-EE0000.svg) [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/CaMnter/EasyCountDownTextureView/blob/master/LICENSE) -![Version](https://img.shields.io/badge/version-1.6-8470FF.svg) -![SDK](https://img.shields.io/badge/SDK-14%2B-orange.svg) -[ ![Download](https://api.bintray.com/packages/camnter/maven/EasyCountDownTextureView/images/download.svg) ](https://bintray.com/camnter/maven/EasyCountDownTextureView/_latestVersion) - -**Easy count down by TextureView** - -
-
- -## Attention - -**minSdkVersion >= 14** - -
-
- -## Gradle - -```gradle -dependencies { - compile 'com.camnter.easycountdowntextureview:easycountdowntextureview:1.6' -} +# EasyCountDownTextureView + + +#### 项目介绍 +- 项目名称:EasyCountDownTextureView +- 所属系列:openharmony的第三方组件适配移植 +- 功能:实现可以开始/停止,并且可以自定义时间的定时器 +- 项目移植状态:主功能完成 +- 调用差异:新库使用js-ui框架实现 +- 开发版本:sdk6,DevEco Studio 2.2 Beta1 +- 基线版本:Release v1.1 + +#### 效果演示 +![](img/demo.gif) + +#### 安装教程 + + +此组件基于js-ui开发, +在sdk6,DevEco Studio2.2 Beta1下项目可直接运行 +如无法运行,删除项目.gradle,.idea,build,gradle,build.gradle文件, +并依据自己的版本创建新项目,将新项目的对应文件复制到根目录下 + +#### 使用说明 + +使用该库非常简单,只需查看提供的示例的源代码。 +```示例HML + + ``` - -
-
- -## Attributes - -```xml - - - - - - - - - - - - - - - - - - - -``` - -
-
- -## Easy use - -```xml - - - - - - - + + +另外,您可以选择在布局hml文件中设置以下属性,以自定义EasyCountDownTextureView的行为。 +1. hours (默认为0)显示当前倒计时的小时数 + +2. minutes (默认为0)当前倒计时的分钟数 + +3. seconds (默认值为0)当前倒计时的秒数 + +4. milliseconds (默认值为0)当前倒计时的毫秒数 + +5. width (默认值为30px)自定义一个时间所在容器的宽度 + +6. height (默认值为30px)自定义一个时间所在容器的高度 + +7. spacing (默认值为10px)自定义时分秒之间的间隔距离 + +8. color 自定义时间展示的字体颜色(例:#ccff00) + +9. bgc 自定义时间所在容器的背景颜色(例:#ccff00) + +10. weight 自定义时间展示的字体粗细(范围:100-900) + +11. font(默认值为20px)自定义时间展示的字体大小 + +12. id 用来获取当前组件,可以来使用内部定义好的方法--(setTimeHour(设置小时的函数),setTimeMinute(设置分钟的函数),setTimeSecond(设置秒钟的函数),startAndRestoreTime(调用开始倒计时函数),stopAndRecordTime(调用停止倒计时函数),isRunningState(调用当前函数查看倒计时是否完成)) + +13. onCountDownStop()子组件通知父组件倒计时停止执行之后接下来需要执行的操作 + +14. onCountDownCompleted()子组件通知父组件倒计时执行结束之后接下来需要执行的操作 + +15. onCountDownStart()子组件通知父组件倒计时开始执行之后接下来需要执行的操作 + +16. onCountDownTimeError()子组件通知父组件倒计时执行途中出错之后接下来需要执行的操作 + ``` - -
- -![TextureView_1](https://github.com/CaMnter/EasyCountDownTextureView/raw/master/screenshot/textureview_1.gif) - -
- -```xml - +父组件调用子组件的方法: +this.$child('子组件ID')['子组件中的方法名']() + +父组件使用子组件中的数据: +this.$child('子组件ID').子组件中的数据 ``` -
- -![TextureView_2](https://github.com/CaMnter/EasyCountDownTextureView/raw/master/screenshot/textureview_2.gif) - -
-
- -## Performance - -Without scrolling, only time in the refreshing - - - - -
-
- -## License +#### 测试信息 - Copyright (C) 2016 CaMnter yuanyu.camnter@gmail.com +CodeCheck代码测试无异常 + +CloudTest代码测试无异常 + +病毒安全检测通过 + +当前版本demo功能与原组件基本无差异 + +#### 版本迭代 + +- 0.0.1-SNAPSHOT + +#### 版权和许可信息 + + Copyright (C) 2016 CaMnter yuanyu.camnter@gmail.com + 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. - diff --git a/build.gradle b/build.gradle index 1a227aaa0456426625f15ae6c7ccbdece124bf85..bc82fb695baeeaaa1643ac75ee6e08433fb100f2 100644 --- a/build.gradle +++ b/build.gradle @@ -1,25 +1,36 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'com.huawei.ohos.app' + +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 5 + } +} buildscript { repositories { - jcenter() + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } } dependencies { - classpath 'com.android.tools.build:gradle:2.2.2' - - classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath 'com.huawei.ohos:hap:2.4.5.0' + classpath 'com.huawei.ohos:decctest:1.2.4.1' } } allprojects { repositories { - jcenter() + maven { + url 'https://repo.huaweicloud.com/repository/maven/' + } + maven { + url 'https://developer.huawei.com/repo/' + } } } - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/easycountdowntextureview/build.gradle b/easycountdowntextureview/build.gradle deleted file mode 100644 index 5d280c7a0afc1e854cdd9f6d74a618941ffbbe04..0000000000000000000000000000000000000000 --- a/easycountdowntextureview/build.gradle +++ /dev/null @@ -1,112 +0,0 @@ -apply plugin: 'com.android.library' - -android { - compileSdkVersion 24 - buildToolsVersion "24.0.2" - - defaultConfig { - minSdkVersion 14 - targetSdkVersion 24 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - compile 'com.android.support:support-annotations:25.0.1' -} - -// --------- - -apply plugin: 'com.android.library' -apply plugin: 'com.github.dcendents.android-maven' -apply plugin: 'com.jfrog.bintray' -// #CONFIG# // project version -version = "1.6" -// #CONFIG# // project homepage -def siteUrl = 'https://github.com/camnter/EasyCountDownTextureView' -// #CONFIG# // project git -def gitUrl = 'https://github.com/camnter/EasyCountDownTextureView.git' -// #CONFIG# // Maven Group ID for the artifact (package name is ok) -group = "com.camnter.easycountdowntextureview" - -install { - repositories.mavenInstaller { - // This generates POM.xml with proper parameters - pom { - project { - packaging 'aar' - // - name 'Easy count down TextureView For Android' - url siteUrl - licenses { - license { - name 'The Apache Software License, Version 2.0' - url 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - developers { - developer { - // - id 'CaMnter' - // - name 'YuanYuZhang' - // - email '421482590@qq.com' - } - } - scm { - connection gitUrl - developerConnection gitUrl - url siteUrl - } - } - } - } -} -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - - -task javadoc(type: Javadoc) { - source = android.sourceSets.main.java.srcDirs - classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - classifier = 'javadoc' - from javadoc.destinationDir -} - -artifacts { - archives javadocJar - archives sourcesJar -} - - - -Properties properties = new Properties() -properties.load(project.rootProject.file('local.properties').newDataInputStream()) -bintray { - user = properties.getProperty("bintray.user") - key = properties.getProperty("bintray.apikey") - configurations = ['archives'] - pkg { - repo = "maven" - name = "EasyCountDownTextureView" // project name in jcenter - websiteUrl = siteUrl - vcsUrl = gitUrl - licenses = ["Apache-2.0"] - publish = true - } -} - -// --------------- diff --git a/easycountdowntextureview/proguard-rules.pro b/easycountdowntextureview/proguard-rules.pro deleted file mode 100644 index b2aacdf6b04f88352f995a4f39d40226c22d981c..0000000000000000000000000000000000000000 --- a/easycountdowntextureview/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/CaMnter/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/easycountdowntextureview/src/main/AndroidManifest.xml b/easycountdowntextureview/src/main/AndroidManifest.xml deleted file mode 100644 index acf68a68e00da82ed94a7e0d399c4b725b92effb..0000000000000000000000000000000000000000 --- a/easycountdowntextureview/src/main/AndroidManifest.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/easycountdowntextureview/src/main/java/com/camnter/easycountdowntextureview/EasyCountDownTextureView.java b/easycountdowntextureview/src/main/java/com/camnter/easycountdowntextureview/EasyCountDownTextureView.java deleted file mode 100644 index 3781991c606114d1f142f94563cbed66a7cafc65..0000000000000000000000000000000000000000 --- a/easycountdowntextureview/src/main/java/com/camnter/easycountdowntextureview/EasyCountDownTextureView.java +++ /dev/null @@ -1,772 +0,0 @@ -/* - * Copyright (C) 2016 CaMnter yuanyu.camnter@gmail.com - * - * 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.camnter.easycountdowntextureview; - -import android.annotation.TargetApi; -import android.content.Context; -import android.content.res.TypedArray; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Paint; -import android.graphics.RectF; -import android.graphics.SurfaceTexture; -import android.os.Build; -import android.os.Handler; -import android.os.Looper; -import android.os.Message; -import android.os.SystemClock; -import android.support.annotation.NonNull; -import android.support.annotation.Nullable; -import android.util.AttributeSet; -import android.util.DisplayMetrics; -import android.util.Log; -import android.util.TypedValue; -import android.view.TextureView; -import java.lang.ref.WeakReference; -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; -import java.util.TimeZone; - -/** - * Description:EasyCountDownTextureView - * Created by:CaMnter - * Time:2016-03-16 13:45 - */ -public class EasyCountDownTextureView extends TextureView - implements TextureView.SurfaceTextureListener { - - private static final String TAG = EasyCountDownTextureView.class.getSimpleName(); - - private static final String LESS_THAN_TEN_FORMAT = "%02d"; - private static final String COLON = ":"; - - private static final int DEFAULT_COLOR_BACKGROUND = Color.BLACK; - private static final int DEFAULT_COLOR_COLON = Color.BLACK; - private static final int DEFAULT_COLOR_TIME = Color.WHITE; - private static final int DEFAULT_COLOR_RECT_BORDER = Color.BLACK; - private DisplayMetrics metrics; - - private static final int COUNT_DOWN_INTERVAL = 1000; - - private static final long ONE_SECOND = 1000L; - private static final long ONE_MINUTE = 60 * ONE_SECOND; - private static final long ONE_HOUR = 60 * ONE_MINUTE; - private static final long ONE_DAY = 24 * ONE_HOUR; - - private volatile long millisInFuture = 0L; - - /************** - * Default dp * - **************/ - private static final float DEFAULT_BACKGROUND_PAINT_WIDTH = 0.01f; - private static final float DEFAULT_COLON_PAINT_STROKE = 0.66f; - private static final float DEFAULT_TIME_PAINT_STROKE = 0.77f; - private static final float DEFAULT_ROUND_RECT_RADIUS = 2.66f; - private static final float DEFAULT_RECT_WIDTH = 18.0f; - private static final float DEFAULT_RECT_HEIGHT = 17.0f; - private static final float DEFAULT_RECT_SPACING = 6.0f; - private static final float DEFAULT_TIME_TEXT_SIZE = 13.0f; - private static final float DEFAULT_COLON_TEXT_SIZE = 13.0f; - - // 66dp - private static final float DEFAULT_VIEW_WIDTH = DEFAULT_RECT_WIDTH * 3 + - DEFAULT_RECT_SPACING * 2; - // 17dp - private static final float DEFAULT_VIEW_HEIGHT = DEFAULT_RECT_HEIGHT; - - /************** - * Default px * - **************/ - private float rectWidth; - private float rectHeight; - private float rectSpacing; - private float rectRadius; - private boolean drawRectBorder = false; - - private float paddingLeft; - private float paddingTop; - private float paddingRight; - private float paddingBottom; - - private float firstTranslateX; - private float firstTranslateColonX; - private float secondTranslateX; - private float secondTranslateColonX; - - private int timeHour; - private int timeMinute; - private int timeSecond; - - private int viewWidth; - private int viewHeight; - private float defaultWrapContentWidth; - private float defaultWrapContentHeight; - - private EasyThread easyThread; - - private final Locale locale = Locale.getDefault(); - private final Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT+00:00")); - - private Paint colonPaint; - private Paint rectBorderPaint; - - private Paint timePaint; - // for draw time - private float timePaintBaseLine; - // for draw colon - private float timePaintBaseLineFixed; - - private Paint backgroundPaint; - private RectF backgroundRectF; - - private volatile long lastRecordTime = 0L; - private volatile boolean runningState = false; - - private boolean autoResume = true; - private long pauseTime = 0L; - - private EasyCountDownListener easyCountDownListener; - - - private static class MainHandler extends Handler { - - private static final int WHAT_COUNT_DOWN_COMPLETED = 0x26; - - private final WeakReference listenerReference; - - - MainHandler(@NonNull final EasyCountDownListener easyCountDownListener) { - super(Looper.getMainLooper()); - this.listenerReference = new WeakReference<>(easyCountDownListener); - } - - - /** - * Handle system messages here. - */ - @Override - public void dispatchMessage(Message msg) { - switch (msg.what) { - case WHAT_COUNT_DOWN_COMPLETED: - final EasyCountDownListener easyCountDownListener - = this.listenerReference.get(); - if (easyCountDownListener == null) return; - easyCountDownListener.onCountDownCompleted(); - break; - } - } - - } - - - private MainHandler mainHandler; - - - public EasyCountDownTextureView(Context context) { - super(context); - this.init(context, null); - } - - - public EasyCountDownTextureView(Context context, AttributeSet attrs) { - super(context, attrs); - this.init(context, attrs); - } - - - public EasyCountDownTextureView(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - this.init(context, attrs); - } - - - @TargetApi(Build.VERSION_CODES.LOLLIPOP) - public EasyCountDownTextureView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - this.init(context, attrs); - } - - - private void init(Context context, AttributeSet attrs) { - this.metrics = this.getResources().getDisplayMetrics(); - this.defaultWrapContentWidth = this.dp2px(DEFAULT_VIEW_WIDTH); - this.defaultWrapContentHeight = this.dp2px(DEFAULT_VIEW_HEIGHT); - - this.setSurfaceTextureListener(this); - this.setOpaque(false); - - TypedArray typedArray = context.obtainStyledAttributes(attrs, - R.styleable.EasyCountDownTextureView); - this.timeHour = typedArray.getInteger(R.styleable.EasyCountDownTextureView_easyCountHour, - 0); - this.timeMinute = typedArray.getInteger( - R.styleable.EasyCountDownTextureView_easyCountMinute, 0); - this.timeSecond = typedArray.getInteger( - R.styleable.EasyCountDownTextureView_easyCountSecond, 0); - - this.initTimePaint(typedArray); - this.initColonPaint(typedArray); - this.initRectBorderPaint(typedArray); - this.initBackgroundPaint(typedArray); - - this.rectWidth = typedArray.getDimension( - R.styleable.EasyCountDownTextureView_easyCountRectWidth, - this.dp2px(DEFAULT_RECT_WIDTH)); - this.rectHeight = typedArray.getDimension( - R.styleable.EasyCountDownTextureView_easyCountRectHeight, - this.dp2px(DEFAULT_RECT_HEIGHT)); - this.rectSpacing = typedArray.getDimension( - R.styleable.EasyCountDownTextureView_easyCountRectSpacing, - this.dp2px(DEFAULT_RECT_SPACING)); - this.refitBackgroundAttribute(); - - final Paint.FontMetricsInt timePaintFontMetrics = this.timePaint.getFontMetricsInt(); - this.timePaintBaseLine = (this.backgroundRectF.bottom + this.backgroundRectF.top - - timePaintFontMetrics.bottom - timePaintFontMetrics.top) / 2; - // for colon - this.timePaintBaseLineFixed = this.timePaintBaseLine / 40 * 37; - this.rectRadius = typedArray.getDimension( - R.styleable.EasyCountDownTextureView_easyCountRectRadius, - this.dp2px(DEFAULT_ROUND_RECT_RADIUS)); - typedArray.recycle(); - - this.updateTime(); - } - - - private void initColonPaint(@NonNull final TypedArray typedArray) { - this.colonPaint = new Paint(); - this.colonPaint.setAntiAlias(true); - this.colonPaint.setColor( - typedArray.getColor(R.styleable.EasyCountDownTextureView_easyCountColonColor, - DEFAULT_COLOR_COLON)); - this.colonPaint.setTextSize( - typedArray.getDimension(R.styleable.EasyCountDownTextureView_easyCountColonSize, - this.dp2px(DEFAULT_TIME_TEXT_SIZE))); - this.colonPaint.setStrokeWidth( - typedArray.getDimension(R.styleable.EasyCountDownTextureView_easyCountColonStroke, - this.dp2px(DEFAULT_COLON_PAINT_STROKE))); - this.colonPaint.setStyle(Paint.Style.FILL_AND_STROKE); - this.colonPaint.setTextAlign(Paint.Align.CENTER); - this.colonPaint.setStrokeCap(Paint.Cap.ROUND); - } - - - private void initTimePaint(@NonNull final TypedArray typedArray) { - this.timePaint = new Paint(); - this.timePaint.setAntiAlias(true); - this.timePaint.setColor( - typedArray.getColor(R.styleable.EasyCountDownTextureView_easyCountTimeColor, - DEFAULT_COLOR_TIME)); - this.timePaint.setTextSize( - typedArray.getDimension(R.styleable.EasyCountDownTextureView_easyCountTimeSize, - this.dp2px(DEFAULT_COLON_TEXT_SIZE))); - this.timePaint.setStrokeWidth( - typedArray.getDimension(R.styleable.EasyCountDownTextureView_easyCountTimeStroke, - this.dp2px(DEFAULT_TIME_PAINT_STROKE))); - this.timePaint.setStyle(Paint.Style.FILL_AND_STROKE); - this.timePaint.setTextAlign(Paint.Align.CENTER); - this.timePaint.setStrokeCap(Paint.Cap.ROUND); - } - - - private void initRectBorderPaint(@NonNull final TypedArray typedArray) { - final float rectBorderStroke = typedArray.getDimension( - R.styleable.EasyCountDownTextureView_easyCountRectBorderStroke, Float.MIN_VALUE); - this.checkRectBorder(rectBorderStroke); - if (!this.drawRectBorder) return; - this.rectBorderPaint = new Paint(); - this.rectBorderPaint.setAntiAlias(true); - this.rectBorderPaint.setColor( - typedArray.getColor(R.styleable.EasyCountDownTextureView_easyCountRectBorderColor, - DEFAULT_COLOR_RECT_BORDER)); - this.rectBorderPaint.setStrokeWidth(rectBorderStroke); - this.rectBorderPaint.setStyle(Paint.Style.STROKE); - this.rectBorderPaint.setTextAlign(Paint.Align.CENTER); - this.rectBorderPaint.setStrokeCap(Paint.Cap.SQUARE); - } - - - private void initBackgroundPaint(@NonNull final TypedArray typedArray) { - this.backgroundPaint = new Paint(); - this.backgroundPaint.setAntiAlias(true); - this.backgroundPaint.setColor( - typedArray.getColor(R.styleable.EasyCountDownTextureView_easyCountBackgroundColor, - DEFAULT_COLOR_BACKGROUND)); - this.backgroundPaint.setStyle(Paint.Style.FILL_AND_STROKE); - this.backgroundPaint.setStrokeWidth(this.dp2px(DEFAULT_BACKGROUND_PAINT_WIDTH)); - this.backgroundPaint.setTextAlign(Paint.Align.CENTER); - this.backgroundPaint.setStrokeCap(Paint.Cap.ROUND); - } - - - private void checkRectBorder(final float rectBorder) { - this.drawRectBorder = rectBorder != Float.MIN_VALUE; - } - - - private void updateTime() { - this.millisInFuture = this.timeHour * ONE_HOUR + this.timeMinute * ONE_MINUTE + - this.timeSecond * ONE_SECOND; - this.setTime(this.millisInFuture); - } - - - private void refitBackgroundAttribute() { - this.paddingLeft = this.getPaddingLeft(); - this.paddingTop = this.getPaddingTop(); - this.paddingRight = this.getPaddingRight(); - this.paddingBottom = this.getPaddingBottom(); - - this.firstTranslateX = this.rectWidth + this.rectSpacing + paddingLeft; - this.secondTranslateX = this.rectWidth * 2 + this.rectSpacing * 2 + paddingLeft; - this.firstTranslateColonX = this.firstTranslateX - this.rectSpacing / 2; - this.secondTranslateColonX = this.secondTranslateX - this.rectSpacing / 2; - - this.backgroundRectF = new RectF(0, 0, this.rectWidth, this.rectHeight); - } - - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - this.viewWidth = MeasureSpec.getSize(widthMeasureSpec); - this.viewHeight = MeasureSpec.getSize(heightMeasureSpec); - - final int widthMode = MeasureSpec.getMode(widthMeasureSpec); - final int heightMode = MeasureSpec.getMode(heightMeasureSpec); - - float resultWidth; - float resultHeight; - - switch (widthMode) { - // wrap_content - case MeasureSpec.AT_MOST: - case MeasureSpec.UNSPECIFIED: - resultWidth = this.defaultWrapContentWidth; - break; - // match_parent - case MeasureSpec.EXACTLY: - default: - resultWidth = Math.max(this.viewWidth, this.defaultWrapContentWidth); - break; - } - switch (heightMode) { - // wrap_content - case MeasureSpec.AT_MOST: - case MeasureSpec.UNSPECIFIED: - resultHeight = this.defaultWrapContentHeight; - break; - // match_parent - case MeasureSpec.EXACTLY: - default: - resultHeight = Math.max(this.viewHeight, this.defaultWrapContentHeight); - break; - } - resultWidth += (this.paddingLeft + this.paddingRight); - resultHeight += (this.paddingTop + this.paddingBottom); - this.setMeasuredDimension((int) resultWidth, (int) resultHeight); - } - - - @Override - protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) { - super.onSizeChanged(width, height, oldWidth, oldHeight); - this.viewWidth = width; - this.viewHeight = height; - this.refitBackgroundAttribute(); - this.invalidate(); - } - - - public void setTimeHour(final int timeHour) { - this.timeHour = timeHour; - this.updateTime(); - } - - - public void setTimeMinute(final int timeMinute) { - this.timeMinute = timeMinute; - this.updateTime(); - } - - - public void setTimeSecond(final int timeSecond) { - this.timeSecond = timeSecond; - this.updateTime(); - } - - - public void setRectWidth(final float rectWidthDp) { - this.rectWidth = this.dp2px(rectWidthDp); - this.refitBackgroundAttribute(); - } - - - public void setRectHeight(final float rectHeightDp) { - this.rectHeight = this.dp2px(rectHeightDp); - this.refitBackgroundAttribute(); - } - - - public void setRectSpacing(final float rectSpacingDp) { - this.rectSpacing = this.dp2px(rectSpacingDp); - this.refitBackgroundAttribute(); - } - - - public void setAutoResume(final boolean autoResume) { - this.autoResume = autoResume; - } - - - public void setEasyCountDownListener( - @NonNull final EasyCountDownListener easyCountDownListener) { - this.easyCountDownListener = easyCountDownListener; - this.mainHandler = new MainHandler(easyCountDownListener); - } - - - public boolean isRunningState() { - return this.runningState; - } - - - public float getRectWidth() { - return this.rectWidth; - } - - - public float getRectHeight() { - return this.rectHeight; - } - - - public float getRectSpacing() { - return this.rectSpacing; - } - - - @Override - public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { - Log.i(TAG, "[onSurfaceTextureAvailable]"); - this.startAndRestoreTime(); - } - - - @Override - public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) { - - } - - - @Override - public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { - Log.i(TAG, "[onSurfaceTextureDestroyed]"); - this.stopAndRecordTime(); - return true; - } - - - public void stopAndRecordTime() { - if (this.autoResume) { - this.pauseTime = SystemClock.elapsedRealtime(); - } - this.stop(); - } - - - public void startAndRestoreTime() { - if (this.pauseTime > 0) { - this.millisInFuture -= (SystemClock.elapsedRealtime() - this.pauseTime); - this.pauseTime = 0; - } - this.start(); - } - - - @Override - public void onSurfaceTextureUpdated(SurfaceTexture surface) { - // Nothing to do - } - - - public void start() { - if (this.runningState) return; - this.drawZeroZeroZero(); - if (millisInFuture > 0) { - this.easyThread = new EasyThread(); - this.easyThread.startThread(); - this.easyThread.start(); - this.runningState = true; - if (this.easyCountDownListener != null) { - this.easyCountDownListener.onCountDownStart(); - } - } else { - if (this.easyCountDownListener != null) { - this.easyCountDownListener.onCountDownTimeError(); - } - this.runningState = false; - } - } - - - public void stop() { - if (!this.runningState) return; - if (this.easyThread != null) { - this.easyThread.interrupt(); - this.easyThread = null; - } - if (this.easyCountDownListener != null) { - this.easyCountDownListener.onCountDownStop(this.millisInFuture); - } - this.runningState = false; - } - - - /** - * Start count down by date - * - * @param date date - */ - public void setTime(@NonNull final Date date) { - this.millisInFuture = date.getTime(); - } - - - /** - * Start count down by timeMillis - * - * @param timeMillis timeMillis - */ - public void setTime(final long timeMillis) { - this.millisInFuture = timeMillis; - this.calendar.setTimeInMillis(this.millisInFuture); - } - - - private void drawZeroZeroZero() { - Canvas canvas = null; - try { - canvas = EasyCountDownTextureView.this.lockCanvas(); - if (canvas == null) return; - this.drawTimeAndBackground(canvas, String.format(locale, LESS_THAN_TEN_FORMAT, 0), - String.format(locale, LESS_THAN_TEN_FORMAT, 0), - String.format(locale, LESS_THAN_TEN_FORMAT, 0)); - unlockCanvasAndPost(canvas); - } catch (Exception e) { - e.printStackTrace(); - unlockCanvasAndPost(canvas); - } - } - - - private class EasyThread extends Thread { - - private volatile boolean running = false; - private volatile boolean completed = false; - - - EasyThread() { - this.running = true; - } - - - final void startThread() { - this.completed = false; - this.running = true; - } - - - final void stopThread() { - this.completed = true; - this.running = false; - } - - - private int checkCalendarHour(final long millisInFuture, int calendarHour) { - final int days = (int) (millisInFuture / ONE_DAY); - if (days >= 1) { - calendarHour += days * 24; - } - return calendarHour; - } - - - @Override - public void run() { - while (!this.completed) { - while (this.running) { - Canvas canvas = null; - try { - synchronized (this) { - lastRecordTime = SystemClock.elapsedRealtime(); - canvas = EasyCountDownTextureView.this.lockCanvas(); - if (canvas == null) continue; - timeHour = calendar.get(Calendar.HOUR_OF_DAY); - timeMinute = calendar.get(Calendar.MINUTE); - timeSecond = calendar.get(Calendar.SECOND); - drawTimeAndBackground(canvas, - String.format(locale, LESS_THAN_TEN_FORMAT, - this.checkCalendarHour(millisInFuture, timeHour)), - String.format(locale, LESS_THAN_TEN_FORMAT, timeMinute), - String.format(locale, LESS_THAN_TEN_FORMAT, timeSecond)); - - final long pastTime = SystemClock.elapsedRealtime() - lastRecordTime; - if (pastTime < COUNT_DOWN_INTERVAL) { - this.wait(COUNT_DOWN_INTERVAL - pastTime); - } - // refresh time - millisInFuture -= 1000; - if (millisInFuture < 0) { - this.completed = true; - this.running = false; - // refresh runningState - runningState = false; - if (mainHandler != null) { - mainHandler.sendEmptyMessageDelayed( - MainHandler.WHAT_COUNT_DOWN_COMPLETED, - 1000); - } - calendar.setTimeInMillis(0); - } else { - calendar.setTimeInMillis(millisInFuture); - } - } - } catch (InterruptedException interruptedException) { - final long intervalTime = SystemClock.elapsedRealtime() - lastRecordTime; - Log.i(TAG, - "[run]\t\t\t thread interrupted\t\t\t interval time: " + intervalTime, - interruptedException); - millisInFuture -= intervalTime; - calendar.setTimeInMillis(millisInFuture); - this.stopThread(); - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - unlockCanvasAndPost(canvas); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - } - } - } - - - private void drawTimeAndBackground(@NonNull final Canvas canvas, - @NonNull final String hour, - @NonNull final String minute, - @NonNull final String second) { - // background - canvas.save(); - canvas.translate(paddingLeft, paddingTop); - canvas.drawRoundRect(backgroundRectF, rectRadius, rectRadius, backgroundPaint); - // border - this.drawRectBorder(canvas, backgroundRectF, rectRadius, rectBorderPaint); - canvas.drawText(hour, backgroundRectF.centerX(), timePaintBaseLine, timePaint); - canvas.restore(); - - // colon - canvas.save(); - canvas.translate(firstTranslateColonX, paddingTop); - canvas.drawText(COLON, 0, timePaintBaseLineFixed, colonPaint); - canvas.restore(); - - // background - canvas.save(); - canvas.translate(firstTranslateX, paddingTop); - canvas.drawRoundRect(backgroundRectF, rectRadius, rectRadius, backgroundPaint); - // border - this.drawRectBorder(canvas, backgroundRectF, rectRadius, rectBorderPaint); - canvas.drawText(minute, backgroundRectF.centerX(), timePaintBaseLine, timePaint); - canvas.restore(); - - // colon - canvas.save(); - canvas.translate(secondTranslateColonX, paddingTop); - canvas.drawText(COLON, 0, timePaintBaseLineFixed, colonPaint); - canvas.restore(); - - // background - canvas.save(); - canvas.translate(secondTranslateX, paddingTop); - canvas.drawRoundRect(backgroundRectF, rectRadius, rectRadius, backgroundPaint); - // border - this.drawRectBorder(canvas, backgroundRectF, rectRadius, rectBorderPaint); - canvas.drawText(second, backgroundRectF.centerX(), timePaintBaseLine, timePaint); - canvas.restore(); - } - - - private void drawRectBorder(@NonNull final Canvas canvas, - @NonNull final RectF rect, - final float rectRadius, - @Nullable Paint paint) { - if (paint == null) return; - if (rectRadius > 0) { - paint.setStrokeCap(Paint.Cap.ROUND); - canvas.drawRoundRect(rect, rectRadius, rectRadius, paint); - } else { - paint.setStrokeCap(Paint.Cap.SQUARE); - canvas.drawRect(rect, paint); - } - } - - - /** - * Dp to px - * - * @param dp dp - * @return px - */ - private float dp2px(final float dp) { - return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, this.metrics); - } - - - public interface EasyCountDownListener { - - /** - * When count down start - */ - void onCountDownStart(); - - /** - * When count down time error - */ - void onCountDownTimeError(); - - /** - * When count down stop - * - * @param millisInFuture millisInFuture - */ - void onCountDownStop(long millisInFuture); - - /** - * When count down completed - */ - void onCountDownCompleted(); - - } - -} diff --git a/easycountdowntextureview/src/main/res/values/attrs.xml b/easycountdowntextureview/src/main/res/values/attrs.xml deleted file mode 100644 index 9e00d3642f432c8906f581cd9a802649c966a729..0000000000000000000000000000000000000000 --- a/easycountdowntextureview/src/main/res/values/attrs.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/easycountdowntextureview/.gitignore b/entry/.gitignore similarity index 87% rename from easycountdowntextureview/.gitignore rename to entry/.gitignore index 3543521e9fef8e7322940a87c2b45dd0061b0f45..796b96d1c402326528b4ba3c12ee9d92d0e212e9 100644 --- a/easycountdowntextureview/.gitignore +++ b/entry/.gitignore @@ -1 +1 @@ -/build +/build diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/app.js b/entry/.preview/intermediates/res/debug/rich/assets/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..ec17326d047d1a4c0308978f60dc3c4db09c6e76 --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/app.js @@ -0,0 +1,150 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js?entry"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js?entry": +/*!************************************************************************************************!*\ + !*** D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js?entry ***! + \************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $app_script$ = __webpack_require__(/*! !../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/manifest-loader.js?path=D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js!./app.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!./lib/manifest-loader.js?path=D:\\DevecostudioProjects\\EasyCountDownTextureView1\\entry\\src\\main\\js\\default\\app.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js") + + $app_define$('@app-application/app', [], function($app_require$, $app_exports$, $app_module$) { + + $app_script$($app_module$, $app_exports$, $app_require$) + if ($app_exports$.__esModule && $app_exports$.default) { + $app_module$.exports = $app_exports$.default + } + + }) + $app_bootstrap$('@app-application/app',undefined,undefined) + +/***/ }), + +/***/ "./lib/manifest-plugin.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/.preview/jsManifest/default/manifest.json": +/*!**********************************************************************************************************************************!*\ + !*** ./lib/manifest-plugin.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/.preview/jsManifest/default/manifest.json ***! + \**********************************************************************************************************************************/ +/*! exports provided: appID, appName, versionName, versionCode, minPlatformVersion, pages, deviceType, window, default */ +/***/ (function(module) { + +module.exports = JSON.parse("{\"appID\":\"com.gzb.ohos\",\"appName\":\"$string:app_name\",\"versionName\":\"1.0.0\",\"versionCode\":1000000,\"minPlatformVersion\":5,\"pages\":[\"pages/index/index\",\"pages/show/show\",\"pages/setting/setting\",\"pages/completed/completed\"],\"deviceType\":[\"phone\",\"tablet\",\"wearable\"],\"window\":{\"designWidth\":720,\"autoDesignWidth\":true}}"); + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!./lib/manifest-loader.js?path=D:\\DevecostudioProjects\\EasyCountDownTextureView1\\entry\\src\\main\\js\\default\\app.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js": +/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./lib/manifest-loader.js?path=D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/app.js ***! + \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; +var _default = { + onCreate: function onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy: function onDestroy() { + console.info('AceApplication onDestroy'); + } +}; +exports["default"] = _default; +; +(exports["default"] || module.exports).manifest = __webpack_require__(/*! !../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/manifest-plugin.js!../../../../.preview/jsManifest/default/manifest.json */ "./lib/manifest-plugin.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/.preview/jsManifest/default/manifest.json");} +/* generated by ace-loader */ + + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/Wallpaper.png b/entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/Wallpaper.png new file mode 100644 index 0000000000000000000000000000000000000000..60d4841a80eb20c63de74306cb7f8350d6a85c48 Binary files /dev/null and b/entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/Wallpaper.png differ diff --git a/samples/src/main/res/mipmap-xhdpi/bg_fruit.png b/entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/a.png similarity index 100% rename from samples/src/main/res/mipmap-xhdpi/bg_fruit.png rename to entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/a.png diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/bg-tv.jpg b/entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/bg-tv.jpg new file mode 100644 index 0000000000000000000000000000000000000000..86fc07358eea5c1474bc833fca07c6d4d8698a89 Binary files /dev/null and b/entry/.preview/intermediates/res/debug/rich/assets/js/default/common/images/bg-tv.jpg differ diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/i18n/en-US.json b/entry/.preview/intermediates/res/debug/rich/assets/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/i18n/zh-CN.json b/entry/.preview/intermediates/res/debug/rich/assets/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/manifest.json b/entry/.preview/intermediates/res/debug/rich/assets/js/default/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..d5ec75fc083287dd74257e04f6bce1484ebacd3d --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/manifest.json @@ -0,0 +1,22 @@ +{ + "appID": "com.gzb.ohos", + "appName": "$string:app_name", + "versionName": "1.0.0", + "versionCode": 1000000, + "minPlatformVersion": 5, + "pages": [ + "pages/index/index", + "pages/show/show", + "pages/setting/setting", + "pages/completed/completed" + ], + "deviceType": [ + "phone", + "tablet", + "wearable" + ], + "window": { + "designWidth": 720, + "autoDesignWidth": true + } +} \ No newline at end of file diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/completed/completed.js b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/completed/completed.js new file mode 100644 index 0000000000000000000000000000000000000000..b03c8a2345671e0926f8c3fca4e40cfdeb1df96e --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/completed/completed.js @@ -0,0 +1,761 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.hml?entry"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.hml?entry": +/*!***********************************************************************************************************************!*\ + !*** D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.hml?entry ***! + \***********************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/loader.js!../../common/components/countdown/countdown.hml?name=comp1 */ "./lib/loader.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1") +var $app_template$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/template.js!./completed.hml */ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.hml") +var $app_style$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/style.js!./completed.css */ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.css") +var $app_script$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./completed.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.js") + +$app_define$('@app-component/completed', [], function($app_require$, $app_exports$, $app_module$) { + +$app_script$($app_module$, $app_exports$, $app_require$) +if ($app_exports$.__esModule && $app_exports$.default) { +$app_module$.exports = $app_exports$.default +} + +$app_module$.exports.template = $app_template$ + +$app_module$.exports.style = $app_style$ + +}) +$app_bootstrap$('@app-component/completed',undefined,undefined) + +/***/ }), + +/***/ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css": +/*!**********************************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/style.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css ***! + \**********************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + ".container": { + "width": "454px" + }, + ".title": { + "borderBottomLeftRadius": "5px", + "borderBottomRightRadius": "5px", + "borderTopLeftRadius": "5px", + "borderTopRightRadius": "5px" + }, + ".title text": { + "width": "100%", + "height": "100%", + "textAlign": "center" + }, + ".dian": { + "textAlign": "center" + } +} + +/***/ }), + +/***/ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.css": +/*!**********************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/style.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.css ***! + \**********************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + ".container": { + "display": "flex", + "flexDirection": "column", + "paddingTop": "20px", + "paddingRight": "20px", + "paddingBottom": "20px", + "paddingLeft": "20px" + }, + ".container div": { + "marginBottom": "10px" + } +} + +/***/ }), + +/***/ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml": +/*!*************************************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/template.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml ***! + \*************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "attr": { + "debugLine": "common/components/countdown/countdown:15", + "className": "container" + }, + "type": "div", + "classList": [ + "container" + ], + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:16", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:17", + "value": function () {return this.hours<10?'0'+this.hours:this.hours} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:21", + "className": "dian", + "value": ":" + }, + "type": "text", + "classList": [ + "dian" + ], + "style": { + "width": function () {return this.spacing}, + "color": function () {return this.bgc}, + "height": function () {return this.height}, + "fontSize": function () {return this.font} + } + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:24", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:25", + "value": function () {return this.minutes<10?'0'+this.minutes:this.minutes} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:29", + "className": "dian", + "value": ":" + }, + "type": "text", + "classList": [ + "dian" + ], + "style": { + "width": function () {return this.spacing}, + "color": function () {return this.bgc}, + "height": function () {return this.height}, + "fontSize": function () {return this.font} + } + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:32", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:33", + "value": function () {return this.seconds<10?'0'+this.seconds:this.seconds} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + } + ] +} + +/***/ }), + +/***/ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.hml": +/*!*************************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/template.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.hml ***! + \*************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "attr": { + "debugLine": "pages/completed/completed:18", + "className": "container" + }, + "type": "div", + "classList": [ + "container" + ], + "children": [ + { + "attr": { + "debugLine": "pages/completed/completed:19" + }, + "type": "div", + "children": [ + { + "attr": { + "debugLine": "pages/completed/completed:20", + "id": "componter", + "hours": function () {return this.time.hours}, + "minutes": function () {return this.time.minutes}, + "seconds": function () {return this.time.seconds}, + "milliseconds": function () {return this.time.milliseconds}, + "width": function () {return this.width}, + "height": function () {return this.height}, + "spacing": function () {return this.spacing}, + "color": function () {return this.color}, + "bgc": function () {return this.bgc1}, + "weight": function () {return this.weight}, + "font": function () {return this.font}, + "className": "zujian" + }, + "type": "comp1", + "id": "componter", + "events": { + "on-count-down-stop": "onCountDownStop", + "on-count-down-completed": "onCountDownCompleted", + "on-count-down-start": "onCountDownStart", + "on-count-down-time-error": "onCountDownTimeError" + }, + "classList": [ + "zujian" + ] + } + ] + }, + { + "attr": { + "debugLine": "pages/completed/completed:40" + }, + "type": "div", + "children": [ + { + "attr": { + "debugLine": "pages/completed/completed:41", + "hours": function () {return this.time2.hours}, + "minutes": function () {return this.time2.minutes}, + "seconds": function () {return this.time2.seconds}, + "milliseconds": function () {return this.time2.milliseconds}, + "width": function () {return this.width}, + "height": function () {return this.height}, + "spacing": function () {return this.spacing}, + "color": function () {return this.color}, + "bgc": function () {return this.bgc2}, + "weight": function () {return this.weight}, + "font": function () {return this.font}, + "className": "zujian" + }, + "type": "comp1", + "events": { + "on-count-down-completed": "onCountDownCompleted" + }, + "classList": [ + "zujian" + ] + } + ] + } + ] +} + +/***/ }), + +/***/ "./lib/loader.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1": +/*!********************************************************************************************************************************************************!*\ + !*** ./lib/loader.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1 ***! + \********************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $app_template$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/template.js!./countdown.hml */ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml") +var $app_style$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/style.js!./countdown.css */ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css") +var $app_script$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./countdown.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js") + +$app_define$('@app-component/comp1', [], function($app_require$, $app_exports$, $app_module$) { + +$app_script$($app_module$, $app_exports$, $app_require$) +if ($app_exports$.__esModule && $app_exports$.default) { +$app_module$.exports = $app_exports$.default +} + +$app_module$.exports.template = $app_template$ + +$app_module$.exports.style = $app_style$ + +}) + + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js": +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _newArrowCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/newArrowCheck */ "./node_modules/@babel/runtime/helpers/newArrowCheck.js")); + +var _default = { + data: function data() { + return { + hours: this.hours, + minutes: this.minutes, + seconds: this.seconds, + milliseconds: this.milliseconds, + width: this.width, + height: this.height, + spacing: this.spacing, + flot: true, + color: this.color, + bgc: this.bgc, + weight: this.weight, + font: this.font + }; + }, + props: { + hours: { + "default": 0 + }, + minutes: { + "default": 0 + }, + seconds: { + "default": 0 + }, + milliseconds: { + "default": 0 + }, + width: { + "default": '30px' + }, + height: { + "default": '30px' + }, + spacing: { + "default": '10px' + }, + color: { + "default": '#fff' + }, + bgc: { + "default": '#000' + }, + weight: { + "default": 400 + }, + font: { + "default": '20px' + } + }, + onReady: function onReady() { + this.startAndRestoreTime(); + + if (this.milliseconds > 0) { + this.seconds = Math.floor(this.milliseconds / 1000) % 60; + this.minutes = Math.floor(this.milliseconds / 1000 / 60) % 60; + this.hours = Math.floor(this.milliseconds / 1000 / 60 / 60); + } else { + this.milliseconds = this.seconds * 1000 + this.minutes * 1000 * 60 + this.hours * 1000 * 60 * 60; + } + + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60); + this.minutes = this.minutes - Math.floor(this.minutes / 60) * 60; + } + + if (this.seconds <= 0) { + this.seconds = 0; + } else if (this.seconds > 60) { + this.minutes = this.minutes + Math.floor(this.seconds / 60); + this.seconds = this.seconds % 60; + } + }, + setTimeHour: function setTimeHour(h) { + if (h < 0) { + this.hours = 0; + } else { + this.hours = h; + } + }, + setTimeMinute: function setTimeMinute(m) { + if (m > 60) { + this.hours = Number(this.hours) + Math.floor(m / 60); + this.minutes = this.minutes + m % 60; + } else if (m <= 0) { + this.minutes = 0; + } else { + this.minutes = m; + } + }, + setTimeSecond: function setTimeSecond(s) { + if (s > 60) { + this.minutes = Number(this.minutes) + Math.floor(s / 60); + this.seconds = this.seconds + s % 60; + } else if (s <= 0) { + this.seconds = 0; + } else { + this.seconds = s; + } + + if (this.seconds > 60) { + this.minutes = Number(this.minutes) + Math.floor(this.seconds / 60); + this.seconds = this.seconds % 60; + } + + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60); + this.minutes = this.minutes % 60; + } + }, + setTime: function setTime(timeMillis) { + if (timeMillis > 0) { + this.seconds = Math.floor(timeMillis / 1000) % 60; + this.minutes = Math.floor(timeMillis / 1000 / 60) % 60; + this.hours = Math.floor(this.timeMillis / 1000 / 60 / 60); + } else { + return; + } + }, + startAndRestoreTime: function startAndRestoreTime() { + var _this = this; + + this.flot = true; + this.$emit('onCountDownStart'); + this.timer = setInterval(function () { + (0, _newArrowCheck2["default"])(this, _this); + + if (this.hours >= 0 || this.minutes >= 0 || this.seconds >= 0) { + if (this.hours == 0 && this.minutes == 0 && this.seconds == 0) { + this.$emit('onCountDownCompleted'); + this.flot = false; + clearInterval(this.timer); + } else { + if (this.seconds > 0) { + this.seconds = Number(this.seconds) - 1; + } else { + if (this.minutes > 0) { + this.minutes = Number(this.minutes) - 1; + } else { + if (this.hours > 0) { + this.hours = Number(this.hours) - 1; + } else { + this.$emit('onCountDownCompleted'); + this.flot = false; + clearInterval(this.timer); + } + + this.minutes = 59; + } + + this.seconds = 59; + } + } + } else { + this.flot = false; + this.$emit('onCountDownTimeError'); + clearInterval(this.timer); + } + }.bind(this), 1000); + }, + stopAndRecordTime: function stopAndRecordTime() { + this.$emit('onCountDownStop', { + 'millisInFuture': this.milliseconds + }); + this.flot = false; + clearInterval(this.timer); + }, + isRunningState: function isRunningState() { + return this.flot; + } +}; +exports["default"] = _default; +var moduleOwn = exports.default || module.exports; +var accessors = ['public', 'protected', 'private']; +if (moduleOwn.data && accessors.some(function (acc) { + return moduleOwn[acc]; + })) { + throw new Error('For VM objects, attribute data must not coexist with public, protected, or private. Please replace data with public.'); +} else if (!moduleOwn.data) { + moduleOwn.data = {}; + moduleOwn._descriptor = {}; + accessors.forEach(function(acc) { + var accType = typeof moduleOwn[acc]; + if (accType === 'object') { + moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); + for (var name in moduleOwn[acc]) { + moduleOwn._descriptor[name] = {access : acc}; + } + } else if (accType === 'function') { + console.warn('For VM objects, attribute ' + acc + ' value must not be a function. Change the value to an object.'); + } + }); +}} +/* generated by ace-loader */ + + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.js": +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/completed/completed.js ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _system = _interopRequireDefault($app_require$("@app-module/system.prompt")); + +var _default = { + data: { + time: { + hours: '0', + minutes: '0', + seconds: '6', + milliseconds: '0' + }, + time2: { + hours: '0', + minutes: '0', + seconds: '12', + milliseconds: 0 + }, + width: '28px', + height: '28px', + spacing: '8px', + bgc1: '#eeeeee', + bgc2: '#eedddd', + color: '#ff0000', + weight: 500, + font: '18px' + }, + onInit: function onInit() {}, + onCountDownCompleted: function onCountDownCompleted() { + _system["default"].showToast({ + message: "[CompletedAbility] [onCountDownCompleted]", + duration: 2000 + }); + } +}; +exports["default"] = _default; +var moduleOwn = exports.default || module.exports; +var accessors = ['public', 'protected', 'private']; +if (moduleOwn.data && accessors.some(function (acc) { + return moduleOwn[acc]; + })) { + throw new Error('For VM objects, attribute data must not coexist with public, protected, or private. Please replace data with public.'); +} else if (!moduleOwn.data) { + moduleOwn.data = {}; + moduleOwn._descriptor = {}; + accessors.forEach(function(acc) { + var accType = typeof moduleOwn[acc]; + if (accType === 'object') { + moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); + for (var name in moduleOwn[acc]) { + moduleOwn._descriptor[name] = {access : acc}; + } + } else if (accType === 'function') { + console.warn('For VM objects, attribute ' + acc + ' value must not be a function. Change the value to an object.'); + } + }); +}} +/* generated by ace-loader */ + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} + +module.exports = _interopRequireDefault; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/newArrowCheck.js": +/*!**************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/newArrowCheck.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +} + +module.exports = _newArrowCheck; + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/index/index.js b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9778b8f5dd4bf003906bfabc976f0e91eddf0ba7 --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/index/index.js @@ -0,0 +1,283 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.hml?entry"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.hml?entry": +/*!***************************************************************************************************************!*\ + !*** D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.hml?entry ***! + \***************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $app_template$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/template.js!./index.hml */ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.hml") +var $app_style$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/style.js!./index.css */ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.css") +var $app_script$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./index.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.js") + +$app_define$('@app-component/index', [], function($app_require$, $app_exports$, $app_module$) { + +$app_script$($app_module$, $app_exports$, $app_require$) +if ($app_exports$.__esModule && $app_exports$.default) { +$app_module$.exports = $app_exports$.default +} + +$app_module$.exports.template = $app_template$ + +$app_module$.exports.style = $app_style$ + +}) +$app_bootstrap$('@app-component/index',undefined,undefined) + +/***/ }), + +/***/ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.css": +/*!**************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/style.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.css ***! + \**************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + ".container": { + "flexDirection": "column", + "paddingTop": "10px" + }, + ".title": { + "paddingLeft": "10px", + "width": "100%", + "fontSize": "18px", + "fontWeight": "600", + "lineHeight": "22px", + "color": "#33cc00", + "borderBottomWidth": "1px", + "borderBottomStyle": "solid", + "borderBottomColor": "#cccccc", + "height": "50px" + } +} + +/***/ }), + +/***/ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.hml": +/*!*****************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/template.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.hml ***! + \*****************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "attr": { + "debugLine": "pages/index/index:15", + "className": "container" + }, + "type": "div", + "classList": [ + "container" + ], + "children": [ + { + "attr": { + "debugLine": "pages/index/index:16", + "className": "title", + "value": "ShowAbility" + }, + "type": "text", + "classList": [ + "title" + ], + "events": { + "click": function (evt) {this.push('show',evt)} + } + }, + { + "attr": { + "debugLine": "pages/index/index:20", + "className": "title", + "value": "SettingAbility" + }, + "type": "text", + "classList": [ + "title" + ], + "events": { + "click": function (evt) {this.push('setting',evt)} + } + }, + { + "attr": { + "debugLine": "pages/index/index:24", + "className": "title", + "value": "CompletedAbility" + }, + "type": "text", + "classList": [ + "title" + ], + "events": { + "click": function (evt) {this.push('completed',evt)} + } + } + ] +} + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.js": +/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/index/index.js ***! + \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _system = _interopRequireDefault($app_require$("@app-module/system.router")); + +var _default = { + data: { + title: "" + }, + onCreate: function onCreate() { + this.title = this.$t('strings.world'); + }, + push: function push(url) { + _system["default"].push({ + uri: "pages/".concat(url, "/").concat(url) + }); + } +}; +exports["default"] = _default; +var moduleOwn = exports.default || module.exports; +var accessors = ['public', 'protected', 'private']; +if (moduleOwn.data && accessors.some(function (acc) { + return moduleOwn[acc]; + })) { + throw new Error('For VM objects, attribute data must not coexist with public, protected, or private. Please replace data with public.'); +} else if (!moduleOwn.data) { + moduleOwn.data = {}; + moduleOwn._descriptor = {}; + accessors.forEach(function(acc) { + var accType = typeof moduleOwn[acc]; + if (accType === 'object') { + moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); + for (var name in moduleOwn[acc]) { + moduleOwn._descriptor[name] = {access : acc}; + } + } else if (accType === 'function') { + console.warn('For VM objects, attribute ' + acc + ' value must not be a function. Change the value to an object.'); + } + }); +}} +/* generated by ace-loader */ + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} + +module.exports = _interopRequireDefault; + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/setting/setting.js b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/setting/setting.js new file mode 100644 index 0000000000000000000000000000000000000000..7f2ffb1673cb3083e3e2897e9bd8396993e9da43 --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/setting/setting.js @@ -0,0 +1,894 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.hml?entry"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.hml?entry": +/*!*******************************************************************************************************************!*\ + !*** D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.hml?entry ***! + \*******************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/loader.js!../../common/components/countdown/countdown.hml?name=comp1 */ "./lib/loader.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1") +var $app_template$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/template.js!./setting.hml */ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.hml") +var $app_style$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/style.js!./setting.css */ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.css") +var $app_script$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./setting.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.js") + +$app_define$('@app-component/setting', [], function($app_require$, $app_exports$, $app_module$) { + +$app_script$($app_module$, $app_exports$, $app_require$) +if ($app_exports$.__esModule && $app_exports$.default) { +$app_module$.exports = $app_exports$.default +} + +$app_module$.exports.template = $app_template$ + +$app_module$.exports.style = $app_style$ + +}) +$app_bootstrap$('@app-component/setting',undefined,undefined) + +/***/ }), + +/***/ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css": +/*!**********************************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/style.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css ***! + \**********************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + ".container": { + "width": "454px" + }, + ".title": { + "borderBottomLeftRadius": "5px", + "borderBottomRightRadius": "5px", + "borderTopLeftRadius": "5px", + "borderTopRightRadius": "5px" + }, + ".title text": { + "width": "100%", + "height": "100%", + "textAlign": "center" + }, + ".dian": { + "textAlign": "center" + } +} + +/***/ }), + +/***/ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.css": +/*!******************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/style.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.css ***! + \******************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + ".container": { + "display": "flex", + "flexDirection": "column", + "justifyContent": "space-between", + "flexWrap": "wrap", + "paddingTop": "20px", + "paddingRight": "20px", + "paddingBottom": "20px", + "paddingLeft": "20px", + "height": "100%" + }, + ".title": { + "fontSize": "30px", + "textAlign": "center", + "width": "200px", + "height": "100px" + }, + ".btn": { + "position": "absolute", + "right": "10px", + "top": "20px", + "width": "60px", + "height": "60px" + }, + ".btn-box": { + "height": "200px", + "width": "300px", + "display": "flex", + "flexDirection": "column" + }, + ".btn1": { + "flexGrow": 1, + "marginBottom": "30px", + "display": "flex", + "justifyContent": "space-between", + "flexWrap": "wrap" + }, + ".btn2": { + "flexGrow": 1, + "display": "flex", + "justifyContent": "space-between", + "flexWrap": "wrap" + }, + ".btn1 text": { + "paddingTop": "10px", + "paddingRight": "10px", + "paddingBottom": "10px", + "paddingLeft": "10px", + "backgroundColor": "#999999", + "fontSize": "18px", + "width": "90px", + "textAlign": "center", + "borderBottomLeftRadius": "5px", + "borderBottomRightRadius": "5px", + "borderTopLeftRadius": "5px", + "borderTopRightRadius": "5px", + "color": "#000000" + }, + ".btn2 text": { + "flexGrow": 1, + "paddingTop": "10px", + "paddingRight": "20px", + "paddingBottom": "10px", + "paddingLeft": "20px", + "backgroundColor": "#999999", + "fontSize": "18px", + "width": "90px", + "textAlign": "center", + "borderBottomLeftRadius": "5px", + "borderBottomRightRadius": "5px", + "borderTopLeftRadius": "5px", + "borderTopRightRadius": "5px", + "color": "#000000" + } +} + +/***/ }), + +/***/ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml": +/*!*************************************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/template.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml ***! + \*************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "attr": { + "debugLine": "common/components/countdown/countdown:15", + "className": "container" + }, + "type": "div", + "classList": [ + "container" + ], + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:16", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:17", + "value": function () {return this.hours<10?'0'+this.hours:this.hours} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:21", + "className": "dian", + "value": ":" + }, + "type": "text", + "classList": [ + "dian" + ], + "style": { + "width": function () {return this.spacing}, + "color": function () {return this.bgc}, + "height": function () {return this.height}, + "fontSize": function () {return this.font} + } + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:24", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:25", + "value": function () {return this.minutes<10?'0'+this.minutes:this.minutes} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:29", + "className": "dian", + "value": ":" + }, + "type": "text", + "classList": [ + "dian" + ], + "style": { + "width": function () {return this.spacing}, + "color": function () {return this.bgc}, + "height": function () {return this.height}, + "fontSize": function () {return this.font} + } + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:32", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:33", + "value": function () {return this.seconds<10?'0'+this.seconds:this.seconds} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + } + ] +} + +/***/ }), + +/***/ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.hml": +/*!*********************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/template.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.hml ***! + \*********************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "attr": { + "debugLine": "pages/setting/setting:18", + "className": "container" + }, + "type": "div", + "classList": [ + "container" + ], + "children": [ + { + "attr": { + "debugLine": "pages/setting/setting:19" + }, + "type": "div", + "children": [ + { + "attr": { + "debugLine": "pages/setting/setting:20", + "id": "componter", + "hours": function () {return this.time.hours}, + "minutes": function () {return this.time.minutes}, + "seconds": function () {return this.time.seconds}, + "milliseconds": function () {return this.time.milliseconds}, + "width": function () {return this.width}, + "height": function () {return this.height}, + "spacing": function () {return this.spacing}, + "color": function () {return this.color}, + "bgc": function () {return this.bgc}, + "weight": function () {return this.weight}, + "font": function () {return this.font}, + "className": "zujian" + }, + "type": "comp1", + "id": "componter", + "events": { + "on-count-down-stop": "onCountDownStop", + "on-count-down-completed": "onCountDownCompleted", + "on-count-down-start": "onCountDownStart", + "on-count-down-time-error": "onCountDownTimeError" + }, + "classList": [ + "zujian" + ] + } + ] + }, + { + "attr": { + "debugLine": "pages/setting/setting:40" + }, + "type": "div", + "children": [ + { + "attr": { + "debugLine": "pages/setting/setting:41", + "className": "btn-box" + }, + "type": "div", + "classList": [ + "btn-box" + ], + "children": [ + { + "attr": { + "debugLine": "pages/setting/setting:42", + "className": "btn1" + }, + "type": "div", + "classList": [ + "btn1" + ], + "children": [ + { + "attr": { + "debugLine": "pages/setting/setting:43", + "value": "START" + }, + "type": "text", + "events": { + "click": "start" + } + }, + { + "attr": { + "debugLine": "pages/setting/setting:46", + "value": "STOP" + }, + "type": "text", + "events": { + "click": "stop" + } + } + ] + }, + { + "attr": { + "debugLine": "pages/setting/setting:50", + "className": "btn2" + }, + "type": "div", + "classList": [ + "btn2" + ], + "children": [ + { + "attr": { + "debugLine": "pages/setting/setting:51", + "value": "H=01" + }, + "type": "text", + "events": { + "click": function (evt) {this.shi(1,evt)} + } + }, + { + "attr": { + "debugLine": "pages/setting/setting:54", + "value": "M=01" + }, + "type": "text", + "events": { + "click": function (evt) {this.fen(1,evt)} + } + }, + { + "attr": { + "debugLine": "pages/setting/setting:57", + "value": "S=01" + }, + "type": "text", + "events": { + "click": function (evt) {this.miao(1,evt)} + } + } + ] + } + ] + } + ] + } + ] +} + +/***/ }), + +/***/ "./lib/loader.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1": +/*!********************************************************************************************************************************************************!*\ + !*** ./lib/loader.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1 ***! + \********************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $app_template$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/template.js!./countdown.hml */ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml") +var $app_style$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/style.js!./countdown.css */ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css") +var $app_script$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./countdown.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js") + +$app_define$('@app-component/comp1', [], function($app_require$, $app_exports$, $app_module$) { + +$app_script$($app_module$, $app_exports$, $app_require$) +if ($app_exports$.__esModule && $app_exports$.default) { +$app_module$.exports = $app_exports$.default +} + +$app_module$.exports.template = $app_template$ + +$app_module$.exports.style = $app_style$ + +}) + + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js": +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _newArrowCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/newArrowCheck */ "./node_modules/@babel/runtime/helpers/newArrowCheck.js")); + +var _default = { + data: function data() { + return { + hours: this.hours, + minutes: this.minutes, + seconds: this.seconds, + milliseconds: this.milliseconds, + width: this.width, + height: this.height, + spacing: this.spacing, + flot: true, + color: this.color, + bgc: this.bgc, + weight: this.weight, + font: this.font + }; + }, + props: { + hours: { + "default": 0 + }, + minutes: { + "default": 0 + }, + seconds: { + "default": 0 + }, + milliseconds: { + "default": 0 + }, + width: { + "default": '30px' + }, + height: { + "default": '30px' + }, + spacing: { + "default": '10px' + }, + color: { + "default": '#fff' + }, + bgc: { + "default": '#000' + }, + weight: { + "default": 400 + }, + font: { + "default": '20px' + } + }, + onReady: function onReady() { + this.startAndRestoreTime(); + + if (this.milliseconds > 0) { + this.seconds = Math.floor(this.milliseconds / 1000) % 60; + this.minutes = Math.floor(this.milliseconds / 1000 / 60) % 60; + this.hours = Math.floor(this.milliseconds / 1000 / 60 / 60); + } else { + this.milliseconds = this.seconds * 1000 + this.minutes * 1000 * 60 + this.hours * 1000 * 60 * 60; + } + + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60); + this.minutes = this.minutes - Math.floor(this.minutes / 60) * 60; + } + + if (this.seconds <= 0) { + this.seconds = 0; + } else if (this.seconds > 60) { + this.minutes = this.minutes + Math.floor(this.seconds / 60); + this.seconds = this.seconds % 60; + } + }, + setTimeHour: function setTimeHour(h) { + if (h < 0) { + this.hours = 0; + } else { + this.hours = h; + } + }, + setTimeMinute: function setTimeMinute(m) { + if (m > 60) { + this.hours = Number(this.hours) + Math.floor(m / 60); + this.minutes = this.minutes + m % 60; + } else if (m <= 0) { + this.minutes = 0; + } else { + this.minutes = m; + } + }, + setTimeSecond: function setTimeSecond(s) { + if (s > 60) { + this.minutes = Number(this.minutes) + Math.floor(s / 60); + this.seconds = this.seconds + s % 60; + } else if (s <= 0) { + this.seconds = 0; + } else { + this.seconds = s; + } + + if (this.seconds > 60) { + this.minutes = Number(this.minutes) + Math.floor(this.seconds / 60); + this.seconds = this.seconds % 60; + } + + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60); + this.minutes = this.minutes % 60; + } + }, + setTime: function setTime(timeMillis) { + if (timeMillis > 0) { + this.seconds = Math.floor(timeMillis / 1000) % 60; + this.minutes = Math.floor(timeMillis / 1000 / 60) % 60; + this.hours = Math.floor(this.timeMillis / 1000 / 60 / 60); + } else { + return; + } + }, + startAndRestoreTime: function startAndRestoreTime() { + var _this = this; + + this.flot = true; + this.$emit('onCountDownStart'); + this.timer = setInterval(function () { + (0, _newArrowCheck2["default"])(this, _this); + + if (this.hours >= 0 || this.minutes >= 0 || this.seconds >= 0) { + if (this.hours == 0 && this.minutes == 0 && this.seconds == 0) { + this.$emit('onCountDownCompleted'); + this.flot = false; + clearInterval(this.timer); + } else { + if (this.seconds > 0) { + this.seconds = Number(this.seconds) - 1; + } else { + if (this.minutes > 0) { + this.minutes = Number(this.minutes) - 1; + } else { + if (this.hours > 0) { + this.hours = Number(this.hours) - 1; + } else { + this.$emit('onCountDownCompleted'); + this.flot = false; + clearInterval(this.timer); + } + + this.minutes = 59; + } + + this.seconds = 59; + } + } + } else { + this.flot = false; + this.$emit('onCountDownTimeError'); + clearInterval(this.timer); + } + }.bind(this), 1000); + }, + stopAndRecordTime: function stopAndRecordTime() { + this.$emit('onCountDownStop', { + 'millisInFuture': this.milliseconds + }); + this.flot = false; + clearInterval(this.timer); + }, + isRunningState: function isRunningState() { + return this.flot; + } +}; +exports["default"] = _default; +var moduleOwn = exports.default || module.exports; +var accessors = ['public', 'protected', 'private']; +if (moduleOwn.data && accessors.some(function (acc) { + return moduleOwn[acc]; + })) { + throw new Error('For VM objects, attribute data must not coexist with public, protected, or private. Please replace data with public.'); +} else if (!moduleOwn.data) { + moduleOwn.data = {}; + moduleOwn._descriptor = {}; + accessors.forEach(function(acc) { + var accType = typeof moduleOwn[acc]; + if (accType === 'object') { + moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); + for (var name in moduleOwn[acc]) { + moduleOwn._descriptor[name] = {access : acc}; + } + } else if (accType === 'function') { + console.warn('For VM objects, attribute ' + acc + ' value must not be a function. Change the value to an object.'); + } + }); +}} +/* generated by ace-loader */ + + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.js": +/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/setting/setting.js ***! + \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; +var _default = { + data: { + time: { + hours: '26', + minutes: '6', + seconds: '26', + milliseconds: '0' + }, + flot: true, + width: '40px', + height: '40px', + spacing: '10px', + bgc: '#cccccc', + color: '#0099ff', + weight: 500, + font: '20px' + }, + start: function start() { + if (this.$child('componter').flot) { + return; + } else { + this.$child('componter')['startAndRestoreTime'](); + } + }, + stop: function stop() { + if (!this.$child('componter').flot) { + return; + } else { + this.$child('componter')['stopAndRecordTime'](); + } + }, + shi: function shi(num) { + this.$child('componter')['setTimeHour'](num); + }, + fen: function fen(num) { + this.$child('componter')['setTimeMinute'](num); + }, + miao: function miao(num) { + this.$child('componter')['setTimeSecond'](num); + }, + onCountDownStop: function onCountDownStop(e) { + console.log(JSON.stringify(e)); + } +}; +exports["default"] = _default; +var moduleOwn = exports.default || module.exports; +var accessors = ['public', 'protected', 'private']; +if (moduleOwn.data && accessors.some(function (acc) { + return moduleOwn[acc]; + })) { + throw new Error('For VM objects, attribute data must not coexist with public, protected, or private. Please replace data with public.'); +} else if (!moduleOwn.data) { + moduleOwn.data = {}; + moduleOwn._descriptor = {}; + accessors.forEach(function(acc) { + var accType = typeof moduleOwn[acc]; + if (accType === 'object') { + moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); + for (var name in moduleOwn[acc]) { + moduleOwn._descriptor[name] = {access : acc}; + } + } else if (accType === 'function') { + console.warn('For VM objects, attribute ' + acc + ' value must not be a function. Change the value to an object.'); + } + }); +}} +/* generated by ace-loader */ + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} + +module.exports = _interopRequireDefault; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/newArrowCheck.js": +/*!**************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/newArrowCheck.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +} + +module.exports = _newArrowCheck; + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/show/show.js b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/show/show.js new file mode 100644 index 0000000000000000000000000000000000000000..8b9ab7d9caacf9ed8edbc2b1ecaf0d64b06ecd52 --- /dev/null +++ b/entry/.preview/intermediates/res/debug/rich/assets/js/default/pages/show/show.js @@ -0,0 +1,719 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.hml?entry"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.hml?entry": +/*!*************************************************************************************************************!*\ + !*** D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.hml?entry ***! + \*************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +__webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/loader.js!../../common/components/countdown/countdown.hml?name=comp1 */ "./lib/loader.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1") +var $app_template$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/template.js!./show.hml */ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.hml") +var $app_style$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/style.js!./show.css */ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.css") +var $app_script$ = __webpack_require__(/*! !../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./show.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.js") + +$app_define$('@app-component/show', [], function($app_require$, $app_exports$, $app_module$) { + +$app_script$($app_module$, $app_exports$, $app_require$) +if ($app_exports$.__esModule && $app_exports$.default) { +$app_module$.exports = $app_exports$.default +} + +$app_module$.exports.template = $app_template$ + +$app_module$.exports.style = $app_style$ + +}) +$app_bootstrap$('@app-component/show',undefined,undefined) + +/***/ }), + +/***/ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css": +/*!**********************************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/style.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css ***! + \**********************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + ".container": { + "width": "454px" + }, + ".title": { + "borderBottomLeftRadius": "5px", + "borderBottomRightRadius": "5px", + "borderTopLeftRadius": "5px", + "borderTopRightRadius": "5px" + }, + ".title text": { + "width": "100%", + "height": "100%", + "textAlign": "center" + }, + ".dian": { + "textAlign": "center" + } +} + +/***/ }), + +/***/ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.css": +/*!************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/style.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.css ***! + \************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + ".container": { + "width": "454px", + "paddingTop": "20px", + "paddingRight": "10px", + "paddingBottom": "20px", + "paddingLeft": "10px", + "position": "relative", + "display": "flex", + "flexDirection": "column" + }, + ".btn": { + "position": "absolute", + "right": "10px", + "top": "20px", + "width": "60px", + "height": "60px" + }, + "image": { + "width": "300px" + } +} + +/***/ }), + +/***/ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml": +/*!*************************************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/template.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml ***! + \*************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "attr": { + "debugLine": "common/components/countdown/countdown:15", + "className": "container" + }, + "type": "div", + "classList": [ + "container" + ], + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:16", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:17", + "value": function () {return this.hours<10?'0'+this.hours:this.hours} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:21", + "className": "dian", + "value": ":" + }, + "type": "text", + "classList": [ + "dian" + ], + "style": { + "width": function () {return this.spacing}, + "color": function () {return this.bgc}, + "height": function () {return this.height}, + "fontSize": function () {return this.font} + } + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:24", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:25", + "value": function () {return this.minutes<10?'0'+this.minutes:this.minutes} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:29", + "className": "dian", + "value": ":" + }, + "type": "text", + "classList": [ + "dian" + ], + "style": { + "width": function () {return this.spacing}, + "color": function () {return this.bgc}, + "height": function () {return this.height}, + "fontSize": function () {return this.font} + } + }, + { + "attr": { + "debugLine": "common/components/countdown/countdown:32", + "className": "title" + }, + "type": "div", + "classList": [ + "title" + ], + "style": { + "height": function () {return this.height}, + "width": function () {return this.width}, + "backgroundColor": function () {return this.bgc}, + "fontSize": function () {return this.font} + }, + "children": [ + { + "attr": { + "debugLine": "common/components/countdown/countdown:33", + "value": function () {return this.seconds<10?'0'+this.seconds:this.seconds} + }, + "type": "text", + "style": { + "color": function () {return this.color}, + "fontWeight": function () {return this.weight}, + "fontSize": function () {return this.font} + } + } + ] + } + ] +} + +/***/ }), + +/***/ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.hml": +/*!***************************************************************************************************************************************!*\ + !*** ./lib/json.js!./lib/template.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.hml ***! + \***************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +module.exports = { + "attr": { + "debugLine": "pages/show/show:17", + "className": "container" + }, + "type": "div", + "classList": [ + "container" + ], + "children": [ + { + "attr": { + "debugLine": "pages/show/show:20", + "hours": function () {return this.time.hours}, + "minutes": function () {return this.time.minutes}, + "seconds": function () {return this.time.seconds}, + "milliseconds": function () {return this.time.milliseconds}, + "width": function () {return this.width}, + "height": function () {return this.height}, + "spacing": function () {return this.spacing}, + "color": function () {return this.color}, + "bgc": function () {return this.bgc}, + "weight": function () {return this.weight}, + "font": function () {return this.font} + }, + "type": "comp1" + }, + { + "attr": { + "debugLine": "pages/show/show:32", + "src": "/common/images/a.png" + }, + "type": "image" + } + ] +} + +/***/ }), + +/***/ "./lib/loader.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1": +/*!********************************************************************************************************************************************************!*\ + !*** ./lib/loader.js!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml?name=comp1 ***! + \********************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +var $app_template$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/template.js!./countdown.hml */ "./lib/json.js!./lib/template.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.hml") +var $app_style$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/json.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/style.js!./countdown.css */ "./lib/json.js!./lib/style.js!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.css") +var $app_script$ = __webpack_require__(/*! !../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/lib/script.js!../../../../../../../../../../HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/babel-loader?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!./countdown.js */ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js") + +$app_define$('@app-component/comp1', [], function($app_require$, $app_exports$, $app_module$) { + +$app_script$($app_module$, $app_exports$, $app_require$) +if ($app_exports$.__esModule && $app_exports$.default) { +$app_module$.exports = $app_exports$.default +} + +$app_module$.exports.template = $app_template$ + +$app_module$.exports.style = $app_style$ + +}) + + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js": +/*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/common/components/countdown/countdown.js ***! + \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _newArrowCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/newArrowCheck */ "./node_modules/@babel/runtime/helpers/newArrowCheck.js")); + +var _default = { + data: function data() { + return { + hours: this.hours, + minutes: this.minutes, + seconds: this.seconds, + milliseconds: this.milliseconds, + width: this.width, + height: this.height, + spacing: this.spacing, + flot: true, + color: this.color, + bgc: this.bgc, + weight: this.weight, + font: this.font + }; + }, + props: { + hours: { + "default": 0 + }, + minutes: { + "default": 0 + }, + seconds: { + "default": 0 + }, + milliseconds: { + "default": 0 + }, + width: { + "default": '30px' + }, + height: { + "default": '30px' + }, + spacing: { + "default": '10px' + }, + color: { + "default": '#fff' + }, + bgc: { + "default": '#000' + }, + weight: { + "default": 400 + }, + font: { + "default": '20px' + } + }, + onReady: function onReady() { + this.startAndRestoreTime(); + + if (this.milliseconds > 0) { + this.seconds = Math.floor(this.milliseconds / 1000) % 60; + this.minutes = Math.floor(this.milliseconds / 1000 / 60) % 60; + this.hours = Math.floor(this.milliseconds / 1000 / 60 / 60); + } else { + this.milliseconds = this.seconds * 1000 + this.minutes * 1000 * 60 + this.hours * 1000 * 60 * 60; + } + + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60); + this.minutes = this.minutes - Math.floor(this.minutes / 60) * 60; + } + + if (this.seconds <= 0) { + this.seconds = 0; + } else if (this.seconds > 60) { + this.minutes = this.minutes + Math.floor(this.seconds / 60); + this.seconds = this.seconds % 60; + } + }, + setTimeHour: function setTimeHour(h) { + if (h < 0) { + this.hours = 0; + } else { + this.hours = h; + } + }, + setTimeMinute: function setTimeMinute(m) { + if (m > 60) { + this.hours = Number(this.hours) + Math.floor(m / 60); + this.minutes = this.minutes + m % 60; + } else if (m <= 0) { + this.minutes = 0; + } else { + this.minutes = m; + } + }, + setTimeSecond: function setTimeSecond(s) { + if (s > 60) { + this.minutes = Number(this.minutes) + Math.floor(s / 60); + this.seconds = this.seconds + s % 60; + } else if (s <= 0) { + this.seconds = 0; + } else { + this.seconds = s; + } + + if (this.seconds > 60) { + this.minutes = Number(this.minutes) + Math.floor(this.seconds / 60); + this.seconds = this.seconds % 60; + } + + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60); + this.minutes = this.minutes % 60; + } + }, + setTime: function setTime(timeMillis) { + if (timeMillis > 0) { + this.seconds = Math.floor(timeMillis / 1000) % 60; + this.minutes = Math.floor(timeMillis / 1000 / 60) % 60; + this.hours = Math.floor(this.timeMillis / 1000 / 60 / 60); + } else { + return; + } + }, + startAndRestoreTime: function startAndRestoreTime() { + var _this = this; + + this.flot = true; + this.$emit('onCountDownStart'); + this.timer = setInterval(function () { + (0, _newArrowCheck2["default"])(this, _this); + + if (this.hours >= 0 || this.minutes >= 0 || this.seconds >= 0) { + if (this.hours == 0 && this.minutes == 0 && this.seconds == 0) { + this.$emit('onCountDownCompleted'); + this.flot = false; + clearInterval(this.timer); + } else { + if (this.seconds > 0) { + this.seconds = Number(this.seconds) - 1; + } else { + if (this.minutes > 0) { + this.minutes = Number(this.minutes) - 1; + } else { + if (this.hours > 0) { + this.hours = Number(this.hours) - 1; + } else { + this.$emit('onCountDownCompleted'); + this.flot = false; + clearInterval(this.timer); + } + + this.minutes = 59; + } + + this.seconds = 59; + } + } + } else { + this.flot = false; + this.$emit('onCountDownTimeError'); + clearInterval(this.timer); + } + }.bind(this), 1000); + }, + stopAndRecordTime: function stopAndRecordTime() { + this.$emit('onCountDownStop', { + 'millisInFuture': this.milliseconds + }); + this.flot = false; + clearInterval(this.timer); + }, + isRunningState: function isRunningState() { + return this.flot; + } +}; +exports["default"] = _default; +var moduleOwn = exports.default || module.exports; +var accessors = ['public', 'protected', 'private']; +if (moduleOwn.data && accessors.some(function (acc) { + return moduleOwn[acc]; + })) { + throw new Error('For VM objects, attribute data must not coexist with public, protected, or private. Please replace data with public.'); +} else if (!moduleOwn.data) { + moduleOwn.data = {}; + moduleOwn._descriptor = {}; + accessors.forEach(function(acc) { + var accType = typeof moduleOwn[acc]; + if (accType === 'object') { + moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); + for (var name in moduleOwn[acc]) { + moduleOwn._descriptor[name] = {access : acc}; + } + } else if (accType === 'function') { + console.warn('For VM objects, attribute ' + acc + ' value must not be a function. Change the value to an object.'); + } + }); +}} +/* generated by ace-loader */ + + +/***/ }), + +/***/ "./lib/script.js!./node_modules/babel-loader/lib/index.js?presets[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\preset-env&plugins[]=D:\\HM_SDK\\js\\2.1.1.21\\build-tools\\ace-loader\\node_modules\\@babel\\plugin-transform-modules-commonjs&comments=false!../../../../../DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.js": +/*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./lib/script.js!./node_modules/babel-loader/lib?presets[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/preset-env&plugins[]=D:/HM_SDK/js/2.1.1.21/build-tools/ace-loader/node_modules/@babel/plugin-transform-modules-commonjs&comments=false!D:/DevecostudioProjects/EasyCountDownTextureView1/entry/src/main/js/default/pages/show/show.js ***! + \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = function(module, exports, $app_require$){"use strict"; + +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js"); + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports["default"] = void 0; + +var _system = _interopRequireDefault($app_require$("@app-module/system.router")); + +var _default = { + data: { + time: { + hours: '6', + minutes: '6', + seconds: '26', + milliseconds: '0' + }, + width: '20px', + height: '20px', + spacing: '5px', + bgc: '#0000000', + color: '#ffffff', + weight: 900, + font: '12px' + }, + fanhui: function fanhui() { + _system["default"].replace({ + uri: 'pages/index/index' + }); + }, + onCountDownStart: function onCountDownStart() { + console.log(111); + } +}; +exports["default"] = _default; +var moduleOwn = exports.default || module.exports; +var accessors = ['public', 'protected', 'private']; +if (moduleOwn.data && accessors.some(function (acc) { + return moduleOwn[acc]; + })) { + throw new Error('For VM objects, attribute data must not coexist with public, protected, or private. Please replace data with public.'); +} else if (!moduleOwn.data) { + moduleOwn.data = {}; + moduleOwn._descriptor = {}; + accessors.forEach(function(acc) { + var accType = typeof moduleOwn[acc]; + if (accType === 'object') { + moduleOwn.data = Object.assign(moduleOwn.data, moduleOwn[acc]); + for (var name in moduleOwn[acc]) { + moduleOwn._descriptor[name] = {access : acc}; + } + } else if (accType === 'function') { + console.warn('For VM objects, attribute ' + acc + ' value must not be a function. Change the value to an object.'); + } + }); +}} +/* generated by ace-loader */ + + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/interopRequireDefault.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; +} + +module.exports = _interopRequireDefault; + +/***/ }), + +/***/ "./node_modules/@babel/runtime/helpers/newArrowCheck.js": +/*!**************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/newArrowCheck.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +function _newArrowCheck(innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +} + +module.exports = _newArrowCheck; + +/***/ }) + +/******/ }); \ No newline at end of file diff --git a/entry/.preview/jsManifest/default/manifest.json b/entry/.preview/jsManifest/default/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..d5ec75fc083287dd74257e04f6bce1484ebacd3d --- /dev/null +++ b/entry/.preview/jsManifest/default/manifest.json @@ -0,0 +1,22 @@ +{ + "appID": "com.gzb.ohos", + "appName": "$string:app_name", + "versionName": "1.0.0", + "versionCode": 1000000, + "minPlatformVersion": 5, + "pages": [ + "pages/index/index", + "pages/show/show", + "pages/setting/setting", + "pages/completed/completed" + ], + "deviceType": [ + "phone", + "tablet", + "wearable" + ], + "window": { + "designWidth": 720, + "autoDesignWidth": true + } +} \ No newline at end of file diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.css b/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.css new file mode 100644 index 0000000000000000000000000000000000000000..80534efd7ace5f43c787c3892a047c4f23cd778b --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.css @@ -0,0 +1,22 @@ +/* + * 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. + */ +.container { + display: flex; + flex-direction: column; + padding: 20px; +} +.container div{ + margin-bottom: 10px; +} \ No newline at end of file diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.hml b/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.hml new file mode 100644 index 0000000000000000000000000000000000000000..976ea41412f548881814b4f2fb72eaeaf0e9228a --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.hml @@ -0,0 +1,58 @@ + + + + +

+
+ +
+ +
+ +
+ +
diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.js b/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.js new file mode 100644 index 0000000000000000000000000000000000000000..807ea904a21ee49e4c88bedb0867a6aafdb13d86 --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/completed/completed.js @@ -0,0 +1,48 @@ +/* + * 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. + */ +import prompt from '@system.prompt'; +export default { + data: { + time:{ + hours:'0', + minutes:'0', + seconds:'6', + milliseconds:'0' + }, + time2:{ + hours:'0', + minutes:'0', + seconds:'12', + milliseconds:0 + }, + width:'28px', + height:'28px', + spacing:'8px', + bgc1:'#eeeeee', + bgc2:'#eedddd', + color:'#ff0000', + weight:500, + font:'18px' + }, + onInit(){ + }, + onCountDownCompleted(){ +// console.log('倒计时执行结束') + prompt.showToast({ + message: `[CompletedAbility] [onCountDownCompleted]`, + duration: 2000, + }); + } +} diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/index/index.css b/entry/.preview/merge_js_src/liteWearable/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..2a4e4e774a980493184b00ac564921f25360ccaa --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/index/index.css @@ -0,0 +1,30 @@ +/* + * 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. + */ +.container { + flex-direction: column; + padding-top: 10px; +} + +.title { + padding-left: 10px; + width: 100%; + font-size: 18px; + font-weight: 600; + line-height: 22px; + color: #33cc00; + border-bottom: 1px solid #ccc; + height: 50px; +} + diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/index/index.hml b/entry/.preview/merge_js_src/liteWearable/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..ed11ae6161d11d59abe3685b498686182fedcd35 --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/index/index.hml @@ -0,0 +1,27 @@ + +

+ + ShowAbility + + + + SettingAbility + + + + CompletedAbility + +
diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.css b/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.css new file mode 100644 index 0000000000000000000000000000000000000000..41b114926a90aaab93bdacf9dff9fb55f1280bae --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.css @@ -0,0 +1,75 @@ +/* + * 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. + */ +.container { + display: flex; + flex-direction: column; + justify-content: space-between; + flex-wrap:wrap; + padding: 20px; + height: 100%; +} + +.title { + font-size: 30px; + text-align: center; + width: 200px; + height: 100px; +} +.btn{ + position: absolute; + right: 10px; + top: 20px; + width: 60px; + height: 60px; +} +.btn-box{ +/* background-color: skyblue;*/ + height: 200px; + width: 300px; + display: flex; + flex-direction: column; +} +.btn1{ + flex: 1; + margin-bottom: 30px; + display: flex; + justify-content: space-between; + flex-wrap:wrap; +} +.btn2{ + flex: 1; + display: flex; + justify-content: space-between; + flex-wrap:wrap; +} +.btn1 text{ + padding: 10px; + background-color: #999; + font-size: 18px; + width: 90px; + text-align: center; + border-radius: 5px; + color: #000; +} +.btn2 text{ + flex: 1; + padding: 10px 20px; + background-color: #999; + font-size: 18px; + width: 90px; + text-align: center; + border-radius: 5px; + color: #000; +} \ No newline at end of file diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.hml b/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.hml new file mode 100644 index 0000000000000000000000000000000000000000..9cbe40ee87f1afc2654370eb8ccec2620eb7cb57 --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.hml @@ -0,0 +1,64 @@ + + + + +

+
+ +
+
+
+
+ + START + + + STOP + +
+
+ + H=01 + + + M=01 + + + S=01 + +
+
+
+ +
diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.js b/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.js new file mode 100644 index 0000000000000000000000000000000000000000..0394e54003c3d8501500b7c07abe7562b812c5d3 --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/setting/setting.js @@ -0,0 +1,58 @@ +/* + * 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. + */ +export default { + data: { + time:{ + hours:'26', + minutes:'6', + seconds:'26', + milliseconds:'0' + }, + flot:true, + width:'40px', + height:'40px', + spacing:'10px', + bgc:'#cccccc', + color:'#0099ff', + weight:500, + font:'20px' + }, + start(){ + if(this.$child('componter').flot){ + return + }else{ + this.$child('componter')['startAndRestoreTime']() + } + }, + stop(){ + if(!this.$child('componter').flot){ + return + }else{ + this.$child('componter')['stopAndRecordTime']() + } + }, + shi(num){ + this.$child('componter')['setTimeHour'](num) + }, + fen(num){ + this.$child('componter')['setTimeMinute'](num) + }, + miao(num){ + this.$child('componter')['setTimeSecond'](num) + }, + onCountDownStop(e){ + console.log(JSON.stringify(e)) + } +} diff --git a/entry/.preview/merge_js_src/liteWearable/default/pages/show/show.js b/entry/.preview/merge_js_src/liteWearable/default/pages/show/show.js new file mode 100644 index 0000000000000000000000000000000000000000..fcce8a656703164ac3ce36aa670de027de7462f3 --- /dev/null +++ b/entry/.preview/merge_js_src/liteWearable/default/pages/show/show.js @@ -0,0 +1,40 @@ +/* + * 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. + */ +import router from '@system.router' +export default { + data: { + time:{ + hours:'6', + minutes:'6', + seconds:'26', + milliseconds:'0' + }, + width:'20px', + height:'20px', + spacing:'5px', + bgc:'#0000000', + color:'#ffffff', + weight:900, + font:'12px' + }, + fanhui(){ + router.replace({ + uri: 'pages/index/index' + }); + }, + onCountDownStart(){ + console.log(111) + } +} diff --git a/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.css b/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.css new file mode 100644 index 0000000000000000000000000000000000000000..80534efd7ace5f43c787c3892a047c4f23cd778b --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.css @@ -0,0 +1,22 @@ +/* + * 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. + */ +.container { + display: flex; + flex-direction: column; + padding: 20px; +} +.container div{ + margin-bottom: 10px; +} \ No newline at end of file diff --git a/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.hml b/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.hml new file mode 100644 index 0000000000000000000000000000000000000000..976ea41412f548881814b4f2fb72eaeaf0e9228a --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.hml @@ -0,0 +1,58 @@ + + + + +

+
+ +
+ +
+ +
+ +
diff --git a/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.js b/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.js new file mode 100644 index 0000000000000000000000000000000000000000..807ea904a21ee49e4c88bedb0867a6aafdb13d86 --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/completed/completed.js @@ -0,0 +1,48 @@ +/* + * 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. + */ +import prompt from '@system.prompt'; +export default { + data: { + time:{ + hours:'0', + minutes:'0', + seconds:'6', + milliseconds:'0' + }, + time2:{ + hours:'0', + minutes:'0', + seconds:'12', + milliseconds:0 + }, + width:'28px', + height:'28px', + spacing:'8px', + bgc1:'#eeeeee', + bgc2:'#eedddd', + color:'#ff0000', + weight:500, + font:'18px' + }, + onInit(){ + }, + onCountDownCompleted(){ +// console.log('倒计时执行结束') + prompt.showToast({ + message: `[CompletedAbility] [onCountDownCompleted]`, + duration: 2000, + }); + } +} diff --git a/entry/.preview/merge_js_src/wearable/default/pages/index/index.css b/entry/.preview/merge_js_src/wearable/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..2a4e4e774a980493184b00ac564921f25360ccaa --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/index/index.css @@ -0,0 +1,30 @@ +/* + * 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. + */ +.container { + flex-direction: column; + padding-top: 10px; +} + +.title { + padding-left: 10px; + width: 100%; + font-size: 18px; + font-weight: 600; + line-height: 22px; + color: #33cc00; + border-bottom: 1px solid #ccc; + height: 50px; +} + diff --git a/entry/.preview/merge_js_src/wearable/default/pages/index/index.hml b/entry/.preview/merge_js_src/wearable/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..ed11ae6161d11d59abe3685b498686182fedcd35 --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/index/index.hml @@ -0,0 +1,27 @@ + +

+ + ShowAbility + + + + SettingAbility + + + + CompletedAbility + +
diff --git a/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.css b/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.css new file mode 100644 index 0000000000000000000000000000000000000000..41b114926a90aaab93bdacf9dff9fb55f1280bae --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.css @@ -0,0 +1,75 @@ +/* + * 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. + */ +.container { + display: flex; + flex-direction: column; + justify-content: space-between; + flex-wrap:wrap; + padding: 20px; + height: 100%; +} + +.title { + font-size: 30px; + text-align: center; + width: 200px; + height: 100px; +} +.btn{ + position: absolute; + right: 10px; + top: 20px; + width: 60px; + height: 60px; +} +.btn-box{ +/* background-color: skyblue;*/ + height: 200px; + width: 300px; + display: flex; + flex-direction: column; +} +.btn1{ + flex: 1; + margin-bottom: 30px; + display: flex; + justify-content: space-between; + flex-wrap:wrap; +} +.btn2{ + flex: 1; + display: flex; + justify-content: space-between; + flex-wrap:wrap; +} +.btn1 text{ + padding: 10px; + background-color: #999; + font-size: 18px; + width: 90px; + text-align: center; + border-radius: 5px; + color: #000; +} +.btn2 text{ + flex: 1; + padding: 10px 20px; + background-color: #999; + font-size: 18px; + width: 90px; + text-align: center; + border-radius: 5px; + color: #000; +} \ No newline at end of file diff --git a/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.hml b/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.hml new file mode 100644 index 0000000000000000000000000000000000000000..9cbe40ee87f1afc2654370eb8ccec2620eb7cb57 --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.hml @@ -0,0 +1,64 @@ + + + + +

+
+ +
+
+
+
+ + START + + + STOP + +
+
+ + H=01 + + + M=01 + + + S=01 + +
+
+
+ +
diff --git a/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.js b/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.js new file mode 100644 index 0000000000000000000000000000000000000000..0394e54003c3d8501500b7c07abe7562b812c5d3 --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/setting/setting.js @@ -0,0 +1,58 @@ +/* + * 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. + */ +export default { + data: { + time:{ + hours:'26', + minutes:'6', + seconds:'26', + milliseconds:'0' + }, + flot:true, + width:'40px', + height:'40px', + spacing:'10px', + bgc:'#cccccc', + color:'#0099ff', + weight:500, + font:'20px' + }, + start(){ + if(this.$child('componter').flot){ + return + }else{ + this.$child('componter')['startAndRestoreTime']() + } + }, + stop(){ + if(!this.$child('componter').flot){ + return + }else{ + this.$child('componter')['stopAndRecordTime']() + } + }, + shi(num){ + this.$child('componter')['setTimeHour'](num) + }, + fen(num){ + this.$child('componter')['setTimeMinute'](num) + }, + miao(num){ + this.$child('componter')['setTimeSecond'](num) + }, + onCountDownStop(e){ + console.log(JSON.stringify(e)) + } +} diff --git a/entry/.preview/merge_js_src/wearable/default/pages/show/show.js b/entry/.preview/merge_js_src/wearable/default/pages/show/show.js new file mode 100644 index 0000000000000000000000000000000000000000..fcce8a656703164ac3ce36aa670de027de7462f3 --- /dev/null +++ b/entry/.preview/merge_js_src/wearable/default/pages/show/show.js @@ -0,0 +1,40 @@ +/* + * 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. + */ +import router from '@system.router' +export default { + data: { + time:{ + hours:'6', + minutes:'6', + seconds:'26', + milliseconds:'0' + }, + width:'20px', + height:'20px', + spacing:'5px', + bgc:'#0000000', + color:'#ffffff', + weight:900, + font:'12px' + }, + fanhui(){ + router.replace({ + uri: 'pages/index/index' + }); + }, + onCountDownStart(){ + console.log(111) + } +} diff --git a/entry/build.gradle b/entry/build.gradle new file mode 100644 index 0000000000000000000000000000000000000000..8b7ec8312514680f078c1c7e1c74263431effc4b --- /dev/null +++ b/entry/build.gradle @@ -0,0 +1,27 @@ +apply plugin: 'com.huawei.ohos.hap' +apply plugin: 'com.huawei.ohos.decctest' +//For instructions on signature configuration, see https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ide_debug_device-0000001053822404#section1112183053510 +ohos { + compileSdkVersion 5 + defaultConfig { + compatibleSdkVersion 5 + } + buildTypes { + release { + proguardOpt { + proguardEnabled false + rulesFiles 'proguard-rules.pro' + } + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) + testImplementation 'junit:junit:4.13' + ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.200' +} +decc { + supportType = ['html','xml'] +} diff --git a/entry/package.json b/entry/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0967ef424bce6791893e9a57bb952f80fd536e93 --- /dev/null +++ b/entry/package.json @@ -0,0 +1 @@ +{} diff --git a/entry/proguard-rules.pro b/entry/proguard-rules.pro new file mode 100644 index 0000000000000000000000000000000000000000..f7666e47561d514b2a76d5a7dfbb43ede86da92a --- /dev/null +++ b/entry/proguard-rules.pro @@ -0,0 +1 @@ +# config module specific ProGuard rules here. \ No newline at end of file diff --git a/entry/src/main/config.json b/entry/src/main/config.json new file mode 100644 index 0000000000000000000000000000000000000000..f037410037c86973c5c13d4346a069d9256c1238 --- /dev/null +++ b/entry/src/main/config.json @@ -0,0 +1,63 @@ +{ + "app": { + "bundleName": "com.gzb.ohos", + "vendor": "example", + "version": { + "code": 1000000, + "name": "1.0.0" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.example.countdown", + "name": ".MyApplication", + "mainAbility": "com.example.countdown.MainAbility", + "deviceType": [ + "phone", + "tablet", + "wearable" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "orientation": "portrait", + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "name": "com.example.countdown.MainAbility", + "icon": "$media:icon", + "description": "$string:mainability_description", + "label": "$string:app_name", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/show/show", + "pages/setting/setting", + "pages/completed/completed" + ], + "name": "default", + "window": { + "designWidth": 720, + "autoDesignWidth": true + } + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/java/com/example/countdown/MainAbility.java b/entry/src/main/java/com/example/countdown/MainAbility.java new file mode 100644 index 0000000000000000000000000000000000000000..c166847f85062e19a1701f5b0420ecd78f5b7cff --- /dev/null +++ b/entry/src/main/java/com/example/countdown/MainAbility.java @@ -0,0 +1,36 @@ +/* + * 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.example.countdown; + +import ohos.ace.ability.AceAbility; +import ohos.aafwk.content.Intent; + +/** + * MainAbility + * + * @since 2021-08-10 + */ +public class MainAbility extends AceAbility { + @Override + public void onStart(Intent intent) { + super.onStart(intent); + } + + @Override + public void onStop() { + super.onStop(); + } +} diff --git a/entry/src/main/java/com/example/countdown/MyApplication.java b/entry/src/main/java/com/example/countdown/MyApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..c65ebac80c8b63f93f799e3b0e81592aef3350be --- /dev/null +++ b/entry/src/main/java/com/example/countdown/MyApplication.java @@ -0,0 +1,28 @@ +/* + * 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.example.countdown; + +import ohos.aafwk.ability.AbilityPackage; +/** + * MainAbility + * + * @since 2021-08-10 + */ +public class MyApplication extends AbilityPackage { + @Override + public void onInitialize() { + super.onInitialize(); + } +} diff --git a/entry/src/main/js/default/app.js b/entry/src/main/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..aedcefe0054c6e16c40491f4d1abc20a4dc1c6ef --- /dev/null +++ b/entry/src/main/js/default/app.js @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +}; diff --git a/entry/src/main/js/default/common/components/countdown/countdown.css b/entry/src/main/js/default/common/components/countdown/countdown.css new file mode 100644 index 0000000000000000000000000000000000000000..4c1cd9468385a45495027240adef69d82fe5fc06 --- /dev/null +++ b/entry/src/main/js/default/common/components/countdown/countdown.css @@ -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. + */ +.container { + width: 454px; +} + +.title { + border-radius: 5px; +} +.title text{ + width: 100%; + height: 100%; + text-align: center; +} +.dian{ + text-align: center; +} \ No newline at end of file diff --git a/entry/src/main/js/default/common/components/countdown/countdown.hml b/entry/src/main/js/default/common/components/countdown/countdown.hml new file mode 100644 index 0000000000000000000000000000000000000000..7a65d114eb178352e62b8fc73461d982a34c7a23 --- /dev/null +++ b/entry/src/main/js/default/common/components/countdown/countdown.hml @@ -0,0 +1,37 @@ + +

+
+ + {{hours<10?'0'+hours:hours}} + +
+ + : + +
+ + {{minutes<10?'0'+minutes:minutes}} + +
+ + : + +
+ + {{seconds<10?'0'+seconds:seconds}} + +
+
\ No newline at end of file diff --git a/entry/src/main/js/default/common/components/countdown/countdown.js b/entry/src/main/js/default/common/components/countdown/countdown.js new file mode 100644 index 0000000000000000000000000000000000000000..30a27416338eda2f8208a2ebcdef2079d2bf9614 --- /dev/null +++ b/entry/src/main/js/default/common/components/countdown/countdown.js @@ -0,0 +1,194 @@ +/* + * 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. + */ +export default { + data() { + return { + hours: this.hours, + minutes: this.minutes, + seconds: this.seconds, + milliseconds: this.milliseconds, + width: this.width, + height: this.height, + spacing: this.spacing, + flot: true, + color: this.color, + bgc: this.bgc, + weight: this.weight, + font: this.font, + } + }, + props: { + hours: { + default: 0, + }, + minutes: { + default: 0 + }, + seconds: { + default: 0 + }, + milliseconds: { + default: 0 + }, + width: { + default: '30px' + }, + height: { + default: '30px' + }, + spacing: { + default: '10px' + }, + color: { + default: '#fff' + }, + bgc: { + default: '#000' + }, + weight: { + default: 400 + }, + font: { + default: '20px' + } + }, + onReady() { + this.startAndRestoreTime() + if (this.milliseconds > 0) { + this.seconds = Math.floor(this.milliseconds / 1000) % 60 + this.minutes = Math.floor(this.milliseconds / 1000 / 60) % 60 + this.hours = Math.floor(this.milliseconds / 1000 / 60 / 60) + } else { + this.milliseconds = this.seconds * 1000 + this.minutes * 1000 * 60 + this.hours * 1000 * 60 * 60 + } + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60) + this.minutes = this.minutes - Math.floor(this.minutes / 60) * 60 + } + if (this.seconds <= 0) { + this.seconds = 0 + } else if (this.seconds > 60) { + this.minutes = this.minutes + Math.floor(this.seconds / 60) + this.seconds = this.seconds % 60 + } + }, + //设置小时的函数 + setTimeHour(h) { + if (h < 0) { + this.hours = 0 + } else { + this.hours = h + } + }, + //设置分钟数 + setTimeMinute(m) { + // this.minutes=m + if (m > 60) { + this.hours = Number(this.hours) + Math.floor(m / 60) + this.minutes = this.minutes + m % 60 + } else if (m <= 0) { + this.minutes = 0 + } else { + this.minutes = m + } + }, + //设置秒数 + setTimeSecond(s) { + if (s > 60) { + this.minutes = Number(this.minutes) + Math.floor(s / 60) + this.seconds = this.seconds + s % 60 + } else if (s <= 0) { + this.seconds = 0 + } else { + this.seconds = s + } + if (this.seconds > 60) { + this.minutes = Number(this.minutes) + Math.floor(this.seconds / 60) + this.seconds = this.seconds % 60 + } + if (this.minutes > 60) { + this.hours = Number(this.hours) + Math.floor(this.minutes / 60) + this.minutes = this.minutes % 60 + } + }, + //设置毫秒数 + setTime(timeMillis) { + if (timeMillis > 0) { + this.seconds = Math.floor(timeMillis / 1000) % 60 + this.minutes = Math.floor(timeMillis / 1000 / 60) % 60 + this.hours = Math.floor(this.timeMillis / 1000 / 60 / 60) + } else { + return + } + }, + //开始倒计时 + startAndRestoreTime() { + this.flot = true + this.$emit('onCountDownStart') + this.timer = setInterval(() => { + //当小时,分钟,秒钟,三者有一个大于等于零的时候 + if (this.hours >= 0 || this.minutes >= 0 || this.seconds >= 0) { + //判断他们三个全部都等于0 退出 + if (this.hours == 0 && this.minutes == 0 && this.seconds == 0) { + this.$emit('onCountDownCompleted') + this.flot = false + clearInterval(this.timer) + } else { + //当他们三个有一个不为0的时候 + if (this.seconds > 0) { + //如果秒钟大于0的时候让他自身减1 + this.seconds = Number(this.seconds) - 1 + } else { + //当秒钟等于0的时候,并且分钟不为零的时候 + if (this.minutes > 0) { + //分钟不为0让分钟减1 + this.minutes = Number(this.minutes) - 1 + } else { + //分钟为0的时候 + if (this.hours > 0) { + //小时数大于0的时候让他减1 + this.hours = Number(this.hours) - 1 + } else { + //三个数值都为零 + this.$emit('onCountDownCompleted') + this.flot = false + clearInterval(this.timer) + } + this.minutes = 59 + } + this.seconds = 59 + } + } + } else { + //当时间有任意一个小于0的时候报错 + this.flot = false + this.$emit('onCountDownTimeError') + clearInterval(this.timer) + } + }, 1000) + }, + //停止倒计时 + stopAndRecordTime() { + this.$emit('onCountDownStop', { + 'millisInFuture': this.milliseconds + }) + this.flot = false + clearInterval(this.timer) + }, + //倒计时是否结束 + isRunningState() { + return this.flot + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/common/images/Wallpaper.png b/entry/src/main/js/default/common/images/Wallpaper.png new file mode 100644 index 0000000000000000000000000000000000000000..60d4841a80eb20c63de74306cb7f8350d6a85c48 Binary files /dev/null and b/entry/src/main/js/default/common/images/Wallpaper.png differ diff --git a/entry/src/main/js/default/common/images/a.png b/entry/src/main/js/default/common/images/a.png new file mode 100644 index 0000000000000000000000000000000000000000..f64c942db7a213ad81401de930d56e74d3003cbf Binary files /dev/null and b/entry/src/main/js/default/common/images/a.png differ diff --git a/entry/src/main/js/default/common/images/bg-tv.jpg b/entry/src/main/js/default/common/images/bg-tv.jpg new file mode 100644 index 0000000000000000000000000000000000000000..86fc07358eea5c1474bc833fca07c6d4d8698a89 Binary files /dev/null and b/entry/src/main/js/default/common/images/bg-tv.jpg differ diff --git a/entry/src/main/js/default/i18n/en-US.json b/entry/src/main/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c --- /dev/null +++ b/entry/src/main/js/default/i18n/en-US.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/i18n/zh-CN.json b/entry/src/main/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f --- /dev/null +++ b/entry/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,6 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + } +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/completed/completed.css b/entry/src/main/js/default/pages/completed/completed.css new file mode 100644 index 0000000000000000000000000000000000000000..80534efd7ace5f43c787c3892a047c4f23cd778b --- /dev/null +++ b/entry/src/main/js/default/pages/completed/completed.css @@ -0,0 +1,22 @@ +/* + * 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. + */ +.container { + display: flex; + flex-direction: column; + padding: 20px; +} +.container div{ + margin-bottom: 10px; +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/completed/completed.hml b/entry/src/main/js/default/pages/completed/completed.hml new file mode 100644 index 0000000000000000000000000000000000000000..976ea41412f548881814b4f2fb72eaeaf0e9228a --- /dev/null +++ b/entry/src/main/js/default/pages/completed/completed.hml @@ -0,0 +1,58 @@ + + + + +

+
+ +
+ +
+ +
+ +
diff --git a/entry/src/main/js/default/pages/completed/completed.js b/entry/src/main/js/default/pages/completed/completed.js new file mode 100644 index 0000000000000000000000000000000000000000..807ea904a21ee49e4c88bedb0867a6aafdb13d86 --- /dev/null +++ b/entry/src/main/js/default/pages/completed/completed.js @@ -0,0 +1,48 @@ +/* + * 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. + */ +import prompt from '@system.prompt'; +export default { + data: { + time:{ + hours:'0', + minutes:'0', + seconds:'6', + milliseconds:'0' + }, + time2:{ + hours:'0', + minutes:'0', + seconds:'12', + milliseconds:0 + }, + width:'28px', + height:'28px', + spacing:'8px', + bgc1:'#eeeeee', + bgc2:'#eedddd', + color:'#ff0000', + weight:500, + font:'18px' + }, + onInit(){ + }, + onCountDownCompleted(){ +// console.log('倒计时执行结束') + prompt.showToast({ + message: `[CompletedAbility] [onCountDownCompleted]`, + duration: 2000, + }); + } +} diff --git a/entry/src/main/js/default/pages/index/index.css b/entry/src/main/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..2a4e4e774a980493184b00ac564921f25360ccaa --- /dev/null +++ b/entry/src/main/js/default/pages/index/index.css @@ -0,0 +1,30 @@ +/* + * 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. + */ +.container { + flex-direction: column; + padding-top: 10px; +} + +.title { + padding-left: 10px; + width: 100%; + font-size: 18px; + font-weight: 600; + line-height: 22px; + color: #33cc00; + border-bottom: 1px solid #ccc; + height: 50px; +} + diff --git a/entry/src/main/js/default/pages/index/index.hml b/entry/src/main/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..ed11ae6161d11d59abe3685b498686182fedcd35 --- /dev/null +++ b/entry/src/main/js/default/pages/index/index.hml @@ -0,0 +1,27 @@ + +

+ + ShowAbility + + + + SettingAbility + + + + CompletedAbility + +
diff --git a/entry/src/main/js/default/pages/index/index.js b/entry/src/main/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..9952246f5e63b7251f7030b5fd581fa815c67f9c --- /dev/null +++ b/entry/src/main/js/default/pages/index/index.js @@ -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. + */ +import router from '@system.router' +export default { + data: { + title: "" + }, + onCreate() { + this.title = this.$t('strings.world'); + + }, + push(url){ + router.push({ + uri:`pages/${url}/${url}` + }) + } +} diff --git a/entry/src/main/js/default/pages/setting/setting.css b/entry/src/main/js/default/pages/setting/setting.css new file mode 100644 index 0000000000000000000000000000000000000000..41b114926a90aaab93bdacf9dff9fb55f1280bae --- /dev/null +++ b/entry/src/main/js/default/pages/setting/setting.css @@ -0,0 +1,75 @@ +/* + * 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. + */ +.container { + display: flex; + flex-direction: column; + justify-content: space-between; + flex-wrap:wrap; + padding: 20px; + height: 100%; +} + +.title { + font-size: 30px; + text-align: center; + width: 200px; + height: 100px; +} +.btn{ + position: absolute; + right: 10px; + top: 20px; + width: 60px; + height: 60px; +} +.btn-box{ +/* background-color: skyblue;*/ + height: 200px; + width: 300px; + display: flex; + flex-direction: column; +} +.btn1{ + flex: 1; + margin-bottom: 30px; + display: flex; + justify-content: space-between; + flex-wrap:wrap; +} +.btn2{ + flex: 1; + display: flex; + justify-content: space-between; + flex-wrap:wrap; +} +.btn1 text{ + padding: 10px; + background-color: #999; + font-size: 18px; + width: 90px; + text-align: center; + border-radius: 5px; + color: #000; +} +.btn2 text{ + flex: 1; + padding: 10px 20px; + background-color: #999; + font-size: 18px; + width: 90px; + text-align: center; + border-radius: 5px; + color: #000; +} \ No newline at end of file diff --git a/entry/src/main/js/default/pages/setting/setting.hml b/entry/src/main/js/default/pages/setting/setting.hml new file mode 100644 index 0000000000000000000000000000000000000000..9cbe40ee87f1afc2654370eb8ccec2620eb7cb57 --- /dev/null +++ b/entry/src/main/js/default/pages/setting/setting.hml @@ -0,0 +1,64 @@ + + + + +

+
+ +
+
+
+
+ + START + + + STOP + +
+
+ + H=01 + + + M=01 + + + S=01 + +
+
+
+ +
diff --git a/entry/src/main/js/default/pages/setting/setting.js b/entry/src/main/js/default/pages/setting/setting.js new file mode 100644 index 0000000000000000000000000000000000000000..0394e54003c3d8501500b7c07abe7562b812c5d3 --- /dev/null +++ b/entry/src/main/js/default/pages/setting/setting.js @@ -0,0 +1,58 @@ +/* + * 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. + */ +export default { + data: { + time:{ + hours:'26', + minutes:'6', + seconds:'26', + milliseconds:'0' + }, + flot:true, + width:'40px', + height:'40px', + spacing:'10px', + bgc:'#cccccc', + color:'#0099ff', + weight:500, + font:'20px' + }, + start(){ + if(this.$child('componter').flot){ + return + }else{ + this.$child('componter')['startAndRestoreTime']() + } + }, + stop(){ + if(!this.$child('componter').flot){ + return + }else{ + this.$child('componter')['stopAndRecordTime']() + } + }, + shi(num){ + this.$child('componter')['setTimeHour'](num) + }, + fen(num){ + this.$child('componter')['setTimeMinute'](num) + }, + miao(num){ + this.$child('componter')['setTimeSecond'](num) + }, + onCountDownStop(e){ + console.log(JSON.stringify(e)) + } +} diff --git a/entry/src/main/js/default/pages/show/show.css b/entry/src/main/js/default/pages/show/show.css new file mode 100644 index 0000000000000000000000000000000000000000..df3486bf25b4487d600b69a762e310af3dcd2cc8 --- /dev/null +++ b/entry/src/main/js/default/pages/show/show.css @@ -0,0 +1,40 @@ +/* + * 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. + */ +.container { + width: 454px; +/* height: 80px;*/ + padding: 20px 10px; + position: relative; + display: flex; + flex-direction: column; +} + +.btn{ + position: absolute; + right: 10px; + top: 20px; + width: 60px; + height: 60px; +} +image{ + + width: 300px; +/* border: 1px solid #222;*/ +} +/*.zujian{*/ +/* position: absolute;*/ +/* top: 20px;*/ +/* left: 10px;*/ +/*}*/ \ No newline at end of file diff --git a/entry/src/main/js/default/pages/show/show.hml b/entry/src/main/js/default/pages/show/show.hml new file mode 100644 index 0000000000000000000000000000000000000000..63d96ef9f267a0cff7ce95c117b2391deccd0db4 --- /dev/null +++ b/entry/src/main/js/default/pages/show/show.hml @@ -0,0 +1,34 @@ + + + +

+ + + + + +
diff --git a/entry/src/main/js/default/pages/show/show.js b/entry/src/main/js/default/pages/show/show.js new file mode 100644 index 0000000000000000000000000000000000000000..fcce8a656703164ac3ce36aa670de027de7462f3 --- /dev/null +++ b/entry/src/main/js/default/pages/show/show.js @@ -0,0 +1,40 @@ +/* + * 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. + */ +import router from '@system.router' +export default { + data: { + time:{ + hours:'6', + minutes:'6', + seconds:'26', + milliseconds:'0' + }, + width:'20px', + height:'20px', + spacing:'5px', + bgc:'#0000000', + color:'#ffffff', + weight:900, + font:'12px' + }, + fanhui(){ + router.replace({ + uri: 'pages/index/index' + }); + }, + onCountDownStart(){ + console.log(111) + } +} 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..94f3052d4a238d74b5d811073cd7a89eafa46693 --- /dev/null +++ b/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "mainability_description", + "value": "JS_Empty Ability" + }, + { + "name": "app_name", + "value": "EasyCountDownTextureView" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/base/media/icon.png b/entry/src/main/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/entry/src/main/resources/base/media/icon.png differ diff --git a/entry/src/ohosTest/java/com/example/countdown/ExampleOhosTest.java b/entry/src/ohosTest/java/com/example/countdown/ExampleOhosTest.java new file mode 100644 index 0000000000000000000000000000000000000000..40e04d5e62d9892b0b8794cc8eddcf8f82b7a5c3 --- /dev/null +++ b/entry/src/ohosTest/java/com/example/countdown/ExampleOhosTest.java @@ -0,0 +1,14 @@ +package com.example.countdown; + +import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ExampleOhosTest { + @Test + public void testBundleName() { + final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); + assertEquals("com.example.countdown", actualBundleName); + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/js/default/app.js b/entry/src/ohosTest/js/default/app.js new file mode 100644 index 0000000000000000000000000000000000000000..55b67e96deb821033f71d30b6fff05efdeb0d901 --- /dev/null +++ b/entry/src/ohosTest/js/default/app.js @@ -0,0 +1,8 @@ +export default { + onCreate() { + console.info('TestApplication onCreate'); + }, + onDestroy() { + console.info('TestApplication onDestroy'); + } +}; diff --git a/entry/src/ohosTest/js/default/i18n/en-US.json b/entry/src/ohosTest/js/default/i18n/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..55561b83737c3c31d082fbfa11e5fc987a351104 --- /dev/null +++ b/entry/src/ohosTest/js/default/i18n/en-US.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "Hello", + "world": "World" + }, + "Files": { + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/js/default/i18n/zh-CN.json b/entry/src/ohosTest/js/default/i18n/zh-CN.json new file mode 100644 index 0000000000000000000000000000000000000000..cce1af06761a42add0cac1a0567aa3237eda8cb4 --- /dev/null +++ b/entry/src/ohosTest/js/default/i18n/zh-CN.json @@ -0,0 +1,8 @@ +{ + "strings": { + "hello": "您好", + "world": "世界" + }, + "Files": { + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/js/default/pages/index/index.css b/entry/src/ohosTest/js/default/pages/index/index.css new file mode 100644 index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf --- /dev/null +++ b/entry/src/ohosTest/js/default/pages/index/index.css @@ -0,0 +1,9 @@ +.container { + flex-direction: column; + justify-content: center; + align-items: center; +} + +.title { + font-size: 100px; +} diff --git a/entry/src/ohosTest/js/default/pages/index/index.hml b/entry/src/ohosTest/js/default/pages/index/index.hml new file mode 100644 index 0000000000000000000000000000000000000000..f64b040a5ae394dbaa5e185e1ecd4f4556b92184 --- /dev/null +++ b/entry/src/ohosTest/js/default/pages/index/index.hml @@ -0,0 +1,5 @@ +

+ + {{ $t('strings.hello') }} {{ title }} + +
diff --git a/entry/src/ohosTest/js/default/pages/index/index.js b/entry/src/ohosTest/js/default/pages/index/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8be2df2479a8da755ed800ad70d2b6247e21b8a2 --- /dev/null +++ b/entry/src/ohosTest/js/default/pages/index/index.js @@ -0,0 +1,41 @@ +import file from '@system.file' +import app from '@system.app' +import device from '@system.device' +import router from '@system.router' +import {Core, Constant, ExpectExtend, ReportExtend, InstrumentLog} from 'deccjsunit/index' + +export default { + data: { + title: "" + }, + onInit() { + this.title = this.$t('strings.world'); + }, + onShow() { + console.info('onShow finish') + const core = Core.getInstance() + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }) + const reportExtend = new ReportExtend(file) + const instrumentLog = new InstrumentLog({ + 'id': 'report', + 'version': '1.0.3' + }) + core.addService('expect', expectExtend) + core.addService('report', reportExtend) + core.addService('report', instrumentLog) + core.init() + core.subscribeEvent('spec', instrumentLog) + core.subscribeEvent('suite', instrumentLog) + core.subscribeEvent('task', instrumentLog) + + const configService = core.getDefaultService('config') + configService.setConfig(this) + + require('../../../test/List.test') + core.execute() + }, + onReady() { + }, +} \ No newline at end of file diff --git a/entry/src/ohosTest/js/test/ExampleJsunit.test.js b/entry/src/ohosTest/js/test/ExampleJsunit.test.js new file mode 100644 index 0000000000000000000000000000000000000000..b6d74caed96ddede98edd1bc9292f6568cd1cfd1 --- /dev/null +++ b/entry/src/ohosTest/js/test/ExampleJsunit.test.js @@ -0,0 +1,10 @@ +import app from '@system.app' +import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' + +describe('appInfoTest', function () { + it('app_info_test_001', 0, function () { + var info = app.getInfo() + expect(info.versionName).assertEqual('1.0') + expect(info.versionCode).assertEqual('3') + }) +}) \ No newline at end of file diff --git a/entry/src/ohosTest/js/test/List.test.js b/entry/src/ohosTest/js/test/List.test.js new file mode 100644 index 0000000000000000000000000000000000000000..305eb5bb254cd4802afaffebe68fca2f9436159f --- /dev/null +++ b/entry/src/ohosTest/js/test/List.test.js @@ -0,0 +1 @@ +require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/string.json b/entry/src/ohosTest/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..8d49422e480969d900788a82b599761f21b4840f --- /dev/null +++ b/entry/src/ohosTest/resources/base/element/string.json @@ -0,0 +1,12 @@ +{ + "string": [ + { + "name": "app_name", + "value": "countdown" + }, + { + "name": "mainability_description", + "value": "hap sample empty page" + } + ] +} diff --git a/entry/src/ohosTest/resources/base/media/icon.png b/entry/src/ohosTest/resources/base/media/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c Binary files /dev/null and b/entry/src/ohosTest/resources/base/media/icon.png differ diff --git a/gradle.properties b/gradle.properties index 1d3591c8a4c9c29578c36c87f80c05a6aea3ee3f..be492496f9a20ac2d980ef4fc30061f4184c1c40 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,18 +1,13 @@ # Project-wide Gradle settings. - -# IDE (e.g. Android Studio) users: +# IDE (e.g. DevEco Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. - # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html - # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -# Default value: -Xmx10248m -XX:MaxPermSize=256m -# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 - -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true \ No newline at end of file +# If the Chinese output is garbled, please configure the following parameter. +# This function is enabled by default when the DevEco Studio builds the hap/app,if you need disable gradle parallel,you should set org.gradle.parallel false. +# more information see https://docs.gradle.org/current/userguide/performance.html +# org.gradle.parallel=false +# org.gradle.jvmargs=-Dfile.encoding=GBK \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 13372aef5e24af05341d49695ee84e5f9b594659..490fda8577df6c95960ba7077c43220e5bb2c0d9 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 356d66bd14cb40c9617e32ffc9850a6bc4283e69..f59159e865d4b59feb1b8c44b001f62fc5d58df4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Mon Nov 07 23:04:46 CST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://repo.huaweicloud.com/gradle/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip diff --git a/gradlew b/gradlew index 9d82f78915133e1c35a6ea51252590fb38efac2f..2fe81a7d95e4f9ad2c9b2a046707d36ceb3980b3 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# 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 +# +# https://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. +# ############################################################################## ## @@ -6,20 +22,38 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null APP_NAME="Gradle" APP_BASE_NAME=`basename "$0"` +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD="maximum" -warn ( ) { +warn () { echo "$*" } -die ( ) { +die () { echo echo "$*" echo @@ -30,6 +64,7 @@ die ( ) { cygwin=false msys=false darwin=false +nonstop=false case "`uname`" in CYGWIN* ) cygwin=true @@ -40,26 +75,11 @@ case "`uname`" in MINGW* ) msys=true ;; + NONSTOP* ) + nonstop=true + ;; esac -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar # Determine the Java command to use to start the JVM. @@ -85,7 +105,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -105,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` @@ -134,27 +154,30 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 8a0b282aa6885fb573c106b3551f7275c5f17e8e..62bd9b9ccefea2b65ae41e5d9a545e2021b90a1d 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -8,14 +24,17 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome @@ -46,10 +65,9 @@ echo location of your Java installation. goto fail :init -@rem Get command-line arguments, handling Windowz variants +@rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +78,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/img/demo.gif b/img/demo.gif new file mode 100644 index 0000000000000000000000000000000000000000..2978b8da0dbe376591b979564ea0b255872c6821 Binary files /dev/null and b/img/demo.gif differ diff --git a/samples/.gitignore b/samples/.gitignore deleted file mode 100644 index 3543521e9fef8e7322940a87c2b45dd0061b0f45..0000000000000000000000000000000000000000 --- a/samples/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/samples/build.gradle b/samples/build.gradle deleted file mode 100644 index 111cebe827beed1ca88627fd6e5a7eab74862ce7..0000000000000000000000000000000000000000 --- a/samples/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 23 - buildToolsVersion "23.0.2" - - defaultConfig { - applicationId "com.camnter.easycountdowntextureview.demo" - minSdkVersion 14 - targetSdkVersion 23 - versionCode 1 - versionName "1.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.2.0' - compile 'com.camnter.easyrecyclerview:easyrecyclerview:1.2' - compile project(':easycountdowntextureview') - // compile 'com.camnter.easycountdowntextureview:easycountdowntextureview:1.4' -} diff --git a/samples/proguard-rules.pro b/samples/proguard-rules.pro deleted file mode 100644 index b2aacdf6b04f88352f995a4f39d40226c22d981c..0000000000000000000000000000000000000000 --- a/samples/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/CaMnter/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/samples/src/main/AndroidManifest.xml b/samples/src/main/AndroidManifest.xml deleted file mode 100644 index 1d3e72a123fd1734f55be03e73a787c96391e597..0000000000000000000000000000000000000000 --- a/samples/src/main/AndroidManifest.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/CompletedActivity.java b/samples/src/main/java/com/camnter/easycountdowntextureview/demo/CompletedActivity.java deleted file mode 100644 index 46257517aae82131dc9b0fdd4ce275bcae907c06..0000000000000000000000000000000000000000 --- a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/CompletedActivity.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.camnter.easycountdowntextureview.demo; - -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; -import android.widget.Toast; -import com.camnter.easycountdowntextureview.EasyCountDownTextureView; - -/** - * Description:CompletedActivity - * Created by:CaMnter - */ - -public class CompletedActivity extends AppCompatActivity - implements EasyCountDownTextureView.EasyCountDownListener { - - private static final long WHITE_DURATION_TIME = 6 * 1000; - private static final long YELLOW_DURATION_TIME = 12 * 1000; - private static final String TAG = CompletedActivity.class.getSimpleName(); - - - @Override protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - this.setContentView(R.layout.activity_completed); - EasyCountDownTextureView whiteCountDownTextureView - = (EasyCountDownTextureView) this.findViewById(R.id.completed_white_countdown_text); - whiteCountDownTextureView.setTime(WHITE_DURATION_TIME); - whiteCountDownTextureView.setEasyCountDownListener(this); - whiteCountDownTextureView.start(); - - EasyCountDownTextureView yellowCountDownTextureView - = (EasyCountDownTextureView) this.findViewById(R.id.completed_yellow_countdown_text); - yellowCountDownTextureView.setTime(YELLOW_DURATION_TIME); - yellowCountDownTextureView.setEasyCountDownListener(this); - yellowCountDownTextureView.start(); - } - - - /** - * When count down start - */ - @Override public void onCountDownStart() { - - } - - - /** - * When count down time error - */ - @Override public void onCountDownTimeError() { - - } - - - /** - * When count down stop - * - * @param millisInFuture millisInFuture - */ - @Override public void onCountDownStop(long millisInFuture) { - - } - - - /** - * When count down completed - */ - @Override public void onCountDownCompleted() { - Toast.makeText(this, "[" + TAG + "] [onCountDownCompleted]", Toast.LENGTH_LONG).show(); - } - -} diff --git a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/MainActivity.java b/samples/src/main/java/com/camnter/easycountdowntextureview/demo/MainActivity.java deleted file mode 100644 index ad4e9b9e265aa9554daea60f14a90d9322904898..0000000000000000000000000000000000000000 --- a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/MainActivity.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.camnter.easycountdowntextureview.demo; - -import android.content.Intent; -import android.os.Bundle; -import android.support.v7.app.AppCompatActivity; -import android.view.View; -import com.camnter.easycountdowntextureview.demo.adapter.MainAdapter; -import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; -import com.camnter.easyrecyclerview.widget.EasyRecyclerView; -import com.camnter.easyrecyclerview.widget.decorator.EasyDividerItemDecoration; -import java.util.ArrayList; - -public class MainActivity extends AppCompatActivity { - - private EasyRecyclerView mainRecyclerView; - private MainAdapter mainAdapter; - private ArrayList classes; - - - @Override protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - this.initViews(); - this.initData(); - this.initListeners(); - } - - - private void initViews() { - this.mainRecyclerView = (EasyRecyclerView) this.findViewById(R.id.main_rv); - EasyDividerItemDecoration decoration = new EasyDividerItemDecoration(this, - EasyDividerItemDecoration.VERTICAL_LIST); - decoration.bottomDivider = true; - this.mainRecyclerView.addItemDecoration(decoration); - } - - - private void initData() { - this.classes = new ArrayList<>(); - this.classes.add(ShowActivity.class); - this.classes.add(SettingActivity.class); - this.classes.add(CompletedActivity.class); - - this.mainAdapter = new MainAdapter(); - this.mainAdapter.setList(this.classes); - this.mainRecyclerView.setAdapter(this.mainAdapter); - } - - - private void initListeners() { - this.mainAdapter.setOnItemClickListener(new EasyRecyclerViewHolder.OnItemClickListener() { - @Override public void onItemClick(View view, int i) { - Class c = MainActivity.this.classes.get(i); - MainActivity.this.startActivity(new Intent(MainActivity.this, c)); - } - }); - } - -} diff --git a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/SettingActivity.java b/samples/src/main/java/com/camnter/easycountdowntextureview/demo/SettingActivity.java deleted file mode 100644 index b59e7c794794f276afddca79087643919a232cab..0000000000000000000000000000000000000000 --- a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/SettingActivity.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.camnter.easycountdowntextureview.demo; - -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; -import android.util.Log; -import android.view.View; -import com.camnter.easycountdowntextureview.EasyCountDownTextureView; - -/** - * Description:SettingActivity - * Created by:CaMnter - * Time:2016-03-17 17:20 - */ -public class SettingActivity extends AppCompatActivity - implements View.OnClickListener, EasyCountDownTextureView.EasyCountDownListener { - - private static final String TAG = "StyleActivity"; - private EasyCountDownTextureView countdownText; - - - @Override protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - this.setContentView(R.layout.activity_setting); - this.countdownText = (EasyCountDownTextureView) this.findViewById( - R.id.setting_countdown_text); - this.findViewById(R.id.setting_hour_button).setOnClickListener(this); - this.findViewById(R.id.setting_minute_button).setOnClickListener(this); - this.findViewById(R.id.setting_second_button).setOnClickListener(this); - this.findViewById(R.id.setting_start_button).setOnClickListener(this); - this.findViewById(R.id.setting_stop_button).setOnClickListener(this); - this.countdownText.setEasyCountDownListener(this); - } - - - /** - * Called when a view has been clicked. - * - * @param v The view that was clicked. - */ - @Override public void onClick(View v) { - switch (v.getId()) { - case R.id.setting_hour_button: - this.countdownText.setTimeHour(1); - break; - case R.id.setting_minute_button: - this.countdownText.setTimeMinute(1); - break; - case R.id.setting_second_button: - this.countdownText.setTimeSecond(1); - break; - case R.id.setting_start_button: - this.countdownText.start(); - break; - case R.id.setting_stop_button: - this.countdownText.stop(); - break; - } - } - - - /** - * When count down start - */ - @Override public void onCountDownStart() { - Log.i(TAG, "[" + TAG + "] [onCountDownStart]"); - } - - - /** - * When count down time error - */ - @Override public void onCountDownTimeError() { - - } - - - /** - * When count down stop - * - * @param millisInFuture millisInFuture - */ - @Override public void onCountDownStop(long millisInFuture) { - Log.i(TAG, "[" + TAG + "] [onCountDownStop]"); - } - - - /** - * When count down completed - */ - @Override public void onCountDownCompleted() { - - } - -} diff --git a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/ShowActivity.java b/samples/src/main/java/com/camnter/easycountdowntextureview/demo/ShowActivity.java deleted file mode 100644 index 8327a2efc662b101f42f52d05b598643b8f61293..0000000000000000000000000000000000000000 --- a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/ShowActivity.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.camnter.easycountdowntextureview.demo; - -import android.os.Bundle; -import android.support.annotation.Nullable; -import android.support.v7.app.AppCompatActivity; - -/** - * Description:ShowActivity - * Created by:CaMnter - * Time:2016-03-18 13:28 - */ -public class ShowActivity extends AppCompatActivity { - - @Override protected void onCreate(@Nullable Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - this.setContentView(R.layout.activity_show); - } - -} diff --git a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/adapter/MainAdapter.java b/samples/src/main/java/com/camnter/easycountdowntextureview/demo/adapter/MainAdapter.java deleted file mode 100644 index 2c2ea9ba11f37426e5480144dbebde6256715bff..0000000000000000000000000000000000000000 --- a/samples/src/main/java/com/camnter/easycountdowntextureview/demo/adapter/MainAdapter.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.camnter.easycountdowntextureview.demo.adapter; - -import android.widget.TextView; -import com.camnter.easycountdowntextureview.demo.R; -import com.camnter.easyrecyclerview.adapter.EasyRecyclerViewAdapter; -import com.camnter.easyrecyclerview.holder.EasyRecyclerViewHolder; - -/** - * Description:MainAdapter - * Created by:CaMnter - * Time:2016-03-18 13:21 - */ -public class MainAdapter extends EasyRecyclerViewAdapter { - - @Override public int[] getItemLayouts() { - return new int[] { R.layout.item_main }; - } - - - @Override public void onBindRecycleViewHolder(EasyRecyclerViewHolder viewHolder, int position) { - Class c = (Class) this.getList().get(position); - if (c == null) return; - TextView textView = viewHolder.findViewById(R.id.main_item_tv); - textView.setText(c.getSimpleName()); - } - - - @Override public int getRecycleViewItemType(int position) { - return 0; - } -} diff --git a/samples/src/main/res/layout/activity_completed.xml b/samples/src/main/res/layout/activity_completed.xml deleted file mode 100644 index 8ab8f3f10650f03f2773d9316ef7a71eea78a61f..0000000000000000000000000000000000000000 --- a/samples/src/main/res/layout/activity_completed.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/samples/src/main/res/layout/activity_main.xml b/samples/src/main/res/layout/activity_main.xml deleted file mode 100644 index 0e1e7e95be75237b825245c29999863db7ecea56..0000000000000000000000000000000000000000 --- a/samples/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - diff --git a/samples/src/main/res/layout/activity_setting.xml b/samples/src/main/res/layout/activity_setting.xml deleted file mode 100644 index be3c06792bae6314d431b20368f21e6577cf9d75..0000000000000000000000000000000000000000 --- a/samples/src/main/res/layout/activity_setting.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - - - -