android-architecture-components

Navigation Architecture component- How to refresh a fragment?

南笙酒味 提交于 2020-12-08 05:58:31
问题 I have a ListFragment that has a recyclerview and onClick on any items opens the DetailsFragment. The details fragment contains another recyclerview on the bottom that shows "MORE ITEMS". Now onClick on any of these items should open the DetailsFragment for that particular item. Basically the fragment needs to be refreshed. In the past, I would just replace fragment using fragmentManager. How do I go about refreshing the fragment? How can I create an action that points to the same fragment?

Navigation Architecture component- How to refresh a fragment?

落花浮王杯 提交于 2020-12-08 05:57:06
问题 I have a ListFragment that has a recyclerview and onClick on any items opens the DetailsFragment. The details fragment contains another recyclerview on the bottom that shows "MORE ITEMS". Now onClick on any of these items should open the DetailsFragment for that particular item. Basically the fragment needs to be refreshed. In the past, I would just replace fragment using fragmentManager. How do I go about refreshing the fragment? How can I create an action that points to the same fragment?

Modifying PagedList in Android Paging Architecture library

一个人想着一个人 提交于 2020-11-30 04:46:26
问题 I'm currently looking into incorporating the Paging Architecture library (version 2.1.0-beta01 at the time of writing) into my app. One components is a list which allows the user to delete individual items from it. This list is network-only and caching localy with Room does not make sense. PagedList is immutable and does not support modification. I have read that having a copy of the list which is than modified and returned as the new one is the way to go. The documentation states the same:

Modifying PagedList in Android Paging Architecture library

天涯浪子 提交于 2020-11-30 04:45:57
问题 I'm currently looking into incorporating the Paging Architecture library (version 2.1.0-beta01 at the time of writing) into my app. One components is a list which allows the user to delete individual items from it. This list is network-only and caching localy with Room does not make sense. PagedList is immutable and does not support modification. I have read that having a copy of the list which is than modified and returned as the new one is the way to go. The documentation states the same:

Modifying PagedList in Android Paging Architecture library

不打扰是莪最后的温柔 提交于 2020-11-30 04:44:56
问题 I'm currently looking into incorporating the Paging Architecture library (version 2.1.0-beta01 at the time of writing) into my app. One components is a list which allows the user to delete individual items from it. This list is network-only and caching localy with Room does not make sense. PagedList is immutable and does not support modification. I have read that having a copy of the list which is than modified and returned as the new one is the way to go. The documentation states the same:

Modifying PagedList in Android Paging Architecture library

心不动则不痛 提交于 2020-11-30 04:43:33
问题 I'm currently looking into incorporating the Paging Architecture library (version 2.1.0-beta01 at the time of writing) into my app. One components is a list which allows the user to delete individual items from it. This list is network-only and caching localy with Room does not make sense. PagedList is immutable and does not support modification. I have read that having a copy of the list which is than modified and returned as the new one is the way to go. The documentation states the same:

Navigation Component: pass safeArgs from activity to a fragment

北城余情 提交于 2020-11-27 05:05:51
问题 I have two graphs, so the first graph move from one fragment to an activity passing safeArgs to the activity. val action = MyFragmentDirections.actionMyActivity(arg1, arg2) Navigation.findNavController(view).navigate(action) Now in the second, I want to pass these arguments from MyActivity to a fragment which belongs to this activity. I can get the args: val args = MyActivity.fromBundle(intent.extras) The problem is there is not a Directions file for this activity, so I can't pass the

Navigation Component: pass safeArgs from activity to a fragment

こ雲淡風輕ζ 提交于 2020-11-27 05:02:53
问题 I have two graphs, so the first graph move from one fragment to an activity passing safeArgs to the activity. val action = MyFragmentDirections.actionMyActivity(arg1, arg2) Navigation.findNavController(view).navigate(action) Now in the second, I want to pass these arguments from MyActivity to a fragment which belongs to this activity. I can get the args: val args = MyActivity.fromBundle(intent.extras) The problem is there is not a Directions file for this activity, so I can't pass the