diff --git a/app/build.gradle b/app/build.gradle index 77de7397..d0cbf524 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -48,7 +48,7 @@ android { } buildFeatures { - dataBinding true + dataBinding true // ObservableField migrate to flow or liveData viewBinding true } diff --git a/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt b/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt index 0213c768..7a0cd0c5 100644 --- a/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt +++ b/app/src/main/java/com/vanced/manager/adapter/AppListAdapter.kt @@ -2,7 +2,9 @@ package com.vanced.manager.adapter import android.view.LayoutInflater import android.view.ViewGroup +import androidx.core.view.isVisible import androidx.fragment.app.FragmentActivity +import androidx.lifecycle.LifecycleOwner import androidx.preference.PreferenceManager.getDefaultSharedPreferences import androidx.recyclerview.widget.RecyclerView import com.github.florent37.viewtooltip.ViewTooltip @@ -15,6 +17,7 @@ import com.vanced.manager.ui.viewmodels.HomeViewModel class AppListAdapter( private val context: FragmentActivity, private val viewModel: HomeViewModel, + private val lifecycleOwner: LifecycleOwner, private val tooltip: ViewTooltip ) : RecyclerView.Adapter() { @@ -30,14 +33,36 @@ class AppListAdapter( val appCard = binding.appCard fun bind(position: Int) { - binding.viewModel = viewModel - binding.dataModel = if (isRoot) rootDataModels[position] else dataModels[position] - binding.app = apps[position] + val dataModel = if (isRoot) rootDataModels[position] else dataModels[position] + with(binding) { + appName.text = dataModel?.appName + dataModel?.buttonTxt?.observe(this@AppListAdapter.lifecycleOwner) { + appInstallButton.text = it + } + appInstallButton.setOnClickListener { + viewModel.openInstallDialog(it, apps[position]) + } + appUninstall.setOnClickListener { + dataModel?.appPkg?.let { it1 -> viewModel.uninstallPackage(it1) } + } + appUninstall.isVisible = dataModel?.isAppInstalled?.value == true + appSettings.setOnClickListener { + viewModel.openMicrogSettings() + } + appSettings.isVisible = + apps[position] == context.getString(R.string.microg) && dataModel?.isAppInstalled?.value == true + dataModel?.versionName?.observe(this@AppListAdapter.lifecycleOwner) { + appRemoteVersion.text = it + } + dataModel?.installedVersionName?.observe(this@AppListAdapter.lifecycleOwner) { + appInstalledVersion.text = it + } + } } } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ListViewHolder { - val view = ViewAppBinding.inflate(LayoutInflater.from(parent.context), parent, false) + val view = ViewAppBinding.inflate(LayoutInflater.from(context), parent, false) return ListViewHolder(view) } @@ -49,7 +74,7 @@ class AppListAdapter( AppInfoDialog.newInstance( appName = apps[position], appIcon = dataModels[position]?.appIcon, - changelog = dataModels[position]?.changelog?.get() + changelog = dataModels[position]?.changelog?.value ).show(context.supportFragmentManager, "info") } } diff --git a/app/src/main/java/com/vanced/manager/adapter/GetNotifAdapter.kt b/app/src/main/java/com/vanced/manager/adapter/GetNotifAdapter.kt index c174a3be..5b71441c 100644 --- a/app/src/main/java/com/vanced/manager/adapter/GetNotifAdapter.kt +++ b/app/src/main/java/com/vanced/manager/adapter/GetNotifAdapter.kt @@ -9,19 +9,20 @@ import com.vanced.manager.R import com.vanced.manager.databinding.ViewNotificationSettingBinding import com.vanced.manager.model.NotifModel -class GetNotifAdapter(context: Context) : RecyclerView.Adapter() { +class GetNotifAdapter(private val context: Context) : + RecyclerView.Adapter() { private val vanced = NotifModel( - "Vanced-Update", - context.getString(R.string.push_notifications, context.getString(R.string.vanced)), - context.getString(R.string.push_notifications_summary, context.getString(R.string.vanced)), - "vanced_notifs" + "Vanced-Update", + context.getString(R.string.push_notifications, context.getString(R.string.vanced)), + context.getString(R.string.push_notifications_summary, context.getString(R.string.vanced)), + "vanced_notifs" ) private val music = NotifModel( - "MicroG-Update", - context.getString(R.string.push_notifications, context.getString(R.string.music)), - context.getString(R.string.push_notifications_summary, context.getString(R.string.music)), - "music_notifs" + "MicroG-Update", + context.getString(R.string.push_notifications, context.getString(R.string.music)), + context.getString(R.string.push_notifications_summary, context.getString(R.string.music)), + "music_notifs" ) private val microg = NotifModel( "Music-Update", @@ -36,12 +37,18 @@ class GetNotifAdapter(context: Context) : RecyclerView.Adapter() { +class LinkAdapter( + private val context: Context, + private val viewModel: HomeViewModel +) : RecyclerView.Adapter() { private val instagram = LinkModel( AppCompatResources.getDrawable(context, R.drawable.ic_instagram), @@ -55,16 +58,18 @@ class LinkAdapter(context: Context, private val viewModel: HomeViewModel) : Recy val links = arrayOf(instagram, youtube, github, website, telegram, twitter, discord, reddit) inner class LinkViewHolder(private val binding: ViewSocialLinkBinding) : RecyclerView.ViewHolder(binding.root) { - val logo = binding.linkImage - fun bind(position: Int) { - binding.viewModel = viewModel - binding.linkModel = links[position] - } + val logo = binding.linkImage + + fun bind(position: Int) { + binding.linkBg.setOnClickListener { + viewModel.openUrl(links[position].linkUrl) + } + } } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LinkViewHolder { - val view = ViewSocialLinkBinding.inflate(LayoutInflater.from(parent.context), parent, false) + val view = ViewSocialLinkBinding.inflate(LayoutInflater.from(context), parent, false) return LinkViewHolder(view) } diff --git a/app/src/main/java/com/vanced/manager/adapter/SelectAppsAdapter.kt b/app/src/main/java/com/vanced/manager/adapter/SelectAppsAdapter.kt index 92a39eba..26c443da 100644 --- a/app/src/main/java/com/vanced/manager/adapter/SelectAppsAdapter.kt +++ b/app/src/main/java/com/vanced/manager/adapter/SelectAppsAdapter.kt @@ -9,7 +9,8 @@ import com.vanced.manager.R import com.vanced.manager.databinding.ViewAppCheckboxBinding import com.vanced.manager.model.SelectAppModel -class SelectAppsAdapter(context: Context) : RecyclerView.Adapter() { +class SelectAppsAdapter(private val context: Context) : + RecyclerView.Adapter() { private val prefs by lazy { getDefaultSharedPreferences(context) } @@ -37,7 +38,7 @@ class SelectAppsAdapter(context: Context) : RecyclerView.Adapter ) : RecyclerView.Adapter() { @@ -35,14 +35,17 @@ class SponsorAdapter( ) { val logo = binding.sponsorLogo fun bind(position: Int) { - binding.viewModel = viewModel - binding.sponsor = sponsors[position] + with(binding) { + sponsorName.text = sponsors[position].name + cardSponsor.setOnClickListener { + viewModel.openUrl(sponsors[position].url) + } + } } - } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LinkViewHolder { - val view = ViewSponsorBinding.inflate(LayoutInflater.from(parent.context), parent, false) + val view = ViewSponsorBinding.inflate(LayoutInflater.from(context), parent, false) return LinkViewHolder(view) } diff --git a/app/src/main/java/com/vanced/manager/model/DataModel.kt b/app/src/main/java/com/vanced/manager/model/DataModel.kt index 55bd758c..d762680d 100644 --- a/app/src/main/java/com/vanced/manager/model/DataModel.kt +++ b/app/src/main/java/com/vanced/manager/model/DataModel.kt @@ -4,9 +4,8 @@ import android.content.Context import android.graphics.drawable.Drawable import android.os.Build import androidx.databinding.Observable -import androidx.databinding.ObservableBoolean import androidx.databinding.ObservableField -import androidx.databinding.ObservableInt +import androidx.lifecycle.MutableLiveData import com.beust.klaxon.JsonObject import com.vanced.manager.R import com.vanced.manager.utils.PackageHelper.isPackageInstalled @@ -22,24 +21,28 @@ open class DataModel( val appIcon: Drawable?, ) { - private val versionCode = ObservableInt() - private val installedVersionCode = ObservableInt() + private val versionCode = MutableLiveData() + private val installedVersionCode = MutableLiveData() - val isAppInstalled = ObservableBoolean() - val versionName = ObservableField() - val installedVersionName = ObservableField() - val buttonTxt = ObservableField() - val changelog = ObservableField() + val isAppInstalled = MutableLiveData() + val versionName = MutableLiveData() + val installedVersionName = MutableLiveData() + val buttonTxt = MutableLiveData() + val changelog = MutableLiveData() fun fetch() = CoroutineScope(Dispatchers.IO).launch { val jobj = jsonObject.get() - isAppInstalled.set(isPackageInstalled(appPkg, context.packageManager)) - versionName.set(jobj?.string("version")?.removeSuffix("-vanced") ?: context.getString(R.string.unavailable)) - installedVersionName.set(getPkgVersionName(isAppInstalled.get(), appPkg)) - versionCode.set(jobj?.int("versionCode") ?: 0) - installedVersionCode.set(getPkgVersionCode(isAppInstalled.get(), appPkg)) - buttonTxt.set(compareInt(installedVersionCode.get(), versionCode.get())) - changelog.set(jobj?.string("changelog") ?: context.getString(R.string.unavailable)) + isAppInstalled.postValue(isPackageInstalled(appPkg, context.packageManager)) + versionName.postValue( + jobj?.string("version")?.removeSuffix("-vanced") ?: context.getString( + R.string.unavailable + ) + ) + installedVersionName.postValue(getPkgVersionName(isAppInstalled.value, appPkg)) + versionCode.postValue(jobj?.int("versionCode") ?: 0) + installedVersionCode.postValue(getPkgVersionCode(isAppInstalled.value, appPkg)) + buttonTxt.postValue(compareInt(installedVersionCode.value, versionCode.value)) + changelog.postValue(jobj?.string("changelog") ?: context.getString(R.string.unavailable)) } init { @@ -50,10 +53,10 @@ open class DataModel( } }) } - - private fun getPkgVersionName(toCheck: Boolean, pkg: String): String { + + private fun getPkgVersionName(toCheck: Boolean?, pkg: String): String { val pm = context.packageManager - return if (toCheck) { + return if (toCheck == true) { pm.getPackageInfo(pkg, 0).versionName.removeSuffix("-vanced") } else { context.getString(R.string.unavailable) @@ -61,23 +64,25 @@ open class DataModel( } @Suppress("DEPRECATION") - private fun getPkgVersionCode(toCheck: Boolean, pkg: String): Int { - return if (toCheck) { + private fun getPkgVersionCode(toCheck: Boolean?, pkg: String): Int { + return if (toCheck == true) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) - context.packageManager.getPackageInfo(pkg, 0).longVersionCode.and(0xFFFFFFFF).toInt() + context.packageManager.getPackageInfo(pkg, 0).longVersionCode.and(0xFFFFFFFF) + .toInt() else context.packageManager.getPackageInfo(pkg, 0).versionCode } else 0 } - private fun compareInt(int1: Int, int2: Int): String { - return when { - int1 == 0 -> context.getString(R.string.install) - int2 > int1 -> context.getString(R.string.update) - int2 == int1 || int1 > int2 -> context.getString(R.string.button_reinstall) - else -> context.getString(R.string.install) + private fun compareInt(int1: Int?, int2: Int?): String { + if (int2 != null && int1 != null) { + return when { + int1 == 0 -> context.getString(R.string.install) + int2 > int1 -> context.getString(R.string.update) + int2 == int1 || int1 > int2 -> context.getString(R.string.button_reinstall) + else -> context.getString(R.string.install) + } } - + return context.getString(R.string.install) } - -} +} \ No newline at end of file diff --git a/app/src/main/java/com/vanced/manager/ui/MainActivity.kt b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt index 62d72115..14704707 100644 --- a/app/src/main/java/com/vanced/manager/ui/MainActivity.kt +++ b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt @@ -8,7 +8,6 @@ import android.util.Log import android.view.MenuItem import androidx.appcompat.app.AppCompatActivity import androidx.core.content.ContextCompat -import androidx.databinding.DataBindingUtil import androidx.navigation.NavDestination import androidx.navigation.findNavController import androidx.navigation.ui.AppBarConfiguration @@ -56,12 +55,15 @@ class MainActivity : AppCompatActivity() { if (ENABLE_CROWDIN_AUTH) authCrowdin() - binding = DataBindingUtil.setContentView(this, R.layout.activity_main) + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) with(binding) { - lifecycleOwner = this@MainActivity setSupportActionBar(toolbar) - toolbar.setupWithNavController(this@MainActivity.navHost, AppBarConfiguration(this@MainActivity.navHost.graph)) + toolbar.setupWithNavController( + this@MainActivity.navHost, + AppBarConfiguration(this@MainActivity.navHost.graph) + ) } navHost.addOnDestinationChangedListener { _, currFrag: NavDestination, _ -> setDisplayHomeAsUpEnabled(currFrag.id != R.id.home_fragment) diff --git a/app/src/main/java/com/vanced/manager/ui/WelcomeActivity.kt b/app/src/main/java/com/vanced/manager/ui/WelcomeActivity.kt index 58f8abe8..f4a3c7dc 100644 --- a/app/src/main/java/com/vanced/manager/ui/WelcomeActivity.kt +++ b/app/src/main/java/com/vanced/manager/ui/WelcomeActivity.kt @@ -2,19 +2,16 @@ package com.vanced.manager.ui import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import androidx.databinding.DataBindingUtil import androidx.navigation.findNavController import com.vanced.manager.R -import com.vanced.manager.databinding.ActivityWelcomeBinding class WelcomeActivity : AppCompatActivity() { - private lateinit var binding: ActivityWelcomeBinding private val navHost by lazy { findNavController(R.id.welcome_navhost) } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - binding = DataBindingUtil.setContentView(this, R.layout.activity_welcome) + setContentView(R.layout.activity_welcome) } override fun onBackPressed() { diff --git a/app/src/main/java/com/vanced/manager/ui/core/PreferenceSwitch.kt b/app/src/main/java/com/vanced/manager/ui/core/PreferenceSwitch.kt index 4e17f539..8786701a 100644 --- a/app/src/main/java/com/vanced/manager/ui/core/PreferenceSwitch.kt +++ b/app/src/main/java/com/vanced/manager/ui/core/PreferenceSwitch.kt @@ -6,10 +6,9 @@ import android.view.LayoutInflater import android.widget.CompoundButton import android.widget.FrameLayout import androidx.core.content.edit -import androidx.databinding.BindingAdapter import androidx.preference.PreferenceManager.getDefaultSharedPreferences import com.vanced.manager.R -import kotlinx.android.synthetic.main.view_preference_switch.view.* +import com.vanced.manager.databinding.ViewPreferenceSwitchBinding class PreferenceSwitch @JvmOverloads constructor( context: Context, @@ -18,26 +17,50 @@ class PreferenceSwitch @JvmOverloads constructor( defStyleRes: Int = 0 ) : FrameLayout(context, attrs, defStyle, defStyleRes) { + interface OnCheckedListener { + fun onChecked(buttonView: CompoundButton, isChecked: Boolean) + } + private val prefs by lazy { getDefaultSharedPreferences(context) } + var prefKey: String = "" + private set + var defValue: Boolean = false + private set + private var mListener: OnCheckedListener? = null + private var _binding: ViewPreferenceSwitchBinding? = null + + val binding: ViewPreferenceSwitchBinding + get() = requireNotNull(_binding) + init { - LayoutInflater.from(context).inflate(R.layout.view_preference_switch, this, true) - initAttrs(context, attrs) + _binding = ViewPreferenceSwitchBinding.inflate(LayoutInflater.from(context), this, true) + attrs?.let { mAttrs -> + with(context.obtainStyledAttributes(mAttrs, R.styleable.PreferenceSwitch, 0, 0)) { + val title = getText(R.styleable.PreferenceSwitch_switch_title) + val summary = getText(R.styleable.PreferenceSwitch_switch_summary) + val key = getText(R.styleable.PreferenceSwitch_switch_key) + setDefaultValue(getBoolean(R.styleable.PreferenceSwitch_switch_def_value, false)) + setKey(key) + setTitle(title) + setSummary(summary) + recycle() + } + } } override fun onFinishInflate() { super.onFinishInflate() setOnClickListener { - preference_switch.isChecked = !preference_switch.isChecked + binding.preferenceSwitch.isChecked = !binding.preferenceSwitch.isChecked } - preference_switch.setOnCheckedChangeListener { buttonView, isChecked -> + binding.preferenceSwitch.setOnCheckedChangeListener { buttonView, isChecked -> prefs.edit { putBoolean(prefKey, isChecked) } mListener?.onChecked(buttonView, isChecked) } - } fun setOnCheckedListener(method: (buttonView: CompoundButton, isChecked: Boolean) -> Unit) { @@ -52,62 +75,21 @@ class PreferenceSwitch @JvmOverloads constructor( mListener = listener } - private fun initAttrs(context: Context, attrs: AttributeSet?) { - attrs?.let { mAttrs -> - val typedArray = context.obtainStyledAttributes(mAttrs, R.styleable.PreferenceSwitch, 0, 0) - val title = typedArray.getText(R.styleable.PreferenceSwitch_switch_title) - val summary = typedArray.getText(R.styleable.PreferenceSwitch_switch_summary) - val key = typedArray.getText(R.styleable.PreferenceSwitch_switch_key) - val value = typedArray.getBoolean(R.styleable.PreferenceSwitch_switch_def_value, false) - - if (key != null) { - prefKey = key.toString() - preference_switch.isChecked = prefs.getBoolean(key.toString(), value) - } - - defValue = value - preference_switch_title.text = title - - if (summary != null) { - preference_switch_summary.text = summary - } - - typedArray.recycle() - } + fun setTitle(title: CharSequence?) { + binding.preferenceSwitchTitle.text = title } - interface OnCheckedListener { - fun onChecked(buttonView: CompoundButton, isChecked: Boolean) + fun setSummary(summary: CharSequence?) { + binding.preferenceSwitchSummary.text = summary } - companion object { - - @JvmStatic - @BindingAdapter("app:switch_title") - fun setTitle(view: PreferenceSwitch, newTitle: String) { - view.preference_switch_title.text = newTitle - } - - @JvmStatic - @BindingAdapter("app:switch_summary") - fun setSummary(view: PreferenceSwitch, newSummary: String) { - view.preference_switch_summary.text = newSummary - } - - @JvmStatic - @BindingAdapter("app:switch_key") - fun setKey(view: PreferenceSwitch, newKey: String) { - view.prefKey = newKey - view.preference_switch.isChecked = view.prefs.getBoolean(view.prefKey, view.defValue) - } - - @JvmStatic - @BindingAdapter("app:switch_def_value") - fun setDefaultValue(view: PreferenceSwitch, newVal: Boolean) { - view.defValue = newVal - view.preference_switch.isChecked = view.prefs.getBoolean(view.prefKey, view.defValue) - } - + fun setKey(key: CharSequence?) { + prefKey = key.toString() + binding.preferenceSwitch.isChecked = prefs.getBoolean(prefKey, defValue) } + fun setDefaultValue(newVal: Boolean) { + defValue = newVal + binding.preferenceSwitch.isChecked = prefs.getBoolean(prefKey, defValue) + } } \ No newline at end of file diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt index c8eaafc9..229e07e2 100644 --- a/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt +++ b/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt @@ -77,7 +77,7 @@ open class HomeFragment : BindingFragment() { recyclerAppList.apply { layoutManager = LinearLayoutManager(requireActivity()) - adapter = AppListAdapter(requireActivity(), this@HomeFragment.viewModel, tooltip) + adapter = AppListAdapter(requireActivity(), viewModel, viewLifecycleOwner, tooltip) setHasFixedSize(true) } @@ -86,7 +86,7 @@ open class HomeFragment : BindingFragment() { lm.justifyContent = JustifyContent.SPACE_EVENLY layoutManager = lm setHasFixedSize(true) - adapter = SponsorAdapter(requireActivity(), this@HomeFragment.viewModel) + adapter = SponsorAdapter(requireActivity(), viewModel) } recyclerLinks.apply { @@ -94,7 +94,7 @@ open class HomeFragment : BindingFragment() { lm.justifyContent = JustifyContent.SPACE_EVENLY layoutManager = lm setHasFixedSize(true) - adapter = LinkAdapter(requireActivity(), this@HomeFragment.viewModel) + adapter = LinkAdapter(requireActivity(), viewModel) } } } diff --git a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt index f7a1aa11..27714bc1 100644 --- a/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt +++ b/app/src/main/java/com/vanced/manager/ui/viewmodels/HomeViewModel.kt @@ -91,7 +91,7 @@ open class HomeViewModel(private val activity: FragmentActivity): ViewModel() { fun openInstallDialog(view: View, app: String) { val variant = prefs.getString("vanced_variant", "nonroot") - if (variant == "nonroot" && app != activity.getString(R.string.microg) && !microg.get()?.isAppInstalled?.get()!!) { + if (variant == "nonroot" && app != activity.getString(R.string.microg) && !microg.get()?.isAppInstalled?.value!!) { microgToast.show() return } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 186bc30a..2682469f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -1,40 +1,34 @@ - + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="?colorSurface" + tools:context=".ui.MainActivity"> - + + + + + - - - - - - - - - - - - + android:layout_below="@id/app_bar" + app:defaultNavHost="true" + app:navGraph="@navigation/mobile_navigation" /> + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_welcome.xml b/app/src/main/res/layout/activity_welcome.xml index 4bacaa45..91ee392c 100644 --- a/app/src/main/res/layout/activity_welcome.xml +++ b/app/src/main/res/layout/activity_welcome.xml @@ -1,21 +1,16 @@ - + - - - - - - - + app:defaultNavHost="true" + app:navGraph="@navigation/welcome_navigation" /> + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml index e88d13b4..2ae4011e 100644 --- a/app/src/main/res/layout/fragment_settings.xml +++ b/app/src/main/res/layout/fragment_settings.xml @@ -1,65 +1,61 @@ - + - + android:layout_height="match_parent" + android:orientation="vertical" + android:paddingHorizontal="8dp" + android:paddingTop="16dp"> - + android:layout_height="wrap_content" + android:background="@drawable/category_background" + app:category_title="@string/category_behaviour"> - + app:switch_def_value="true" + app:switch_key="@{@string/use_custom_tabs}" + app:switch_summary="@string/link_custom_tabs" + app:switch_title="@string/link_title" /> - + - + - + - - - - - + + + app:preference_title="@string/language_title" /> + app:preference_title="@string/select_apps" /> - - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_app.xml b/app/src/main/res/layout/view_app.xml index e1b205ce..e0f0f4c2 100644 --- a/app/src/main/res/layout/view_app.xml +++ b/app/src/main/res/layout/view_app.xml @@ -1,113 +1,84 @@ - + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/app_card" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + app:cardBackgroundColor="?colorLinkBG" + app:cardCornerRadius="16dp" + app:cardElevation="0dp" + app:contentPaddingBottom="4dp" + app:contentPaddingLeft="16dp" + app:contentPaddingRight="16dp" + app:contentPaddingTop="8dp"> - - - - - - - - - - - - - + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> - + + + + + + + + + app:layout_constraintTop_toBottomOf="@id/app_name"> + style="@style/AppVersionText" + android:text="@string/latest" /> - - - - - - - - - - - - - + + - + android:layout_marginStart="4dp" /> - - - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_app_checkbox.xml b/app/src/main/res/layout/view_app_checkbox.xml index b63422b7..c0b7b065 100644 --- a/app/src/main/res/layout/view_app_checkbox.xml +++ b/app/src/main/res/layout/view_app_checkbox.xml @@ -1,56 +1,51 @@ - + xmlns:tools="http://schemas.android.com/tools" + android:id="@+id/app_checkbox_bg" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginTop="16dp" + android:layout_marginEnd="8dp"> - + + + android:layout_marginTop="4dp" + android:layout_marginEnd="24dp" + android:gravity="start" + android:paddingBottom="4dp" + app:layout_constrainedWidth="true" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/app_checkbox" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/app_checkbox_text" + tools:text="YouTube Vanced is the stock Android YouTube App, but better!" /> - - - - - - - - - + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_notification_setting.xml b/app/src/main/res/layout/view_notification_setting.xml index e9658d01..9830c9cd 100644 --- a/app/src/main/res/layout/view_notification_setting.xml +++ b/app/src/main/res/layout/view_notification_setting.xml @@ -1,21 +1,5 @@ - - - - - - - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/view_social_link.xml b/app/src/main/res/layout/view_social_link.xml index 2147053a..b4a689fc 100644 --- a/app/src/main/res/layout/view_social_link.xml +++ b/app/src/main/res/layout/view_social_link.xml @@ -1,44 +1,26 @@ - + - - - - - - - - - - - - - - - \ No newline at end of file + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_sponsor.xml b/app/src/main/res/layout/view_sponsor.xml index fe97b1d3..b824e7df 100644 --- a/app/src/main/res/layout/view_sponsor.xml +++ b/app/src/main/res/layout/view_sponsor.xml @@ -1,68 +1,49 @@ - + - + - + - + - - - - - - - - - - - - - - - - - + android:layout_height="wrap_content" + android:text="@string/support_us" + android:textAlignment="center" + android:textColor="?colorLinkImage" + android:textSize="18sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintTop_toBottomOf="@id/sponsor_name" /> + + \ No newline at end of file