当前位置: 首页>>代码示例>>Java>>正文


Java AppSettingsDialog类代码示例

本文整理汇总了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();
    }
}
 
开发者ID:ynztlxdeai,项目名称:MoneyPackage,代码行数:21,代码来源:MainActivity.java

示例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();
    }
}
 
开发者ID:firebase,项目名称:FirebaseUI-Android,代码行数:17,代码来源:ImageActivity.java

示例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();
    }
}
 
开发者ID:opentok,项目名称:opentok-android-sdk-samples,代码行数:17,代码来源:MainActivity.java

示例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();
    }
}
 
开发者ID:CodingCodersCode,项目名称:EvolvingNetLib,代码行数:11,代码来源:DownloadListTestActivity.java

示例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();
    }
}
 
开发者ID:RockyQu,项目名称:MVVMFrames,代码行数:11,代码来源:WelcomeActivity.java

示例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();
            }
    }
}
 
开发者ID:CityZenApp,项目名称:Android-Development,代码行数:28,代码来源:MainActivity.java

示例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();
    }
}
 
开发者ID:android-jian,项目名称:topnews,代码行数:14,代码来源:SettingFragment.java

示例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();
    }
}
 
开发者ID:FZZFVII,项目名称:pipe,代码行数:11,代码来源:PermisionsFragment.java

示例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();
    }
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:11,代码来源:BaseActivity.java

示例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();
        }
    }
}
 
开发者ID:typebrook,项目名称:FiveMinsMore,代码行数:14,代码来源:BaseActivity.java

示例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();
    }
}
 
开发者ID:hsj-xiaokang,项目名称:OSchina_resources_android,代码行数:8,代码来源:LargeImageActivity.java

示例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();
	}
}
 
开发者ID:EduardoVernier,项目名称:bikedeboa-android,代码行数:14,代码来源:MapActivity.java

示例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();
    }
}
 
开发者ID:RuanXiaoHui,项目名称:ZxingScan,代码行数:14,代码来源:MainActivity.java

示例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);
    }

}
 
开发者ID:googlecodelabs,项目名称:android-storage-permissions,代码行数:16,代码来源:ImageImportActivity.java

示例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);
    }

}
 
开发者ID:googlecodelabs,项目名称:android-storage-permissions,代码行数:16,代码来源:ImagesFragment.java


注:本文中的pub.devrel.easypermissions.AppSettingsDialog类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。