diff --git a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt index 91f3acb53..855573461 100644 --- a/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt +++ b/app/src/main/java/org/schabi/newpipe/local/feed/FeedFragment.kt @@ -57,7 +57,7 @@ import org.schabi.newpipe.util.Localization class FeedFragment : BaseListFragment() { private lateinit var viewModel: FeedViewModel - private lateinit var swipeRefreshLayout: SwipeRefreshLayout + private lateinit var swipeRefreshLayout: SwipeRefreshLayout @State @JvmField var listState: Parcelable? = null @@ -80,17 +80,13 @@ class FeedFragment : BaseListFragment() { } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { - return inflater.inflate(R.layout.fragment_feed, container, false) } override fun onViewCreated(rootView: View, savedInstanceState: Bundle?) { super.onViewCreated(rootView, savedInstanceState) swipeRefreshLayout = requireView().findViewById(R.id.swiperefresh) - swipeRefreshLayout.setOnRefreshListener { - reloadContent() - } - + swipeRefreshLayout.setOnRefreshListener { reloadContent() } viewModel = ViewModelProvider(this, FeedViewModel.Factory(requireContext(), groupId)).get(FeedViewModel::class.java) viewModel.stateLiveData.observe(viewLifecycleOwner, Observer { it?.let(::handleResult) }) } @@ -196,9 +192,7 @@ class FeedFragment : BaseListFragment() { empty_state_view?.let { animateView(it, false, 0) } animateView(error_panel, false, 0) - if (swipeRefreshLayout.isRefreshing){ - swipeRefreshLayout.isRefreshing = false - } + swipeRefreshLayout.isRefreshing = false } override fun showEmptyState() { diff --git a/app/src/main/res/layout/fragment_feed.xml b/app/src/main/res/layout/fragment_feed.xml index 19cc34106..9f873cea1 100644 --- a/app/src/main/res/layout/fragment_feed.xml +++ b/app/src/main/res/layout/fragment_feed.xml @@ -1,14 +1,10 @@ - - - - +