Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change deprecated method setButton #546

Closed
UrjaPawar opened this issue Mar 8, 2017 · 7 comments
Closed

Change deprecated method setButton #546

UrjaPawar opened this issue Mar 8, 2017 · 7 comments

Comments

@UrjaPawar
Copy link

There are a bunch of setButton methods used in Alert Dialogs which are deprecated and need to be replaced for a smoother transition to updated version of app's UI.
All the methods used previously in alert dialogs are available in similar formats in the updated version where the builder is customized first and then is created.
These methods need to get changed

@UrjaPawar
Copy link
Author

I would eagerly like to work on this issue and have already started. :)
@lognaturel Will you please tag this issue as "in progress"!?

@grzesiek2010
Copy link
Member

@UrjaPawar does it make sense now? As you know we want to refactor our dialogs #541

@lognaturel
Copy link
Member

@grzesiek2010 @UrjaPawar I haven't looked at this in detail. Could doing this first be a way to break #541 more incremental? In other words, will this change be useful for #541 and reduce the scope of what then needs to be done there? I guess it depends on whether an external library gets used, right?

@UrjaPawar
Copy link
Author

UrjaPawar commented Mar 9, 2017

@lognaturel @grzesiek2010 I did think about #541 and noticed that if we use this-> https://github.com/michael-rapp/AndroidMaterialDialog library or simply update the original one, the syntax changes will be similar!

This is what will be used in case of libraries
MaterialDialog.Builder dialogBuilder = new MaterialDialog.Builder(this); dialogBuilder.setTitle(R.string.dialog_title); dialogBuilder.setMessage(R.string.dialog_message); dialogBuilder.setTitle(R.string.dialog_title); dialogBuilder.setPositiveButton(android.R.string.ok, null); dialogBuilder.setNegativeButton(android.R.string.cancel, null); MaterialDialog dialog = dialogBuilder.create(); dialog.show();

This is what alternative of deprecated setButton came out to be in one of the function of the app:
AlertDialog.Builder builder=new AlertDialog.Builder(this); builder.setIcon(android.R.drawable.ic_dialog_info) .setMessage(errorMsg) .setCancelable(false) .setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { Collect.getInstance() .getActivityLogger() .logAction(this, "createErrorDialog", shouldExit ? "exitApplication" : "OK"); if (shouldExit) { finish(); } } }); mAlertDialog = new AlertDialog.Builder(this).create(); mAlertDialog.show();

Please consider this and let me know what are your thoughts!

@grzesiek2010
Copy link
Member

@UrjaPawar I see. I just thought that we can do that as a part of #541 but generally I'm in favour of small and focused prs so maybe it makes sense. Let @lognaturel decide.

@UrjaPawar
Copy link
Author

@grzesiek2010 I understand your preference and will make sure not to repeat this. I will close this issue as soon as @lognaturel confirms it

@lognaturel
Copy link
Member

I'm sorry I let this sit for so long! Yes, I think it's best to close for now, make a decision on dialogs more generally and then decide how we want to implement those changes.

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

No branches or pull requests

3 participants