From 9a8274130be805ed534090a48d12211ea7553ff1 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Tue, 11 Feb 2020 20:54:23 -0800 Subject: [PATCH] Manually set referenced resource ID for barriers --- .../topjohnwu/magisk/ui/home/HomeFragment.kt | 23 ++++++++++++++++--- .../main/res/layout/include_home_device.xml | 6 ++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt index 2a419c05a..5b090c525 100644 --- a/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/topjohnwu/magisk/ui/home/HomeFragment.kt @@ -1,8 +1,7 @@ package com.topjohnwu.magisk.ui.home -import android.view.Menu -import android.view.MenuInflater -import android.view.MenuItem +import android.os.Bundle +import android.view.* import com.topjohnwu.magisk.R import com.topjohnwu.magisk.databinding.FragmentHomeMd2Binding import com.topjohnwu.magisk.model.navigation.Navigation @@ -20,6 +19,24 @@ class HomeFragment : BaseUIFragment() { setHasOptionsMenu(true) } + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + super.onCreateView(inflater, container, savedInstanceState) + + // Set barrier reference IDs in code, since resource IDs will be stripped in release mode + binding.homeDeviceWrapper.homeDeviceTitleBarrier.referencedIds = + intArrayOf(R.id.home_device_action, R.id.home_device_title, R.id.home_device_icon) + binding.homeMagiskWrapper.homeMagiskTitleBarrier.referencedIds = + intArrayOf(R.id.home_magisk_action, R.id.home_magisk_title, R.id.home_magisk_icon) + binding.homeManagerWrapper.homeManagerTitleBarrier.referencedIds = + intArrayOf(R.id.home_manager_action, R.id.home_manager_title, R.id.home_manager_icon) + + return binding.root + } + override fun onCreateOptionsMenu(menu: Menu, inflater: MenuInflater) { inflater.inflate(R.menu.menu_home_md2, menu) } diff --git a/app/src/main/res/layout/include_home_device.xml b/app/src/main/res/layout/include_home_device.xml index d78a5f768..3e8b06ec8 100644 --- a/app/src/main/res/layout/include_home_device.xml +++ b/app/src/main/res/layout/include_home_device.xml @@ -52,12 +52,12 @@ android:textAppearance="@style/AppearanceFoundation.Title" android:textColor="?colorPrimary" app:layout_constraintBottom_toBottomOf="@+id/home_device_icon" - app:layout_constraintEnd_toStartOf="@+id/home_device_action_reboot" + app:layout_constraintEnd_toStartOf="@+id/home_device_action" app:layout_constraintStart_toEndOf="@+id/home_device_icon" app:layout_constraintTop_toTopOf="@+id/home_device_icon" /> + app:constraint_referenced_ids="home_device_action,home_device_title,home_device_icon" />