mirror of
https://github.com/skyline-emu/skyline.git
synced 2025-01-09 23:59:33 +01:00
Apply changed layout to all items
* Fix memory leaks
This commit is contained in:
parent
686d61b893
commit
2ff06d5421
@ -299,7 +299,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
super.onResume()
|
super.onResume()
|
||||||
|
|
||||||
var layoutTypeChanged = false
|
var layoutTypeChanged = false
|
||||||
for (appViewItem in adapter.currentItems.filterIsInstance(AppViewItem::class.java)) {
|
for (appViewItem in adapter.allItems.filterIsInstance(AppViewItem::class.java)) {
|
||||||
if (layoutType != appViewItem.layoutType) {
|
if (layoutType != appViewItem.layoutType) {
|
||||||
appViewItem.layoutType = layoutType
|
appViewItem.layoutType = layoutType
|
||||||
layoutTypeChanged = true
|
layoutTypeChanged = true
|
||||||
|
@ -32,7 +32,7 @@ class GenericAdapter : RecyclerView.Adapter<GenericViewHolder<ViewBinding>>(), F
|
|||||||
|
|
||||||
private val asyncListDiffer = AsyncListDiffer(this, DIFFER)
|
private val asyncListDiffer = AsyncListDiffer(this, DIFFER)
|
||||||
private val headerItems = mutableListOf<GenericListItem<out ViewBinding>>()
|
private val headerItems = mutableListOf<GenericListItem<out ViewBinding>>()
|
||||||
private val allItems = mutableListOf<GenericListItem<out ViewBinding>>()
|
val allItems = mutableListOf<GenericListItem<out ViewBinding>>()
|
||||||
val currentItems : List<GenericListItem<in ViewBinding>> get() = asyncListDiffer.currentList
|
val currentItems : List<GenericListItem<in ViewBinding>> get() = asyncListDiffer.currentList
|
||||||
|
|
||||||
var currentSearchTerm = ""
|
var currentSearchTerm = ""
|
||||||
|
@ -26,14 +26,15 @@ import kotlin.math.abs
|
|||||||
* @param item This is used to hold the [ControllerButtonViewItem] between instances
|
* @param item This is used to hold the [ControllerButtonViewItem] between instances
|
||||||
*/
|
*/
|
||||||
class ButtonDialog @JvmOverloads constructor(private val item : ControllerButtonViewItem? = null) : BottomSheetDialogFragment() {
|
class ButtonDialog @JvmOverloads constructor(private val item : ControllerButtonViewItem? = null) : BottomSheetDialogFragment() {
|
||||||
private lateinit var binding : ButtonDialogBinding
|
private var _binding : ButtonDialogBinding? = null
|
||||||
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
private val inputManager by lazy { requireContext().getInputManager() }
|
private val inputManager by lazy { requireContext().getInputManager() }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This inflates the layout of the dialog after initial view creation
|
* This inflates the layout of the dialog after initial view creation
|
||||||
*/
|
*/
|
||||||
override fun onCreateView(inflater : LayoutInflater, container : ViewGroup?, savedInstanceState : Bundle?) = ButtonDialogBinding.inflate(inflater).also { binding = it }.root
|
override fun onCreateView(inflater : LayoutInflater, container : ViewGroup?, savedInstanceState : Bundle?) = ButtonDialogBinding.inflate(inflater).also { _binding = it }.root
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This expands the bottom sheet so that it's fully visible
|
* This expands the bottom sheet so that it's fully visible
|
||||||
@ -239,4 +240,9 @@ class ButtonDialog @JvmOverloads constructor(private val item : ControllerButton
|
|||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
_binding = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,14 +26,15 @@ import emu.skyline.input.ControllerActivity
|
|||||||
* @param item This is used to hold the [ControllerGeneralViewItem] between instances
|
* @param item This is used to hold the [ControllerGeneralViewItem] between instances
|
||||||
*/
|
*/
|
||||||
class RumbleDialog @JvmOverloads constructor(val item : ControllerGeneralViewItem? = null) : BottomSheetDialogFragment() {
|
class RumbleDialog @JvmOverloads constructor(val item : ControllerGeneralViewItem? = null) : BottomSheetDialogFragment() {
|
||||||
private lateinit var binding : RumbleDialogBinding
|
private var _binding : RumbleDialogBinding? = null
|
||||||
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
private val inputManager by lazy { requireContext().getInputManager() }
|
private val inputManager by lazy { requireContext().getInputManager() }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This inflates the layout of the dialog after initial view creation
|
* This inflates the layout of the dialog after initial view creation
|
||||||
*/
|
*/
|
||||||
override fun onCreateView(inflater : LayoutInflater, container : ViewGroup?, savedInstanceState : Bundle?) = RumbleDialogBinding.inflate(inflater).also { binding = it }.root
|
override fun onCreateView(inflater : LayoutInflater, container : ViewGroup?, savedInstanceState : Bundle?) = RumbleDialogBinding.inflate(inflater).also { _binding = it }.root
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This expands the bottom sheet so that it's fully visible
|
* This expands the bottom sheet so that it's fully visible
|
||||||
@ -139,4 +140,9 @@ class RumbleDialog @JvmOverloads constructor(val item : ControllerGeneralViewIte
|
|||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
_binding = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,8 @@ class StickDialog @JvmOverloads constructor(val item : ControllerStickViewItem?
|
|||||||
Stick(R.string.stick_preview);
|
Stick(R.string.stick_preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
private lateinit var binding : StickDialogBinding
|
private var _binding : StickDialogBinding? = null
|
||||||
|
private val binding get() = _binding!!
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the current stage of the dialog
|
* This is the current stage of the dialog
|
||||||
@ -69,7 +70,7 @@ class StickDialog @JvmOverloads constructor(val item : ControllerStickViewItem?
|
|||||||
/**
|
/**
|
||||||
* This inflates the layout of the dialog after initial view creation
|
* This inflates the layout of the dialog after initial view creation
|
||||||
*/
|
*/
|
||||||
override fun onCreateView(inflater : LayoutInflater, container : ViewGroup?, savedInstanceState : Bundle?) = StickDialogBinding.inflate(inflater).also { binding = it }.root
|
override fun onCreateView(inflater : LayoutInflater, container : ViewGroup?, savedInstanceState : Bundle?) = StickDialogBinding.inflate(inflater).also { _binding = it }.root
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This expands the bottom sheet so that it's fully visible
|
* This expands the bottom sheet so that it's fully visible
|
||||||
@ -607,4 +608,9 @@ class StickDialog @JvmOverloads constructor(val item : ControllerStickViewItem?
|
|||||||
dismiss()
|
dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroyView() {
|
||||||
|
super.onDestroyView()
|
||||||
|
_binding = null
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
app:layout_scrollFlags="scroll">
|
app:layout_scrollFlags="enterAlwaysCollapsed">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user