about: redesign ui
Completely redesign the about UI to remove its dependency on bottomsheetdialogfragment. That object is such a hassle to deal with an is the epitome of everything wrong with this horrible platform. This design will enable further about extensions in the future.
This commit is contained in:
@@ -116,7 +116,7 @@ class PlaybackSessionConnector(
|
||||
invalidateSessionState()
|
||||
}
|
||||
|
||||
// --
|
||||
// -- EXOPLAYER CALLBACKS ---
|
||||
|
||||
override fun onEvents(player: Player, events: Player.Events) {
|
||||
if (events.containsAny(
|
||||
|
||||
+9
-6
@@ -8,10 +8,12 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.net.toUri
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||
import org.oxycblt.auxio.BuildConfig
|
||||
import org.oxycblt.auxio.R
|
||||
import org.oxycblt.auxio.databinding.DialogAboutBinding
|
||||
import org.oxycblt.auxio.databinding.FragmentAboutBinding
|
||||
import org.oxycblt.auxio.logD
|
||||
import org.oxycblt.auxio.music.MusicStore
|
||||
import org.oxycblt.auxio.ui.showToast
|
||||
@@ -20,19 +22,20 @@ import org.oxycblt.auxio.ui.showToast
|
||||
* A [BottomSheetDialogFragment] that shows Auxio's about screen.
|
||||
* @author OxygenCobalt
|
||||
*/
|
||||
class AboutDialog : BottomSheetDialogFragment() {
|
||||
override fun getTheme() = R.style.Theme_BottomSheetFix
|
||||
|
||||
class AboutFragment : Fragment() {
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
val binding = DialogAboutBinding.inflate(layoutInflater)
|
||||
val binding = FragmentAboutBinding.inflate(layoutInflater)
|
||||
val musicStore = MusicStore.getInstance()
|
||||
|
||||
binding.aboutVersion.text = BuildConfig.VERSION_NAME
|
||||
binding.aboutToolbar.setNavigationOnClickListener {
|
||||
findNavController().navigateUp()
|
||||
}
|
||||
|
||||
binding.aboutVersion.text = BuildConfig.VERSION_NAME
|
||||
binding.aboutCode.setOnClickListener { openLinkInBrowser(LINK_CODEBASE) }
|
||||
binding.aboutFaq.setOnClickListener { openLinkInBrowser(LINK_FAQ) }
|
||||
binding.aboutLicenses.setOnClickListener { openLinkInBrowser(LINK_LICENSES) }
|
||||
@@ -5,6 +5,8 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import org.oxycblt.auxio.MainFragmentDirections
|
||||
import org.oxycblt.auxio.databinding.FragmentSettingsBinding
|
||||
|
||||
/**
|
||||
@@ -20,7 +22,10 @@ class SettingsFragment : Fragment() {
|
||||
val binding = FragmentSettingsBinding.inflate(inflater)
|
||||
|
||||
binding.settingsToolbar.setOnMenuItemClickListener {
|
||||
AboutDialog().show(childFragmentManager, AboutDialog.TAG)
|
||||
parentFragment?.parentFragment?.findNavController()?.navigate(
|
||||
MainFragmentDirections.actionShowAbout()
|
||||
)
|
||||
|
||||
true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user