File tree Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Expand file tree Collapse file tree 4 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 13
13
<property id =" showSourceVersion" type =" boolean" >false</property >
14
14
<property id =" dummySourceVersion" type =" string" ></property >
15
15
<property id =" customGlanceTitle" type =" string" ></property >
16
+ <property id =" incomingCallMessageFormat" type =" string" >< $1$</property >
16
17
<property id =" forceLargeFonts" type =" boolean" >false</property >
17
18
<property id =" eraseAppDataOnNextLaunch" type =" boolean" >false</property >
18
19
<property id =" incomingOpenAppViaCompanion" type =" boolean" >false</property >
30
31
<string id =" secondsToCheckIn" >Timeout for check-in (sec)</string >
31
32
<string id =" showSourceVersion" >Show source verison in the app</string >
32
33
<string id =" customGlanceTitle" >Custom title for glance</string >
34
+ <string id =" incomingCallMessageFormat" >Incoming call message format (use $1$ as the contact
35
+ name/phone number placeholder)</string >
33
36
<string id =" forceLargeFonts" >Force large fonts</string >
34
37
<string id =" eraseAppDataOnNextLaunch" >Erase data on next launch</string >
35
38
<string id =" incomingOpenAppViaCompanion" >Open app on incoming call</string >
47
50
<setting propertyKey =" @Properties.customGlanceTitle" title =" @Strings.customGlanceTitle" >
48
51
<settingConfig type =" alphaNumeric" />
49
52
</setting >
53
+ <setting propertyKey =" @Properties.incomingCallMessageFormat"
54
+ title =" @Strings.incomingCallMessageFormat" >
55
+ <settingConfig type =" alphaNumeric" />
56
+ </setting >
50
57
<setting propertyKey =" @Properties.eraseAppDataOnNextLaunch"
51
58
title =" @Strings.eraseAppDataOnNextLaunch" >
52
59
<settingConfig type =" boolean" />
Original file line number Diff line number Diff line change @@ -35,11 +35,16 @@ function openAppOnIncomingCall(phone as Phone) as Void {
35
35
function messageForApplicationWake (phone as Phone ) as Lang.String {
36
36
var name = phone [" name" ] as Lang .String or Null ;
37
37
if (name != null ) {
38
- return " < " + name ;
38
+ return incomingCallMessage ( name ) ;
39
39
}
40
40
var number = phone [" number" ] as Lang .String or Null ;
41
41
if (number != null ) {
42
- return " < " + number ;
42
+ return incomingCallMessage ( number ) ;
43
43
}
44
44
return " Incoming call" ;
45
45
}
46
+
47
+ (:background , :glance )
48
+ function incomingCallMessage (phone as Lang .String ) as Lang.String {
49
+ return Lang .format (incomingCallMessageFormat (), [phone ]);
50
+ }
Original file line number Diff line number Diff line change @@ -66,3 +66,8 @@ function isIncomingOpenAppViaCompanionEnabled() as Lang.Boolean {
66
66
function isIncomingOpenAppViaWakeUpEnabled () as Lang.Boolean {
67
67
return Application .Properties .getValue (" incomingOpenAppViaWakeUp" ) as Lang .Boolean ;
68
68
}
69
+
70
+ (:background , :glance )
71
+ function incomingCallMessageFormat () as Lang.String {
72
+ return Application .Properties .getValue (" incomingCallMessageFormat" ) as Lang .String ;
73
+ }
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ class GlanceView extends WatchUi.GlanceView {
68
68
var number = phone [" number" ] as Lang .String or Null ;
69
69
if (isIncomingCall ) {
70
70
if (number != null ) {
71
- subtitle = " < " + number ;
71
+ subtitle = incomingCallMessage ( number ) ;
72
72
} else {
73
73
subtitle = " Incoming call" ;
74
74
}
You can’t perform that action at this time.
0 commit comments