From cf7bbeb0831920b44bde4edc70a0174c0b5e8cf1 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 20 Nov 2014 10:50:20 +0100 Subject: [PATCH] Remove French and Russian HistoryDetails xibs, and use new UIButtonShrinkable instead to make text fit the button width --- .../HistoryDetailsViewController.xib | 15 +- Classes/HistoryDetailsViewController.m | 1 + Classes/LinphoneUI/UIButtonShrinkable.h | 24 ++ Classes/LinphoneUI/UIButtonShrinkable.m | 34 +++ .../HistoryDetailsViewController.strings | 69 +++++ .../fr.lproj/HistoryDetailsViewController.xib | 266 ------------------ .../HistoryDetailsViewController.strings | 69 +++++ .../ru.lproj/HistoryDetailsViewController.xib | 266 ------------------ linphone.xcodeproj/project.pbxproj | 14 +- 9 files changed, 218 insertions(+), 540 deletions(-) create mode 100644 Classes/LinphoneUI/UIButtonShrinkable.h create mode 100644 Classes/LinphoneUI/UIButtonShrinkable.m create mode 100644 Classes/fr.lproj/HistoryDetailsViewController.strings delete mode 100644 Classes/fr.lproj/HistoryDetailsViewController.xib create mode 100644 Classes/ru.lproj/HistoryDetailsViewController.strings delete mode 100644 Classes/ru.lproj/HistoryDetailsViewController.xib diff --git a/Classes/Base.lproj/HistoryDetailsViewController.xib b/Classes/Base.lproj/HistoryDetailsViewController.xib index 3229d1c40..9107c8827 100644 --- a/Classes/Base.lproj/HistoryDetailsViewController.xib +++ b/Classes/Base.lproj/HistoryDetailsViewController.xib @@ -1,8 +1,8 @@ - + - - + + @@ -250,6 +250,8 @@ + + @@ -263,4 +265,9 @@ - \ No newline at end of file + + + + + + diff --git a/Classes/HistoryDetailsViewController.m b/Classes/HistoryDetailsViewController.m index 3b9d34051..d9261bd7c 100644 --- a/Classes/HistoryDetailsViewController.m +++ b/Classes/HistoryDetailsViewController.m @@ -113,6 +113,7 @@ static UICompositeViewDescription *compositeDescription = nil; [HistoryDetailsViewController adaptSize:durationHeaderLabel field:durationLabel]; [HistoryDetailsViewController adaptSize:typeHeaderLabel field:typeLabel]; [HistoryDetailsViewController adaptSize:plainAddressHeaderLabel field:plainAddressLabel]; + [addContactButton.titleLabel setAdjustsFontSizeToFitWidth:TRUE]; // Auto shrink: IB lack! [callButton.titleLabel setAdjustsFontSizeToFitWidth:TRUE]; // Auto shrink: IB lack! [messageButton.titleLabel setAdjustsFontSizeToFitWidth:TRUE]; // Auto shrink: IB lack! } diff --git a/Classes/LinphoneUI/UIButtonShrinkable.h b/Classes/LinphoneUI/UIButtonShrinkable.h new file mode 100644 index 000000000..0691daf0b --- /dev/null +++ b/Classes/LinphoneUI/UIButtonShrinkable.h @@ -0,0 +1,24 @@ +/* UIButtonShrinkable + * + * Copyright (C) 2011 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import + +@protocol UIButtonShrinkable : UIButton + +@end diff --git a/Classes/LinphoneUI/UIButtonShrinkable.m b/Classes/LinphoneUI/UIButtonShrinkable.m new file mode 100644 index 000000000..40c63f18a --- /dev/null +++ b/Classes/LinphoneUI/UIButtonShrinkable.m @@ -0,0 +1,34 @@ +/* UIButtonShrinkable + * + * Copyright (C) 2011 Belledonne Comunications, Grenoble, France + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#import "UIButtonShrinkable.h" + +@implementation UIButtonShrinkable : UIButton + +- (instancetype)init { + self = [super init]; + if (self) { + // automatically adjust title to fit available width + [self.titleLabel setAdjustsFontSizeToFitWidth:TRUE]; + } + return self; +} + + +@end diff --git a/Classes/fr.lproj/HistoryDetailsViewController.strings b/Classes/fr.lproj/HistoryDetailsViewController.strings new file mode 100644 index 000000000..de77c7efc --- /dev/null +++ b/Classes/fr.lproj/HistoryDetailsViewController.strings @@ -0,0 +1,69 @@ + +/* Class = "IBUIButton"; accessibilityLabel = "Retour"; ObjectID = "9"; */ +"9.accessibilityLabel" = "Retour"; + +/* Class = "IBUIButton"; normalTitle = "Retour"; ObjectID = "9"; */ +"9.normalTitle" = "Retour"; + +/* Class = "IBUIImageView"; accessibilityLabel = "Avatar du contact"; ObjectID = "23"; */ +"23.accessibilityLabel" = "Avatar du contact"; + +/* Class = "IBUILabel"; accessibilityLabel = "Nom du contact"; ObjectID = "25"; */ +"25.accessibilityLabel" = "Nom du contact"; + +/* Class = "IBUILabel"; text = "Contact1"; ObjectID = "25"; */ +"25.text" = "Contact1"; + +/* Class = "IBUILabel"; text = "Date:"; ObjectID = "27"; */ +"27.text" = "Date:"; + +/* Class = "IBUILabel"; accessibilityLabel = "Date de l'appel"; ObjectID = "28"; */ +"28.accessibilityLabel" = "Date de l'appel"; + +/* Class = "IBUILabel"; text = "11/11/2011 at 10:01"; ObjectID = "28"; */ +"28.text" = "11/11/2011 at 10:01"; + +/* Class = "IBUILabel"; text = "Durée:"; ObjectID = "31"; */ +"31.text" = "Durée:"; + +/* Class = "IBUILabel"; accessibilityLabel = "Durée de l'appel"; ObjectID = "32"; */ +"32.accessibilityLabel" = "Durée de l'appel"; + +/* Class = "IBUILabel"; text = "9:05"; ObjectID = "32"; */ +"32.text" = "9:05"; + +/* Class = "IBUILabel"; accessibilityLabel = "Type d'appel"; ObjectID = "35"; */ +"35.accessibilityLabel" = "Type d'appel"; + +/* Class = "IBUILabel"; text = "outgoing call"; ObjectID = "35"; */ +"35.text" = "outgoing call"; + +/* Class = "IBUILabel"; text = "Type:"; ObjectID = "36"; */ +"36.text" = "Type:"; + +/* Class = "IBUIButton"; accessibilityLabel = "Rappeler"; ObjectID = "37"; */ +"37.accessibilityLabel" = "Rappeler"; + +/* Class = "IBUIButton"; normalTitle = "Call"; ObjectID = "37"; */ +"37.normalTitle" = "Call"; + +/* Class = "IBUIButton"; accessibilityLabel = "Ajouter au contact"; ObjectID = "50"; */ +"50.accessibilityLabel" = "Ajouter au contact"; + +/* Class = "IBUIButton"; normalTitle = "Ajouter aux contacts"; ObjectID = "50"; */ +"50.normalTitle" = "Ajouter aux contacts"; + +/* Class = "IBUILabel"; text = "Adresse:"; ObjectID = "55"; */ +"55.text" = "Adresse:"; + +/* Class = "IBUILabel"; accessibilityLabel = "Adresse"; ObjectID = "56"; */ +"56.accessibilityLabel" = "Adresse"; + +/* Class = "IBUILabel"; text = "0102030405"; ObjectID = "56"; */ +"56.text" = "0102030405"; + +/* Class = "IBUIButton"; accessibilityLabel = "Envoyer un message"; ObjectID = "59"; */ +"59.accessibilityLabel" = "Envoyer un message"; + +/* Class = "IBUIButton"; normalTitle = "Envoyer un message"; ObjectID = "59"; */ +"59.normalTitle" = "Envoyer un message"; diff --git a/Classes/fr.lproj/HistoryDetailsViewController.xib b/Classes/fr.lproj/HistoryDetailsViewController.xib deleted file mode 100644 index 11e9f2bb0..000000000 --- a/Classes/fr.lproj/HistoryDetailsViewController.xib +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Classes/ru.lproj/HistoryDetailsViewController.strings b/Classes/ru.lproj/HistoryDetailsViewController.strings new file mode 100644 index 000000000..6afd1a47d --- /dev/null +++ b/Classes/ru.lproj/HistoryDetailsViewController.strings @@ -0,0 +1,69 @@ + +/* Class = "IBUIButton"; accessibilityLabel = "Назад"; ObjectID = "9"; */ +"9.accessibilityLabel" = "Назад"; + +/* Class = "IBUIButton"; normalTitle = "Назад"; ObjectID = "9"; */ +"9.normalTitle" = "Назад"; + +/* Class = "IBUIImageView"; accessibilityLabel = "Аватар контакта"; ObjectID = "23"; */ +"23.accessibilityLabel" = "Аватар контакта"; + +/* Class = "IBUILabel"; accessibilityLabel = "Имя контакта"; ObjectID = "25"; */ +"25.accessibilityLabel" = "Имя контакта"; + +/* Class = "IBUILabel"; text = "Contact1"; ObjectID = "25"; */ +"25.text" = "Contact1"; + +/* Class = "IBUILabel"; text = "Дата:"; ObjectID = "27"; */ +"27.text" = "Дата:"; + +/* Class = "IBUILabel"; accessibilityLabel = "Дата звонка"; ObjectID = "28"; */ +"28.accessibilityLabel" = "Дата звонка"; + +/* Class = "IBUILabel"; text = "11/11/2011 at 10:01"; ObjectID = "28"; */ +"28.text" = "11/11/2011 at 10:01"; + +/* Class = "IBUILabel"; text = "Длительность:"; ObjectID = "31"; */ +"31.text" = "Длительность:"; + +/* Class = "IBUILabel"; accessibilityLabel = "Длительность звонка"; ObjectID = "32"; */ +"32.accessibilityLabel" = "Длительность звонка"; + +/* Class = "IBUILabel"; text = "9:05"; ObjectID = "32"; */ +"32.text" = "9:05"; + +/* Class = "IBUILabel"; accessibilityLabel = "Тип звонка"; ObjectID = "35"; */ +"35.accessibilityLabel" = "Тип звонка"; + +/* Class = "IBUILabel"; text = "outgoing call"; ObjectID = "35"; */ +"35.text" = "outgoing call"; + +/* Class = "IBUILabel"; text = "Тип:"; ObjectID = "36"; */ +"36.text" = "Тип:"; + +/* Class = "IBUIButton"; accessibilityLabel = "Позвонить"; ObjectID = "37"; */ +"37.accessibilityLabel" = "Позвонить"; + +/* Class = "IBUIButton"; normalTitle = "Call"; ObjectID = "37"; */ +"37.normalTitle" = "Call"; + +/* Class = "IBUIButton"; accessibilityLabel = "Добавить к контактам"; ObjectID = "50"; */ +"50.accessibilityLabel" = "Добавить к контактам"; + +/* Class = "IBUIButton"; normalTitle = "Добавить к контактам"; ObjectID = "50"; */ +"50.normalTitle" = "Добавить к контактам"; + +/* Class = "IBUILabel"; text = "Адрес:"; ObjectID = "55"; */ +"55.text" = "Адрес:"; + +/* Class = "IBUILabel"; accessibilityLabel = "Адрес"; ObjectID = "56"; */ +"56.accessibilityLabel" = "Адрес"; + +/* Class = "IBUILabel"; text = "0102030405"; ObjectID = "56"; */ +"56.text" = "0102030405"; + +/* Class = "IBUIButton"; accessibilityLabel = "Послать сообщение"; ObjectID = "59"; */ +"59.accessibilityLabel" = "Послать сообщение"; + +/* Class = "IBUIButton"; normalTitle = "Послать сообщение"; ObjectID = "59"; */ +"59.normalTitle" = "Послать сообщение"; diff --git a/Classes/ru.lproj/HistoryDetailsViewController.xib b/Classes/ru.lproj/HistoryDetailsViewController.xib deleted file mode 100644 index 60859a8fb..000000000 --- a/Classes/ru.lproj/HistoryDetailsViewController.xib +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index a1273f06c..fcfc5081e 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -117,6 +117,7 @@ 636316D11A1DEBCB0009B839 /* AboutViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D31A1DEBCB0009B839 /* AboutViewController.xib */; }; 636316D41A1DEC650009B839 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D61A1DEC650009B839 /* SettingsViewController.xib */; }; 636316D91A1DECC90009B839 /* PhoneMainView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 636316D71A1DECC90009B839 /* PhoneMainView.xib */; }; + 636316DE1A1DEF2F0009B839 /* UIButtonShrinkable.m in Sources */ = {isa = PBXBuildFile; fileRef = 636316DD1A1DEF2F0009B839 /* UIButtonShrinkable.m */; }; 70571E1A13FABCB000CDD3C2 /* rootca.pem in Resources */ = {isa = PBXBuildFile; fileRef = 70571E1913FABCB000CDD3C2 /* rootca.pem */; }; 7066FC0C13E830E400EFC6DC /* libvpx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7066FC0B13E830E400EFC6DC /* libvpx.a */; }; 70E542F313E147E3002BA2C0 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70E542F213E147E3002BA2C0 /* OpenGLES.framework */; }; @@ -948,6 +949,10 @@ 636316D21A1DEBCB0009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AboutViewController.xib; sourceTree = ""; }; 636316D51A1DEC650009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/SettingsViewController.xib; sourceTree = ""; }; 636316D81A1DECC90009B839 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PhoneMainView.xib; sourceTree = ""; }; + 636316DA1A1DEDD40009B839 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/HistoryDetailsViewController.strings; sourceTree = ""; }; + 636316DB1A1DEDD80009B839 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/HistoryDetailsViewController.strings; sourceTree = ""; }; + 636316DC1A1DEECB0009B839 /* UIButtonShrinkable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIButtonShrinkable.h; sourceTree = ""; }; + 636316DD1A1DEF2F0009B839 /* UIButtonShrinkable.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UIButtonShrinkable.m; sourceTree = ""; }; 70571E1913FABCB000CDD3C2 /* rootca.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = rootca.pem; path = "liblinphone-sdk/apple-darwin/share/linphone/rootca.pem"; sourceTree = ""; }; 7066FC0B13E830E400EFC6DC /* libvpx.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libvpx.a; path = "liblinphone-sdk/apple-darwin/lib/libvpx.a"; sourceTree = ""; }; 70E542F213E147E3002BA2C0 /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; @@ -1227,7 +1232,6 @@ D380800415C28A7A005BE9BC /* UILinphone.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UILinphone.m; sourceTree = ""; }; D380801115C29984005BE9BC /* ColorSpaceUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ColorSpaceUtilities.h; path = Utils/ColorSpaceUtilities.h; sourceTree = ""; }; D380801215C299D0005BE9BC /* ColorSpaceUtilites.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ColorSpaceUtilites.m; path = Utils/ColorSpaceUtilites.m; sourceTree = ""; }; - D381883315FE447200C3EDCA /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/HistoryDetailsViewController.xib; sourceTree = ""; }; D381884815FE448400C3EDCA /* fr */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = fr; path = fr.lproj/UICallCell.xib; sourceTree = ""; }; D381885815FE44A700C3EDCA /* fr */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = fr; path = Resources/fr.lproj/Localizable.strings; sourceTree = ""; }; D38327EB1580FE3A00FA0D23 /* contacts_default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = contacts_default.png; path = Resources/contacts_default.png; sourceTree = ""; }; @@ -1700,7 +1704,6 @@ F84015BE1939FE37006ABAB5 /* test_passed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = test_passed.png; path = Resources/test_passed.png; sourceTree = ""; }; F84015C5193B4E34006ABAB5 /* LogsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogsViewController.h; sourceTree = ""; }; F84015C6193B4E34006ABAB5 /* LogsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LogsViewController.m; sourceTree = ""; }; - FD61C862169FC495001AA2D6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/HistoryDetailsViewController.xib; sourceTree = ""; }; FD61C88216A00E69001AA2D6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = ru; path = ru.lproj/UICallCell.xib; sourceTree = ""; }; FD979F30169E84670022A8B4 /* ru */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = ru; path = Resources/ru.lproj/Localizable.strings; sourceTree = ""; }; /* End PBXFileReference section */ @@ -1931,6 +1934,8 @@ D35E7580159328EB0066B1C1 /* UIAddressTextField.m */, 22C7555E1317E59C007BC101 /* UIBluetoothButton.h */, 22C7555F1317E59C007BC101 /* UIBluetoothButton.m */, + 636316DC1A1DEECB0009B839 /* UIButtonShrinkable.h */, + 636316DD1A1DEF2F0009B839 /* UIButtonShrinkable.m */, D326483B1588950F00930C67 /* UICallBar.h */, D326483C1588950F00930C67 /* UICallBar.m */, D38187E415FE349700C3EDCA /* UICallBar.xib */, @@ -3690,6 +3695,7 @@ D3128FE115AABC7E00A2147A /* ContactDetailsViewController.m in Sources */, D37C639515AADDAF009D0BAC /* UIContactDetailsHeader.m in Sources */, D37C639B15AADEF6009D0BAC /* ContactDetailsTableViewController.m in Sources */, + 636316DE1A1DEF2F0009B839 /* UIButtonShrinkable.m in Sources */, D3C6526715AC1A8F0092A874 /* UIEditableTableViewCell.m in Sources */, D378906515AC373B00BD776C /* ContactDetailsLabelViewController.m in Sources */, D3E8F68615ADE05B0065A226 /* UIContactDetailsFooter.m in Sources */, @@ -3902,9 +3908,9 @@ D38187D015FE346700C3EDCA /* HistoryDetailsViewController.xib */ = { isa = PBXVariantGroup; children = ( - D381883315FE447200C3EDCA /* fr */, - FD61C862169FC495001AA2D6 /* ru */, F09548201883F15400E8A69B /* Base */, + 636316DA1A1DEDD40009B839 /* fr */, + 636316DB1A1DEDD80009B839 /* ru */, ); name = HistoryDetailsViewController.xib; sourceTree = "";