mirror of
https://gitee.com/openharmony/applications_app_samples
synced 2024-11-28 03:00:49 +00:00
!2295 【cherry-pick】 0230 to master
Merge pull request !2295 from wenxusun/0230Master
This commit is contained in:
commit
d633ac12cc
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import Logger from '../data/Logger'
|
||||
|
||||
const TAG: string = 'AbilityStage'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../data/Logger'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import Logger from '../util/Logger'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../util/Logger'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
@ -154,8 +154,8 @@ export struct CommonItemColorSelect {
|
||||
*/
|
||||
@Component
|
||||
export struct CommonItemInput {
|
||||
@Link inputValue: string
|
||||
private name: Resource
|
||||
@Link inputValue: ResourceStr
|
||||
private name: ResourceStr
|
||||
private placeholder?: ResourceStr = ''
|
||||
|
||||
build() {
|
||||
|
@ -18,7 +18,7 @@ import { CommonItemSlider, CommonItemSelect, CommonItemColorSelect } from '../..
|
||||
|
||||
@Component
|
||||
export struct ChangePanel {
|
||||
@Link lineColor: string
|
||||
@Link lineColor: ResourceColor
|
||||
@Link strokeWidth: number
|
||||
@Link lineCapStyle: LineCapStyle
|
||||
|
||||
|
@ -35,7 +35,7 @@ import { TitleBar } from '../../../../common/TitleBar'
|
||||
@Component
|
||||
struct DividerSample {
|
||||
@State strokeWidth: number = 8
|
||||
@State lineColor: Resource = $r('app.color.background_blue')
|
||||
@State lineColor: ResourceColor = $r('app.color.background_blue')
|
||||
@State lineCapStyle: LineCapStyle = LineCapStyle.Butt
|
||||
|
||||
build() {
|
||||
|
@ -34,7 +34,7 @@ struct TextInputSample {
|
||||
@State showPasswordIcon: boolean = true
|
||||
@State inputType: InputType = InputType.Normal
|
||||
@State inputContent: string = ''
|
||||
@State typePlaceholder: Resource = $r('app.string.text_input_normal_type')
|
||||
@State typePlaceholder: ResourceStr = $r('app.string.text_input_normal_type')
|
||||
private maxLength: number = 12
|
||||
private context: any = getContext(this)
|
||||
private inputController: TextInputController = new TextInputController()
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
|
||||
const TAG: string = '[Sample_HealthyDiet]'
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
const TAG: string = '[Sample_HealthyDiet]'
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import Logger from '../../../../../updatedialog/src/main/ets/components/util/Logger'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
@ -13,8 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../../../../../updatedialog/src/main/ets/components/util/Logger'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
@ -22,16 +21,7 @@ const TAG: string = 'MainAbility'
|
||||
export default class MainAbility extends Ability {
|
||||
async onCreate(want, launchParam) {
|
||||
Logger.info(TAG, `[Demo] MainAbility onCreate`)
|
||||
let atManager = abilityAccessCtrl.createAtManager()
|
||||
try {
|
||||
atManager.requestPermissionsFromUser(this.context, ['ohos.permission.INTERNET']).then((data) => {
|
||||
Logger.info(TAG, `data: ${JSON.stringify(data)}`)
|
||||
}).catch((err) => {
|
||||
Logger.info(TAG, `err: ${JSON.stringify(err)}`)
|
||||
})
|
||||
} catch (err) {
|
||||
Logger.info(TAG, `catch err->${JSON.stringify(err)}`);
|
||||
}
|
||||
await this.context.requestPermissionsFromUser(['ohos.permission.INTERNET'])
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import logger from '../model/Logger'
|
||||
|
||||
const TAG: string = 'AbilityStage'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import logger from '../model/Logger'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import hilog from '@ohos.hilog'
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
onCreate() {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import hilog from '@ohos.hilog'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../model/Logger'
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
|
||||
const TAG = '[MyAbilityStage]'
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../model/Logger'
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
const TAG = '[MainAbility]'
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
onCreate() {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import window from '@ohos.window'
|
||||
import Logger from '../../../../../WindowComponent/src/main/ets/components/util/Logger'
|
||||
import WindowManger from "../../../../../WindowComponent/src/main/ets/components/feature/WindowManger"
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../model/Logger'
|
||||
import window from '@ohos.window'
|
||||
|
||||
@ -30,7 +30,7 @@ export default class MainAbility extends Ability {
|
||||
// Main window is created, set main page for this ability
|
||||
Logger.info('[Sample_AdaptiveCapabilities]', 'onWindowStageCreate')
|
||||
windowStage.setUIContent(this.context, "pages/Index", null)
|
||||
window.getLastWindow(this.context)
|
||||
window.getTopWindow(this.context)
|
||||
.then(windowObj => {
|
||||
AppStorage.SetOrCreate('windowObj', windowObj)
|
||||
})
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
onCreate() {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
onCreate() {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
|
@ -38,6 +38,6 @@
|
||||
|
||||
1. 本示例仅支持在标准系统上运行。
|
||||
2. 本示例仅支持API9版本的SDK,版本号:3.2.10.6。
|
||||
3. 本示例需要使用DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100)才可编译运行。
|
||||
3. 本示例需要使用DevEco Studio 3.0 Release (Build Version: 3.0.0.993)才可编译运行。
|
||||
5. 本示例在开发板上运行时,可以[修改开发板系统配置文件以开启自由窗口能力](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/key-features/multi-device-app-dev/faq.md#%E5%A6%82%E4%BD%95%E5%BC%80%E5%90%AF%E8%87%AA%E7%94%B1%E7%AA%97%E5%8F%A3)。
|
||||
|
||||
|
@ -9,6 +9,5 @@
|
||||
"types": "",
|
||||
"repository": {},
|
||||
"license": "ISC",
|
||||
"dependencies": {},
|
||||
"type": "module"
|
||||
"dependencies": {}
|
||||
}
|
||||
|
@ -11,6 +11,5 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@ohos/common": "file:../../common"
|
||||
},
|
||||
"type": "module"
|
||||
}
|
||||
}
|
||||
|
@ -10,8 +10,8 @@
|
||||
"repository": {},
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@ohos/hypium": "1.0.3",
|
||||
"@ohos/hvigor": "1.3.1",
|
||||
"@ohos/hvigor-ohos-plugin": "1.3.1"
|
||||
"@ohos/hypium": "1.0.2",
|
||||
"@ohos/hvigor": "1.2.2",
|
||||
"@ohos/hvigor-ohos-plugin": "1.2.2"
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import { Logger } from '@ohos/common'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import deviceInfo from'@ohos.deviceInfo'
|
||||
import display from '@ohos.display';
|
||||
import Window from '@ohos.window'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
onCreate() {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import FormExtension from '@ohos.app.form.FormExtensionAbility'
|
||||
import FormExtension from '@ohos.application.FormExtension'
|
||||
import formBindingData from '@ohos.application.formBindingData'
|
||||
import formInfo from '@ohos.application.formInfo'
|
||||
import formProvider from '@ohos.application.formProvider'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
|
@ -17,7 +17,7 @@
|
||||
@Component
|
||||
export struct Sidebar {
|
||||
@Prop sidebarCurrBp: string
|
||||
@State clickFontColor: Color = Color.Black
|
||||
@State clickFontColor: ResourceColor = Color.Black
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import { Logger } from '@ohos/common'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import { Logger } from '@ohos/common'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../util/Logger'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
@ -13,8 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../util/Logger'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
@ -22,16 +21,7 @@ const TAG: string = 'MainAbility'
|
||||
export default class MainAbility extends Ability {
|
||||
async onCreate(want, launchParam) {
|
||||
Logger.info(TAG, '[Demo] MainAbility onCreate')
|
||||
let atManager = abilityAccessCtrl.createAtManager()
|
||||
try {
|
||||
atManager.requestPermissionsFromUser(this.context, ['ohos.permission.INTERNET']).then((data) => {
|
||||
Logger.info(TAG, `data: ${JSON.stringify(data)}`)
|
||||
}).catch((err) => {
|
||||
Logger.info(TAG, `err: ${JSON.stringify(err)}`)
|
||||
})
|
||||
} catch (err) {
|
||||
Logger.info(TAG, `catch err->${JSON.stringify(err)}`);
|
||||
}
|
||||
await this.context.requestPermissionsFromUser(['ohos.permission.INTERNET'])
|
||||
const that = this
|
||||
this.context.eventHub.on('getAbilityData', (data) => {
|
||||
data.context = that.context
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../model/Logger'
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
onCreate() {
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../model/Logger'
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
const TAG: string = '[MainAbility]'
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../module/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -13,8 +13,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import commonEvent from '@ohos.commonEventManager'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import commonEvent from '@ohos.commonEvent'
|
||||
import consts from '../module/Consts'
|
||||
import dataPreferences from '@ohos.data.preferences'
|
||||
import surveillanceEventsManager from '../module/SurveillanceEventsManager'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../module/Logger'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
|
@ -13,12 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import context from '@ohos.app.ability.common'
|
||||
import context from '@ohos.application.context'
|
||||
import consts from '../module/Consts'
|
||||
import dataPreferences from '@ohos.data.preferences'
|
||||
|
||||
export default class HistoryFeature {
|
||||
constructor(abilityContext: context.UIAbilityContext) {
|
||||
constructor(abilityContext: context.AbilityContext) {
|
||||
this.innerContext = abilityContext
|
||||
}
|
||||
|
||||
@ -46,5 +46,5 @@ export default class HistoryFeature {
|
||||
}
|
||||
|
||||
private dataSource: Array<Array<string>> = []
|
||||
private innerContext: context.UIAbilityContext = null
|
||||
private innerContext: context.AbilityContext = null
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import context from '@ohos.app.ability.common'
|
||||
import context from '@ohos.application.context'
|
||||
import commonEvent from '@ohos.commonEvent'
|
||||
import consts from '../module/Consts'
|
||||
import dataPreferences from '@ohos.data.preferences'
|
||||
@ -21,13 +21,13 @@ import Logger from '../module/Logger'
|
||||
import router from '@ohos.router'
|
||||
|
||||
export default class LaunchFeature {
|
||||
private innerContext: context.UIAbilityContext = null
|
||||
private innerContext: context.AbilityContext = null
|
||||
private pref: dataPreferences.Preferences = null
|
||||
private subscriber = null
|
||||
private subscriberLow = null
|
||||
private currentRecordTimes: number = 0
|
||||
|
||||
constructor(abilityContext: context.UIAbilityContext) {
|
||||
constructor(abilityContext: context.AbilityContext) {
|
||||
this.innerContext = abilityContext
|
||||
}
|
||||
|
||||
|
@ -13,18 +13,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import commonEvent from '@ohos.commonEventManager'
|
||||
import context from '@ohos.app.ability.common'
|
||||
import commonEvent from '@ohos.commonEvent'
|
||||
import context from '@ohos.application.context'
|
||||
import consts from '../module/Consts'
|
||||
import dataPreferences from '@ohos.data.preferences'
|
||||
import Logger from '../module/Logger'
|
||||
import surveillanceEventsManager from '../module/SurveillanceEventsManager'
|
||||
|
||||
export default class SettingFeature {
|
||||
private innerContext: context.UIAbilityContext = null
|
||||
private innerContext: context.AbilityContext = null
|
||||
private pref: dataPreferences.Preferences = null
|
||||
|
||||
constructor(abilityContext: context.UIAbilityContext) {
|
||||
constructor(abilityContext: context.AbilityContext) {
|
||||
this.innerContext = abilityContext
|
||||
}
|
||||
|
||||
|
@ -13,14 +13,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import context from '@ohos.app.ability.common'
|
||||
import context from '@ohos.application.context'
|
||||
import historyFeature from '../feature/HistoryFeature'
|
||||
import { Header } from '../component/Header'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct History {
|
||||
private feature: historyFeature = new historyFeature(getContext() as context.UIAbilityContext)
|
||||
private feature: historyFeature = new historyFeature(getContext() as context.AbilityContext)
|
||||
@State arr: Array<Array<string>> = []
|
||||
|
||||
async onPageShow() {
|
||||
|
@ -13,13 +13,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import context from '@ohos.app.ability.common'
|
||||
import context from '@ohos.application.context'
|
||||
import launchFeature from '../feature/LaunchFeature'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct Launch {
|
||||
private feature :launchFeature = new launchFeature(getContext() as context.UIAbilityContext)
|
||||
private feature :launchFeature = new launchFeature(getContext() as context.AbilityContext)
|
||||
|
||||
async onPageShow() {
|
||||
await this.feature.init()
|
||||
|
@ -14,14 +14,15 @@
|
||||
*/
|
||||
|
||||
import commonEvent from '@ohos.commonEvent'
|
||||
import context from '@ohos.app.ability.common'
|
||||
import context from '@ohos.application.context'
|
||||
import settingFeature from '../feature/SettingFeature'
|
||||
import surveillanceEventsManager from '../module/SurveillanceEventsManager'
|
||||
import { Header } from '../component/Header'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct Setting {
|
||||
private feature:settingFeature = new settingFeature(getContext() as context.UIAbilityContext)
|
||||
private feature:settingFeature = new settingFeature(getContext() as context.AbilityContext)
|
||||
private dataSource: Array<Array<any>> = [
|
||||
[commonEvent.Support.COMMON_EVENT_WIFI_POWER_STATE, $r('app.string.enable_wifi')],
|
||||
[commonEvent.Support.COMMON_EVENT_SCREEN_OFF, $r('app.string.enable_screen_off')],
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../util/Logger'
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../util/Logger'
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Window from '@ohos.window'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import { logger } from '@ohos/notification'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Window from '@ohos.window'
|
||||
import { logger } from '@ohos/notification'
|
||||
|
||||
|
@ -21,7 +21,7 @@ import {
|
||||
notificationRequestUtil,
|
||||
wantAgentUtil
|
||||
} from '@ohos/notification'
|
||||
import notification from '@ohos.notificationManager'
|
||||
import notification from '@ohos.notification'
|
||||
|
||||
const TAG: string = 'NotificationOperations'
|
||||
const BUNDLE_NAME: string = 'ohos.samples.customnotification'
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import image from '@ohos.multimedia.image'
|
||||
import notification from '@ohos.notificationManager'
|
||||
import notification from '@ohos.notification'
|
||||
|
||||
class NotificationContentUtil {
|
||||
/**
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import notification from '@ohos.notificationManager'
|
||||
import notification from '@ohos.notification'
|
||||
import { WantAgent } from '@ohos.wantAgent'
|
||||
|
||||
class NotificationRequestUtil {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import notification from '@ohos.notificationManager'
|
||||
import notification from '@ohos.notification'
|
||||
import { logger } from '../util/Logger'
|
||||
|
||||
const TAG: string = 'NotificationUtilModel'
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import AbilityStage from "@ohos.app.ability.AbilityStage"
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import abilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import abilityStage from '@ohos.application.AbilityStage'
|
||||
import Logger from '../util/Logger'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import ability from '@ohos.app.ability.UIAbility'
|
||||
import ability from '@ohos.application.Ability'
|
||||
import notification from '@ohos.notification'
|
||||
import window from '@ohos.window'
|
||||
import Logger from '../util/Logger'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import { Logger } from '@ohos/notification'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import { Logger } from '@ohos/notification'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../model/Logger'
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
|
||||
const TAG: string = '[AbilityStage]'
|
||||
|
||||
|
@ -14,24 +14,14 @@
|
||||
*/
|
||||
|
||||
import Logger from '../model/Logger'
|
||||
import abilityAccessCtrl from '@ohos.abilityAccessCtrl'
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
const TAG: string = '[MainAbility]'
|
||||
|
||||
export default class MainAbility extends Ability {
|
||||
async onCreate(want, launchParam) {
|
||||
Logger.info(TAG, `[Demo] MainAbility onCreate`)
|
||||
let atManager = abilityAccessCtrl.createAtManager()
|
||||
try {
|
||||
atManager.requestPermissionsFromUser(this.context, ['ohos.permission.GET_NETWORK_INFO']).then((data) => {
|
||||
Logger.info(TAG, `data: ${JSON.stringify(data)}`)
|
||||
}).catch((err) => {
|
||||
Logger.info(TAG, `err: ${JSON.stringify(err)}`)
|
||||
})
|
||||
} catch (err) {
|
||||
Logger.info(TAG, `catch err->${JSON.stringify(err)}`);
|
||||
}
|
||||
await this.context.requestPermissionsFromUser(['ohos.permission.GET_NETWORK_INFO'])
|
||||
}
|
||||
|
||||
onDestroy() {
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import Logger from '../modle/Logger'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import Ability from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../modle/Logger'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
@ -51,7 +51,8 @@
|
||||
"js": [
|
||||
{
|
||||
"pages": [
|
||||
"pages/index/index"
|
||||
"pages/index/index",
|
||||
"pages/setPage/setPage"
|
||||
],
|
||||
"name": ".MainAbility",
|
||||
"window": {
|
||||
|
@ -50,6 +50,7 @@
|
||||
"pages/index/index",
|
||||
"pages/animation/index/index",
|
||||
"pages/gradient/index",
|
||||
"pages/customfont/index",
|
||||
"pages/transitions/index/index",
|
||||
"pages/transitions/sharedelement/sharedelement",
|
||||
"pages/transitions/sharedtargetpage/sharedtargetpage",
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Want from '@ohos.application.Want'
|
||||
import Logger from '../common/Logger'
|
||||
|
||||
|
@ -13,12 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../common/Logger'
|
||||
|
||||
const TAG = '[Sample_StartMode]'
|
||||
|
||||
export default class MainAbility extends UIAbility {
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
Logger.info(TAG, 'MainAbility onCreate')
|
||||
const that = this
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import emitter from '@ohos.events.emitter'
|
||||
import Logger from '../common/Logger'
|
||||
|
||||
@ -21,7 +21,7 @@ const TAG = '[Sample_StartMode]'
|
||||
const eventId = 1 // 设置一个Id,用来emitter传输
|
||||
|
||||
|
||||
export default class SingletonAbility extends UIAbility {
|
||||
export default class SingletonAbility extends Ability {
|
||||
onCreate(want) {
|
||||
Logger.info(TAG, 'SingletonAbility onCreate')
|
||||
const that = this
|
||||
|
@ -13,13 +13,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Want from '@ohos.application.Want'
|
||||
import Logger from '../common/Logger'
|
||||
|
||||
const TAG = '[Sample_StartMode]'
|
||||
|
||||
export default class SpecifiedAbility extends UIAbility {
|
||||
export default class SpecifiedAbility extends Ability {
|
||||
private want: Want
|
||||
|
||||
onCreate(want, launchParam) {
|
||||
|
@ -13,13 +13,13 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import AbilityConstant from '@ohos.app.ability.AbilityConstant'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import AbilityConstant from '@ohos.application.AbilityConstant'
|
||||
import Logger from '../common/Logger'
|
||||
|
||||
const TAG = '[Sample_StartMode]'
|
||||
|
||||
export default class StandardAbility extends UIAbility {
|
||||
export default class StandardAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
Logger.info(TAG, 'StandardAbility onCreate')
|
||||
const that = this
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../utils/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../utils/Logger'
|
||||
|
||||
export default class MainAbility extends UIAbility {
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
Logger.info("[Demo] MainAbility onCreate")
|
||||
globalThis.abilityWant = want
|
||||
|
8
ability/Contacts/.gitignore
vendored
8
ability/Contacts/.gitignore
vendored
@ -1,5 +1,5 @@
|
||||
/node_modules
|
||||
/local.properties
|
||||
/.idea
|
||||
**/build
|
||||
/node_modules
|
||||
/local.properties
|
||||
/.idea
|
||||
**/build
|
||||
/.hvigor
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../model/Logger';
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import dataStorage from '@ohos.data.storage';
|
||||
import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility';
|
||||
import FormExtension from '@ohos.application.FormExtension';
|
||||
import formBindingData from '@ohos.application.formBindingData';
|
||||
import formInfo from '@ohos.application.formInfo';
|
||||
import formProvider from '@ohos.application.formProvider';
|
||||
@ -139,7 +139,7 @@ async function deleteFormInfo(formId: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export default class FormAbility extends FormExtensionAbility {
|
||||
export default class FormAbility extends FormExtension {
|
||||
onCreate(want) {
|
||||
Logger.log(`FormAbility onCreate, want: ${JSON.stringify(want)}`);
|
||||
|
||||
|
@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../model/Logger';
|
||||
|
||||
export default class MainAbility extends UIAbility {
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
Logger.log("[Demo] MainAbility onCreate")
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
import Logger from '../Utils/Logger';
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
onCreate() {
|
||||
|
@ -14,14 +14,14 @@
|
||||
*/
|
||||
|
||||
import Logger from '../Utils/Logger';
|
||||
import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility';
|
||||
import FormExtension from '@ohos.application.FormExtension';
|
||||
import formBindingData from '@ohos.application.formBindingData';
|
||||
import formInfo from '@ohos.application.formInfo';
|
||||
import formProvider from '@ohos.application.formProvider';
|
||||
import dataStorage from '@ohos.data.storage'
|
||||
import infoUtil from "libinfoutil.so";
|
||||
|
||||
export default class FormAbility extends FormExtensionAbility {
|
||||
export default class FormAbility extends FormExtension {
|
||||
private storeDB: dataStorage.Storage = undefined
|
||||
private allWordArray : Array<string> = [
|
||||
"与时俱进", "与虎谋皮", "天下兴亡", "天天向上", "一心一意",
|
||||
|
@ -14,9 +14,9 @@
|
||||
*/
|
||||
|
||||
import Logger from '../Utils/Logger';
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
|
||||
export default class MainAbility extends UIAbility {
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
Logger.info("[Demo] MainAbility onCreate")
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from '@ohos.application.AbilityStage'
|
||||
import Logger from '../data/Logger'
|
||||
|
||||
const TAG: string = 'MyAbilityStage'
|
||||
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility'
|
||||
import FormExtension from '@ohos.application.FormExtension'
|
||||
import formBindingData from '@ohos.application.formBindingData'
|
||||
import formInfo from '@ohos.application.formInfo'
|
||||
import formProvider from '@ohos.application.formProvider'
|
||||
@ -26,7 +26,7 @@ import GalleryFormConst from '../data/GalleryFormConst'
|
||||
const TAG: string = 'FormAbility'
|
||||
let counts: number = 0
|
||||
|
||||
export default class FormAbility extends FormExtensionAbility {
|
||||
export default class FormAbility extends FormExtension {
|
||||
getPreferences(context, key) {
|
||||
try {
|
||||
return preferences.getPreferences(context, key)
|
||||
|
@ -13,12 +13,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../data/Logger'
|
||||
|
||||
const TAG: string = 'MainAbility'
|
||||
|
||||
export default class MainAbility extends UIAbility {
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
Logger.info(TAG, '[Demo] MainAbility onCreate')
|
||||
}
|
||||
|
@ -11,4 +11,4 @@
|
||||
"repository": {},
|
||||
"version": "1.0.0",
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
@ -13,7 +13,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import AbilityStage from '@ohos.app.ability.AbilityStage'
|
||||
import AbilityStage from "@ohos.application.AbilityStage"
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MyAbilityStage extends AbilityStage {
|
||||
|
@ -13,10 +13,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import UIAbility from '@ohos.app.ability.UIAbility'
|
||||
import Ability from '@ohos.application.Ability'
|
||||
import Logger from '../model/Logger'
|
||||
|
||||
export default class MainAbility extends UIAbility {
|
||||
export default class MainAbility extends Ability {
|
||||
onCreate(want, launchParam) {
|
||||
Logger.info('MainAbility onCreate')
|
||||
}
|
||||
|
@ -11,9 +11,9 @@
|
||||
"repository": {},
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"@ohos/hypium": "1.0.3",
|
||||
"@ohos/hvigor-ohos-plugin": "1.3.1",
|
||||
"@ohos/hypium": "1.0.1",
|
||||
"@ohos/hvigor-ohos-plugin": "1.1.6",
|
||||
"hypium": "^1.0.0",
|
||||
"@ohos/hvigor": "1.3.1"
|
||||
"@ohos/hvigor": "1.1.6"
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user