本文整理汇总了Java中pub.devrel.easypermissions.AppSettingsDialog类的典型用法代码示例。如果您正苦于以下问题:Java AppSettingsDialog类的具体用法?Java AppSettingsDialog怎么用?Java AppSettingsDialog使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AppSettingsDialog类属于pub.devrel.easypermissions包,在下文中一共展示了AppSettingsDialog类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
// (Optional) Check whether the user denied any permissions and checked "NEVER ASK AGAIN."
// This will display a dialog directing them to enable the permission in app settings.
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this, getString(R.string.rationale_ask_again)).setTitle(
getString(R.string.title_settings_dialog))
.setPositiveButton(
getString(
R.string.setting))
.setNegativeButton(
getString(
R.string.cancel),
null /* click listener */)
.setRequestCode(
100)
.build()
.show();
}
}
示例2: onActivityResult
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_CHOOSE_PHOTO) {
if (resultCode == RESULT_OK) {
Uri selectedImage = data.getData();
uploadPhoto(selectedImage);
} else {
Toast.makeText(this, "No image chosen", Toast.LENGTH_SHORT).show();
}
} else if (requestCode == AppSettingsDialog.DEFAULT_SETTINGS_REQ_CODE
&& EasyPermissions.hasPermissions(this, PERMS)) {
choosePhoto();
}
}
示例3: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
Log.d(LOG_TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size());
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this)
.setTitle(getString(R.string.title_settings_dialog))
.setRationale(getString(R.string.rationale_ask_again))
.setPositiveButton(getString(R.string.setting))
.setNegativeButton(getString(R.string.cancel))
.setRequestCode(RC_SETTINGS_SCREEN_PERM)
.build()
.show();
}
}
示例4: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
//Log.d(TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size());
// (Optional) Check whether the user denied any permissions and checked "NEVER ASK AGAIN."
// This will display a dialog directing them to enable the permission in app settings.
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this).build().show();
}
}
示例5: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this)
.setTitle(R.string.PermissionsErrorTitle)
.setRationale(R.string.PermissionsErrorMessage)
.build()
.show();
}
}
示例6: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
if (requestCode == WRITE_EXTERNAL_STORAGE_PERMISSION) {
new AppToast(this).longToast(R.string.write_storage_request_toast);
//double check that write access is granted, this permission is needed
requestWriteExternalStoragePermission();
// (Optional) Check whether the user denied any permissions and checked "NEVER ASK AGAIN."
// This will display a dialog directing them to enable the permission in app settings.
if (!EasyPermissions.hasPermissions(this, Manifest.permission.WRITE_EXTERNAL_STORAGE))
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this).build().show();
}
} else if (requestCode == LOCATION_PERMISSION) {
new AppToast(this).longToast(R.string.location_request_toast);
//double check that write access is granted, this permission is needed
requestLocationPermission();
String[] permissions = {Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION};
// (Optional) Check whether the user denied any permissions and checked "NEVER ASK AGAIN."
// This will display a dialog directing them to enable the permission in app settings.
if (!EasyPermissions.hasPermissions(this, permissions))
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this).build().show();
}
}
}
示例7: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
Toast.makeText(UIUtils.getContext(), "执行onPermissionsDenied()...", Toast.LENGTH_SHORT).show();
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this, "当前App需要申请camera权限,需要打开设置页面么?")
.setTitle("权限申请")
.setPositiveButton("确认")
.setNegativeButton("取消", null /* click listener */)
.setRequestCode(REQUEST_CAMERA_PERM)
.build()
.show();
}
}
示例8: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
// 如果权限有没有申请成功的权限存在,则弹出弹出框,用户点击后去到设置界面自己打开权限
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog
.Builder(this)
.build()
.show();
}
}
示例9: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
Log.d(TAG, "onPermissionsDenied:" + requestCode + ":" + perms.size());
// If Permission permanently denied, ask user again
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this).build().show();
} else {
finish();
}
}
示例10: onActivityResult
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == AppSettingsDialog.DEFAULT_SETTINGS_REQ_CODE) {
// Do something after user returned from app settings screen, like showing a Toast.
if (EasyPermissions.hasPermissions(this, "android.permission.READ_EXTERNAL_STORAGE")) {
permissionGranted();
} else {
finish();
}
}
}
示例11: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
Toast.makeText(this, R.string.gallery_save_file_not_have_external_storage_permission, Toast.LENGTH_SHORT).show();
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this).build().show();
}
}
示例12: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> permissions) {
if (EasyPermissions.somePermissionPermanentlyDenied(this, permissions)) {
new AppSettingsDialog.Builder(this)
.setRationale(R.string.rationale)
.setTitle(R.string.title_rationale)
.setPositiveButton(R.string.app_settings)
.setNegativeButton(R.string.cancel)
.setRequestCode(SETTINGS_REQUEST_CODE)
.build()
.show();
}
}
示例13: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> perms) {
Toast.makeText(this, "执行onPermissionsDenied()...", Toast.LENGTH_SHORT).show();
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
new AppSettingsDialog.Builder(this, "当前App需要申请camera权限,需要打开设置页面么?")
.setTitle("权限申请")
.setPositiveButton("确认")
.setNegativeButton("取消", null /* click listener */)
.setRequestCode(REQUEST_CAMERA_PERM)
.build()
.show();
}
}
示例14: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> list) {
if (requestCode != REQUEST_STORAGE_PERMISSION || !list.contains(READ_EXTERNAL_STORAGE)) {
return;
}
if (EasyPermissions.somePermissionPermanentlyDenied(this, list)) {
// Permanently denied. Notify presenter.
Log.d(TAG, "Permission has been permanently denied.");
new AppSettingsDialog.Builder(this).build().show();
} else {
showPermissionError(true);
}
}
示例15: onPermissionsDenied
import pub.devrel.easypermissions.AppSettingsDialog; //导入依赖的package包/类
@Override
public void onPermissionsDenied(int requestCode, List<String> list) {
if (requestCode != REQUEST_STORAGE_PERMISSION) {
return;
}
if (EasyPermissions.somePermissionPermanentlyDenied(this, list)) {
// Permanently denied. Notify presenter.
Log.d(TAG, "Permission has been permanently denied.");
new AppSettingsDialog.Builder(this).build().show();
} else {
mPresenter.onPermissionRequestResult(false);
}
}