All Projects → Nimrodda → github-commit-browser

Nimrodda / github-commit-browser

Licence: Apache-2.0 license
A blog companion sample project that demonstrates saving UI state after process death on Android utilizing the community established 3rd party libraries

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to github-commit-browser

Android-daily-read-tips
log for articles and info in android for every developer
Stars: ✭ 13 (-76.36%)
Mutual labels:  android-development, android-architecture, android-ui
Modern Android Development
Modern Android Development tools & key points
Stars: ✭ 219 (+298.18%)
Mutual labels:  android-development, android-architecture, android-ui
Expenso
📊 A Minimal Expense Tracker App built to demonstrate the use of modern android architecture component with MVVM Architecture
Stars: ✭ 325 (+490.91%)
Mutual labels:  android-development, android-architecture, android-ui
Material-Backdrop-Android
Material Backdrop
Stars: ✭ 106 (+92.73%)
Mutual labels:  android-development, android-architecture, android-ui
Android Inappbilling
A sample which uses Google's Play Billing Library and it does InApp Purchases and Subscriptions.
Stars: ✭ 114 (+107.27%)
Mutual labels:  android-development, android-architecture, android-ui
media-picker
Easy customizable picker for all your needs in Android application
Stars: ✭ 167 (+203.64%)
Mutual labels:  android-development, android-architecture, android-ui
Androidkex
Extensions for Kotlin. Use the power of Kotlin to make your code smaller and beautiful.
Stars: ✭ 35 (-36.36%)
Mutual labels:  android-development, android-architecture, android-ui
Einsen
🎯 Einsen is a prioritization app that uses Eisenhower matrix technique as workflow to prioritize a list of tasks & built to Demonstrate use of Jetpack Compose with Modern Android Architecture Components & MVVM Architecture.
Stars: ✭ 821 (+1392.73%)
Mutual labels:  android-development, android-architecture, android-ui
Cameraxdemo
A sample camera app with CameraX API from Android Jetpack
Stars: ✭ 112 (+103.64%)
Mutual labels:  android-development, android-architecture, android-ui
Mediapicker
Easy customizable picker for all your needs in Android application
Stars: ✭ 105 (+90.91%)
Mutual labels:  android-development, android-architecture, android-ui
Android Arsenal.com
Source to android-arsenal.herokuapp.com
Stars: ✭ 541 (+883.64%)
Mutual labels:  android-development, android-architecture, android-ui
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (+187.27%)
Mutual labels:  android-development, android-architecture, android-ui
Aacpaginginfinitescrollingwithnetworksample
AAC Paging Infinite Scrolling With Network Sample
Stars: ✭ 74 (+34.55%)
Mutual labels:  android-development, android-architecture, android-architecture-components
Ibackdrop
A library to simply use Backdrop in your project (make it easy). Read more ->
Stars: ✭ 137 (+149.09%)
Mutual labels:  android-development, android-architecture, android-ui
Awesome Android Complete Reference
Awesome Android references for everything like best practices, performance optimization, etc.
Stars: ✭ 2,701 (+4810.91%)
Mutual labels:  android-development, android-architecture, android-ui
Advancedrecycleview
♻ RecycleView with multiple view types, inner horizontal RecycleView and layout animation
Stars: ✭ 172 (+212.73%)
Mutual labels:  android-development, android-ui
Awesomedialog
A Beautiful Dialog Library for Kotlin Android
Stars: ✭ 163 (+196.36%)
Mutual labels:  android-development, android-ui
box
BOX is the Android framework from MyRealTrip which is a MVI architecture for Android apps that is created out of the box.
Stars: ✭ 38 (-30.91%)
Mutual labels:  android-development, android-architecture
Android Mvp Architecture
🏛 A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP.
Stars: ✭ 203 (+269.09%)
Mutual labels:  android-development, android-architecture
Glidetoast
GlideToast is a android library to implement flying Toast Animation
Stars: ✭ 162 (+194.55%)
Mutual labels:  android-development, android-ui

CircleCI

Saving UI state with ViewModel SavedState and Dagger

This repository contains a sample project that demonstrate the topic discussed in my article about ViewModel SavedState module, which part of the Android architecture lifecycle components.

Saved state use cases in the sample

To simulate a process stop, switch to Logcat and at the lefthand corner press the Stop button to stop the process while making sure that the right process is selected in the dropdown box.

Commit List screen

You will notice that CommitListViewModel is making use of SavedStateHandle to save the last seen page in the list. If the app recovers from a process stop, the handle will load the last seen page. We then load the data up to that page.

Commit Detail screen

In this case, we're saving the state of the whole commit response object so that the next time the app recovers from a process stop, it will restore that last commit response object and will skip making a request to Github.

When you launch the app, pay attention to the logs in Logcat. You will see that when the activity is started for the first time, it will make the request and then store the result in SavedStateHandle that is passed to CommitDetailViewModel. Then navigate away from the activity by simply going to the home screen and then navigate back. You'll see in the logs that the previously stored response is loaded from SavedStateHandle - indicating that the state has been restored after process death.

Libraries and architecture

The app is utilizing the MVVM design pattern for the UI with the help of the following libraries:

  • AndroidX
  • Architecture Components - ViewModel, Lifecycle, Navigation
  • Material components library
  • Constraint layout
  • Retrofit2 + OkHttp
  • Moshi
  • Dagger2 + Hilt
  • Timber
  • Glide
  • Kotlin coroutines
  • Epoxy

License

Copyright 2020 Nimrod Dayan nimroddayan.com

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].