mirror of
https://github.com/NiciDieNase/chaosflix
synced 2024-11-23 04:43:07 +00:00
formatting and reenable toolbar in player
This commit is contained in:
parent
f4efbdd4ae
commit
209854bddd
5 changed files with 19 additions and 20 deletions
|
@ -43,13 +43,12 @@ class AboutFragment : Fragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
val version = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
|
val version = "${BuildConfig.VERSION_NAME} (${BuildConfig.VERSION_CODE})"
|
||||||
val versionElement = Element()
|
val versionElement = Element()
|
||||||
var clickCounter = 0
|
var clickCounter = 0
|
||||||
versionElement.title = "Version $version"
|
versionElement.title = "Version $version"
|
||||||
versionElement.setOnClickListener {
|
versionElement.setOnClickListener {
|
||||||
when(clickCounter++){
|
when (clickCounter++) {
|
||||||
10 -> {
|
10 -> {
|
||||||
chaosflixPreferenceManager.debugEnabled = true
|
chaosflixPreferenceManager.debugEnabled = true
|
||||||
showToast(R.string.debug_enabled)
|
showToast(R.string.debug_enabled)
|
||||||
|
@ -59,7 +58,6 @@ class AboutFragment : Fragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return AboutPage(requireContext())
|
return AboutPage(requireContext())
|
||||||
.setImage(R.drawable.icon_primary_background)
|
.setImage(R.drawable.icon_primary_background)
|
||||||
.setDescription(resources.getString(R.string.about_description))
|
.setDescription(resources.getString(R.string.about_description))
|
||||||
|
|
|
@ -7,7 +7,7 @@ import android.view.ViewGroup
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||||
import de.nicidienase.chaosflix.touch.databinding.FragmentFilterSheetBinding
|
import de.nicidienase.chaosflix.touch.databinding.FragmentFilterSheetBinding
|
||||||
|
|
||||||
class FilterBottomSheet: BottomSheetDialogFragment() {
|
class FilterBottomSheet : BottomSheetDialogFragment() {
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
|
||||||
val binding = FragmentFilterSheetBinding.inflate(inflater, container, false)
|
val binding = FragmentFilterSheetBinding.inflate(inflater, container, false)
|
||||||
|
|
|
@ -9,6 +9,8 @@ import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.appcompat.widget.Toolbar
|
||||||
import androidx.databinding.DataBindingUtil
|
import androidx.databinding.DataBindingUtil
|
||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
|
@ -66,15 +68,15 @@ class ExoPlayerFragment : Fragment(), PlayerStateChangeListener {
|
||||||
val binding: FragmentExoPlayerBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_exo_player, container, false)
|
val binding: FragmentExoPlayerBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_exo_player, container, false)
|
||||||
viewModel = ViewModelProvider(this, ViewModelFactory.getInstance(requireContext())).get(PlayerViewModel::class.java)
|
viewModel = ViewModelProvider(this, ViewModelFactory.getInstance(requireContext())).get(PlayerViewModel::class.java)
|
||||||
viewModel.setEvent(args.playbackItem.eventGuid)
|
viewModel.setEvent(args.playbackItem.eventGuid)
|
||||||
// val toolbar: Toolbar = binding.getRoot().findViewById(R.id.toolbar)
|
val toolbar: Toolbar = binding.root.findViewById(R.id.toolbar)
|
||||||
// toolbar.title = args.playbackItem.title
|
toolbar.title = args.playbackItem.title
|
||||||
// toolbar.subtitle = args.playbackItem.subtitle
|
toolbar.subtitle = args.playbackItem.subtitle
|
||||||
// val activity = activity as AppCompatActivity?
|
val activity = activity as AppCompatActivity?
|
||||||
// if (activity != null) {
|
if (activity != null) {
|
||||||
// activity.setSupportActionBar(toolbar)
|
activity.setSupportActionBar(toolbar)
|
||||||
// val actionBar = activity.supportActionBar
|
val actionBar = activity.supportActionBar
|
||||||
// actionBar?.setDisplayHomeAsUpEnabled(true)
|
actionBar?.setDisplayHomeAsUpEnabled(true)
|
||||||
// }
|
}
|
||||||
this.binding = binding
|
this.binding = binding
|
||||||
return binding.root
|
return binding.root
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) {
|
||||||
if(key == getString(R.string.preference_key_darkmode_setting)){
|
if (key == getString(R.string.preference_key_darkmode_setting)) {
|
||||||
DarkmodeUtil.init(requireContext())
|
DarkmodeUtil.init(requireContext())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
|
||||||
|
|
||||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||||
setPreferencesFromResource(R.xml.preferences, rootKey)
|
setPreferencesFromResource(R.xml.preferences, rootKey)
|
||||||
if(BuildConfig.DEBUG || chaosflixPreferenceManager.debugEnabled){
|
if (BuildConfig.DEBUG || chaosflixPreferenceManager.debugEnabled) {
|
||||||
addPreferencesFromResource(R.xml.debug_settings)
|
addPreferencesFromResource(R.xml.debug_settings)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,6 +201,5 @@ class SettingsFragment : PreferenceFragmentCompat(), SharedPreferences.OnSharedP
|
||||||
fragment.arguments = args
|
fragment.arguments = args
|
||||||
return fragment
|
return fragment
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue