Enhance accessibility

This commit is contained in:
Guillaume BIENKOWSKI 2014-10-28 10:04:56 +01:00
parent 24ee727736
commit da51e58f02
9 changed files with 89 additions and 20 deletions

View file

@ -71,6 +71,10 @@
#pragma mark -
- (NSString *)accessibilityValue {
return [NSString stringWithFormat:@"%@ - %@ (%d)", addressLabel.text, chatContentLabel.text, [unreadMessageLabel.text integerValue]];
}
- (LinphoneChatMessage*)getLastIncomingMessage {
LinphoneChatMessage* last_message = nil;
MSList* last_message_list = linphone_chat_room_get_history(chatRoom, 20);
@ -122,7 +126,7 @@
displayName = [NSString stringWithUTF8String:linphone_address_get_username(linphoneAddress)];
}
[addressLabel setText:displayName];
// Avatar
if(image == nil) {
image = [UIImage imageNamed:@"avatar_unknown_small.png"];

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1072" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIChatCell">
@ -27,7 +27,7 @@
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="2" contentMode="left" text="John" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" id="20" userLabel="addressLabel">
<rect key="frame" x="62" y="2" width="218" height="38"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Firstname"/>
<accessibility key="accessibilityConfiguration" label="Contact name"/>
<fontDescription key="fontDescription" type="system" pointSize="25"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
@ -35,7 +35,7 @@
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="2" contentMode="left" text="This is a message" lineBreakMode="tailTruncation" numberOfLines="2" minimumFontSize="10" adjustsFontSizeToFit="NO" id="21" userLabel="chatContentLabel">
<rect key="frame" x="62" y="39" width="218" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Firstname"/>
<accessibility key="accessibilityConfiguration" label="Message"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
@ -51,6 +51,7 @@
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" text="3" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" id="41" userLabel="unreadMessageLabel">
<rect key="frame" x="12" y="10" width="20" height="20"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Unread message number"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
@ -61,6 +62,7 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" adjustsImageWhenHighlighted="NO" lineBreakMode="middleTruncation" id="32" userLabel="deleteButton">
<rect key="frame" x="276" y="8" width="44" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES"/>
<accessibility key="accessibilityConfiguration" label="Delete"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="15"/>
<inset key="imageEdgeInsets" minX="11" minY="11" maxX="11" maxY="11"/>
<state key="normal" image="list_delete_default.png">
@ -73,6 +75,8 @@
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
@ -81,4 +85,9 @@
<image name="list_delete_default.png" width="45" height="45"/>
<image name="list_delete_over.png" width="45" height="45"/>
</resources>
</document>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -70,6 +70,10 @@
[self setHighlighted:false animated:true];
}
- (NSString *)accessibilityValue {
return [NSString stringWithFormat:@"%@ %@", firstNameLabel.text, lastNameLabel.text];
}
- (void)update {
if(contact == NULL) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update contact cell: null contact"];
@ -83,13 +87,15 @@
CFStringRef lOrganization = ABRecordCopyValue(contact, kABPersonOrganizationProperty);
CFStringRef lLocalizedOrganization = (lOrganization != nil)?ABAddressBookCopyLocalizedLabel(lOrganization):nil;
if(lLocalizedFirstName != nil)
if(lLocalizedFirstName != nil){
[firstNameLabel setText: (NSString *)lLocalizedFirstName];
}
else
[firstNameLabel setText: @""];
if(lLocalizedLastName != nil)
if(lLocalizedLastName != nil){
[lastNameLabel setText: (NSString *)lLocalizedLastName];
}
else
[lastNameLabel setText: @""];

View file

@ -93,6 +93,19 @@
#pragma mark -
- (NSString *)accessibilityValue {
// TODO: localize?
BOOL incoming = linphone_call_log_get_dir(callLog) == LinphoneCallIncoming;
BOOL missed = linphone_call_log_get_status(callLog) == LinphoneCallMissed;
NSString* call_type = @"Outgoing";
if( incoming ){
call_type = missed?@"Missed" : @"Incoming";
}
return [NSString stringWithFormat:@"%@ from %@", call_type, addressLabel.text];
}
- (void)update {
if(callLog == NULL) {
[LinphoneLogger logc:LinphoneLoggerWarning format:"Cannot update history cell: null callLog"];

View file

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
<dependencies>
<deployment defaultVersion="1280" identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3747"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="UIHistoryCell">
@ -21,11 +21,14 @@
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" id="6" userLabel="imageView">
<rect key="frame" x="10" y="8" width="27" height="27"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<accessibility key="accessibilityConfiguration" label="Call type">
<bool key="isElement" value="YES"/>
</accessibility>
</imageView>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" tag="2" contentMode="left" text="John" lineBreakMode="tailTruncation" minimumFontSize="10" adjustsFontSizeToFit="NO" id="5" userLabel="displayNameLabel">
<rect key="frame" x="45" y="0.0" width="236" height="44"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<accessibility key="accessibilityConfiguration" label="Firstname"/>
<accessibility key="accessibilityConfiguration" label="Contact name"/>
<fontDescription key="fontDescription" type="system" pointSize="25"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
@ -58,6 +61,8 @@
</button>
</subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<nil key="simulatedStatusBarMetrics"/>
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
</view>
</objects>
<resources>
@ -66,4 +71,9 @@
<image name="list_details_default.png" width="45" height="45"/>
<image name="list_details_over.png" width="45" height="45"/>
</resources>
</document>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
</document>

View file

@ -0,0 +1,12 @@
/* Class = "IBUILabel"; accessibilityLabel = "Firstname"; ObjectID = "6"; */
"6.accessibilityLabel" = "Prénom";
/* Class = "IBUILabel"; text = "John"; ObjectID = "6"; */
"6.text" = "John";
/* Class = "IBUILabel"; accessibilityLabel = "Lastname"; ObjectID = "10"; */
"10.accessibilityLabel" = "Nom";
/* Class = "IBUILabel"; text = "Doe"; ObjectID = "10"; */
"10.text" = "Doe";

View file

@ -307,3 +307,8 @@
"Warning" = "Attention";
"Launching the Wizard will delete any existing proxy config.\nAre you sure to want it?" = "Lancer l'Assistant va effacer vos réglages. Êtes-vous sûr de vouloir cela?";
"Launch Wizard" = "Lancer l'assistant";
/* Accessibility */
"Firstname" = "Prénom";
"Lastname" = "Nom";

View file

@ -674,7 +674,6 @@
D34BD73615C13DF40070C209 /* UIChatCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3EA5413159853C90037DC6B /* UIChatCell.xib */; };
D34BD73715C13DF40070C209 /* UIChatRoomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3A8BB7315A6C81A00F96BE5 /* UIChatRoomCell.xib */; };
D34BD73815C13DF40070C209 /* UICompositeViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = D31B4B20159876C0002E6C72 /* UICompositeViewController.xib */; };
D34BD73A15C13DF40070C209 /* UIContactCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3A55FBE15877E69003FD403 /* UIContactCell.xib */; };
D34BD73D15C13DF40070C209 /* UIHistoryCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D31AC4AF158A29C600C2638B /* UIHistoryCell.xib */; };
D34BD73F15C13DF40070C209 /* UIStateBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = D35498201587716B000081D8 /* UIStateBar.xib */; };
D34BD74015C13E110070C209 /* InAppSettings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = D34F6F9D1594D3FB0095705B /* InAppSettings.bundle */; };
@ -902,7 +901,6 @@
D3998D0516031937009DD22C /* background_alt.png in Resources */ = {isa = PBXBuildFile; fileRef = D3998D0316031937009DD22C /* background_alt.png */; };
D3A55FBC15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; };
D3A55FBD15877E5E003FD403 /* UIContactCell.m in Sources */ = {isa = PBXBuildFile; fileRef = D3A55FBB15877E5E003FD403 /* UIContactCell.m */; };
D3A55FBF15877E69003FD403 /* UIContactCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = D3A55FBE15877E69003FD403 /* UIContactCell.xib */; };
D3A74E5915C68162001500B9 /* toolsbar_background.png in Resources */ = {isa = PBXBuildFile; fileRef = D3A74E5815C68162001500B9 /* toolsbar_background.png */; };
D3A74E5A15C68162001500B9 /* toolsbar_background.png in Resources */ = {isa = PBXBuildFile; fileRef = D3A74E5815C68162001500B9 /* toolsbar_background.png */; };
D3A74EB215C69392001500B9 /* add_call_default~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = D3A74E5E15C69391001500B9 /* add_call_default~ipad.png */; };
@ -1359,6 +1357,8 @@
F0818E7F17FC51D8005A3330 /* linphone_icon_76.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7C17FC51D8005A3330 /* linphone_icon_76.png */; };
F0818E8017FC51D8005A3330 /* linphone_icon_152.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7D17FC51D8005A3330 /* linphone_icon_152.png */; };
F0818E8117FC51D8005A3330 /* linphone_icon_152.png in Resources */ = {isa = PBXBuildFile; fileRef = F0818E7D17FC51D8005A3330 /* linphone_icon_152.png */; };
F088488A19FF8C41007FFCF3 /* UIContactCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F088488D19FF8C41007FFCF3 /* UIContactCell.xib */; };
F088488B19FF8C41007FFCF3 /* UIContactCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F088488D19FF8C41007FFCF3 /* UIContactCell.xib */; };
F08F118519C09C6B007D70C2 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F03A9B3318C0CF7000C4D7FE /* XCTest.framework */; };
F08F118619C09C6B007D70C2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; };
F08F118719C09C6B007D70C2 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
@ -1959,7 +1959,6 @@
D3998D0316031937009DD22C /* background_alt.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = background_alt.png; path = Resources/background_alt.png; sourceTree = "<group>"; };
D3A55FBA15877E5E003FD403 /* UIContactCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIContactCell.h; sourceTree = "<group>"; };
D3A55FBB15877E5E003FD403 /* UIContactCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIContactCell.m; sourceTree = "<group>"; };
D3A55FBE15877E69003FD403 /* UIContactCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UIContactCell.xib; sourceTree = "<group>"; };
D3A74E5815C68162001500B9 /* toolsbar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = toolsbar_background.png; path = Resources/toolsbar_background.png; sourceTree = "<group>"; };
D3A74E5E15C69391001500B9 /* add_call_default~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "add_call_default~ipad.png"; path = "Resources/add_call_default~ipad.png"; sourceTree = "<group>"; };
D3A74E5F15C69391001500B9 /* add_call_disabled~ipad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "add_call_disabled~ipad.png"; path = "Resources/add_call_disabled~ipad.png"; sourceTree = "<group>"; };
@ -2288,6 +2287,8 @@
F0818E7B17FC5160005A3330 /* linphone_icon_120.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_120.png; path = Resources/linphone_icon_120.png; sourceTree = "<group>"; };
F0818E7C17FC51D8005A3330 /* linphone_icon_76.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_76.png; path = Resources/linphone_icon_76.png; sourceTree = "<group>"; };
F0818E7D17FC51D8005A3330 /* linphone_icon_152.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = linphone_icon_152.png; path = Resources/linphone_icon_152.png; sourceTree = "<group>"; };
F088488C19FF8C41007FFCF3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/UIContactCell.xib; sourceTree = "<group>"; };
F088488F19FF8C44007FFCF3 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/UIContactCell.strings; sourceTree = "<group>"; };
F08F118419C09C6A007D70C2 /* LinphoneTester Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "LinphoneTester Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
F08F118A19C09C6B007D70C2 /* LinphoneTester Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "LinphoneTester Tests-Info.plist"; sourceTree = "<group>"; };
F08F118C19C09C6B007D70C2 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
@ -2718,7 +2719,7 @@
D38187F315FE354000C3EDCA /* UIConferenceHeader.xib */,
D3A55FBA15877E5E003FD403 /* UIContactCell.h */,
D3A55FBB15877E5E003FD403 /* UIContactCell.m */,
D3A55FBE15877E69003FD403 /* UIContactCell.xib */,
F088488D19FF8C41007FFCF3 /* UIContactCell.xib */,
D3E8F68315ADE0570065A226 /* UIContactDetailsFooter.h */,
D3E8F68415ADE0580065A226 /* UIContactDetailsFooter.m */,
D38187F715FE354700C3EDCA /* UIContactDetailsFooter.xib */,
@ -3899,7 +3900,7 @@
D354981A15876FE7000081D8 /* list_details_default.png in Resources */,
D354981C15876FE7000081D8 /* list_details_over.png in Resources */,
D35498231587716B000081D8 /* UIStateBar.xib in Resources */,
D3A55FBF15877E69003FD403 /* UIContactCell.xib in Resources */,
F088488A19FF8C41007FFCF3 /* UIContactCell.xib in Resources */,
D38187E115FE349700C3EDCA /* UICallBar.xib in Resources */,
D31C9C90158A1C1000756B45 /* call_status_incoming.png in Resources */,
D31C9C92158A1C1000756B45 /* call_status_missed.png in Resources */,
@ -4351,7 +4352,7 @@
D34BD73715C13DF40070C209 /* UIChatRoomCell.xib in Resources */,
D34BD73815C13DF40070C209 /* UICompositeViewController.xib in Resources */,
D38187F115FE354000C3EDCA /* UIConferenceHeader.xib in Resources */,
D34BD73A15C13DF40070C209 /* UIContactCell.xib in Resources */,
F088488B19FF8C41007FFCF3 /* UIContactCell.xib in Resources */,
D38187F515FE354700C3EDCA /* UIContactDetailsFooter.xib in Resources */,
D381881615FE3F7F00C3EDCA /* UIContactDetailsHeader.xib in Resources */,
D34BD73D15C13DF40070C209 /* UIHistoryCell.xib in Resources */,
@ -5479,6 +5480,15 @@
name = "IncomingCallViewController~ipad.xib";
sourceTree = "<group>";
};
F088488D19FF8C41007FFCF3 /* UIContactCell.xib */ = {
isa = PBXVariantGroup;
children = (
F088488C19FF8C41007FFCF3 /* Base */,
F088488F19FF8C44007FFCF3 /* fr */,
);
name = UIContactCell.xib;
sourceTree = "<group>";
};
F08F118B19C09C6B007D70C2 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (