mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2025-08-29 17:07:55 +00:00
Use bundleOf().
This commit is contained in:
@@ -29,6 +29,7 @@ import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.appcompat.app.AlertDialog
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.preference.PreferenceManager
|
||||
@@ -330,12 +331,7 @@ class FeedFragment : BaseListFragment<FeedState, Unit>() {
|
||||
@JvmStatic
|
||||
fun newInstance(groupId: Long = FeedGroupEntity.GROUP_ALL_ID, groupName: String? = null): FeedFragment {
|
||||
val feedFragment = FeedFragment()
|
||||
|
||||
feedFragment.arguments = Bundle().apply {
|
||||
putLong(KEY_GROUP_ID, groupId)
|
||||
putString(KEY_GROUP_NAME, groupName)
|
||||
}
|
||||
|
||||
feedFragment.arguments = bundleOf(KEY_GROUP_ID to groupId, KEY_GROUP_NAME to groupName)
|
||||
return feedFragment
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import android.view.ViewGroup
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.getSystemService
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
@@ -501,11 +502,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
|
||||
|
||||
fun newInstance(groupId: Long = NO_GROUP_SELECTED): FeedGroupDialog {
|
||||
val dialog = FeedGroupDialog()
|
||||
|
||||
dialog.arguments = Bundle().apply {
|
||||
putLong(KEY_GROUP_ID, groupId)
|
||||
}
|
||||
|
||||
dialog.arguments = bundleOf(KEY_GROUP_ID to groupId)
|
||||
return dialog
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user