Partial documentation available here : documentation
-
Easy File Download manager Found here
-
Easy Imgur uploader Found here
-
Easy debugger Found here
-
Easy Ui Components creator (Confirm/Input/Progress/List dialogs, Toasts) Found here
-
General App utils, File Utils, Image Utils Found here
-
Easy Global SharedPreferences Setup/Usage Found here.
Call
new Utils(this)
once in the first activity. later use this methods put(key, value), getFloatPref(key, default value), getIntegerPref(key, default value), getLongPref(key, default value), getStringPref(key, default value), getBooleanPref(key, default value), removeKeyPrefs(key), prefsContains(key),
repositories {
//...
maven { url 'https://jitpack.io' }
}
implementation 'com.github.H4zh4n:HaxHanTools:1.0.15.2'
For the whole process to work properly, Utils()
must be initialized before any of the ui/ context based components to be used.
I Recommend that you write below line in first activities onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
new Utils(this); // <--- have this
// ... other codes
}
For the dialogs/toast and such to work and display data properly, make sure that for each activity you have below line in it's onResume
@Override
protected void onResume() {
super.onResume();
Utils.activeContext = this;
// ... other codes
}
This is so that the app knows on which screen the dialogs should be shown.
- If you faced duplicate Class found for
lifecycle-viewmodel
orandroidx.lifecycle
orlifecycle-viewmodel-ktx
then implement as following
implementation('com.github.H4zh4n:HaxHanTools:1.0.15.2') {
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel'
exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx'
}
- below code might be needed in
build.grade
Module to avoidMore than one file was found with OS independent path 'META-INF/DEPENDENCIES'
android {
// ...
packagingOptions {
exclude 'META-INF/*'
}
//...
}