Giter VIP home page Giter VIP logo

rnetwork's Introduction

RNetwork

License API

Feature Image

A light weight and lifecycle awared live internet connection status library using reactivenetwork and crouton.

How To

How does another developer add this as a dependency?

STEP 1: Reference your Bintray repository into project-level build.gradle:

    allprojects {
      repositories {
        // ...
        maven { url 'https://dl.bintray.com/rrsaikat/RNetwork' }
      }
    }

STEP 2: Reference the library itself in your module-level build.gradle:

    implementation 'com.rezwan.knetworklib:knetworklib:1.0.3'

STEP 3: KNetwork.initialize(this) - must declare this into Application.

    class App:Application() {
        override fun onCreate() {
            super.onCreate()
            KNetwork.initialize(this)
        }
    }

STEP 4: KNetwork.bind(this, lifecycle) - bind the targeted activity in which you want to show network status.

    KNetwork.bind(this, lifecycle)
                   .setConnectivityListener(this)

NOTE:

  1. Enable java 8:

     compileOptions {
         sourceCompatibility JavaVersion.VERSION_1_8
         targetCompatibility JavaVersion.VERSION_1_8
     }
    

Available additinal methods:

*  showKNDialog() - set true for show dialog when net connection goes off.
*  setConnectivityListener() - connected, disconnected callback into activity
*  setInAnimation() - custom animation setup
*  setOutAnimation() - custom animation setup
*  setViewGroupResId() - targeted viewgroup to show network status views.

Example project is here for better understanding: GO TO Example

Proguard

################ rxjava2 ###########
-dontwarn java.util.concurrent.Flow*
##### END ##############

##ReactNetwork####
-dontwarn com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork
-dontwarn io.reactivex.functions.Function
-dontwarn rx.internal.util.**
-dontwarn sun.misc.Unsafe
##END#####

Apps that are used this library:

Get it on Google Play

Author

๐Ÿ‘ค RRSaikat

Used Libraries

  1. ReactiveNetwork
  2. Crouton

License

  Copyright (c) 2020-present, RRsaikat

  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.

rnetwork's People

Contributors

rrsaikat avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.