Skip to content

Repository files navigation

EasyButtonDelayed


Easy Delay TabLayout or Button.


Content List


Download

Add maven jitpack.io and dependencies in build.gradle (Project) :

// build.gradle projectallprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
// build.gradle app/moduledependencies {
...
implementation 'com.github.gzeinnumer:EasyButtonDelayed:version'
}

Feature List

DelayButton

Default Delay 2 second (2000)

button.setOnClickListener(newDelayButton(button, newView.OnClickListener() {}));
Buttonbutton = findViewById(R.id.btn);
button.setOnClickListener(newDelayButton(button, newView.OnClickListener() {
@OverridepublicvoidonClick(Viewview) {
Toast.makeText(getApplicationContext(), "Test", Toast.LENGTH_SHORT).show();
}
}));

Custom Delay 1 second (1000)

intdelay = 1000;
button.setOnClickListener(newDelayButton(button, newView.OnClickListener() {}, delay));

DelayTabLayout

Default Delay 2 second (2000)

tabLayout.addOnTabSelectedListener(newDelayTabLayout(tabLayout, newTabLayout.OnTabSelectedListener() {}));
TabLayouttabLayout = findViewById(R.id.tab_layout);
tabLayout.addOnTabSelectedListener(newDelayTabLayout(tabLayout, newTabLayout.OnTabSelectedListener() {
@OverridepublicvoidonTabSelected(TabLayout.Tabtab) {
Toast.makeText(getApplicationContext(), "test aja", Toast.LENGTH_SHORT).show();
}
@OverridepublicvoidonTabUnselected(TabLayout.Tabtab) {}
@OverridepublicvoidonTabReselected(TabLayout.Tabtab) {}
}));

Custom Delay 1 second (1000)

intdelay = 1000;
tabLayout.addOnTabSelectedListener(newDelayTabLayout(tabLayout, newTabLayout.OnTabSelectedListener() {}, delay));

Example Code/App

MainActivity.javaactivity_main.xml


Version

  • 1.0.3
    • First Release
  • 1.1.0
    • Validasi Valid Time
  • 1.1.1
    • Bug Fixing

Contribution

You can sent your constribution to branchopen-pull.

Fore More All My Library


Copyright 2022 M. Fadli Zein

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages