Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.xihadulislam:AndroidUtils:2.0.2'
}
val sharePrefSettings = AndroidUtils.getSharePrefSetting(this);
sharePrefSettings.setBoolValue("key", false)
val kBoolean = sharePrefSettings.getBoolValue("key")
sharePrefSettings.setStringValue("key2", "xihad islam")
val xd = sharePrefSettings.getStringValue("key2");
AndroidUtils.toast(this, xd)
toast.setOnClickListener {
AndroidUtils.toast(this, "show something")
}
showSnack.setOnClickListener {
AndroidUtils.getSnackBar(this).snackBar("show something")
}
showSnackSuccess.setOnClickListener {
AndroidUtils.getSnackBar(this).successSnack(root, "show something")
}
showSnackInfo.setOnClickListener {
AndroidUtils.getSnackBar(this).infoSnack(root, "show something", Gravity.BOTTOM, fun() {
AndroidUtils.toast(this, "click")
})
}
showSnackWarning.setOnClickListener {
AndroidUtils.getSnackBar(this).warningSnack(root, "show something")
}
showSnackError.setOnClickListener {
AndroidUtils.getSnackBar(this).errorSnack(root, "show something")
}
startNextActivity.setOnClickListener {
AndroidUtils.getIntent().startNextActivity(this, SecondActivity::class.java)
}
afterNextActivity.setOnClickListener {
AndroidUtils.getIntent().afterNextActivity(this, 2000, SecondActivity::class.java)
}
startFacebookIntent.setOnClickListener {
AndroidUtils.getIntent().startFacebookIntent(this, "url")
}
if (AndroidUtils.getAppUtil().isInternetAvailable(this)) {
AndroidUtils.toast(this, "Available")
}
Clone this repo and check out the app module.
This is my First built library, so if you face any issues or errors feel free to tell me. I will update it continuously.
Like this project? Why not share to your friend :)
Copyright 2021 @xihad islam.
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.