npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

t4-weather-detail-native-module

v1.11.14

Published

TODO

Downloads

23

Readme

CircleCI

t4-weather-detail-native-module

Prerequests

node & yarn setup

Getting started

$ npm install t4-weather-detail-native-module --save

Mostly automatic installation

$ react-native link t4-weather-detail-native-module

Usage in RN

import WeatherDetailNativeModule from 't4-weather-detail-native-module';

WeatherDetailNativeModule;

Native Android Weather Detail Page module

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:

Alt text

Architecture

  • 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.

Dependency Injection

  • Koin is used as a Dependency injection framework.

Network Layer

  • 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:

Alt text

2- Timeout:

Alt text

when user clicks the retry, it triggers new network request.

UI

  • 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.

Unit Testing

  • Repository, UseCase, ViewModel are unit tested by using Mockito and Junit

CI

  • 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.

Additional Info

  • Android module has it's own README file. Please also check other README file to get more information about weatherapi module. Link