!62 修改联系人超长显示和锁屏跳转联系人

Merge pull request !62 from wangziming/master
This commit is contained in:
openharmony_ci 2022-11-22 13:06:21 +00:00 committed by Gitee
commit 2dfcc78035
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 22 additions and 8 deletions

View File

@ -100,6 +100,8 @@ export default struct ContactCard {
.fontWeight(FontWeight.Medium)
.fontColor('#FFFFFF')
.margin({ bottom: 8 })
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (!this.isShowKeyboard) {
Text(this.isEmergencyPhoneNumber ? this.emergency : this.callData.contactName ? this.callData.contactName : this.accountNumber)
.fontSize(30)
@ -108,6 +110,8 @@ export default struct ContactCard {
.fontWeight(FontWeight.Medium)
.fontColor('#FFFFFF')
.margin({ bottom: 8 })
.maxLines(1)
.textOverflow({ overflow: TextOverflow.Ellipsis })
} else if (this.isShowKeyboard && this.textInput.length != 0) {
Scroll() {
Text(this.textInputValue)
@ -130,13 +134,13 @@ export default struct ContactCard {
Row() {
if (!this.isShowKeyboard || this.isShowKeyboard && this.textInput.length === 0) {
Text(this.callData.contactName ? this.accountNumber : '')
Text((this.callData.contactName || this.isEmergencyPhoneNumber) ? this.accountNumber : '')
.fontSize(14)
.height(19)
.lineHeight(16)
.fontColor('#FFFFFF')
.margin({ bottom: 8 })
.visibility(this.callData.contactName && !this.isShowKeyboard ? Visibility.Visible : Visibility.None)
.visibility((this.callData.contactName || this.isEmergencyPhoneNumber) && !this.isShowKeyboard ? Visibility.Visible : Visibility.None)
}
}

View File

@ -153,8 +153,7 @@ export default struct FuncBtnGroup {
this.mCallServiceProxy.switchCall(callId);
break;
case 'add':
this.startContactAbility('page_flag_dialer')
this.startContact('page_flag_dialer')
break;
case 'video':
break;
@ -162,7 +161,7 @@ export default struct FuncBtnGroup {
this.muteHandle('mute');
break;
case 'contact':
this.startContactAbility("page_flag_choose_contacts")
this.startContact("page_flag_choose_contacts")
break;
case 'merge':
this.mCallServiceProxy.combineConference(callId);
@ -172,10 +171,21 @@ export default struct FuncBtnGroup {
}
}
startContactAbility(pageFlag) {
if (screenLock.isLocked) {
screenLock.unlock();
startContact(pageFlag) {
if (screenLock.isLocked()) {
screenLock.unlock((err, isUnlock) => {
if (isUnlock) {
this.startContactAbility(pageFlag)
} else {
LogUtils.i(TAG, "startContact screen isLocked")
}
});
} else {
this.startContactAbility(pageFlag)
}
}
startContactAbility(pageFlag) {
globalThis.calluiAbilityContext?.startAbility({
bundleName: 'com.ohos.contacts',
abilityName: 'com.ohos.contacts.MainAbility',