Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Version 1.0? #154

Closed
SUPERCILEX opened this issue Aug 18, 2017 · 6 comments
Closed

Version 1.0? #154

SUPERCILEX opened this issue Aug 18, 2017 · 6 comments

Comments

@SUPERCILEX
Copy link
Contributor

Hey @samtstern,
EasyPermissions has been around for awhile and seems about as stable as it'll ever be, what do you think of removing the deprecated apis and releasing a 1.0.0 version?

@samtstern
Copy link
Contributor

@SUPERCILEX I think this is probably a good idea.

@SUPERCILEX
Copy link
Contributor Author

@samtstern We should probably add a GitHub release to be consistant with #131 (comment). Maybe something like:

EasyPermissions `v1.0` is the most stable release ever! It contains mostly bugfixes and API improvements that may result in breaking changes.

# Table of Contents

- [Upgrade guide](#upgrade)
- [New features](#features)
- [Bug fixes](#fixes)

# <a name="upgrade">Upgrade guide</a>

- `AppSettingsDialog.Builder#Builder([Activity/Fragment/android.app.Fragment], String)` constructors removed. Use `AppSettingsDialog.Builder#setRationale([String/int])` instead or leave blank to use the default rationale message.
- `AppSettingsDialog.Builder#setNegativeButton(String, DialogInterface.OnClickListener)` removed. To know if a user cancelled the request, check if your permissions were given with `EasyPermissions#hasPermissions(...)` in `Activity#onActivityResult(...)`. If you still don't have the right permissions, then the request was cancelled. The following example logs which permissions were granted via a `Toast`: https://github.com/googlesamples/easypermissions/blob/25302f5672a851444d74909ac7472db3dffae860/app/src/main/java/pub/devrel/easypermissions/sample/MainActivity.java#L132-L150

# <a name="features">New features</a>

- You can now specify a custom theme for `AppSettingsDialog` via `AppSettingsDialog.Builder#setThemeResId(int)`
- In addition, if you use [AppCompat color theming](https://medium.com/google-developers/theming-with-appcompat-1a292b754b35) and have the three basic colors setup (`color[Primary/PrimaryDark/Accent]`), `AppSettingsDialog` will automatically use them to correctly style the dialog based on your app's theme instead of using the system defaults.

# <a name="fixes">Bug fixes</a>

- Use support and framework dialog implementations where applicable (#142 and [#156](https://github.com/googlesamples/easypermissions/pull/156/commits/a497251e3bccc0cee37315a022bb287e77240f65))
- `appcompat-v7` dependency is no longer leaked to consumers—**possibly breaking change**

And here's the prettily rendered version

EasyPermissions v1.0 is the most stable release ever! It contains mostly bugfixes and API improvements that may result in breaking changes.

Table of Contents

Upgrade guide

  • AppSettingsDialog.Builder#Builder([Activity/Fragment/android.app.Fragment], String) constructors removed. Use AppSettingsDialog.Builder#setRationale([String/int]) instead or leave blank to use the default rationale message.
  • AppSettingsDialog.Builder#setNegativeButton(String, DialogInterface.OnClickListener) removed. To know if a user cancelled the request, check if your permissions were given with EasyPermissions#hasPermissions(...) in Activity#onActivityResult(...). If you still don't have the right permissions, then the request was cancelled. The following example logs which permissions were granted via a Toast:
    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == AppSettingsDialog.DEFAULT_SETTINGS_REQ_CODE) {
    String yes = getString(R.string.yes);
    String no = getString(R.string.no);
    // Do something after user returned from app settings screen, like showing a Toast.
    Toast.makeText(
    this,
    getString(R.string.returned_from_app_settings_to_activity,
    hasCameraPermission() ? yes : no,
    hasLocationAndContactsPermissions() ? yes : no,
    hasSmsPermission() ? yes : no),
    Toast.LENGTH_LONG)
    .show();
    }
    }

New features

  • You can now specify a custom theme for AppSettingsDialog via AppSettingsDialog.Builder#setThemeResId(int)
  • In addition, if you use AppCompat color theming and have the three basic colors setup (color[Primary/PrimaryDark/Accent]), AppSettingsDialog will automatically use them to correctly style the dialog based on your app's theme instead of using the system defaults.

Bug fixes

@samtstern
Copy link
Contributor

Oh yeah you're right, I actually have a release draft but I forgot to publish it!

@SUPERCILEX
Copy link
Contributor Author

Lol, glad to see the release! 😄

@samtstern
Copy link
Contributor

Changed the release to include most of your wording, thanks for that.

@SUPERCILEX
Copy link
Contributor Author

Awesome!

Small bug I just noticed: it looks like the commit you're targeting for that release isn't the latest (old 32ab68f instead of new 25302f5). LGTM otherwise! 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants