Convert MainFragment to Kotlin

This commit is contained in:
tzugen 2021-08-26 22:57:10 +02:00
parent e00137a635
commit e8baea6195
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
2 changed files with 245 additions and 227 deletions

View File

@ -30,7 +30,6 @@
<ID>LongMethod:EditServerFragment.kt$EditServerFragment$override fun onViewCreated(view: View, savedInstanceState: Bundle?)</ID> <ID>LongMethod:EditServerFragment.kt$EditServerFragment$override fun onViewCreated(view: View, savedInstanceState: Bundle?)</ID>
<ID>LongMethod:FilePickerAdapter.kt$FilePickerAdapter$private fun fileLister(currentDirectory: File)</ID> <ID>LongMethod:FilePickerAdapter.kt$FilePickerAdapter$private fun fileLister(currentDirectory: File)</ID>
<ID>LongMethod:LocalMediaPlayer.kt$LocalMediaPlayer$@Synchronized private fun doPlay(downloadFile: DownloadFile, position: Int, start: Boolean)</ID> <ID>LongMethod:LocalMediaPlayer.kt$LocalMediaPlayer$@Synchronized private fun doPlay(downloadFile: DownloadFile, position: Int, start: Boolean)</ID>
<ID>LongMethod:MediaPlayerService.kt$MediaPlayerService$private fun updateMediaSession(currentPlaying: DownloadFile?, playerState: PlayerState)</ID>
<ID>LongMethod:NavigationActivity.kt$NavigationActivity$override fun onCreate(savedInstanceState: Bundle?)</ID> <ID>LongMethod:NavigationActivity.kt$NavigationActivity$override fun onCreate(savedInstanceState: Bundle?)</ID>
<ID>LongMethod:ShareHandler.kt$ShareHandler$private fun showDialog( fragment: Fragment, shareDetails: ShareDetails, swipe: SwipeRefreshLayout?, cancellationToken: CancellationToken )</ID> <ID>LongMethod:ShareHandler.kt$ShareHandler$private fun showDialog( fragment: Fragment, shareDetails: ShareDetails, swipe: SwipeRefreshLayout?, cancellationToken: CancellationToken )</ID>
<ID>LongMethod:SongView.kt$SongView$fun setSong(song: MusicDirectory.Entry, checkable: Boolean, draggable: Boolean)</ID> <ID>LongMethod:SongView.kt$SongView$fun setSong(song: MusicDirectory.Entry, checkable: Boolean, draggable: Boolean)</ID>
@ -49,7 +48,6 @@
<ID>MagicNumber:LocalMediaPlayer.kt$LocalMediaPlayer.BufferTask$86400L</ID> <ID>MagicNumber:LocalMediaPlayer.kt$LocalMediaPlayer.BufferTask$86400L</ID>
<ID>MagicNumber:LocalMediaPlayer.kt$LocalMediaPlayer.BufferTask$8L</ID> <ID>MagicNumber:LocalMediaPlayer.kt$LocalMediaPlayer.BufferTask$8L</ID>
<ID>MagicNumber:LocalMediaPlayer.kt$LocalMediaPlayer.CheckCompletionTask$5000L</ID> <ID>MagicNumber:LocalMediaPlayer.kt$LocalMediaPlayer.CheckCompletionTask$5000L</ID>
<ID>MagicNumber:LocalMediaPlayer.kt$LocalMediaPlayer.PositionCache$50L</ID>
<ID>MagicNumber:MediaPlayerService.kt$MediaPlayerService$256</ID> <ID>MagicNumber:MediaPlayerService.kt$MediaPlayerService$256</ID>
<ID>MagicNumber:MediaPlayerService.kt$MediaPlayerService$3</ID> <ID>MagicNumber:MediaPlayerService.kt$MediaPlayerService$3</ID>
<ID>MagicNumber:MediaPlayerService.kt$MediaPlayerService$4</ID> <ID>MagicNumber:MediaPlayerService.kt$MediaPlayerService$4</ID>
@ -70,11 +68,9 @@
<ID>TooGenericExceptionCaught:LocalMediaPlayer.kt$LocalMediaPlayer$exception: Throwable</ID> <ID>TooGenericExceptionCaught:LocalMediaPlayer.kt$LocalMediaPlayer$exception: Throwable</ID>
<ID>TooGenericExceptionCaught:LocalMediaPlayer.kt$LocalMediaPlayer$x: Exception</ID> <ID>TooGenericExceptionCaught:LocalMediaPlayer.kt$LocalMediaPlayer$x: Exception</ID>
<ID>TooGenericExceptionCaught:LocalMediaPlayer.kt$LocalMediaPlayer.PositionCache$e: Exception</ID> <ID>TooGenericExceptionCaught:LocalMediaPlayer.kt$LocalMediaPlayer.PositionCache$e: Exception</ID>
<ID>TooGenericExceptionCaught:MediaPlayerService.kt$MediaPlayerService$e: Exception</ID>
<ID>TooGenericExceptionCaught:SongView.kt$SongView$e: Exception</ID> <ID>TooGenericExceptionCaught:SongView.kt$SongView$e: Exception</ID>
<ID>TooGenericExceptionCaught:SubsonicUncaughtExceptionHandler.kt$SubsonicUncaughtExceptionHandler$x: Throwable</ID> <ID>TooGenericExceptionCaught:SubsonicUncaughtExceptionHandler.kt$SubsonicUncaughtExceptionHandler$x: Throwable</ID>
<ID>TooGenericExceptionThrown:DownloadFile.kt$DownloadFile.DownloadTask$throw Exception(String.format("Download of '%s' was cancelled", song))</ID> <ID>TooGenericExceptionThrown:DownloadFile.kt$DownloadFile.DownloadTask$throw Exception(String.format("Download of '%s' was cancelled", song))</ID>
<ID>TooManyFunctions:LocalMediaPlayer.kt$LocalMediaPlayer</ID>
<ID>TooManyFunctions:MediaPlayerService.kt$MediaPlayerService : Service</ID> <ID>TooManyFunctions:MediaPlayerService.kt$MediaPlayerService : Service</ID>
<ID>TooManyFunctions:RESTMusicService.kt$RESTMusicService : MusicService</ID> <ID>TooManyFunctions:RESTMusicService.kt$RESTMusicService : MusicService</ID>
<ID>TooManyFunctions:TrackCollectionFragment.kt$TrackCollectionFragment : Fragment</ID> <ID>TooManyFunctions:TrackCollectionFragment.kt$TrackCollectionFragment : Fragment</ID>

