From 213220510b7d006c3ef631431aed5d0b9117934c Mon Sep 17 00:00:00 2001 From: Aric <78001398+arichorn@users.noreply.github.com> Date: Mon, 30 Jan 2023 18:47:14 -0600 Subject: [PATCH 1/4] option to enable iPhone Layout --- Settings.xm | 10 ++++++++++ uYouPlus.xm | 26 ++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/Settings.xm b/Settings.xm index 328f281..5656e35 100644 --- a/Settings.xm +++ b/Settings.xm @@ -398,6 +398,16 @@ extern NSBundle *uYouPlusBundle(); return YES; } settingItemId:0], + + [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"IPHONE_LAYOUT") + titleDescription:LOC(@"IPHONE_LAYOUT_DESC") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"iPhoneLayout_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"iPhoneLayout_enabled"]; + return YES; + } + settingItemId:0], [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"NEW_MINIPLAYER_STYLE") titleDescription:LOC(@"NEW_MINIPLAYER_STYLE_DESC") diff --git a/uYouPlus.xm b/uYouPlus.xm index 250f230..2354b25 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -1300,6 +1300,29 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: // %end %end +%group giPhoneLayout +%hook UIDevice +- (long long)userInterfaceIdiom { + return NO; +} +%end +%hook UIStatusBarStyleAttributes +- (long long)idiom { + return YES; +} +%end +%hook UIKBTree +- (long long)nativeIdiom { + return YES; +} +%end +%hook UIKBRenderer +- (long long)assetIdiom { + return YES; +} +%end +%end + # pragma mark - ctor %ctor { // Load uYou first so its functions are available for hooks. @@ -1342,6 +1365,9 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: if (IsEnabled(@"hideChipBar_enabled")) { %init(gHideChipBar); } + if (IsEnabled(@"iPhoneLayout_enabled")) { + %init(giPhoneLayout); + } // Disable updates [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"automaticallyCheckForUpdates"]; From 7b03afe3769204c2e6bac1e43189713abe315535 Mon Sep 17 00:00:00 2001 From: Aric <78001398+arichorn@users.noreply.github.com> Date: Mon, 30 Jan 2023 18:50:44 -0600 Subject: [PATCH 2/4] update strings --- lang/uYouPlus.bundle/ar.lproj/Localizable.strings | 3 +++ lang/uYouPlus.bundle/cz.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/de.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/el.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/en.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/es.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/fr.lproj/Localizable.strings | 3 +++ lang/uYouPlus.bundle/he.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/hu.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/it.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/ja.lproj/Localizable.strings | 3 +++ lang/uYouPlus.bundle/ko.lproj/Localizable.strings | 3 +++ lang/uYouPlus.bundle/nl.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/pl.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/pt.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/ro.lproj/Localizable.strings | 3 +++ lang/uYouPlus.bundle/ru.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/template.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/tr.lproj/Localizable.strings | 5 ++++- lang/uYouPlus.bundle/vi.lproj/Localizable.strings | 3 +++ lang/uYouPlus.bundle/zh_cn.lproj/Localizable.strings | 3 +++ lang/uYouPlus.bundle/zh_tw.lproj/Localizable.strings | 5 ++++- 22 files changed, 81 insertions(+), 15 deletions(-) diff --git a/lang/uYouPlus.bundle/ar.lproj/Localizable.strings b/lang/uYouPlus.bundle/ar.lproj/Localizable.strings index 607a1b2..973d8bd 100644 --- a/lang/uYouPlus.bundle/ar.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/ar.lproj/Localizable.strings @@ -120,3 +120,6 @@ "YT_RE_EXPLORE" = "استبدال تبويب Shorts بتبويب Explore (أداة YTReExplore)"; "YT_RE_EXPLORE_DESC" = " تتطلب إغلاق التطبيق وإعادة فتحه."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/cz.lproj/Localizable.strings b/lang/uYouPlus.bundle/cz.lproj/Localizable.strings index ed88ee5..5be67e5 100644 --- a/lang/uYouPlus.bundle/cz.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/cz.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Je potřeba restart aplikace."; "YT_RE_EXPLORE" = "Nahradit záložku Shorts tab záložkou Explore (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "Je potřeba restart aplikace."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Je potřeba restart aplikace."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/de.lproj/Localizable.strings b/lang/uYouPlus.bundle/de.lproj/Localizable.strings index 8abc61f..663e8a4 100644 --- a/lang/uYouPlus.bundle/de.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/de.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "App-Neustart erforderlich!"; "YT_RE_EXPLORE" = "Shorts-Tab durch Entdecken-Tab ersetzen (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "App-Neustart erforderlich!"; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "App-Neustart erforderlich!"; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/el.lproj/Localizable.strings b/lang/uYouPlus.bundle/el.lproj/Localizable.strings index 85847ec..ee39853 100644 --- a/lang/uYouPlus.bundle/el.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/el.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Απαιτείται επανεκκίνηση της εφαρμογής."; "YT_RE_EXPLORE" = "Αντικατάσταση της καρτέλας Shorts με την καρτέλα Explore (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "Απαιτείται επανεκκίνηση της εφαρμογής."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Απαιτείται επανεκκίνηση της εφαρμογής."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/en.lproj/Localizable.strings b/lang/uYouPlus.bundle/en.lproj/Localizable.strings index 6b44662..14da76a 100644 --- a/lang/uYouPlus.bundle/en.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/en.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "App restart is required."; "YT_RE_EXPLORE" = "Replace Shorts tab with Explore tab (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "App restart is required."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "App restart is required."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/es.lproj/Localizable.strings b/lang/uYouPlus.bundle/es.lproj/Localizable.strings index e809943..41c14a7 100644 --- a/lang/uYouPlus.bundle/es.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/es.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Requiere reiniciar la app."; "YT_RE_EXPLORE" = "Reemplazar pestaña de Cortos con pestaña de Explorar (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "Requiere reiniciar la app."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Requiere reiniciar la app."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/fr.lproj/Localizable.strings b/lang/uYouPlus.bundle/fr.lproj/Localizable.strings index 31f43a0..ff1f470 100644 --- a/lang/uYouPlus.bundle/fr.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/fr.lproj/Localizable.strings @@ -120,3 +120,6 @@ "YT_RE_EXPLORE" = "Remplacer l'onglet Shorts par l'onglet Explorer (YTReExplore)"; "YT_RE_EXPLORE_DESC" = "Un redémarrage de l'application est nécessaire"; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/he.lproj/Localizable.strings b/lang/uYouPlus.bundle/he.lproj/Localizable.strings index 234db4c..ff25188 100644 --- a/lang/uYouPlus.bundle/he.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/he.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "נדרש לפתוח מחדש את היישום."; "YT_RE_EXPLORE" = "החלף את לשונית ה-Shorts בלשונית Explore (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "נדרש לפתוח מחדש את היישום."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "נדרש לפתוח מחדש את היישום."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/hu.lproj/Localizable.strings b/lang/uYouPlus.bundle/hu.lproj/Localizable.strings index 1e286b0..912f346 100644 --- a/lang/uYouPlus.bundle/hu.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/hu.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Az alkalmazás újraindítása szükséges."; "YT_RE_EXPLORE" = "Cserélje le a Shorts fület a Felfedezés fülre (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "Az alkalmazás újraindítása szükséges."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Az alkalmazás újraindítása szükséges."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/it.lproj/Localizable.strings b/lang/uYouPlus.bundle/it.lproj/Localizable.strings index f425044..1480f88 100644 --- a/lang/uYouPlus.bundle/it.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/it.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "È richiesto un riavvio dell'app."; "YT_RE_EXPLORE" = "Sostituisci il tab Shorts con il tab Esplora (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "È richiesto un riavvio dell'app."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "È richiesto un riavvio dell'app."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/ja.lproj/Localizable.strings b/lang/uYouPlus.bundle/ja.lproj/Localizable.strings index cb405a4..be3088b 100644 --- a/lang/uYouPlus.bundle/ja.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/ja.lproj/Localizable.strings @@ -120,3 +120,6 @@ "YT_RE_EXPLORE" = "ショートタブを探索タブに置き換える (YTReExplore)"; "YT_RE_EXPLORE_DESC" = "アプリの再起動が必要です。"; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/ko.lproj/Localizable.strings b/lang/uYouPlus.bundle/ko.lproj/Localizable.strings index a3723c7..e6fa96a 100644 --- a/lang/uYouPlus.bundle/ko.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/ko.lproj/Localizable.strings @@ -120,3 +120,6 @@ "YT_RE_EXPLORE" = "Shorts 탭 대신 탐색 탭 보이기 (YTReExplore)"; "YT_RE_EXPLORE_DESC" = "앱을 다시 시작해야 합니다."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/nl.lproj/Localizable.strings b/lang/uYouPlus.bundle/nl.lproj/Localizable.strings index 31a0dce..d8ec9a7 100644 --- a/lang/uYouPlus.bundle/nl.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/nl.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Je moet de app opnieuw opstarten om dit te activeren."; "YT_RE_EXPLORE" = "Vervang Shorts met Ontdekken (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "Je moet de app opnieuw opstarten om dit te activeren."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Je moet de app opnieuw opstarten om dit te activeren."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/pl.lproj/Localizable.strings b/lang/uYouPlus.bundle/pl.lproj/Localizable.strings index 162f0eb..7936915 100644 --- a/lang/uYouPlus.bundle/pl.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/pl.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Restart aplikacji jest wymagany."; "YT_RE_EXPLORE" = "Zamień kartę Shorts na kartę Odkrywaj (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "Restart aplikacji jest wymagany."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Restart aplikacji jest wymagany."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/pt.lproj/Localizable.strings b/lang/uYouPlus.bundle/pt.lproj/Localizable.strings index 24d7b08..f06d5c9 100644 --- a/lang/uYouPlus.bundle/pt.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/pt.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "A reinicialização do app é necessária."; "YT_RE_EXPLORE" = "Substituir a guia Shorts pela guia Explorar (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "A reinicialização do app é necessária."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "A reinicialização do app é necessária."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/ro.lproj/Localizable.strings b/lang/uYouPlus.bundle/ro.lproj/Localizable.strings index fb980d3..96758f0 100644 --- a/lang/uYouPlus.bundle/ro.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/ro.lproj/Localizable.strings @@ -120,3 +120,6 @@ "YT_RE_EXPLORE" = "Înlocuire fila Shorts cu fila Explore (YTReExplore)"; "YT_RE_EXPLORE_DESC" = "Este necesară repornirea aplicației."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/ru.lproj/Localizable.strings b/lang/uYouPlus.bundle/ru.lproj/Localizable.strings index 5cdd8f3..783c9ac 100644 --- a/lang/uYouPlus.bundle/ru.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/ru.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Потребуется перезагрузка."; "YT_RE_EXPLORE" = "Вкладка «Навигация» вместо «Shorts»"; -"YT_RE_EXPLORE_DESC" = "Потребуется перезагрузка."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Потребуется перезагрузка."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/template.lproj/Localizable.strings b/lang/uYouPlus.bundle/template.lproj/Localizable.strings index 423e588..3ce1627 100644 --- a/lang/uYouPlus.bundle/template.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/template.lproj/Localizable.strings @@ -134,4 +134,7 @@ https://github.com/PoomSmart/Return-YouTube-Dislikes/tree/main/layout/Library/Ap "NEW_MINIPLAYER_STYLE_DESC" = "App restart is required."; "YT_RE_EXPLORE" = "Replace Shorts tab with Explore tab (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "App restart is required."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "App restart is required."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/tr.lproj/Localizable.strings b/lang/uYouPlus.bundle/tr.lproj/Localizable.strings index a428458..3804548 100644 --- a/lang/uYouPlus.bundle/tr.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/tr.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "Uygulamanın yeniden başlatılması gerekir."; "YT_RE_EXPLORE" = "Shorts sekmesini Keşfet sekmesiyle değiştirin (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "Uygulamanın yeniden başlatılması gerekir."; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "Uygulamanın yeniden başlatılması gerekir."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/vi.lproj/Localizable.strings b/lang/uYouPlus.bundle/vi.lproj/Localizable.strings index e8253ef..682d201 100644 --- a/lang/uYouPlus.bundle/vi.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/vi.lproj/Localizable.strings @@ -120,3 +120,6 @@ "YT_RE_EXPLORE" = "Thay thế tab Shorts bằng tab Khám phá (YTReExplore)"; "YT_RE_EXPLORE_DESC" = "Cần khởi động lại ứng dụng."; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/zh_cn.lproj/Localizable.strings b/lang/uYouPlus.bundle/zh_cn.lproj/Localizable.strings index 488662a..59bdf24 100644 --- a/lang/uYouPlus.bundle/zh_cn.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/zh_cn.lproj/Localizable.strings @@ -120,3 +120,6 @@ "YT_RE_EXPLORE" = "将 Shorts 选项卡替换成探索选项卡 (YTReExplore)"; "YT_RE_EXPLORE_DESC" = "更改本设置后需要重启 App。"; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; diff --git a/lang/uYouPlus.bundle/zh_tw.lproj/Localizable.strings b/lang/uYouPlus.bundle/zh_tw.lproj/Localizable.strings index a9234a7..2a87942 100644 --- a/lang/uYouPlus.bundle/zh_tw.lproj/Localizable.strings +++ b/lang/uYouPlus.bundle/zh_tw.lproj/Localizable.strings @@ -119,4 +119,7 @@ "NEW_MINIPLAYER_STYLE_DESC" = "需要重新啟動應用程式。"; "YT_RE_EXPLORE" = "用探索選項卡代替 Shorts 選項卡 (YTReExplore)"; -"YT_RE_EXPLORE_DESC" = "需要重新啟動應用程式。"; \ No newline at end of file +"YT_RE_EXPLORE_DESC" = "需要重新啟動應用程式。"; + +"IPHONE_LAYOUT" = "iPhone Layout"; +"IPHONE_LAYOUT_DESC" = "Toggle to use the iPhone Layout. App restart is required."; From 7139db47bc770804e5ce079fb5d195cb4dcc1fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BA=A1t?= <52943116+qnblackcat@users.noreply.github.com> Date: Sun, 5 Feb 2023 13:17:07 +0700 Subject: [PATCH 3/4] enable for iPad only --- uYouPlus.xm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uYouPlus.xm b/uYouPlus.xm index 2354b25..fb4afe2 100644 --- a/uYouPlus.xm +++ b/uYouPlus.xm @@ -1365,7 +1365,7 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: if (IsEnabled(@"hideChipBar_enabled")) { %init(gHideChipBar); } - if (IsEnabled(@"iPhoneLayout_enabled")) { + if (IsEnabled(@"iPhoneLayout_enabled") && (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad)) { %init(giPhoneLayout); } From c7be5fa51a748a19e51b6656cf06d4026edb2925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20=C4=90=E1=BA=A1t?= <52943116+qnblackcat@users.noreply.github.com> Date: Sun, 5 Feb 2023 13:18:49 +0700 Subject: [PATCH 4/4] only show the option on iPad --- Settings.xm | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/Settings.xm b/Settings.xm index 5656e35..83acc5e 100644 --- a/Settings.xm +++ b/Settings.xm @@ -92,7 +92,7 @@ extern NSBundle *uYouPlusBundle(); return YES; } settingItemId:0], - ]; + ]; YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_PLAYER_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]]; [settingsViewController pushViewController:picker]; return YES; @@ -211,8 +211,7 @@ extern NSBundle *uYouPlusBundle(); return YES; } settingItemId:0], - - ]; + ]; YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"VIDEO_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]]; [settingsViewController pushViewController:picker]; return YES; @@ -291,7 +290,7 @@ extern NSBundle *uYouPlusBundle(); return YES; } settingItemId:0], - ]; + ]; YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"SHORTS_CONTROLS_OVERLAY_OPTIONS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]]; [settingsViewController pushViewController:picker]; return YES; @@ -398,16 +397,6 @@ extern NSBundle *uYouPlusBundle(); return YES; } settingItemId:0], - - [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"IPHONE_LAYOUT") - titleDescription:LOC(@"IPHONE_LAYOUT_DESC") - accessibilityIdentifier:nil - switchOn:IsEnabled(@"iPhoneLayout_enabled") - switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { - [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"iPhoneLayout_enabled"]; - return YES; - } - settingItemId:0], [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"NEW_MINIPLAYER_STYLE") titleDescription:LOC(@"NEW_MINIPLAYER_STYLE_DESC") @@ -428,7 +417,22 @@ extern NSBundle *uYouPlusBundle(); return YES; } settingItemId:0], - ]; + ]; + + if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) { + YTSettingsSectionItem *ipadItem = [YTSettingsSectionItemClass switchItemWithTitle:LOC(@"IPHONE_LAYOUT") + titleDescription:LOC(@"IPHONE_LAYOUT_DESC") + accessibilityIdentifier:nil + switchOn:IsEnabled(@"iPhoneLayout_enabled") + switchBlock:^BOOL (YTSettingsCell *cell, BOOL enabled) { + [[NSUserDefaults standardUserDefaults] setBool:enabled forKey:@"iPhoneLayout_enabled"]; + return YES; + } + settingItemId:0]; + + rows = [rows arrayByAddingObject:ipadItem]; + } + YTSettingsPickerViewController *picker = [[%c(YTSettingsPickerViewController) alloc] initWithNavTitle:LOC(@"MISCELLANEOUS") pickerSectionTitle:nil rows:rows selectedItemIndex:NSNotFound parentResponder:[self parentResponder]]; [settingsViewController pushViewController:picker]; return YES;