diff --git a/app/src/main/java/com/github/libretube/SettingsActivity.kt b/app/src/main/java/com/github/libretube/SettingsActivity.kt index 23cf30bab..27f6f5046 100644 --- a/app/src/main/java/com/github/libretube/SettingsActivity.kt +++ b/app/src/main/java/com/github/libretube/SettingsActivity.kt @@ -4,7 +4,8 @@ import android.app.NotificationManager import android.os.Build import android.os.Bundle import android.view.View -import android.widget.ImageView +import android.widget.ImageButton +import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat import com.github.libretube.preferences.MainSettings @@ -32,7 +33,7 @@ class SettingsActivity : AppCompatActivity() { setContentView(R.layout.activity_settings) - val backButton = view.findViewById(R.id.back_imageView) + val backButton = view.findViewById(R.id.back_imageButton) backButton.setOnClickListener { onBackPressed() } @@ -65,6 +66,8 @@ class SettingsActivity : AppCompatActivity() { .beginTransaction() .replace(R.id.settings, MainSettings()) .commit() + val topBarTextView = findViewById(R.id.topBar_textView) + topBarTextView?.text = getString(R.string.settings) } } } diff --git a/app/src/main/java/com/github/libretube/preferences/AboutFragment.kt b/app/src/main/java/com/github/libretube/preferences/AboutFragment.kt index 33d205b51..97e95c8f1 100644 --- a/app/src/main/java/com/github/libretube/preferences/AboutFragment.kt +++ b/app/src/main/java/com/github/libretube/preferences/AboutFragment.kt @@ -27,6 +27,9 @@ class AboutFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + val topBarText = activity?.findViewById(R.id.topBar_textView) + topBarText?.text = getString(R.string.about) + val appVersion = view?.findViewById(R.id.app_version) appVersion.text = BuildConfig.VERSION_NAME val website = view?.findViewById(R.id.website) diff --git a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt b/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt index 75c0e31cb..12b31a597 100644 --- a/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/AdvancedSettings.kt @@ -16,8 +16,8 @@ class AdvancedSettings : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.advanced_settings, rootKey) - val settingsTextView = view?.findViewById(R.id.settings_textView) - settingsTextView?.text = getString(R.string.advanced) + val topBarTextView = activity?.findViewById(R.id.topBar_textView) + topBarTextView?.text = getString(R.string.advanced) val clearHistory = findPreference("clear_history") clearHistory?.setOnPreferenceClickListener { diff --git a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt b/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt index 9c7544420..46a9ad30a 100644 --- a/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/AppearanceSettings.kt @@ -1,6 +1,7 @@ package com.github.libretube.preferences import android.os.Bundle +import android.widget.TextView import androidx.preference.ListPreference import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat @@ -13,6 +14,9 @@ class AppearanceSettings : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.appearance_settings, rootKey) + val topBarTextView = activity?.findViewById(R.id.topBar_textView) + topBarTextView?.text = getString(R.string.appearance) + val themeToggle = findPreference("theme_togglee") themeToggle?.setOnPreferenceChangeListener { _, _ -> activity?.recreate() diff --git a/app/src/main/java/com/github/libretube/preferences/SponsorBlockSettings.kt b/app/src/main/java/com/github/libretube/preferences/SponsorBlockSettings.kt index 142ec652d..1579feab0 100644 --- a/app/src/main/java/com/github/libretube/preferences/SponsorBlockSettings.kt +++ b/app/src/main/java/com/github/libretube/preferences/SponsorBlockSettings.kt @@ -1,6 +1,7 @@ package com.github.libretube.preferences import android.os.Bundle +import android.widget.TextView import androidx.preference.PreferenceFragmentCompat import androidx.preference.SwitchPreferenceCompat import com.github.libretube.R @@ -20,6 +21,10 @@ class SponsorBlockSettings : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.sponsorblock_settings, rootKey) + + val topBarTextView = activity?.findViewById(R.id.topBar_textView) + topBarTextView?.text = getString(R.string.sponsorblock) + val sponsorBlockToggle = findPreference("sb_enabled_key") sponsorBlockToggle?.setOnPreferenceChangeListener { _, newValue -> sponsorBlockEnabled = newValue as Boolean diff --git a/app/src/main/res/layout/activity_settings.xml b/app/src/main/res/layout/activity_settings.xml index 86fd496d1..9bcbe36d3 100644 --- a/app/src/main/res/layout/activity_settings.xml +++ b/app/src/main/res/layout/activity_settings.xml @@ -7,15 +7,17 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> -