node
& yarn
setup
$ npm install t4-weather-detail-native-module --save
$ react-native link t4-weather-detail-native-module
import WeatherDetailNativeModule from 't4-weather-detail-native-module';
WeatherDetailNativeModule;
This RN module created to show weather detail screen in a native way and already published to npm
and current version is 1.11.*
. By using yarn publish
command, new changes can be re-deployed.
Here is the screenshot of Native Android Weather Detail page:
- MVVM is used as a design pattern.
- ViewModel provides WeatherDetailModel data with the RxJava to UI
- Created usecase layer which can be used several times and is responsible small piece of job to work on the background thread, including application business rules which is isolated from network and UI layer.
- Repository has created to fetch entities from the network and it mediates between data source and use case layer.
- RxJava used to update UI and network operations with different threads.
- Koin is used as a Dependency injection framework.
- Created different module which is called weatherapi for api calls.
- Error handling and callback were done in this layer.
- Moshi and Retrofit libraries are used to fetch data/upload JSON from network.
Snackbar is shown if any kind of error happens
1- Connection Error:
2- Timeout:
when user clicks the retry, it triggers new network request.
- There is Activity to start the fragment transaction.
-
WeatherDetailFragment
which shows weather detail information as a full-screen window - Grouped relevant weather detail in the use-case layer to show them in the card view.
- Added Swipe Refresh mechanism.
- Created custom view which called
WeatherDetailCardView
, it can be reusable several times.
- Repository, UseCase, ViewModel are unit tested by using Mockito and Junit
- Integrated CircleCI for the Android module.
- Added simple job rules in the config file.
- CI checks the Android unit tests and builds. Once the jobs succeed, accordingly, Badge status will be updated on the Readme file.
- Android module has it's own README file. Please also check other README file to get more information about weatherapi module. Link