Skip to content

ithot-all/android-business

Repository files navigation

Android-Business

Build Status

🔥 a series of android business type libraries

AndroidHTTP

required

<uses-permission android:name="android.permission.INTERNET" />

install

implementation 'org.ithot.android.serializer:gson:1.0.1'
implementation 'org.ithot.android.business:http-s:0.0.2'

usage

/* once */
Req.init(this, new JSON());
/* example */
class Dummy{
    public String id;
}
Req.create(this)
    .url("https://ithot.org/dummy")
    .res(new Res<Dummy>() {
        @Override
        public void ok(Dummy dummy) {
            Log.e("dummy", dummy.id);
        }
    }).get();

AndroidRlCache

required

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />

install

implementation 'org.ithot.android.business:rl-cache:0.0.1'

usage

/* once */
Rl.init(this);
/* example */
Rl.put("remoteKey", "localKey", false);
Rl.get("remoteKey");
Rl.get("remoteKey", new IRlGetter() {
    @Override
    public void get(String path) {

    }
});

AndroidRegulator

install

implementation 'org.ithot.android.business:regulator-core:0.0.1'

usage

/* example */
Debouncer debouncer = new Debouncer(500);

debouncer.setListener(new Debouncer.IDebouncer() {
    @Override
    public void perform(Object val) {
        Log.e("perform", "Debouncer");
    }
});

findViewById(R.id.btn_some).setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        debouncer.performAction();
    }
});
Throttler<Integer> throttler = new Throttler<>();

throttler.setListener(new Throttler.IThrottler<Integer>() {
    @Override
    public void perform(Integer val) {
        Log.e("Throttle", val.intValue() + "");
    }
});
SeekBar seekView = findViewById(R.id.seek);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        throttler.performAction(progress);
    }
});

AndroidPortal

required

<uses-permission android:name="android.permission.INTERNET" />

install

implementation 'org.ithot.android.business:portal-detect:0.0.1'

usage

PortalDetector.launch(new IPortalResult() {
    @Override
    public void portal(boolean need) {
        if (need){
            // Open a browser and visit any website
        }
    }
});

About

🔥 A series of Android business type libraries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published