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

[TIMOB-18964] Android: Update Alert Dialogs to use Material #6889

Merged
merged 1 commit into from
Jun 16, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import org.appcelerator.titanium.view.TiUIView;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.support.v4.view.ViewCompat;
Expand Down Expand Up @@ -173,7 +173,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP
{
Log.d(TAG, "Property: " + key + " old: " + oldValue + " new: " + newValue, Log.DEBUG_MODE);

AlertDialog dialog = dialogWrapper.getDialog();
AlertDialog dialog = (AlertDialog) dialogWrapper.getDialog();
if (key.equals(TiC.PROPERTY_TITLE)) {
if (dialog != null) {
dialog.setTitle((String) newValue);
Expand Down Expand Up @@ -251,7 +251,7 @@ public void propertyChanged(String key, Object oldValue, Object newValue, KrollP

public void show(KrollDict options)
{
AlertDialog dialog = dialogWrapper.getDialog();
AlertDialog dialog = (AlertDialog) dialogWrapper.getDialog();
if (dialog == null) {
if (dialogWrapper.getActivity() == null) {
TiBaseActivity dialogActivity = (TiBaseActivity) getCurrentActivity();
Expand Down Expand Up @@ -308,7 +308,7 @@ public void onCancel(DialogInterface dlg) {

public void hide(KrollDict options)
{
AlertDialog dialog = dialogWrapper.getDialog();
AlertDialog dialog = (AlertDialog) dialogWrapper.getDialog();
if (dialog != null) {
dialog.dismiss();
dialogWrapper.getActivity().removeDialog(dialog);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
import org.appcelerator.titanium.view.TiCompositeLayout.LayoutArrangement;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.support.v7.app.AlertDialog;
import android.app.Dialog;
import android.content.Intent;
import android.content.IntentSender;
Expand Down Expand Up @@ -108,10 +109,11 @@ public abstract class TiBaseActivity extends ActionBarActivity

public class DialogWrapper {
boolean isPersistent;
AlertDialog dialog;
Dialog dialog;

WeakReference<TiBaseActivity> dialogActivity;

public DialogWrapper(AlertDialog d, boolean persistent, WeakReference<TiBaseActivity> activity) {
public DialogWrapper(Dialog d, boolean persistent, WeakReference<TiBaseActivity> activity) {
isPersistent = persistent;
dialog = d;
dialogActivity = activity;
Expand All @@ -131,11 +133,11 @@ public void setActivity(WeakReference<TiBaseActivity> da)
dialogActivity = da;
}

public AlertDialog getDialog() {
public Dialog getDialog() {
return dialog;
}

public void setDialog(AlertDialog d) {
public void setDialog(Dialog d) {
dialog = d;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import org.appcelerator.titanium.view.TiUIView;

import android.app.Activity;
import android.app.AlertDialog;
import android.support.v7.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
Expand Down