Use bundleOf().
This commit is contained in:
parent
7e9fba2d96
commit
55d242fa08
2 changed files with 4 additions and 11 deletions
|
@ -29,6 +29,7 @@ import android.view.MenuItem
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.core.os.bundleOf
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.preference.PreferenceManager
|
import androidx.preference.PreferenceManager
|
||||||
|
@ -330,12 +331,7 @@ class FeedFragment : BaseListFragment<FeedState, Unit>() {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun newInstance(groupId: Long = FeedGroupEntity.GROUP_ALL_ID, groupName: String? = null): FeedFragment {
|
fun newInstance(groupId: Long = FeedGroupEntity.GROUP_ALL_ID, groupName: String? = null): FeedFragment {
|
||||||
val feedFragment = FeedFragment()
|
val feedFragment = FeedFragment()
|
||||||
|
feedFragment.arguments = bundleOf(KEY_GROUP_ID to groupId, KEY_GROUP_NAME to groupName)
|
||||||
feedFragment.arguments = Bundle().apply {
|
|
||||||
putLong(KEY_GROUP_ID, groupId)
|
|
||||||
putString(KEY_GROUP_NAME, groupName)
|
|
||||||
}
|
|
||||||
|
|
||||||
return feedFragment
|
return feedFragment
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ import android.view.ViewGroup
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.core.content.getSystemService
|
import androidx.core.content.getSystemService
|
||||||
|
import androidx.core.os.bundleOf
|
||||||
import androidx.fragment.app.DialogFragment
|
import androidx.fragment.app.DialogFragment
|
||||||
import androidx.lifecycle.Observer
|
import androidx.lifecycle.Observer
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
|
@ -501,11 +502,7 @@ class FeedGroupDialog : DialogFragment(), BackPressable {
|
||||||
|
|
||||||
fun newInstance(groupId: Long = NO_GROUP_SELECTED): FeedGroupDialog {
|
fun newInstance(groupId: Long = NO_GROUP_SELECTED): FeedGroupDialog {
|
||||||
val dialog = FeedGroupDialog()
|
val dialog = FeedGroupDialog()
|
||||||
|
dialog.arguments = bundleOf(KEY_GROUP_ID to groupId)
|
||||||
dialog.arguments = Bundle().apply {
|
|
||||||
putLong(KEY_GROUP_ID, groupId)
|
|
||||||
}
|
|
||||||
|
|
||||||
return dialog
|
return dialog
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue