diff --git a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/bottombar/MenuBottomBarFragment.kt b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/bottombar/MenuBottomBarFragment.kt index d3003991..06beee6a 100644 --- a/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/bottombar/MenuBottomBarFragment.kt +++ b/app/src/main/java/com/futo/platformplayer/fragment/mainactivity/bottombar/MenuBottomBarFragment.kt @@ -209,26 +209,30 @@ class MenuBottomBarFragment : MainActivityFragment() { _moreButtons.clear(); _layoutMoreButtons.removeAllViews(); + var insertedButtons = 0; //Force buy to be on top for more buttons val buyIndex = buttons.indexOfFirst { b -> b.id == 98 }; if (buyIndex != -1) { val button = buttons[buyIndex] buttons.removeAt(buyIndex) buttons.add(0, button) + insertedButtons++; } //Force faq to be second val faqIndex = buttons.indexOfFirst { b -> b.id == 97 }; if (faqIndex != -1) { val button = buttons[faqIndex] buttons.removeAt(faqIndex) - buttons.add(if (buttons.size == 1) 1 else 0, button) + buttons.add(if (insertedButtons == 1) 1 else 0, button) + insertedButtons++; } //Force privacy to be third val privacyIndex = buttons.indexOfFirst { b -> b.id == 96 }; if (privacyIndex != -1) { val button = buttons[privacyIndex] buttons.removeAt(privacyIndex) - buttons.add(if (buttons.size == 2) 2 else 1, button) + buttons.add(if (insertedButtons == 2) 2 else (if(insertedButtons == 1) 1 else 0), button) + insertedButtons++; } for (data in buttons) { @@ -310,19 +314,6 @@ class MenuBottomBarFragment : MainActivityFragment() { if (!StatePayment.instance.hasPaid) { newCurrentButtonDefinitions.add(ButtonDefinition(98, R.drawable.ic_paid, R.drawable.ic_paid_filled, R.string.buy, canToggle = false, { it.currentMain is BuyFragment }, { it.navigate() })) } - newCurrentButtonDefinitions.add(ButtonDefinition(97, R.drawable.ic_quiz, R.drawable.ic_quiz_fill, R.string.faq, canToggle = false, { false }, { - it.navigate(Settings.URL_FAQ); - })) - newCurrentButtonDefinitions.add(ButtonDefinition(96, R.drawable.ic_disabled_visible, R.drawable.ic_disabled_visible, R.string.privacy_mode, canToggle = false, { false }, { - UIDialogs.showDialog(context, R.drawable.ic_disabled_visible_purple, "Privacy Mode", - "All requests will be processed anonymously (unauthenticated), playback and history tracking will be disabled.\n\nTap the icon to disable.", null, 0, - UIDialogs.Action("Cancel", { - StateApp.instance.setPrivacyMode(false); - }, UIDialogs.ActionStyle.NONE), - UIDialogs.Action("Enable", { - StateApp.instance.setPrivacyMode(true); - }, UIDialogs.ActionStyle.PRIMARY)); - })) //Add conditional buttons here, when you add a conditional button, be sure to add the register and unregister events for when the button needs to be updated @@ -395,6 +386,19 @@ class MenuBottomBarFragment : MainActivityFragment() { if (c is Activity) { c.overridePendingTransition(R.anim.slide_in_up, R.anim.slide_darken); } + }), + ButtonDefinition(96, R.drawable.ic_disabled_visible, R.drawable.ic_disabled_visible, R.string.privacy_mode, canToggle = true, { false }, { + UIDialogs.showDialog(it.context ?: return@ButtonDefinition, R.drawable.ic_disabled_visible_purple, "Privacy Mode", + "All requests will be processed anonymously (unauthenticated), playback and history tracking will be disabled.\n\nTap the icon to disable.", null, 0, + UIDialogs.Action("Cancel", { + StateApp.instance.setPrivacyMode(false); + }, UIDialogs.ActionStyle.NONE), + UIDialogs.Action("Enable", { + StateApp.instance.setPrivacyMode(true); + }, UIDialogs.ActionStyle.PRIMARY)); + }), + ButtonDefinition(97, R.drawable.ic_quiz, R.drawable.ic_quiz_fill, R.string.faq, canToggle = true, { false }, { + it.navigate(Settings.URL_FAQ); }) //96 is reserved for privacy button //98 is reserved for buy button diff --git a/app/src/stable/assets/sources/youtube b/app/src/stable/assets/sources/youtube index 04e1c069..35b56d38 160000 --- a/app/src/stable/assets/sources/youtube +++ b/app/src/stable/assets/sources/youtube @@ -1 +1 @@ -Subproject commit 04e1c0699354b928ea89c628a1cc23c0ca0fd88d +Subproject commit 35b56d380a9ae6ef85ba8ec16cecb0a86d4efa1d diff --git a/app/src/unstable/assets/sources/youtube b/app/src/unstable/assets/sources/youtube index 04e1c069..35b56d38 160000 --- a/app/src/unstable/assets/sources/youtube +++ b/app/src/unstable/assets/sources/youtube @@ -1 +1 @@ -Subproject commit 04e1c0699354b928ea89c628a1cc23c0ca0fd88d +Subproject commit 35b56d380a9ae6ef85ba8ec16cecb0a86d4efa1d