dependencies {
implementation 'com.github.dev-chetan:BaseAndroid:1.3.4'
}
String[] perms = {Manifest.permission.CALL_PHONE};
PermissionUtil.permission(((AppCompatActivity) context), perms, new PermissionHandler() {
@Override
public void onGranted() {
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + number));
context.startActivity(intent);
}
@Override
public void onDenied() {
toast(context.getString(R.string.txt_permission_deny), context);
}
});
Then, add to your manifest Manifest.xml
<activity android:name="com.android.rb.helper.PermissionActivity"
android:theme="@style/Permissions.TransparentTheme" />
Load PDF form ImageView
String pdfUrl = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf";
loadNetworkPDF(pdfUrl, (ImageView) findViewById(R.id.iv));
Load Image form ImageView
String imageUrl = "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.png";
loadNetworkImage(imageUrl, (ImageView) findViewById(R.id.iv));
loadNetworkProfile(imageUrl, (ImageView) findViewById(R.id.iv));
String localImageUrl = "<Local Image Path>";
oadStorageImage("", (ImageView) findViewById(R.id.iv));
Information Popup Dialog Single Button
showInfoDialog(response.body().getMsg());
Information Popup Dialog Two Button With Action
new DialogHelper("Are you sure you want to delete?", getContext().getString(R.string.txt_cancel), getContext().getString(R.string.txt_delete), new DialogHelper.DialogCallBack() {
@Override
public void onResult(int resultCode) {
if (resultCode == 1) {
}
}
}, DialogStatus.DIALOG_DEFAULT).show(((AppCompatActivity) getContext()).getSupportFragmentManager(), "");
#Bottom Sheet Dialog
Types Of Bottom Sheet BottomSheetHelper.Type.multipleSelection Multiple selection BottomSheetHelper.Type.singleSelection Single selection BottomSheetHelper.Type.singleSearch Single selection with search BottomSheetHelper.Type.multipleSearch Multiple selection with search
new BottomSheetHelper(getContext(), "" + text.getHint(), list, new BottomSheetHelper.OnBottomSheetResult() {
@Override
public void onResult(List<BottomSheetData> arrayList) {
}
}, BottomSheetHelper.Type.singleSearch);
- If you want to set asterisk sign(*) to input fields then use this method lik below
setRequired(textInputUser)
- Output : Username*
edtFirstName.setText("John");
edtFirstName.setSelection(getSelection(edtFirstName));
removeLastChar("Hello,"); // remove last char
removeLastChar("Hello,,",2); // remove last no of 2 char
saveContact(this,"99134***","abc","abc@123")
rbImageMultiPicker(new RBMultipleImagePickerListener() {
@Override
public void onRBPickerResult(ArrayList<DialogMultiImageHelper.ImageData> arrayList) {
Log.e(TAG, "onRBPickerResult: " + arrayList.size());
}
});