feat(YouTube - Settings): Add ability to search in settings (#4881)

Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
This commit is contained in:
MarcaD
2025-05-17 10:40:16 +03:00
committed by GitHub
parent a082914e76
commit aca8b207c1
46 changed files with 2346 additions and 1185 deletions

View File

@ -1472,8 +1472,10 @@ public final class app/revanced/patches/youtube/misc/settings/PreferenceScreen :
public final fun getGENERAL_LAYOUT ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getMISC ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getPLAYER ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getRETURN_YOUTUBE_DISLIKE ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getSEEKBAR ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getSHORTS ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getSPONSORBLOCK ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getSWIPE_CONTROLS ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
public final fun getVIDEO ()Lapp/revanced/patches/shared/misc/settings/preference/BasePreferenceScreen$Screen;
}

View File

@ -6,7 +6,10 @@ import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.bytecodePatch
import app.revanced.patches.all.misc.resources.addResources
import app.revanced.patches.all.misc.resources.addResourcesPatch
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference
import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter
import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch
@ -15,15 +18,18 @@ import app.revanced.patches.youtube.misc.playservice.is_19_33_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_07_or_greater
import app.revanced.patches.youtube.misc.playservice.is_20_10_or_greater
import app.revanced.patches.youtube.misc.playservice.versionCheckPatch
import app.revanced.patches.youtube.misc.settings.addSettingPreference
import app.revanced.patches.youtube.misc.settings.newIntent
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
import app.revanced.patches.youtube.shared.conversionContextFingerprintToString
import app.revanced.patches.youtube.shared.rollingNumberTextViewAnimationUpdateFingerprint
import app.revanced.patches.youtube.video.videoid.hookPlayerResponseVideoId
import app.revanced.patches.youtube.video.videoid.hookVideoId
import app.revanced.patches.youtube.video.videoid.videoIdPatch
import app.revanced.util.*
import app.revanced.util.addInstructionsAtControlFlowLabel
import app.revanced.util.findFreeRegister
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstructionOrThrow
import app.revanced.util.returnLate
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
@ -68,15 +74,24 @@ val returnYouTubeDislikePatch = bytecodePatch(
execute {
addResources("youtube", "layout.returnyoutubedislike.returnYouTubeDislikePatch")
addSettingPreference(
IntentPreference(
key = "revanced_settings_screen_09",
titleKey = "revanced_ryd_settings_title",
summaryKey = null,
icon = "@drawable/revanced_settings_screen_09_ryd",
layout = "@layout/preference_with_icon",
intent = newIntent("revanced_ryd_settings_intent"),
PreferenceScreen.RETURN_YOUTUBE_DISLIKE.addPreferences(
SwitchPreference("revanced_ryd_enabled"),
SwitchPreference("revanced_ryd_shorts"),
SwitchPreference("revanced_ryd_dislike_percentage"),
SwitchPreference("revanced_ryd_compact_layout"),
SwitchPreference("revanced_ryd_estimated_like"),
SwitchPreference("revanced_ryd_toast_on_connection_error"),
NonInteractivePreference(
key = "revanced_ryd_attribution",
tag = "app.revanced.extension.youtube.returnyoutubedislike.ui.ReturnYouTubeDislikeAboutPreference",
selectable = true,
),
PreferenceCategory(
key = "revanced_ryd_statistics_category",
sorting = PreferenceScreenPreference.Sorting.UNSORTED,
preferences = emptySet(), // Preferences are added by custom class at runtime.
tag = "app.revanced.extension.youtube.returnyoutubedislike.ui.ReturnYouTubeDislikeDebugStatsPreferenceCategory"
)
)
// region Inject newVideoLoaded event handler to update dislikes when a new video is loaded.

View File

@ -12,12 +12,13 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
import app.revanced.patches.all.misc.resources.addResources
import app.revanced.patches.all.misc.resources.addResourcesPatch
import app.revanced.patches.shared.misc.mapping.resourceMappingPatch
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference
import app.revanced.patches.shared.misc.settings.preference.PreferenceCategory
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreenPreference
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
import app.revanced.patches.youtube.misc.playercontrols.*
import app.revanced.patches.youtube.misc.playertype.playerTypeHookPatch
import app.revanced.patches.youtube.misc.settings.addSettingPreference
import app.revanced.patches.youtube.misc.settings.newIntent
import app.revanced.patches.youtube.misc.settings.PreferenceScreen
import app.revanced.patches.youtube.misc.settings.settingsPatch
import app.revanced.patches.youtube.shared.*
import app.revanced.patches.youtube.video.information.onCreateHook
@ -43,15 +44,32 @@ private val sponsorBlockResourcePatch = resourcePatch {
execute {
addResources("youtube", "layout.sponsorblock.sponsorBlockResourcePatch")
addSettingPreference(
IntentPreference(
key = "revanced_settings_screen_10",
titleKey = "revanced_sb_settings_title",
summaryKey = null,
icon = "@drawable/revanced_settings_screen_10_sb",
layout = "@layout/preference_with_icon",
intent = newIntent("revanced_sb_settings_intent"),
PreferenceScreen.SPONSORBLOCK.addPreferences(
// SB setting is old code with lots of custom preferences and updating behavior.
// Added as a preference group and not a fragment so the preferences are searchable.
PreferenceCategory(
key = "revanced_settings_screen_10_sponsorblock",
sorting = PreferenceScreenPreference.Sorting.UNSORTED,
preferences = emptySet(), // Preferences are added by custom class at runtime.
tag = "app.revanced.extension.youtube.sponsorblock.ui.SponsorBlockPreferenceGroup"
),
PreferenceCategory(
key = "revanced_sb_stats",
sorting = PreferenceScreenPreference.Sorting.UNSORTED,
preferences = emptySet(), // Preferences are added by custom class at runtime.
tag = "app.revanced.extension.youtube.sponsorblock.ui.SponsorBlockStatsPreferenceCategory"
),
PreferenceCategory(
key = "revanced_sb_about",
sorting = PreferenceScreenPreference.Sorting.UNSORTED,
preferences = setOf(
NonInteractivePreference(
key = "revanced_sb_about_api",
tag = "app.revanced.extension.youtube.sponsorblock.ui.SponsorBlockAboutPreference",
selectable = true,
)
)
)
)
arrayOf(

View File

@ -54,6 +54,7 @@ val changeStartPagePatch = bytecodePatch(
ListPreference(
key = "revanced_change_start_page",
summaryKey = null,
tag = "app.revanced.extension.shared.settings.preference.SortedListPreference"
),
SwitchPreference("revanced_change_start_page_always")
)

View File

@ -74,6 +74,7 @@ private val settingsResourcePatch = resourcePatch {
arrayOf(
ResourceGroup("drawable",
"revanced_settings_cursor.xml",
"revanced_settings_icon.xml",
"revanced_settings_screen_00_about.xml",
"revanced_settings_screen_01_ads.xml",
@ -84,12 +85,16 @@ private val settingsResourcePatch = resourcePatch {
"revanced_settings_screen_06_shorts.xml",
"revanced_settings_screen_07_seekbar.xml",
"revanced_settings_screen_08_swipe_controls.xml",
"revanced_settings_screen_09_ryd.xml",
"revanced_settings_screen_10_sb.xml",
"revanced_settings_screen_09_return_youtube_dislike.xml",
"revanced_settings_screen_10_sponsorblock.xml",
"revanced_settings_screen_11_misc.xml",
"revanced_settings_screen_12_video.xml",
),
ResourceGroup("layout", "revanced_settings_with_toolbar.xml"),
ResourceGroup("layout",
"revanced_preference_with_icon_no_search_result.xml",
"revanced_search_suggestion_item.xml",
"revanced_settings_with_toolbar.xml"),
ResourceGroup("menu", "revanced_search_menu.xml")
).forEach { resourceGroup ->
copyResources("settings", resourceGroup)
}
@ -188,6 +193,7 @@ val settingsPatch = bytecodePatch(
}
PreferenceScreen.GENERAL_LAYOUT.addPreferences(
SwitchPreference("revanced_settings_search_history"),
SwitchPreference("revanced_show_menu_icons")
)
@ -201,7 +207,8 @@ val settingsPatch = bytecodePatch(
),
ListPreference(
key = "revanced_language",
summaryKey = null
summaryKey = null,
tag = "app.revanced.extension.shared.settings.preference.SortedListPreference"
)
)
@ -347,10 +354,20 @@ object PreferenceScreen : BasePreferenceScreen() {
layout = "@layout/preference_with_icon",
sorting = Sorting.UNSORTED,
)
// RYD and SB are items 9 and 10.
// Menus are added in their own patch because they use an Intent and not a Screen.
val RETURN_YOUTUBE_DISLIKE = Screen(
key = "revanced_settings_screen_09_return_youtube_dislike",
summaryKey = null,
icon = "@drawable/revanced_settings_screen_09_return_youtube_dislike",
layout = "@layout/preference_with_icon",
sorting = Sorting.UNSORTED,
)
val SPONSORBLOCK = Screen(
key = "revanced_settings_screen_10_sponsorblock",
summaryKey = null,
icon = "@drawable/revanced_settings_screen_10_sponsorblock",
layout = "@layout/preference_with_icon",
sorting = Sorting.UNSORTED,
)
val MISC = Screen(
key = "revanced_settings_screen_11_misc",
summaryKey = null,

View File

@ -62,7 +62,8 @@ val spoofVideoStreamsPatch = spoofVideoStreamsPatch({
summaryKey = null,
// Language strings are declared in Setting patch.
entriesKey = "revanced_language_entries",
entryValuesKey = "revanced_language_entry_values"
entryValuesKey = "revanced_language_entry_values",
tag = "app.revanced.extension.shared.settings.preference.SortedListPreference"
),
SwitchPreference("revanced_spoof_video_streams_ios_force_avc"),
SwitchPreference("revanced_spoof_streaming_data_stats_for_nerds"),

View File

@ -38,6 +38,7 @@ internal val rememberPlaybackSpeedPatch = bytecodePatch {
// Entries and values are set by the extension code based on the actual speeds available.
entriesKey = null,
entryValuesKey = null,
tag = "app.revanced.extension.youtube.settings.preference.CustomVideoSpeedListPreference"
),
SwitchPreference("revanced_remember_playback_speed_last_selected")
)

View File

@ -65,35 +65,6 @@ fun Method.findFreeRegister(startIndex: Int, vararg registersToExclude: Int): In
val instruction = getInstruction(i)
val instructionRegisters = instruction.registersUsed
if (instruction.isReturnInstruction) {
usedRegisters.addAll(instructionRegisters)
// Use lowest register that hasn't been encountered.
val freeRegister = (0 until implementation!!.registerCount).find {
it !in usedRegisters
}
if (freeRegister != null) {
return freeRegister
}
if (bestFreeRegisterFound != null) {
return bestFreeRegisterFound
}
// Somehow every method register was read from before any register was wrote to.
// In practice this never occurs.
throw IllegalArgumentException("Could not find a free register from startIndex: " +
"$startIndex excluding: $registersToExclude")
}
if (instruction.isBranchInstruction) {
if (bestFreeRegisterFound != null) {
return bestFreeRegisterFound
}
// This method is simple and does not follow branching.
throw IllegalArgumentException("Encountered a branch statement before a free register could be found")
}
val writeRegister = instruction.writeRegister
if (writeRegister != null) {
if (writeRegister !in usedRegisters) {
@ -114,6 +85,32 @@ fun Method.findFreeRegister(startIndex: Int, vararg registersToExclude: Int): In
}
usedRegisters.addAll(instructionRegisters)
if (instruction.isBranchInstruction) {
if (bestFreeRegisterFound != null) {
return bestFreeRegisterFound
}
// This method is simple and does not follow branching.
throw IllegalArgumentException("Encountered a branch statement before a free register could be found")
}
if (instruction.isReturnInstruction) {
// Use lowest register that hasn't been encountered.
val freeRegister = (0 until implementation!!.registerCount).find {
it !in usedRegisters
}
if (freeRegister != null) {
return freeRegister
}
if (bestFreeRegisterFound != null) {
return bestFreeRegisterFound
}
// Somehow every method register was read from before any register was wrote to.
// In practice this never occurs.
throw IllegalArgumentException("Could not find a free register from startIndex: " +
"$startIndex excluding: $registersToExclude")
}
}
// Some methods can have array payloads at the end of the method after a return statement.

View File

@ -42,6 +42,10 @@ Second \"item\" text"</string>
<string name="revanced_settings_import_reset">ReVanced settings reset to default</string>
<string name="revanced_settings_import_success">Imported %d settings</string>
<string name="revanced_settings_import_failure_parse">Import failed: %s</string>
<string name="revanced_settings_search_hint">Search settings</string>
<string name="revanced_settings_search_no_results_title">No results found for \'%s\'</string>
<string name="revanced_settings_search_no_results_summary">Try another keyword</string>
<string name="revanced_settings_search_remove_message">Remove from search history?</string>
<string name="revanced_show_menu_icons_title">Show ReVanced setting icons</string>
<string name="revanced_show_menu_icons_summary_on">Setting icons are shown</string>
<string name="revanced_show_menu_icons_summary_off">Setting icons are not shown</string>
@ -145,11 +149,15 @@ Tap the continue button and allow optimization changes."</string>
<string name="revanced_settings_screen_06_shorts_title">Shorts</string>
<string name="revanced_settings_screen_07_seekbar_title">Seekbar</string>
<string name="revanced_settings_screen_08_swipe_controls_title">Swipe controls</string>
<string name="revanced_settings_screen_09_return_youtube_dislike_title" translatable="false">Return YouTube Dislike</string>
<string name="revanced_settings_screen_11_misc_title">Miscellaneous</string>
<string name="revanced_settings_screen_12_video_title">Video</string>
<string name="revanced_restore_old_settings_menus_title">Restore old settings menus</string>
<string name="revanced_restore_old_settings_menus_summary_on">Old settings menus are shown</string>
<string name="revanced_restore_old_settings_menus_summary_off">Old settings menus are not shown</string>
<string name="revanced_settings_search_history_title">Show settings search history</string>
<string name="revanced_settings_search_history_summary_on">Settings search history is shown</string>
<string name="revanced_settings_search_history_summary_off">Settings search history is not shown</string>
</patch>
<patch id="misc.backgroundplayback.backgroundPlaybackPatch">
<string name="revanced_shorts_disable_background_playback_title">Disable Shorts background play</string>
@ -888,7 +896,6 @@ Settings → Playback → Autoplay next video"</string>
<string name="revanced_player_overlay_opacity_invalid_toast">Player overlay opacity must be between 0-100</string>
</patch>
<patch id="layout.returnyoutubedislike.returnYouTubeDislikePatch">
<string name="revanced_ryd_settings_title" translatable="false">Return YouTube Dislike</string>
<!-- Toast shown if network connection times out. Translations of this should not be longer than the original English or the text can be clipped and not entirely shown. -->
<string name="revanced_ryd_failure_connection_timeout">Dislikes are temporarily not available (API timed out)</string>
<string name="revanced_ryd_failure_connection_status_code">Dislikes are not available (status %d)</string>
@ -898,11 +905,11 @@ Settings → Playback → Autoplay next video"</string>
<string name="revanced_ryd_failure_ryd_enabled_while_playing_video_then_user_voted">Reload video to vote using Return YouTube Dislike</string>
<!-- Video likes have been set to hidden by the video uploader. -->
<string name="revanced_ryd_video_likes_hidden_by_video_owner">Hidden by owner</string>
<string name="revanced_ryd_enable_title" translatable="false">Return YouTube Dislike</string>
<string name="revanced_ryd_enable_summary_on">Dislikes are shown</string>
<string name="revanced_ryd_enable_summary_off">Dislikes are not shown</string>
<string name="revanced_ryd_enabled_title" translatable="false">Return YouTube Dislike</string>
<string name="revanced_ryd_enabled_summary_on">Dislikes are shown</string>
<string name="revanced_ryd_enabled_summary_off">Dislikes are not shown</string>
<string name="revanced_ryd_shorts_title">Show dislikes on Shorts</string>
<string name="revanced_ryd_shorts_summary_on_disclaimer">"Dislikes on Shorts are shown
<string name="revanced_ryd_shorts_summary_on">"Dislikes on Shorts are shown
Limitation: Dislikes may not appear in incognito mode"</string>
<string name="revanced_ryd_shorts_summary_off">Dislikes on Shorts are not shown</string>
@ -919,7 +926,6 @@ Limitation: Dislikes may not appear in incognito mode"</string>
<string name="revanced_ryd_toast_on_connection_error_title">Show a toast if API is not available</string>
<string name="revanced_ryd_toast_on_connection_error_summary_on">Toast is shown if Return YouTube Dislike is not available</string>
<string name="revanced_ryd_toast_on_connection_error_summary_off">Toast is not shown if Return YouTube Dislike is not available</string>
<string name="revanced_ryd_about">About</string>
<string name="revanced_ryd_attribution_title" translatable="false">ReturnYouTubeDislike.com</string>
<string name="revanced_ryd_attribution_summary">Data is provided by the Return YouTube Dislike API. Tap here to learn more</string>
<!-- Statistic strings are shown in the settings only when ReVanced debug mode is enabled. Typical users will never see these. -->
@ -961,7 +967,7 @@ This feature works best with a video quality of 720p or lower and when using a v
<string name="revanced_restore_old_seekbar_thumbnails_summary_off">Seekbar thumbnails will appear in fullscreen</string>
</patch>
<patch id="layout.sponsorblock.sponsorBlockResourcePatch">
<string name="revanced_sb_settings_title" translatable="false">SponsorBlock</string>
<string name="revanced_settings_screen_10_sponsorblock_title" translatable="false">SponsorBlock</string>
<string name="revanced_sb_enable_sb">Enable SponsorBlock</string>
<string name="revanced_sb_enable_sb_sum">SponsorBlock is a crowdsourced system for skipping annoying parts of YouTube videos</string>
<string name="revanced_sb_appearance_category">Appearance</string>
@ -1128,7 +1134,7 @@ Ready to submit?"</string>
<string name="revanced_sb_new_segment_edit_by_hand_title">Edit timing of segment manually</string>
<string name="revanced_sb_new_segment_edit_by_hand_content">Do you want to edit the timing for the start or end of the segment?</string>
<string name="revanced_sb_new_segment_edit_by_hand_parse_error">Invalid time given</string>
<string name="revanced_sb_stats">Stats</string>
<string name="revanced_sb_stats_title">Stats</string>
<!-- Shown in the settings preferences, and translations can be any text length. -->
<string name="revanced_sb_stats_connection_failure">Stats are temporarily not available (API is down)</string>
<string name="revanced_sb_stats_loading">Loading...</string>
@ -1157,9 +1163,9 @@ Ready to submit?"</string>
<string name="revanced_sb_color_invalid">Invalid color code</string>
<string name="revanced_sb_reset_color">Reset color</string>
<string name="revanced_sb_reset">Reset</string>
<string name="revanced_sb_about">About</string>
<string name="revanced_sb_about_api" translatable="false">sponsor.ajay.app</string>
<string name="revanced_sb_about_api_sum">Data is provided by the SponsorBlock API. Tap here to learn more and see downloads for other platforms</string>
<string name="revanced_sb_about_title">About</string>
<string name="revanced_sb_about_api_title" translatable="false">sponsor.ajay.app</string>
<string name="revanced_sb_about_api_summary">Data is provided by the SponsorBlock API. Tap here to learn more and see downloads for other platforms</string>
</patch>
<patch id="layout.formfactor.changeFormFactorPatch">
<string name="revanced_change_form_factor_title">Layout form factor</string>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:id="@+id/revanced_settings_cursor">
<solid android:color="?ytTextPrimary" />
<size android:width="1dp" />
</shape>

View File

@ -22,4 +22,8 @@
<item name="android:windowIsTranslucent">true</item>
<item name="android:background">@android:color/transparent</item>
</style>
<style name="revanced_searchbar_cursor">
<item name="android:textCursorDrawable">@drawable/revanced_settings_cursor</item>
<item name="android:textSize">16sp</item>
</style>
</resources>

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="54dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:id="@android:id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginHorizontal="18dp"
android:contentDescription="@null" />
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:paddingVertical="8dp">
<TextView
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/medium_font_size"
android:textColor="?ytTextPrimary"
android:textAlignment="viewStart" />
<TextView
android:id="@android:id/summary"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/small_font_size"
android:textColor="?ytTextSecondary"
android:textAlignment="viewStart"
android:maxLines="2"
android:ellipsize="end" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,31 @@
<?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:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:paddingTop="12dp"
android:paddingBottom="12dp"
android:gravity="center_vertical">
<!-- History icon -->
<ImageView
android:id="@+id/history_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:contentDescription="History icon"
android:src="@drawable/yt_outline_arrow_time_vd_theme_24" />
<!-- Suggestion text -->
<TextView
android:id="@+id/suggestion_text"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textSize="16sp"
android:textColor="?android:attr/textColorPrimary" />
</LinearLayout>

View File

@ -1,34 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:transitionGroup="true">
<FrameLayout
android:id="@+id/revanced_toolbar_parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/yt_white1"
android:elevation="0dp">
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical"
android:transitionGroup="true">
<android.support.v7.widget.Toolbar
android:id="@+id/revanced_toolbar"
<!-- Parent container for Toolbar and SearchView -->
<FrameLayout
android:id="@+id/revanced_toolbar_parent"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/ytBrandBackgroundSolid"
app:navigationIcon="@drawable/yt_outline_arrow_left_black_24"
app:title="@string/revanced_settings_title" />
android:background="@color/yt_white1"
android:elevation="0dp">
<!-- Toolbar -->
<android.support.v7.widget.Toolbar
android:id="@+id/revanced_toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/ytBrandBackgroundSolid"
app:navigationIcon="@drawable/yt_outline_arrow_left_black_24"
app:title="@string/revanced_settings_title" />
<!-- Container for SearchView -->
<FrameLayout
android:id="@+id/revanced_search_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:visibility="gone">
<android.widget.SearchView
android:id="@+id/revanced_search_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="56dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="6dp"
android:layout_marginBottom="6dp"
android:layout_gravity="center_vertical"
android:iconifiedByDefault="false"
android:searchIcon="@null"
android:queryBackground="@null"
android:theme="@style/revanced_searchbar_cursor"
android:padding="2dp" />
</FrameLayout>
</FrameLayout>
<!-- Container for fragments -->
<FrameLayout
android:id="@+id/revanced_settings_fragments"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:id="@+id/revanced_settings_fragments"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</merge>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_search"
android:icon="@drawable/yt_outline_search_black_24"
android:title=""
android:showAsAction="always"/>
</menu>