use of permissions.dispatcher.PermissionRequest in project android-client by GenesisVision.
the class BaseFragment method showRationaleDialog.
protected void showRationaleDialog(String message, final PermissionRequest request) {
AlertDialog rationaleDialog = new AlertDialog.Builder(getContext()).setPositiveButton(getString(R.string.allow), (dialog, which) -> request.proceed()).setNegativeButton(getString(R.string.deny), (dialog, which) -> request.cancel()).setCancelable(false).setMessage(message).show();
rationaleDialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(ContextCompat.getColor(getContext(), R.color.colorAccent));
rationaleDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(ContextCompat.getColor(getContext(), R.color.colorAccent));
}
use of permissions.dispatcher.PermissionRequest in project android-client by GenesisVision.
the class BaseSwipeBackActivity method showRationaleDialog.
protected void showRationaleDialog(String message, final PermissionRequest request) {
AlertDialog rationaleDialog = new AlertDialog.Builder(this).setPositiveButton(getString(R.string.allow), (dialog, which) -> request.proceed()).setNegativeButton(getString(R.string.deny), (dialog, which) -> request.cancel()).setCancelable(false).setMessage(message).show();
rationaleDialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(ContextCompat.getColor(GenesisVisionApplication.INSTANCE, R.color.colorAccent));
rationaleDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(ContextCompat.getColor(GenesisVisionApplication.INSTANCE, R.color.colorAccent));
}
use of permissions.dispatcher.PermissionRequest in project android-client by GenesisVision.
the class BaseFragment method showRationaleDialog.
protected void showRationaleDialog(String message, final PermissionRequest request, RationaleDialogCallback callback) {
AlertDialog rationaleDialog = new AlertDialog.Builder(getContext()).setPositiveButton(getString(R.string.allow), (dialog, which) -> {
request.proceed();
if (callback != null) {
callback.onPermissionAllowed();
}
}).setNegativeButton(getString(R.string.deny), (dialog, which) -> request.cancel()).setCancelable(false).setMessage(message).show();
rationaleDialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(ContextCompat.getColor(getContext(), R.color.colorAccent));
rationaleDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(ContextCompat.getColor(getContext(), R.color.colorAccent));
}
use of permissions.dispatcher.PermissionRequest in project android-client by GenesisVision.
the class CreatePostActivity method showRationaleDialog.
protected void showRationaleDialog(String message, final PermissionRequest request) {
AlertDialog rationaleDialog = new AlertDialog.Builder(this).setPositiveButton(getString(R.string.allow), (dialog, which) -> request.proceed()).setNegativeButton(getString(R.string.deny), (dialog, which) -> request.cancel()).setCancelable(false).setMessage(message).show();
rationaleDialog.getButton(DialogInterface.BUTTON_POSITIVE).setTextColor(ContextCompat.getColor(GenesisVisionApplication.INSTANCE, R.color.colorAccent));
rationaleDialog.getButton(DialogInterface.BUTTON_NEGATIVE).setTextColor(ContextCompat.getColor(GenesisVisionApplication.INSTANCE, R.color.colorAccent));
}
Aggregations