-
-
-
- {{$item.colorName}}
-
-
-
+
+
+
+ {{ $item.colorName }}
+
+
+
-
- Apply Background Color
-
-
-
Clear Preferences
+
+ {{ $t('Strings.apply_background_color') }}
+
+
+ {{ $t('Strings.clear_preferences') }}
diff --git a/ability/Preferences/entry/src/main/js/default/pages/main/main.js b/data/Preferences/entry/src/main/js/default/pages/main/main.js
similarity index 90%
rename from ability/Preferences/entry/src/main/js/default/pages/main/main.js
rename to data/Preferences/entry/src/main/js/default/pages/main/main.js
index a78c63ed5603ec25984237da622390c3f9258b3b..cd7fe330e8dc7d47c0d532ffcf89c95d753817c5 100644
--- a/ability/Preferences/entry/src/main/js/default/pages/main/main.js
+++ b/data/Preferences/entry/src/main/js/default/pages/main/main.js
@@ -14,7 +14,6 @@
*/
import prompt from "@system.prompt";
-import router from "@system.router";
const injectRef = Object.getPrototypeOf(global) || global;
@@ -27,27 +26,27 @@ export default {
tempVar: true,
colorsList: [
{
- colorName: "Red",
+ colorName: "",
backgroundcolor: "#ff6666",
textColor: "#ff0000"
},
{
- colorName: "Green",
+ colorName: "",
backgroundcolor: "#c1ff80",
textColor: "#336600"
},
{
- colorName: "Blue",
+ colorName: "",
backgroundcolor: "#9999ff",
textColor: "#1a1aff"
},
{
- colorName: "Pink",
+ colorName: "",
backgroundcolor: "#ff99ff",
textColor: "#e600e6"
},
{
- colorName: "Orange",
+ colorName: "",
backgroundcolor: "#ffcc80",
textColor: "#ff9900"
}
@@ -55,6 +54,10 @@ export default {
},
onInit() {
var that = this;
+ var arr = [that.$t('Strings.red'), that.$t('Strings.green'), that.$t('Strings.blue'), that.$t('Strings.pink'), that.$t('Strings.orange')];
+ for (var k = 0; k < this.colorsList.length; k++) {
+ this.colorsList[k].colorName = arr[k];
+ }
if (that.lastSelectedColor) {
that.appliedColor = that.lastSelectedColor;
console.info("Main : onInit : backgroundColor updated to " + that.lastSelectedColor);
@@ -131,7 +134,7 @@ export default {
result);
var resultJson = JSON.parse(result);
if (resultJson.code == 0) {
- that.appliedColor = resultJson.data;
+ that.appliedColor = resultJson.data;
that.showToast("Clear Preferences Success");
} else {
console.error("Main : Clear Preferences Error ");
diff --git a/ability/Preferences/entry/src/main/js/default/pages/splash/splash.css b/data/Preferences/entry/src/main/js/default/pages/splash/splash.css
similarity index 100%
rename from ability/Preferences/entry/src/main/js/default/pages/splash/splash.css
rename to data/Preferences/entry/src/main/js/default/pages/splash/splash.css
diff --git a/ability/Preferences/entry/src/main/js/default/pages/splash/splash.hml b/data/Preferences/entry/src/main/js/default/pages/splash/splash.hml
similarity index 79%
rename from ability/Preferences/entry/src/main/js/default/pages/splash/splash.hml
rename to data/Preferences/entry/src/main/js/default/pages/splash/splash.hml
index 2798cfe2815ca41762b03b95dae0b9a428659fcc..87551b416e54b353983c6097e52680fb96b2adcd 100644
--- a/ability/Preferences/entry/src/main/js/default/pages/splash/splash.hml
+++ b/data/Preferences/entry/src/main/js/default/pages/splash/splash.hml
@@ -15,10 +15,10 @@
\ No newline at end of file
diff --git a/ability/Preferences/entry/src/main/js/default/pages/splash/splash.js b/data/Preferences/entry/src/main/js/default/pages/splash/splash.js
similarity index 97%
rename from ability/Preferences/entry/src/main/js/default/pages/splash/splash.js
rename to data/Preferences/entry/src/main/js/default/pages/splash/splash.js
index 0db8ea871cf1d0f1f52b938cdfccfe02cf4b6837..a1ef85c2b015e99d45810c3035885c06a64313c6 100644
--- a/ability/Preferences/entry/src/main/js/default/pages/splash/splash.js
+++ b/data/Preferences/entry/src/main/js/default/pages/splash/splash.js
@@ -13,7 +13,6 @@
* limitations under the License.
*/
-import prompt from "@system.prompt";
import router from "@system.router";
const injectRef = Object.getPrototypeOf(global) || global;
@@ -84,7 +83,7 @@ export default {
try {
console.info("Splash : Timer started");
var action = that.setAction(1002);
- var result = await FeatureAbility.subscribeAbilityEvent(action,function (timerResult) {
+ var result = await FeatureAbility.subscribeAbilityEvent(action, function (timerResult) {
console.info("Splash : Timer completed timerResult = " + timerResult);
this.eventData = JSON.stringify(timerResult.data);
});
@@ -161,7 +160,7 @@ export default {
setTimeout(function () {
//your codes
that.startTimer();
- },3000);
+ }, 3000);
}
} else {
console.error("Splash : error while getting login status");
@@ -170,11 +169,11 @@ export default {
console.error("Splash : checkShowSplash Plugin Error" + pluginError);
}
},
- onChanged: async function (obj) {
+ onChanged: async function (checked) {
try {
var that = this;
var actionData = {};
- actionData.checkState = obj.checked ? 1: 0;
+ actionData.checkState = checked ? 1 : 0;
var action = {};
action.bundleName = "ohos.samples.preferences";
action.abilityName = "PreferencesInternalAbility";
@@ -194,6 +193,4 @@ export default {
console.error("Splash : onChanged Plugin Error" + pluginError);
}
}
-}
-
-;
+};
diff --git a/ability/Preferences/entry/src/main/resources/base/element/string.json b/data/Preferences/entry/src/main/resources/base/element/string.json
similarity index 100%
rename from ability/Preferences/entry/src/main/resources/base/element/string.json
rename to data/Preferences/entry/src/main/resources/base/element/string.json
diff --git a/ability/Preferences/entry/src/main/resources/base/media/icon.png b/data/Preferences/entry/src/main/resources/base/media/icon.png
similarity index 100%
rename from ability/Preferences/entry/src/main/resources/base/media/icon.png
rename to data/Preferences/entry/src/main/resources/base/media/icon.png
diff --git a/data/Preferences/screenshots/device/apply_background_color.png b/data/Preferences/screenshots/device/apply_background_color.png
new file mode 100644
index 0000000000000000000000000000000000000000..55c7a44c333151807b2838e4d3a7e29f31743da8
Binary files /dev/null and b/data/Preferences/screenshots/device/apply_background_color.png differ
diff --git a/data/Preferences/screenshots/device/login.png b/data/Preferences/screenshots/device/login.png
new file mode 100644
index 0000000000000000000000000000000000000000..b707d10528803fba7d2cff3b235dfc591efacec0
Binary files /dev/null and b/data/Preferences/screenshots/device/login.png differ
diff --git a/data/Preferences/screenshots/device/main.png b/data/Preferences/screenshots/device/main.png
new file mode 100644
index 0000000000000000000000000000000000000000..4022eb02e75cb54379d6c21a23fe50bbb152205f
Binary files /dev/null and b/data/Preferences/screenshots/device/main.png differ
diff --git a/data/Preferences/screenshots/device/splash.png b/data/Preferences/screenshots/device/splash.png
new file mode 100644
index 0000000000000000000000000000000000000000..e02d8793c4b15261a3566b28604a7bb7601b2a99
Binary files /dev/null and b/data/Preferences/screenshots/device/splash.png differ
diff --git a/ability/Preferences/settings.gradle b/data/Preferences/settings.gradle
similarity index 100%
rename from ability/Preferences/settings.gradle
rename to data/Preferences/settings.gradle