Skip to content

Commit

Permalink
feat(Hook feature flag): Added ability to search for supported flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
crimera committed Aug 9, 2024
1 parent f056974 commit 28a2c0a
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,17 @@ import app.revanced.patcher.patch.ResourcePatch
import app.revanced.util.ResourceGroup
import app.revanced.util.copyResources

object FeatureFlagResourcePatch: ResourcePatch() {
object FeatureFlagResourcePatch : ResourcePatch() {
override fun execute(context: ResourceContext) {
context.copyResources("twitter/settings", ResourceGroup("layout", "feature_flags_view.xml", "item_row.xml"))
context.copyResources(
"twitter/settings",
ResourceGroup(
"layout",
"feature_flags_view.xml",
"item_row.xml",
"search_item_row.xml",
"search_dialog.xml"
)
)
}
}
6 changes: 4 additions & 2 deletions src/main/resources/twitter/settings/layout/item_row.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@
android:orientation="horizontal">

<TextView
style="@style/TextAppearance.AppCompat.Body2"
style="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/coreColorPrimaryText"
android:id="@+id/textView"
android:layout_width="0dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>

<Switch
android:layout_marginLeft="10dp"
android:id="@+id/enabled"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
Expand Down
23 changes: 23 additions & 0 deletions src/main/resources/twitter/settings/layout/search_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">

<EditText
android:hint="Search"
android:id="@+id/filterEditText"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:inputType="text"
/>


<ListView
android:id="@+id/featureFlagsSearchListView"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</LinearLayout>
16 changes: 16 additions & 0 deletions src/main/resources/twitter/settings/layout/search_item_row.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp"
android:orientation="vertical">

<TextView
style="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/coreColorPrimaryText"
android:id="@+id/searchItemText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"/>

</LinearLayout>

0 comments on commit 28a2c0a

Please sign in to comment.