View File

@ -1,272 +1,294 @@
package org.moire.ultrasonic.fragment; package org.moire.ultrasonic.fragment
import android.os.Bundle; import android.os.Bundle
import android.view.LayoutInflater; import android.view.LayoutInflater
import android.view.View; import android.view.View
import android.view.ViewGroup; import android.view.ViewGroup
import android.widget.ListView; import android.widget.AdapterView
import android.widget.TextView; import android.widget.AdapterView.OnItemClickListener
import android.widget.ListView
import androidx.annotation.NonNull; import android.widget.TextView
import androidx.annotation.Nullable; import androidx.fragment.app.Fragment
import androidx.fragment.app.Fragment; import androidx.navigation.Navigation
import androidx.navigation.Navigation; import java.util.Locale
import org.koin.core.component.KoinComponent
import org.moire.ultrasonic.R; import org.koin.core.component.inject
import org.moire.ultrasonic.data.ActiveServerProvider; import org.moire.ultrasonic.R
import org.moire.ultrasonic.data.ServerSetting; import org.moire.ultrasonic.data.ActiveServerProvider
import org.moire.ultrasonic.util.Constants; import org.moire.ultrasonic.data.ActiveServerProvider.Companion.isOffline
import org.moire.ultrasonic.util.MergeAdapter; import org.moire.ultrasonic.util.Constants
import org.moire.ultrasonic.util.Util; import org.moire.ultrasonic.util.MergeAdapter
import org.moire.ultrasonic.util.Util.applyTheme
import java.util.Collections; import org.moire.ultrasonic.util.Util.getMaxAlbums
import org.moire.ultrasonic.util.Util.getMaxSongs
import kotlin.Lazy; import org.moire.ultrasonic.util.Util.getShouldUseId3Tags
import static java.util.Arrays.asList;
import static org.koin.java.KoinJavaComponent.inject;
/** /**
* Displays the Main screen of Ultrasonic, where the music library can be browsed * Displays the Main screen of Ultrasonic, where the music library can be browsed
*/ */
public class MainFragment extends Fragment { class MainFragment : Fragment(), KoinComponent {
private var list: ListView? = null
private static boolean shouldUseId3; private lateinit var serverButton: View
private static String lastActiveServerProperties; private lateinit var serverTextView: TextView
private lateinit var musicTitle: View
private lateinit var artistsButton: View
private lateinit var albumsButton: View
private lateinit var genresButton: View
private lateinit var videosTitle: View
private lateinit var songsTitle: View
private lateinit var randomSongsButton: View
private lateinit var songsStarredButton: View
private lateinit var albumsTitle: View
private lateinit var albumsNewestButton: View
private lateinit var albumsRandomButton: View
private lateinit var albumsHighestButton: View
private lateinit var albumsStarredButton: View
private lateinit var albumsRecentButton: View
private lateinit var albumsFrequentButton: View
private lateinit var albumsAlphaByNameButton: View
private lateinit var albumsAlphaByArtistButton: View
private lateinit var videosButton: View
private ListView list; private val activeServerProvider: ActiveServerProvider by inject()
private final Lazy<ActiveServerProvider> activeServerProvider = inject(ActiveServerProvider.class); override fun onCreate(savedInstanceState: Bundle?) {
applyTheme(this.context)
@Override super.onCreate(savedInstanceState)
public void onCreate(@Nullable Bundle savedInstanceState) {
Util.applyTheme(this.getContext());
super.onCreate(savedInstanceState);
} }
@Override override fun onCreateView(
public View onCreateView(LayoutInflater inflater, ViewGroup container, inflater: LayoutInflater,
Bundle savedInstanceState) { container: ViewGroup?,
return inflater.inflate(R.layout.main, container, false); savedInstanceState: Bundle?
): View? {
return inflater.inflate(R.layout.main, container, false)
} }
@Override override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { list = view.findViewById(R.id.main_list)
cachedActiveServerProperties = getActiveServerProperties()
list = view.findViewById(R.id.main_list); setupButtons()
setupMenuList(list);
super.onViewCreated(view, savedInstanceState); if (list != null) setupMenuList(list!!)
super.onViewCreated(view, savedInstanceState)
} }
@Override override fun onResume() {
public void onResume() { super.onResume()
super.onResume(); var shouldRestart = false
boolean shouldRestart = false; val currentId3Setting = getShouldUseId3Tags()
val currentActiveServerProperties = getActiveServerProperties()
boolean id3 = Util.getShouldUseId3Tags(); // If setting has changed...
String currentActiveServerProperties = getActiveServerProperties(); if (currentId3Setting != shouldUseId3) {
shouldUseId3 = currentId3Setting
if (id3 != shouldUseId3) shouldRestart = true
{
shouldUseId3 = id3;
shouldRestart = true;
} }
if (!currentActiveServerProperties.equals(lastActiveServerProperties)) // or the server has changed...
{ if (currentActiveServerProperties != cachedActiveServerProperties) {
lastActiveServerProperties = currentActiveServerProperties; cachedActiveServerProperties = currentActiveServerProperties
shouldRestart = true; shouldRestart = true
} }
// then setup the list anew.
if (shouldRestart) { if (shouldRestart) {
setupMenuList(list); if (list != null) setupMenuList(list!!)
} }
} }
private void setupMenuList(ListView list) private fun setupButtons() {
{ val buttons = layoutInflater.inflate(R.layout.main_buttons, list, false)
final View buttons = getLayoutInflater().inflate(R.layout.main_buttons, list, false); serverButton = buttons.findViewById(R.id.main_select_server)
final View serverButton = buttons.findViewById(R.id.main_select_server); serverTextView = serverButton.findViewById(R.id.main_select_server_2)
final TextView serverTextView = serverButton.findViewById(R.id.main_select_server_2); musicTitle = buttons.findViewById(R.id.main_music)
artistsButton = buttons.findViewById(R.id.main_artists_button)
albumsButton = buttons.findViewById(R.id.main_albums_button)
genresButton = buttons.findViewById(R.id.main_genres_button)
videosTitle = buttons.findViewById(R.id.main_videos_title)
songsTitle = buttons.findViewById(R.id.main_songs)
randomSongsButton = buttons.findViewById(R.id.main_songs_button)
songsStarredButton = buttons.findViewById(R.id.main_songs_starred)
albumsTitle = buttons.findViewById(R.id.main_albums)
albumsNewestButton = buttons.findViewById(R.id.main_albums_newest)
albumsRandomButton = buttons.findViewById(R.id.main_albums_random)
albumsHighestButton = buttons.findViewById(R.id.main_albums_highest)
albumsStarredButton = buttons.findViewById(R.id.main_albums_starred)
albumsRecentButton = buttons.findViewById(R.id.main_albums_recent)
albumsFrequentButton = buttons.findViewById(R.id.main_albums_frequent)
albumsAlphaByNameButton = buttons.findViewById(R.id.main_albums_alphaByName)
albumsAlphaByArtistButton = buttons.findViewById(R.id.main_albums_alphaByArtist)
videosButton = buttons.findViewById(R.id.main_videos)
}
lastActiveServerProperties = getActiveServerProperties(); private fun setupMenuList(list: ListView) {
String name = activeServerProvider.getValue().getActiveServer().getName(); // Set title
val activeServerName = activeServerProvider.getActiveServer().name
serverTextView.text = activeServerName
serverTextView.setText(name); // TODO: Should use RecyclerView
val adapter = MergeAdapter()
final View musicTitle = buttons.findViewById(R.id.main_music); adapter.addView(serverButton, true)
final View artistsButton = buttons.findViewById(R.id.main_artists_button);
final View albumsButton = buttons.findViewById(R.id.main_albums_button);
final View genresButton = buttons.findViewById(R.id.main_genres_button);
final View videosTitle = buttons.findViewById(R.id.main_videos_title);
final View songsTitle = buttons.findViewById(R.id.main_songs);
final View randomSongsButton = buttons.findViewById(R.id.main_songs_button);
final View songsStarredButton = buttons.findViewById(R.id.main_songs_starred);
final View albumsTitle = buttons.findViewById(R.id.main_albums);
final View albumsNewestButton = buttons.findViewById(R.id.main_albums_newest);
final View albumsRandomButton = buttons.findViewById(R.id.main_albums_random);
final View albumsHighestButton = buttons.findViewById(R.id.main_albums_highest);
final View albumsStarredButton = buttons.findViewById(R.id.main_albums_starred);
final View albumsRecentButton = buttons.findViewById(R.id.main_albums_recent);
final View albumsFrequentButton = buttons.findViewById(R.id.main_albums_frequent);
final View albumsAlphaByNameButton = buttons.findViewById(R.id.main_albums_alphaByName);
final View albumsAlphaByArtistButton = buttons.findViewById(R.id.main_albums_alphaByArtist);
final View videosButton = buttons.findViewById(R.id.main_videos);
final MergeAdapter adapter = new MergeAdapter(); shouldUseId3 = getShouldUseId3Tags()
adapter.addViews(Collections.singletonList(serverButton), true);
shouldUseId3 = Util.getShouldUseId3Tags(); if (!isOffline()) {
adapter.addView(musicTitle, false)
if (!ActiveServerProvider.Companion.isOffline()) adapter.addViews(listOf(artistsButton, albumsButton, genresButton), true)
{ adapter.addView(songsTitle, false)
adapter.addView(musicTitle, false); adapter.addViews(listOf(randomSongsButton, songsStarredButton), true)
adapter.addViews(asList(artistsButton, albumsButton, genresButton), true); adapter.addView(albumsTitle, false)
adapter.addViews(
adapter.addView(songsTitle, false); listOf(
adapter.addViews(asList(randomSongsButton, songsStarredButton), true); albumsNewestButton,
albumsRecentButton,
adapter.addView(albumsTitle, false); albumsFrequentButton
adapter.addViews(asList(albumsNewestButton, albumsRecentButton, albumsFrequentButton), true); ),
if (!shouldUseId3) true
adapter.addView(albumsHighestButton, true); )
adapter.addViews(asList(albumsRandomButton, albumsStarredButton, albumsAlphaByNameButton, albumsAlphaByArtistButton), true); if (!shouldUseId3) {
adapter.addView(albumsHighestButton, true)
adapter.addView(videosTitle, false); }
adapter.addViews(Collections.singletonList(videosButton), true); adapter.addViews(
} listOf(
else // Offline supported calls albumsRandomButton,
{ albumsStarredButton,
adapter.addView(musicTitle, false); albumsAlphaByNameButton,
adapter.addViews(asList(artistsButton, genresButton), true); albumsAlphaByArtistButton
),
adapter.addView(songsTitle, false); true
adapter.addView(randomSongsButton, true); )
adapter.addView(videosTitle, false)
adapter.addView(videosTitle, false); adapter.addViews(listOf(videosButton), true)
adapter.addViews(Collections.singletonList(videosButton), true); } else {
// Offline supported calls
adapter.addView(musicTitle, false)
adapter.addViews(listOf(artistsButton, genresButton), true)
adapter.addView(songsTitle, false)
adapter.addView(randomSongsButton, true)
} }
list.setAdapter(adapter); list.adapter = adapter
list.setOnItemClickListener((parent, view, position, id) -> { list.onItemClickListener = listListener
if (view == serverButton)
{
showServers();
}
else if (view == albumsNewestButton)
{
showAlbumList("newest", R.string.main_albums_newest);
}
else if (view == albumsRandomButton)
{
showAlbumList("random", R.string.main_albums_random);
}
else if (view == albumsHighestButton)
{
showAlbumList("highest", R.string.main_albums_highest);
}
else if (view == albumsRecentButton)
{
showAlbumList("recent", R.string.main_albums_recent);
}
else if (view == albumsFrequentButton)
{
showAlbumList("frequent", R.string.main_albums_frequent);
}
else if (view == albumsStarredButton)
{
showAlbumList(Constants.STARRED, R.string.main_albums_starred);
}
else if (view == albumsAlphaByNameButton)
{
showAlbumList(Constants.ALPHABETICAL_BY_NAME, R.string.main_albums_alphaByName);
}
else if (view == albumsAlphaByArtistButton)
{
showAlbumList("alphabeticalByArtist", R.string.main_albums_alphaByArtist);
}
else if (view == songsStarredButton)
{
showStarredSongs();
}
else if (view == artistsButton)
{
showArtists();
}
else if (view == albumsButton)
{
showAlbumList(Constants.ALPHABETICAL_BY_NAME, R.string.main_albums_title);
}
else if (view == randomSongsButton)
{
showRandomSongs();
}
else if (view == genresButton)
{
showGenres();
}
else if (view == videosButton)
{
showVideos();
}
});
} }
private String getActiveServerProperties() private val listListener =
{ OnItemClickListener { _: AdapterView<*>?, view: View, _: Int, _: Long ->
ServerSetting currentSetting = activeServerProvider.getValue().getActiveServer(); when {
return String.format("%s;%s;%s;%s;%s;%s", currentSetting.getUrl(), currentSetting.getUserName(), view === serverButton -> {
currentSetting.getPassword(), currentSetting.getAllowSelfSignedCertificate(), showServers()
currentSetting.getLdapSupport(), currentSetting.getMinimumApiVersion()); }
view === albumsNewestButton -> {
showAlbumList("newest", R.string.main_albums_newest)
}
view === albumsRandomButton -> {
showAlbumList("random", R.string.main_albums_random)
}
view === albumsHighestButton -> {
showAlbumList("highest", R.string.main_albums_highest)
}
view === albumsRecentButton -> {
showAlbumList("recent", R.string.main_albums_recent)
}
view === albumsFrequentButton -> {
showAlbumList("frequent", R.string.main_albums_frequent)
}
view === albumsStarredButton -> {
showAlbumList(Constants.STARRED, R.string.main_albums_starred)
}
view === albumsAlphaByNameButton -> {
showAlbumList(Constants.ALPHABETICAL_BY_NAME, R.string.main_albums_alphaByName)
}
view === albumsAlphaByArtistButton -> {
showAlbumList("alphabeticalByArtist", R.string.main_albums_alphaByArtist)
}
view === songsStarredButton -> {
showStarredSongs()
}
view === artistsButton -> {
showArtists()
}
view === albumsButton -> {
showAlbumList(Constants.ALPHABETICAL_BY_NAME, R.string.main_albums_title)
}
view === randomSongsButton -> {
showRandomSongs()
}
view === genresButton -> {
showGenres()
}
view === videosButton -> {
showVideos()
}
}
}
private fun getActiveServerProperties(): String {
val server = activeServerProvider.getActiveServer()
return String.format(
Locale.ROOT,
"%s;%s;%s;%s;%s;%s",
server.url,
server.userName,
server.password,
server.allowSelfSignedCertificate,
server.ldapSupport,
server.minimumApiVersion
)
} }
private void showStarredSongs() private fun showStarredSongs() {
{ val bundle = Bundle()
Bundle bundle = new Bundle(); bundle.putInt(Constants.INTENT_EXTRA_NAME_STARRED, 1)
bundle.putInt(Constants.INTENT_EXTRA_NAME_STARRED, 1); Navigation.findNavController(requireView()).navigate(R.id.mainToTrackCollection, bundle)
Navigation.findNavController(getView()).navigate(R.id.mainToTrackCollection, bundle);
} }
private void showRandomSongs() private fun showRandomSongs() {
{ val bundle = Bundle()
Bundle bundle = new Bundle(); bundle.putInt(Constants.INTENT_EXTRA_NAME_RANDOM, 1)
bundle.putInt(Constants.INTENT_EXTRA_NAME_RANDOM, 1); bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, getMaxSongs())
bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, Util.getMaxSongs()); Navigation.findNavController(requireView()).navigate(R.id.mainToTrackCollection, bundle)
Navigation.findNavController(getView()).navigate(R.id.mainToTrackCollection, bundle);
} }
private void showArtists() private fun showArtists() {
{ val bundle = Bundle()
Bundle bundle = new Bundle(); bundle.putString(
bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TITLE, getContext().getResources().getString(R.string.main_artists_title)); Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TITLE,
Navigation.findNavController(getView()).navigate(R.id.mainToArtistList, bundle); requireContext().resources.getString(R.string.main_artists_title)
)
Navigation.findNavController(requireView()).navigate(R.id.mainToArtistList, bundle)
} }
private void showAlbumList(final String type, final int titleIndex) { private fun showAlbumList(type: String, titleIndex: Int) {
Bundle bundle = new Bundle(); val bundle = Bundle()
String title = getContext().getResources().getString(titleIndex, ""); val title = requireContext().resources.getString(titleIndex, "")
bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE, type); bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TYPE, type)
bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TITLE, title); bundle.putString(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_TITLE, title)
bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, Util.getMaxAlbums()); bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_SIZE, getMaxAlbums())
bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0); bundle.putInt(Constants.INTENT_EXTRA_NAME_ALBUM_LIST_OFFSET, 0)
Navigation.findNavController(getView()).navigate(R.id.mainToAlbumList, bundle); Navigation.findNavController(requireView()).navigate(R.id.mainToAlbumList, bundle)
} }
private void showGenres() private fun showGenres() {
{ Navigation.findNavController(requireView()).navigate(R.id.mainToSelectGenre)
Navigation.findNavController(getView()).navigate(R.id.mainToSelectGenre);
} }
private void showVideos() private fun showVideos() {
{ val bundle = Bundle()
Bundle bundle = new Bundle(); bundle.putInt(Constants.INTENT_EXTRA_NAME_VIDEOS, 1)
bundle.putInt(Constants.INTENT_EXTRA_NAME_VIDEOS, 1); Navigation.findNavController(requireView()).navigate(R.id.mainToTrackCollection, bundle)
Navigation.findNavController(getView()).navigate(R.id.mainToTrackCollection, bundle);
} }
private void showServers() private fun showServers() {
{ Navigation.findNavController(requireView()).navigate(R.id.mainToServerSelector)
Navigation.findNavController(getView()).navigate(R.id.mainToServerSelector);
} }
}
companion object {
private var shouldUseId3 = false
private var cachedActiveServerProperties: String? = null
}
}