From a41955cc58bd1531c2249d974ce8ceec39def78c Mon Sep 17 00:00:00 2001 From: echosys Date: Wed, 24 Jul 2024 23:05:03 +0000 Subject: [PATCH] Remove early access Android app variant (#27) Removes the early access Android app variant from the build config and removes the get early access button from the settings tab. I also tried to remove the code for the variant (different logo + colors) and the code for the button, but I am no Android developer so I might have missed some stuff. Additionally I did not touch the translation files. Essentially this gets rid of the now useless fancy button and improves build times as it only needs to build one apk now. Reviewed-on: http://vub63vv26q6v27xzv2dtcd25xumubshogm67yrpaz2rculqxs7jlfqad.onion/torzu-emu/torzu/pulls/27 Spec's note: Whatever there's left can still be removed at a later point. Co-authored-by: echosys Co-committed-by: echosys --- src/android/app/build.gradle.kts | 7 - .../app/src/ea/res/drawable/ic_yuzu.xml | 22 -- .../app/src/ea/res/drawable/ic_yuzu_full.xml | 12 - .../app/src/ea/res/drawable/ic_yuzu_title.xml | 24 -- .../yuzu_emu/adapters/HomeSettingAdapter.kt | 9 - .../yuzu_emu/fragments/EarlyAccessFragment.kt | 87 ------- .../fragments/HomeSettingsFragment.kt | 17 -- .../main/res/layout/fragment_early_access.xml | 245 ------------------ .../main/res/navigation/home_navigation.xml | 8 - 9 files changed, 431 deletions(-) delete mode 100644 src/android/app/src/ea/res/drawable/ic_yuzu.xml delete mode 100644 src/android/app/src/ea/res/drawable/ic_yuzu_full.xml delete mode 100644 src/android/app/src/ea/res/drawable/ic_yuzu_title.xml delete mode 100644 src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt delete mode 100644 src/android/app/src/main/res/layout/fragment_early_access.xml diff --git a/src/android/app/build.gradle.kts b/src/android/app/build.gradle.kts index cb026211cc..a7140caba3 100644 --- a/src/android/app/build.gradle.kts +++ b/src/android/app/build.gradle.kts @@ -146,13 +146,6 @@ android { create("mainline") { isDefault = true dimension = "version" - buildConfigField("Boolean", "PREMIUM", "false") - } - - create("ea") { - dimension = "version" - buildConfigField("Boolean", "PREMIUM", "true") - applicationIdSuffix = ".ea" } } diff --git a/src/android/app/src/ea/res/drawable/ic_yuzu.xml b/src/android/app/src/ea/res/drawable/ic_yuzu.xml deleted file mode 100644 index deb8ba53fd..0000000000 --- a/src/android/app/src/ea/res/drawable/ic_yuzu.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - diff --git a/src/android/app/src/ea/res/drawable/ic_yuzu_full.xml b/src/android/app/src/ea/res/drawable/ic_yuzu_full.xml deleted file mode 100644 index 4ef4728769..0000000000 --- a/src/android/app/src/ea/res/drawable/ic_yuzu_full.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/src/android/app/src/ea/res/drawable/ic_yuzu_title.xml b/src/android/app/src/ea/res/drawable/ic_yuzu_title.xml deleted file mode 100644 index 29d0cfced8..0000000000 --- a/src/android/app/src/ea/res/drawable/ic_yuzu_title.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt index 0bd196673c..5d72efa350 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/adapters/HomeSettingAdapter.kt @@ -41,15 +41,6 @@ class HomeSettingAdapter( ) ) - when (model.titleId) { - R.string.get_early_access -> - binding.optionLayout.background = - ContextCompat.getDrawable( - binding.optionCard.context, - R.drawable.premium_background - ) - } - if (!model.isEnabled.invoke()) { binding.optionTitle.alpha = 0.5f binding.optionDescription.alpha = 0.5f diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt deleted file mode 100644 index 0534b68ce6..0000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EarlyAccessFragment.kt +++ /dev/null @@ -1,87 +0,0 @@ -// SPDX-FileCopyrightText: 2023 yuzu Emulator Project -// SPDX-License-Identifier: GPL-2.0-or-later - -package org.yuzu.yuzu_emu.fragments - -import android.content.Intent -import android.net.Uri -import android.os.Bundle -import android.view.LayoutInflater -import android.view.View -import android.view.ViewGroup -import androidx.core.view.ViewCompat -import androidx.core.view.WindowInsetsCompat -import androidx.core.view.updatePadding -import androidx.fragment.app.Fragment -import androidx.fragment.app.activityViewModels -import androidx.navigation.fragment.findNavController -import com.google.android.material.transition.MaterialSharedAxis -import org.yuzu.yuzu_emu.R -import org.yuzu.yuzu_emu.databinding.FragmentEarlyAccessBinding -import org.yuzu.yuzu_emu.model.HomeViewModel -import org.yuzu.yuzu_emu.utils.ViewUtils.updateMargins - -class EarlyAccessFragment : Fragment() { - private var _binding: FragmentEarlyAccessBinding? = null - private val binding get() = _binding!! - - private val homeViewModel: HomeViewModel by activityViewModels() - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - enterTransition = MaterialSharedAxis(MaterialSharedAxis.X, true) - returnTransition = MaterialSharedAxis(MaterialSharedAxis.X, false) - } - - override fun onCreateView( - inflater: LayoutInflater, - container: ViewGroup?, - savedInstanceState: Bundle? - ): View { - _binding = FragmentEarlyAccessBinding.inflate(layoutInflater) - return binding.root - } - - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - homeViewModel.setNavigationVisibility(visible = false, animated = true) - homeViewModel.setStatusBarShadeVisibility(visible = false) - - binding.toolbarAbout.setNavigationOnClickListener { - parentFragmentManager.primaryNavigationFragment?.findNavController()?.popBackStack() - } - - binding.getEarlyAccessButton.setOnClickListener { - openLink( - getString(R.string.play_store_link) - ) - } - - setInsets() - } - - private fun openLink(link: String) { - val intent = Intent(Intent.ACTION_VIEW, Uri.parse(link)) - startActivity(intent) - } - - private fun setInsets() = - ViewCompat.setOnApplyWindowInsetsListener( - binding.root - ) { _: View, windowInsets: WindowInsetsCompat -> - val barInsets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()) - val cutoutInsets = windowInsets.getInsets(WindowInsetsCompat.Type.displayCutout()) - - val leftInsets = barInsets.left + cutoutInsets.left - val rightInsets = barInsets.right + cutoutInsets.right - - binding.appbarEa.updateMargins(left = leftInsets, right = rightInsets) - - binding.scrollEa.updatePadding( - left = leftInsets, - right = rightInsets, - bottom = barInsets.bottom - ) - - windowInsets - } -} diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt index 14a2504b6a..d3d01558f8 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/HomeSettingsFragment.kt @@ -27,7 +27,6 @@ import androidx.navigation.findNavController import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.GridLayoutManager import com.google.android.material.transition.MaterialSharedAxis -import org.yuzu.yuzu_emu.BuildConfig import org.yuzu.yuzu_emu.HomeNavigationDirections import org.yuzu.yuzu_emu.NativeLibrary import org.yuzu.yuzu_emu.R @@ -237,22 +236,6 @@ class HomeSettingsFragment : Fragment() { ) } - if (!BuildConfig.PREMIUM) { - optionsList.add( - 0, - HomeSetting( - R.string.get_early_access, - R.string.get_early_access_description, - R.drawable.ic_diamond, - { - exitTransition = MaterialSharedAxis(MaterialSharedAxis.X, true) - parentFragmentManager.primaryNavigationFragment?.findNavController() - ?.navigate(R.id.action_homeSettingsFragment_to_earlyAccessFragment) - } - ) - ) - } - binding.homeSettingsList.apply { layoutManager = GridLayoutManager(requireContext(), resources.getInteger(R.integer.grid_columns)) diff --git a/src/android/app/src/main/res/layout/fragment_early_access.xml b/src/android/app/src/main/res/layout/fragment_early_access.xml deleted file mode 100644 index 12e233afc8..0000000000 --- a/src/android/app/src/main/res/layout/fragment_early_access.xml +++ /dev/null @@ -1,245 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/android/app/src/main/res/navigation/home_navigation.xml b/src/android/app/src/main/res/navigation/home_navigation.xml index 37a03a8d1a..8e57e866af 100644 --- a/src/android/app/src/main/res/navigation/home_navigation.xml +++ b/src/android/app/src/main/res/navigation/home_navigation.xml @@ -16,9 +16,6 @@ - @@ -58,11 +55,6 @@ app:destination="@id/licensesFragment" /> - -