Skip to content

Commit

Permalink
fix(Feature Flags): Use ListView instead of RecyclerView for a more r…
Browse files Browse the repository at this point in the history
…eliable list.
  • Loading branch information
crimera committed Aug 18, 2024
1 parent efdd59a commit 6f16b7f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ object FeatureFlagPatch : BytecodePatch(
setOf(
FeatureFlagFingerprint,
IntegrationsUtilsFingerprint,
SettingsStatusLoadFingerprint,
CustomAdapterFingerprint,
GetCountFingerprint,
OnCreateViewHolderFingerprint,
OnBindViewHolderFingerprint
SettingsStatusLoadFingerprint
)
) {
override fun execute(context: BytecodeContext) {
Expand All @@ -52,20 +48,5 @@ object FeatureFlagPatch : BytecodePatch(
IntegrationsUtilsFingerprint.result!!.mutableMethod.addInstruction(
1, "${SettingsPatch.FSTS_DESCRIPTOR}->load()V"
)

// Change the getCount override method name
val customAdapter = CustomAdapterFingerprint.result
?: throw PatchException("getCount Method of CustomAdapter not found")

customAdapter.mutableMethod.name = GetCountFingerprint.result?.method?.name
?: throw PatchException("getCount Method of RecyclerView not found")

// onCreateViewHolder
customAdapter.mutableClass.methods.first { it.name == "onCreateViewHolder" }.name = OnCreateViewHolderFingerprint.result?.method?.name
?: throw PatchException("onCreateViewHolder Method of RecyclerView not found")

// onBindViewHolder
customAdapter.mutableClass.methods.first { it.name == "onBindViewHolder" }.name = OnBindViewHolderFingerprint.result?.method?.name
?: throw PatchException("onBindViewHolder Method of RecyclerView not found")
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
android:layout_height="match_parent"
android:id="@+id/linearLayout">

<androidx.recyclerview.widget.RecyclerView
<ListView
android:id="@+id/list"
android:layout_width="0dp"
android:layout_height="0dp"
Expand Down

0 comments on commit 6f16b7f

Please sign in to comment.