Android Example App: Difference between revisions
Jump to navigation
Jump to search
Created page with "=Introduction= I decided to base my application on the CLEAN architecture and set about looking for great examples. <br> I found Lopez at https://github.com/lopspower/CleanRxA..." |
|||
Line 7: | Line 7: | ||
=Implementing Screens= | =Implementing Screens= | ||
==Refreshing== | ==Refreshing== | ||
Android provides the SwipeRefreshLayout which is demonstrated below | Android provides the SwipeRefreshLayout which is demonstrated below<br> | ||
[[File:Android Example App Refresh.png|200px]] | [[File:Android Example App Refresh.png|200px]]<br> | ||
Quite liked the approach of on by default. To implement this we | |||
*Wrap the RecyclerView in it | |||
<syntaxhighlight lang="xml"> | |||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout | |||
android:id="@+id/swipeRefreshLayout" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<androidx.recyclerview.widget.RecyclerView | |||
android:id="@+id/covid_result_recycler_view" | |||
android:layout_width="match_parent" | |||
... | |||
app:layout_constraintStart_toStartOf="parent" | |||
app:layout_constraintTop_toTopOf="parent" /> | |||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> | |||
</syntaxhighlight> |
Revision as of 04:08, 19 March 2021
Introduction
I decided to base my application on the CLEAN architecture and set about looking for great examples.
I found Lopez at https://github.com/lopspower/CleanRxArchitecture which had all of the features I looking for
- Retrofit2
- Room
- RxJava
Implementing Screens
Refreshing
Android provides the SwipeRefreshLayout which is demonstrated below
Quite liked the approach of on by default. To implement this we
- Wrap the RecyclerView in it
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeRefreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/covid_result_recycler_view"
android:layout_width="match_parent"
...
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>