Coder Social home page Coder Social logo

morristech / gpversionchecker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from robohorse/gpversionchecker

0.0 0.0 0.0 211 KB

Android Library for checking the current uploaded version on the Google Play

License: MIT License

Java 98.40% HTML 1.60%

gpversionchecker's Introduction

GPVersionChecker

Android Arsenal

Android Library for checking the current uploaded version on the Google Play

#Quick start

  1. Just add this dependency into your build.gradle
compile 'com.robohorse.gpversionchecker:gpversionchecker:1.0.8'

or

add it to your build.gradle with:

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

and:

 compile 'com.github.robohorse:gpversionchecker:1.0.8'
  1. Add
  new GPVersionChecker.Builder(this).create();

into your Activity.java

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        new GPVersionChecker.Builder(this).create();
    }

Now you can see this awesome dialog window:

This library does not produce memory leaks - all context usages are leak-safe.

#Customization

• Dialog window customization

You can override string resource, that you want:

    <string name="app_name">GPVersionChecker</string>

    <string name="gpvch_header">New version is available!</string>
    <string name="gpvch_button_positive">Update current version</string>
    <string name="gpvch_button_negative">Remind me later</string>
    <string name="gpvch_new_version_info_title">Whats new:</string>

also, you can override dimensions for default dialog window

    <dimen name="gpvch_app_icon_margin">10dp</dimen>

    <dimen name="gpvch_tv_version_code_margin_left">5dp</dimen>
    <dimen name="gpvch_tv_version_code_margin_right">5dp</dimen>
    <dimen name="gpvch_tv_version_code_margin_top">10dp</dimen>

    <dimen name="gpvch_tv_header_whats_new">5dp</dimen>

    <dimen name="gpvch_tv_changes_margin_left">5dp</dimen>
    <dimen name="gpvch_tv_changes_margin_right">5dp</dimen>
    <dimen name="gpvch_tv_changes_margin_bottom">10dp</dimen>

    <integer name="gpvch_tv_changes_max_lines">4</integer>

image by overriding gpvch_app_icon.xml

   <?xml version="1.0" encoding="utf-8"?>
   <bitmap xmlns:android="http://schemas.android.com/apk/res/android"
    android:src="@drawable/ic_launcher" />

or colors

    <color name="gpvch_dialog_text_color">@color/gpvch_black</color>

• Version checking strategy

Add this to builder, and dialog will be shown once in day

.setCheckingStrategy(CheckingStrategy.ONE_PER_DAY)

• Usage info response only

The following code will block showing of the default dialog window, but gives information about current uploaded version

 new GPVersionChecker.Builder(this)
                .setVersionInfoListener(new VersionInfoListener() {
                   
                    @Override
                    public void onResulted(Version version) {
                        
                    }
                })
                .create();

#ProGuard Add the following to proguard-project.txt:

-keep public class org.jsoup.** {
public *;
}

#About Copyright 2016 Vadim Shchenev, and licensed under the MIT license. No attribution is necessary but it's very much appreciated. Star this project if you like it.

gpversionchecker's People

Contributors

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