From f7f93b6f30711e0d0dc867414b7d17cb705e7cf7 Mon Sep 17 00:00:00 2001 From: Lars Grefer Date: Wed, 7 Oct 2015 19:28:11 +0200 Subject: [PATCH] Use appcompat's Dialogs instead of the platform ones --- app/build.gradle | 3 - .../pockethub/accounts/AccountUtils.java | 31 +- .../pockethub/accounts/LoginActivity.java | 2 +- .../accounts/LoginWebViewActivity.java | 3 +- .../pockethub/ui/BaseProgressDialog.java | 2 +- .../pockethub/ui/ConfirmDialogFragment.java | 29 +- .../pockethub/ui/DialogFragmentHelper.java | 17 +- .../github/pockethub/ui/LightAlertDialog.java | 67 --- .../pockethub/ui/LightProgressDialog.java | 412 +++++++++++++++++- .../com/github/pockethub/ui/NewsFragment.java | 23 +- .../pockethub/ui/ProgressDialogTask.java | 2 +- .../ui/commit/CommitDiffListFragment.java | 58 +-- .../ui/issue/AssigneeDialogFragment.java | 2 +- .../ui/issue/LabelsDialogFragment.java | 34 +- .../ui/issue/MilestoneDialogFragment.java | 2 +- .../pockethub/ui/ref/RefDialogFragment.java | 2 +- .../ui/repo/RepositoryListFragment.java | 21 +- .../ui/repo/RepositoryViewActivity.java | 44 +- .../ui/user/UriLauncherActivity.java | 47 +- app/src/main/res/layout/progress_dialog.xml | 44 +- app/src/main/res/values/theme.xml | 18 +- 21 files changed, 574 insertions(+), 289 deletions(-) delete mode 100644 app/src/main/java/com/github/pockethub/ui/LightAlertDialog.java diff --git a/app/build.gradle b/app/build.gradle index 7ce2210c3..fad8c1976 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -76,9 +76,6 @@ dependencies { compile 'com.viewpagerindicator:library:2.4.1@aar' compile 'com.squareup.okio:okio:1.1.0' compile 'com.squareup.retrofit:retrofit:1.9.0' - compile('com.afollestad.material-dialogs:core:0.8.0.1@aar') { - transitive = true - } compile 'com.bugsnag:bugsnag-android:+' //Self compiled .aar version of wishlist diff --git a/app/src/main/java/com/github/pockethub/accounts/AccountUtils.java b/app/src/main/java/com/github/pockethub/accounts/AccountUtils.java index bec370c4e..551a81f5d 100644 --- a/app/src/main/java/com/github/pockethub/accounts/AccountUtils.java +++ b/app/src/main/java/com/github/pockethub/accounts/AccountUtils.java @@ -23,19 +23,18 @@ import android.accounts.AuthenticatorException; import android.accounts.OperationCanceledException; import android.app.Activity; -import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; import android.content.DialogInterface.OnClickListener; import android.os.Bundle; +import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.util.Log; import com.alorma.github.sdk.bean.dto.response.Organization; import com.alorma.github.sdk.bean.dto.response.User; import com.github.pockethub.R; -import com.github.pockethub.ui.LightAlertDialog; import org.eclipse.egit.github.core.client.RequestException; @@ -45,7 +44,6 @@ import java.util.concurrent.atomic.AtomicInteger; import static android.accounts.AccountManager.KEY_ACCOUNT_NAME; -import static android.content.DialogInterface.BUTTON_POSITIVE; import static android.util.Log.DEBUG; import static com.github.pockethub.accounts.AccountConstants.ACCOUNT_TYPE; import static java.net.HttpURLConnection.HTTP_UNAUTHORIZED; @@ -319,26 +317,23 @@ public void run() { * @param activity */ private static void showConflictMessage(final Activity activity) { - AlertDialog dialog = LightAlertDialog.create(activity); - dialog.setTitle(activity.getString(R.string.authenticator_conflict_title)); - dialog.setMessage(activity - .getString(R.string.authenticator_conflict_message)); - dialog.setOnCancelListener(new OnCancelListener() { - - @Override - public void onCancel(DialogInterface dialog) { - activity.finish(); - } - }); - dialog.setButton(BUTTON_POSITIVE, - activity.getString(android.R.string.ok), new OnClickListener() { + new AlertDialog.Builder(activity) + .setTitle(activity.getString(R.string.authenticator_conflict_title)) + .setMessage(R.string.authenticator_conflict_message) + .setOnCancelListener(new OnCancelListener() { + + @Override + public void onCancel(DialogInterface dialog) { + activity.finish(); + } + }) + .setPositiveButton(android.R.string.ok, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { activity.finish(); } - }); - dialog.show(); + }).show(); } /** diff --git a/app/src/main/java/com/github/pockethub/accounts/LoginActivity.java b/app/src/main/java/com/github/pockethub/accounts/LoginActivity.java index ad3479515..168c9e339 100644 --- a/app/src/main/java/com/github/pockethub/accounts/LoginActivity.java +++ b/app/src/main/java/com/github/pockethub/accounts/LoginActivity.java @@ -17,7 +17,7 @@ import android.accounts.Account; import android.accounts.AccountManager; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; diff --git a/app/src/main/java/com/github/pockethub/accounts/LoginWebViewActivity.java b/app/src/main/java/com/github/pockethub/accounts/LoginWebViewActivity.java index bc5e116bd..6250d71c4 100644 --- a/app/src/main/java/com/github/pockethub/accounts/LoginWebViewActivity.java +++ b/app/src/main/java/com/github/pockethub/accounts/LoginWebViewActivity.java @@ -4,6 +4,7 @@ import android.graphics.Bitmap; import android.net.Uri; import android.os.Bundle; +import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.webkit.WebViewClient; @@ -19,7 +20,7 @@ protected void onCreate(Bundle savedInstanceState) { WebView webView = new WebView(this); webView.loadUrl(getIntent().getStringExtra(LoginActivity.INTENT_EXTRA_URL)); webView.setWebViewClient(new WebViewClient() { - LightProgressDialog dialog = (LightProgressDialog) LightProgressDialog.create( + AlertDialog dialog = LightProgressDialog.create( LoginWebViewActivity.this, R.string.loading); @Override diff --git a/app/src/main/java/com/github/pockethub/ui/BaseProgressDialog.java b/app/src/main/java/com/github/pockethub/ui/BaseProgressDialog.java index 925e89c49..47bdf921d 100644 --- a/app/src/main/java/com/github/pockethub/ui/BaseProgressDialog.java +++ b/app/src/main/java/com/github/pockethub/ui/BaseProgressDialog.java @@ -1,6 +1,6 @@ package com.github.pockethub.ui; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.Context; public class BaseProgressDialog { diff --git a/app/src/main/java/com/github/pockethub/ui/ConfirmDialogFragment.java b/app/src/main/java/com/github/pockethub/ui/ConfirmDialogFragment.java index c60aa2928..796c07299 100644 --- a/app/src/main/java/com/github/pockethub/ui/ConfirmDialogFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/ConfirmDialogFragment.java @@ -15,16 +15,17 @@ */ package com.github.pockethub.ui; -import static android.app.Activity.RESULT_CANCELED; -import static android.app.Activity.RESULT_OK; -import static android.content.DialogInterface.BUTTON_NEGATIVE; -import static android.content.DialogInterface.BUTTON_POSITIVE; -import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.Bundle; import android.support.v4.app.FragmentActivity; +import android.support.v7.app.AlertDialog; + +import static android.app.Activity.RESULT_CANCELED; +import static android.app.Activity.RESULT_OK; +import static android.content.DialogInterface.BUTTON_NEGATIVE; +import static android.content.DialogInterface.BUTTON_POSITIVE; /** * Helper to display a confirmation dialog @@ -66,16 +67,14 @@ public static void show(final FragmentActivity activity, } public Dialog onCreateDialog(final Bundle savedInstanceState) { - AlertDialog dialog = LightAlertDialog.create(getActivity()); - dialog.setTitle(getTitle()); - dialog.setMessage(getMessage()); - dialog.setButton(BUTTON_POSITIVE, - getResources().getString(android.R.string.yes), this); - dialog.setButton(BUTTON_NEGATIVE, - getResources().getString(android.R.string.no), this); - dialog.setCancelable(true); - dialog.setOnCancelListener(this); - return dialog; + return new AlertDialog.Builder(getActivity()) + .setTitle(getTitle()) + .setMessage(getMessage()) + .setPositiveButton(android.R.string.yes, this) + .setNegativeButton(android.R.string.no, this) + .setCancelable(true) + .setOnCancelListener(this) + .create(); } @Override diff --git a/app/src/main/java/com/github/pockethub/ui/DialogFragmentHelper.java b/app/src/main/java/com/github/pockethub/ui/DialogFragmentHelper.java index 658bde06d..2f566b300 100644 --- a/app/src/main/java/com/github/pockethub/ui/DialogFragmentHelper.java +++ b/app/src/main/java/com/github/pockethub/ui/DialogFragmentHelper.java @@ -15,8 +15,6 @@ */ package com.github.pockethub.ui; -import static android.app.Activity.RESULT_CANCELED; -import android.app.AlertDialog; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.Bundle; @@ -24,9 +22,12 @@ import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; +import android.support.v7.app.AlertDialog; import roboguice.fragment.RoboDialogFragment; +import static android.app.Activity.RESULT_CANCELED; + /** * Base dialog fragment helper */ @@ -130,12 +131,12 @@ public void onCancel(DialogInterface dialog) { * @return dialog */ protected AlertDialog createDialog() { - final AlertDialog dialog = LightAlertDialog.create(getActivity()); - dialog.setTitle(getTitle()); - dialog.setMessage(getMessage()); - dialog.setCancelable(true); - dialog.setOnCancelListener(this); - return dialog; + return new AlertDialog.Builder(getActivity()) + .setTitle(getTitle()) + .setMessage(getMessage()) + .setCancelable(true) + .setOnCancelListener(this) + .create(); } @Override diff --git a/app/src/main/java/com/github/pockethub/ui/LightAlertDialog.java b/app/src/main/java/com/github/pockethub/ui/LightAlertDialog.java deleted file mode 100644 index 4a0a599cf..000000000 --- a/app/src/main/java/com/github/pockethub/ui/LightAlertDialog.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2012 GitHub Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.github.pockethub.ui; - -import android.app.AlertDialog; -import android.content.Context; - -/** - * Alert dialog using the Holo Light theme - */ -public class LightAlertDialog extends AlertDialog { - - /** - * Create alert dialog - * - * @param context - * @return dialog - */ - public static AlertDialog create(final Context context) { - return new LightAlertDialog(context, THEME_HOLO_LIGHT); - } - - private LightAlertDialog(final Context context, final int theme) { - super(context, theme); - } - - private LightAlertDialog(final Context context) { - super(context); - } - - /** - * Alert dialog builder using the Holo Light theme - */ - public static class Builder extends AlertDialog.Builder { - - /** - * Create alert dialog builder - * - * @param context - * @return dialog builder - */ - public static LightAlertDialog.Builder create(final Context context) { - return new LightAlertDialog.Builder(context, THEME_HOLO_LIGHT); - } - - private Builder(Context context) { - super(context); - } - - private Builder(Context context, int theme) { - super(context, theme); - } - } -} diff --git a/app/src/main/java/com/github/pockethub/ui/LightProgressDialog.java b/app/src/main/java/com/github/pockethub/ui/LightProgressDialog.java index e18bd39ac..273f7d5b8 100644 --- a/app/src/main/java/com/github/pockethub/ui/LightProgressDialog.java +++ b/app/src/main/java/com/github/pockethub/ui/LightProgressDialog.java @@ -15,9 +15,32 @@ */ package com.github.pockethub.ui; -import android.app.AlertDialog; -import android.app.ProgressDialog; import android.content.Context; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.os.Message; +import android.support.annotation.Nullable; +import android.support.v7.app.ActionBar; +import android.support.v7.app.AlertDialog; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.app.AppCompatDelegate; +import android.support.v7.view.ActionMode; +import android.view.ContextMenu; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; +import android.view.MotionEvent; +import android.view.SearchEvent; +import android.view.View; +import android.view.ViewGroup; +import android.view.Window; +import android.view.WindowManager; +import android.view.accessibility.AccessibilityEvent; +import android.widget.Button; +import android.widget.ListView; +import android.widget.ProgressBar; +import android.widget.TextView; import com.github.pockethub.R; @@ -25,7 +48,7 @@ /** * Progress dialog in Holo Light theme */ -public class LightProgressDialog extends ProgressDialog { +public class LightProgressDialog { /** * Create progress dialog @@ -46,15 +69,380 @@ public static AlertDialog create(Context context, int resId) { * @return dialog */ public static AlertDialog create(Context context, CharSequence message) { - ProgressDialog dialog = new LightProgressDialog(context, message); - dialog.setMessage(message); - dialog.setIndeterminate(true); - dialog.setProgressStyle(STYLE_SPINNER); - dialog.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.spinner)); - return dialog; - } + LayoutInflater layoutInflater = LayoutInflater.from(context); + View view = layoutInflater.inflate(R.layout.progress_dialog, null); + + ProgressBar progress = (ProgressBar) view.findViewById(R.id.progress); + progress.setIndeterminate(true); + progress.setIndeterminateDrawable(context.getResources().getDrawable(R.drawable.spinner)); + + final TextView messageView = (TextView) view.findViewById(R.id.message); + messageView.setText(message); + final AlertDialog alertDialog = new AlertDialog.Builder(context) + .setIcon(R.drawable.spinner) + .setView(view) + .create(); + return new AlertDialog(context) { + public Button getButton(int whichButton) { + return alertDialog.getButton(whichButton); + } + + public ListView getListView() { + return alertDialog.getListView(); + } + + public void setTitle(CharSequence title) { + alertDialog.setTitle(title); + } + + public void setCustomTitle(View customTitleView) { + alertDialog.setCustomTitle(customTitleView); + } + + public void setMessage(CharSequence message) { + messageView.setText(message); + } + + public void setView(View view) { + alertDialog.setView(view); + } + + public void setView(View view, int viewSpacingLeft, int viewSpacingTop, int viewSpacingRight, int viewSpacingBottom) { + alertDialog.setView(view, viewSpacingLeft, viewSpacingTop, viewSpacingRight, viewSpacingBottom); + } + + public void setButton(int whichButton, CharSequence text, Message msg) { + alertDialog.setButton(whichButton, text, msg); + } + + public void setButton(int whichButton, CharSequence text, OnClickListener listener) { + alertDialog.setButton(whichButton, text, listener); + } + + public void setIcon(int resId) { + alertDialog.setIcon(resId); + } + + public void setIcon(Drawable icon) { + alertDialog.setIcon(icon); + } + + public void setIconAttribute(int attrId) { + alertDialog.setIconAttribute(attrId); + } + + public boolean onKeyDown(int keyCode, KeyEvent event) { + return alertDialog.onKeyDown(keyCode, event); + } + + public boolean onKeyUp(int keyCode, KeyEvent event) { + return alertDialog.onKeyUp(keyCode, event); + } + + public ActionBar getSupportActionBar() { + return alertDialog.getSupportActionBar(); + } + + public void setContentView(int layoutResID) { + alertDialog.setContentView(layoutResID); + } + + public void setContentView(View view) { + alertDialog.setContentView(view); + } + + public void setContentView(View view, ViewGroup.LayoutParams params) { + alertDialog.setContentView(view, params); + } + + public void setTitle(int titleId) { + alertDialog.setTitle(titleId); + } + + public void addContentView(View view, ViewGroup.LayoutParams params) { + alertDialog.addContentView(view, params); + } + + public boolean supportRequestWindowFeature(int featureId) { + return alertDialog.supportRequestWindowFeature(featureId); + } + + public void invalidateOptionsMenu() { + alertDialog.invalidateOptionsMenu(); + } + + public AppCompatDelegate getDelegate() { + return alertDialog.getDelegate(); + } + + public void onSupportActionModeStarted(ActionMode mode) { + alertDialog.onSupportActionModeStarted(mode); + } + + public void onSupportActionModeFinished(ActionMode mode) { + alertDialog.onSupportActionModeFinished(mode); + } + + @Nullable + public ActionMode onWindowStartingSupportActionMode(ActionMode.Callback callback) { + return alertDialog.onWindowStartingSupportActionMode(callback); + } + + public android.app.ActionBar getActionBar() { + return alertDialog.getActionBar(); + } + + public boolean isShowing() { + return alertDialog.isShowing(); + } + + public void create() { + alertDialog.create(); + } + + public void show() { + alertDialog.show(); + } + + public void hide() { + alertDialog.hide(); + } + + public void dismiss() { + alertDialog.dismiss(); + } + + public Bundle onSaveInstanceState() { + return alertDialog.onSaveInstanceState(); + } + + public void onRestoreInstanceState(Bundle savedInstanceState) { + alertDialog.onRestoreInstanceState(savedInstanceState); + } + + public Window getWindow() { + return alertDialog.getWindow(); + } + + public View getCurrentFocus() { + return alertDialog.getCurrentFocus(); + } + + public View findViewById(int id) { + return alertDialog.findViewById(id); + } + + public boolean onKeyLongPress(int keyCode, KeyEvent event) { + return alertDialog.onKeyLongPress(keyCode, event); + } + + public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) { + return alertDialog.onKeyMultiple(keyCode, repeatCount, event); + } + + public void onBackPressed() { + alertDialog.onBackPressed(); + } + + public boolean onKeyShortcut(int keyCode, KeyEvent event) { + return alertDialog.onKeyShortcut(keyCode, event); + } + + public boolean onTouchEvent(MotionEvent event) { + return alertDialog.onTouchEvent(event); + } + + public boolean onTrackballEvent(MotionEvent event) { + return alertDialog.onTrackballEvent(event); + } + + public boolean onGenericMotionEvent(MotionEvent event) { + return alertDialog.onGenericMotionEvent(event); + } + + public void onWindowAttributesChanged(WindowManager.LayoutParams params) { + alertDialog.onWindowAttributesChanged(params); + } + + public void onContentChanged() { + alertDialog.onContentChanged(); + } + + public void onWindowFocusChanged(boolean hasFocus) { + alertDialog.onWindowFocusChanged(hasFocus); + } + + public void onAttachedToWindow() { + alertDialog.onAttachedToWindow(); + } + + public void onDetachedFromWindow() { + alertDialog.onDetachedFromWindow(); + } + + public boolean dispatchKeyEvent(KeyEvent event) { + return alertDialog.dispatchKeyEvent(event); + } + + public boolean dispatchKeyShortcutEvent(KeyEvent event) { + return alertDialog.dispatchKeyShortcutEvent(event); + } + + public boolean dispatchTouchEvent(MotionEvent ev) { + return alertDialog.dispatchTouchEvent(ev); + } + + public boolean dispatchTrackballEvent(MotionEvent ev) { + return alertDialog.dispatchTrackballEvent(ev); + } + + public boolean dispatchGenericMotionEvent(MotionEvent ev) { + return alertDialog.dispatchGenericMotionEvent(ev); + } + + public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) { + return alertDialog.dispatchPopulateAccessibilityEvent(event); + } + + public View onCreatePanelView(int featureId) { + return alertDialog.onCreatePanelView(featureId); + } + + public boolean onCreatePanelMenu(int featureId, Menu menu) { + return alertDialog.onCreatePanelMenu(featureId, menu); + } + + public boolean onPreparePanel(int featureId, View view, Menu menu) { + return alertDialog.onPreparePanel(featureId, view, menu); + } + + public boolean onMenuOpened(int featureId, Menu menu) { + return alertDialog.onMenuOpened(featureId, menu); + } + + public boolean onMenuItemSelected(int featureId, MenuItem item) { + return alertDialog.onMenuItemSelected(featureId, item); + } + + public void onPanelClosed(int featureId, Menu menu) { + alertDialog.onPanelClosed(featureId, menu); + } + + public boolean onCreateOptionsMenu(Menu menu) { + return alertDialog.onCreateOptionsMenu(menu); + } + + public boolean onPrepareOptionsMenu(Menu menu) { + return alertDialog.onPrepareOptionsMenu(menu); + } + + public boolean onOptionsItemSelected(MenuItem item) { + return alertDialog.onOptionsItemSelected(item); + } + + public void onOptionsMenuClosed(Menu menu) { + alertDialog.onOptionsMenuClosed(menu); + } + + public void openOptionsMenu() { + alertDialog.openOptionsMenu(); + } + + public void closeOptionsMenu() { + alertDialog.closeOptionsMenu(); + } + + public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) { + alertDialog.onCreateContextMenu(menu, v, menuInfo); + } + + public void registerForContextMenu(View view) { + alertDialog.registerForContextMenu(view); + } + + public void unregisterForContextMenu(View view) { + alertDialog.unregisterForContextMenu(view); + } + + public void openContextMenu(View view) { + alertDialog.openContextMenu(view); + } + + public boolean onContextItemSelected(MenuItem item) { + return alertDialog.onContextItemSelected(item); + } + + public void onContextMenuClosed(Menu menu) { + alertDialog.onContextMenuClosed(menu); + } + + public boolean onSearchRequested(SearchEvent searchEvent) { + return alertDialog.onSearchRequested(searchEvent); + } + + public boolean onSearchRequested() { + return alertDialog.onSearchRequested(); + } + + public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback callback) { + return alertDialog.onWindowStartingActionMode(callback); + } + + public android.view.ActionMode onWindowStartingActionMode(android.view.ActionMode.Callback callback, int type) { + return alertDialog.onWindowStartingActionMode(callback, type); + } + + public void onActionModeStarted(android.view.ActionMode mode) { + alertDialog.onActionModeStarted(mode); + } + + public void onActionModeFinished(android.view.ActionMode mode) { + alertDialog.onActionModeFinished(mode); + } + + public void takeKeyEvents(boolean get) { + alertDialog.takeKeyEvents(get); + } + + public LayoutInflater getLayoutInflater() { + return alertDialog.getLayoutInflater(); + } + + public void setCancelable(boolean flag) { + alertDialog.setCancelable(flag); + } + + public void setCanceledOnTouchOutside(boolean cancel) { + alertDialog.setCanceledOnTouchOutside(cancel); + } + + public void cancel() { + alertDialog.cancel(); + } + + public void setOnCancelListener(OnCancelListener listener) { + alertDialog.setOnCancelListener(listener); + } + + public void setCancelMessage(Message msg) { + alertDialog.setCancelMessage(msg); + } + + public void setOnDismissListener(OnDismissListener listener) { + alertDialog.setOnDismissListener(listener); + } + + public void setOnShowListener(OnShowListener listener) { + alertDialog.setOnShowListener(listener); + } + + public void setDismissMessage(Message msg) { + alertDialog.setDismissMessage(msg); + } - private LightProgressDialog(Context context, CharSequence message) { - super(context, THEME_HOLO_LIGHT); + public void setOnKeyListener(OnKeyListener onKeyListener) { + alertDialog.setOnKeyListener(onKeyListener); + } + }; } } diff --git a/app/src/main/java/com/github/pockethub/ui/NewsFragment.java b/app/src/main/java/com/github/pockethub/ui/NewsFragment.java index 200937290..e2ab0e12f 100644 --- a/app/src/main/java/com/github/pockethub/ui/NewsFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/NewsFragment.java @@ -15,16 +15,10 @@ */ package com.github.pockethub.ui; -import static android.content.Intent.ACTION_VIEW; -import static android.content.Intent.CATEGORY_BROWSABLE; -import static com.alorma.github.sdk.bean.dto.response.events.EventType.*; -import static org.eclipse.egit.github.core.event.Event.TYPE_COMMIT_COMMENT; -import static org.eclipse.egit.github.core.event.Event.TYPE_DOWNLOAD; -import static org.eclipse.egit.github.core.event.Event.TYPE_PUSH; -import android.app.AlertDialog; import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.view.View; import android.view.View.OnClickListener; @@ -33,13 +27,11 @@ import com.alorma.github.sdk.bean.dto.response.Commit; import com.alorma.github.sdk.bean.dto.response.CommitComment; import com.alorma.github.sdk.bean.dto.response.Gist; -import com.alorma.github.sdk.bean.dto.response.GitReference; import com.alorma.github.sdk.bean.dto.response.GithubEvent; import com.alorma.github.sdk.bean.dto.response.Issue; import com.alorma.github.sdk.bean.dto.response.Release; import com.alorma.github.sdk.bean.dto.response.Repo; import com.alorma.github.sdk.bean.dto.response.User; -import com.alorma.github.sdk.bean.dto.response.events.EventType; import com.alorma.github.sdk.bean.dto.response.events.payload.CommitCommentEventPayload; import com.alorma.github.sdk.bean.dto.response.events.payload.PushEventPayload; import com.alorma.github.sdk.bean.dto.response.events.payload.ReleaseEventPayload; @@ -63,10 +55,14 @@ import com.google.gson.Gson; import com.google.inject.Inject; -import org.eclipse.egit.github.core.event.CommitCommentPayload; - import java.util.List; +import static android.content.Intent.ACTION_VIEW; +import static android.content.Intent.CATEGORY_BROWSABLE; +import static com.alorma.github.sdk.bean.dto.response.events.EventType.CommitCommentEvent; +import static com.alorma.github.sdk.bean.dto.response.events.EventType.DownloadEvent; +import static com.alorma.github.sdk.bean.dto.response.events.EventType.PushEvent; + /** * Base news fragment class with utilities for subclasses to built on */ @@ -154,8 +150,9 @@ public boolean onListItemLongClick(ListView l, View v, int position, final User user = event.actor; if (repo != null && user != null) { - final AlertDialog dialog = LightAlertDialog.create(getActivity()); - dialog.setTitle(R.string.navigate_to); + final AlertDialog dialog = new AlertDialog.Builder(getActivity()) + .setTitle(R.string.navigate_to) + .create(); dialog.setCanceledOnTouchOutside(true); View view = getActivity().getLayoutInflater().inflate( diff --git a/app/src/main/java/com/github/pockethub/ui/ProgressDialogTask.java b/app/src/main/java/com/github/pockethub/ui/ProgressDialogTask.java index 9ce82bfb2..138b74eca 100644 --- a/app/src/main/java/com/github/pockethub/ui/ProgressDialogTask.java +++ b/app/src/main/java/com/github/pockethub/ui/ProgressDialogTask.java @@ -15,7 +15,7 @@ */ package com.github.pockethub.ui; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.content.Context; import com.github.pockethub.accounts.AuthenticatedUserTask; diff --git a/app/src/main/java/com/github/pockethub/ui/commit/CommitDiffListFragment.java b/app/src/main/java/com/github/pockethub/ui/commit/CommitDiffListFragment.java index da3323610..2dcf97af6 100644 --- a/app/src/main/java/com/github/pockethub/ui/commit/CommitDiffListFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/commit/CommitDiffListFragment.java @@ -15,16 +15,8 @@ */ package com.github.pockethub.ui.commit; -import static android.app.Activity.RESULT_OK; -import static android.content.DialogInterface.BUTTON_NEGATIVE; -import static android.graphics.Paint.UNDERLINE_TEXT_FLAG; -import static com.github.pockethub.Intents.EXTRA_BASE; -import static com.github.pockethub.Intents.EXTRA_COMMENT; -import static com.github.pockethub.Intents.EXTRA_REPOSITORY; -import static com.github.pockethub.RequestCodes.COMMENT_CREATE; import android.accounts.Account; import android.annotation.SuppressLint; -import android.app.AlertDialog; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; @@ -32,6 +24,7 @@ import android.content.Intent; import android.os.Build; import android.os.Bundle; +import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.view.LayoutInflater; import android.view.Menu; @@ -54,7 +47,6 @@ import com.alorma.github.sdk.bean.dto.response.GitCommit; import com.alorma.github.sdk.bean.dto.response.Repo; import com.alorma.github.sdk.bean.dto.response.ShaUrl; -import com.alorma.github.sdk.bean.info.IssueInfo; import com.github.kevinsawicki.wishlist.ViewFinder; import com.github.kevinsawicki.wishlist.ViewUtils; import com.github.pockethub.R; @@ -65,7 +57,6 @@ import com.github.pockethub.core.commit.RefreshCommitTask; import com.github.pockethub.ui.DialogFragment; import com.github.pockethub.ui.HeaderFooterListAdapter; -import com.github.pockethub.ui.LightAlertDialog; import com.github.pockethub.ui.StyledText; import com.github.pockethub.util.AvatarLoader; import com.github.pockethub.util.HttpImageGetter; @@ -78,6 +69,13 @@ import java.util.Date; import java.util.List; +import static android.app.Activity.RESULT_OK; +import static android.graphics.Paint.UNDERLINE_TEXT_FLAG; +import static com.github.pockethub.Intents.EXTRA_BASE; +import static com.github.pockethub.Intents.EXTRA_COMMENT; +import static com.github.pockethub.Intents.EXTRA_REPOSITORY; +import static com.github.pockethub.RequestCodes.COMMENT_CREATE; + /** * Fragment to display commit details with diff output */ @@ -421,10 +419,15 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, return inflater.inflate(R.layout.commit_diff_list, null); } - private void showFileOptions(CharSequence line, final int position, - final CommitFile file) { - final AlertDialog dialog = LightAlertDialog.create(getActivity()); - dialog.setTitle(CommitUtils.getName(file)); + private void showFileOptions(CharSequence line, final int position, final CommitFile file) { + final AlertDialog dialog = new AlertDialog.Builder(getActivity()) + .setTitle(CommitUtils.getName(file)) + .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }) + .create(); dialog.setCanceledOnTouchOutside(true); View view = getActivity().getLayoutInflater().inflate( @@ -436,7 +439,7 @@ private void showFileOptions(CharSequence line, final int position, diffStyler.updateColors(line, diff); finder.setText(R.id.tv_commit, getString(R.string.commit_prefix) - + CommitUtils.abbreviate(commit)); + + CommitUtils.abbreviate(commit)); finder.find(R.id.ll_view_area).setOnClickListener(new OnClickListener() { @@ -447,27 +450,14 @@ public void onClick(View v) { } }); - finder.find(R.id.ll_comment_area).setOnClickListener( - new OnClickListener() { - - public void onClick(View v) { - dialog.dismiss(); - - startActivityForResult(CreateCommentActivity - .createIntent(repository, commit.sha, - file.filename, position), - COMMENT_CREATE); - } - }); + finder.find(R.id.ll_comment_area).setOnClickListener(new OnClickListener() { + public void onClick(View v) { + dialog.dismiss(); + startActivityForResult(CreateCommentActivity.createIntent(repository, commit.sha, file.filename, position), COMMENT_CREATE); + } + }); dialog.setView(view); - dialog.setButton(BUTTON_NEGATIVE, getString(R.string.cancel), - new DialogInterface.OnClickListener() { - - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - } - }); dialog.show(); } diff --git a/app/src/main/java/com/github/pockethub/ui/issue/AssigneeDialogFragment.java b/app/src/main/java/com/github/pockethub/ui/issue/AssigneeDialogFragment.java index 8327c3288..a73c4cfd6 100644 --- a/app/src/main/java/com/github/pockethub/ui/issue/AssigneeDialogFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/issue/AssigneeDialogFragment.java @@ -19,7 +19,7 @@ import static android.content.DialogInterface.BUTTON_NEGATIVE; import static android.content.DialogInterface.BUTTON_NEUTRAL; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; diff --git a/app/src/main/java/com/github/pockethub/ui/issue/LabelsDialogFragment.java b/app/src/main/java/com/github/pockethub/ui/issue/LabelsDialogFragment.java index e69e4330f..b8b19aab2 100644 --- a/app/src/main/java/com/github/pockethub/ui/issue/LabelsDialogFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/issue/LabelsDialogFragment.java @@ -15,16 +15,12 @@ */ package com.github.pockethub.ui.issue; -import static android.app.Activity.RESULT_OK; -import static android.content.DialogInterface.BUTTON_NEGATIVE; -import static android.content.DialogInterface.BUTTON_NEUTRAL; -import static android.content.DialogInterface.BUTTON_POSITIVE; import android.app.Activity; -import android.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.os.Bundle; +import android.support.v7.app.AlertDialog; import android.view.LayoutInflater; import android.view.View; import android.widget.AdapterView; @@ -36,13 +32,15 @@ import com.github.pockethub.R; import com.github.pockethub.ui.DialogFragmentActivity; import com.github.pockethub.ui.DialogFragmentHelper; -import com.github.pockethub.ui.LightAlertDialog; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.List; +import static android.app.Activity.RESULT_OK; +import static android.content.DialogInterface.BUTTON_NEUTRAL; +import static android.content.DialogInterface.BUTTON_POSITIVE; + /** * Dialog fragment to present labels where one or more can be selected */ @@ -145,18 +143,16 @@ public Dialog onCreateDialog(final Bundle savedInstanceState) { view.setAdapter(adapter); view.setOnItemClickListener(adapter); - AlertDialog dialog = LightAlertDialog.create(activity); - dialog.setCancelable(true); - dialog.setOnCancelListener(this); - dialog.setButton(BUTTON_NEGATIVE, activity.getString(R.string.cancel), - this); - dialog.setButton(BUTTON_NEUTRAL, activity.getString(R.string.clear), this); - dialog.setButton(BUTTON_POSITIVE, activity.getString(R.string.apply), - this); - dialog.setTitle(getTitle()); - dialog.setMessage(getMessage()); - dialog.setView(view); - return dialog; + return new AlertDialog.Builder(activity) + .setCancelable(true) + .setOnCancelListener(this) + .setNegativeButton(activity.getString(R.string.cancel), this) + .setNeutralButton(activity.getString(R.string.clear), this) + .setPositiveButton(activity.getString(R.string.apply), this) + .setTitle(getTitle()) + .setMessage(getMessage()) + .setView(view) + .create(); } @SuppressWarnings("unchecked") diff --git a/app/src/main/java/com/github/pockethub/ui/issue/MilestoneDialogFragment.java b/app/src/main/java/com/github/pockethub/ui/issue/MilestoneDialogFragment.java index 2d8651e82..06a4669d9 100644 --- a/app/src/main/java/com/github/pockethub/ui/issue/MilestoneDialogFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/issue/MilestoneDialogFragment.java @@ -19,7 +19,7 @@ import static android.content.DialogInterface.BUTTON_NEGATIVE; import static android.content.DialogInterface.BUTTON_NEUTRAL; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; diff --git a/app/src/main/java/com/github/pockethub/ui/ref/RefDialogFragment.java b/app/src/main/java/com/github/pockethub/ui/ref/RefDialogFragment.java index 4a875f713..7636c7fc3 100644 --- a/app/src/main/java/com/github/pockethub/ui/ref/RefDialogFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/ref/RefDialogFragment.java @@ -18,7 +18,7 @@ import static android.app.Activity.RESULT_OK; import static android.content.DialogInterface.BUTTON_NEGATIVE; import android.app.Activity; -import android.app.AlertDialog; +import android.support.v7.app.AlertDialog; import android.app.Dialog; import android.content.DialogInterface; import android.os.Bundle; diff --git a/app/src/main/java/com/github/pockethub/ui/repo/RepositoryListFragment.java b/app/src/main/java/com/github/pockethub/ui/repo/RepositoryListFragment.java index 0ef7d72c2..e0cf6b300 100644 --- a/app/src/main/java/com/github/pockethub/ui/repo/RepositoryListFragment.java +++ b/app/src/main/java/com/github/pockethub/ui/repo/RepositoryListFragment.java @@ -15,19 +15,17 @@ */ package com.github.pockethub.ui.repo; -import static com.github.pockethub.Intents.EXTRA_USER; -import static com.github.pockethub.RequestCodes.REPOSITORY_VIEW; -import static com.github.pockethub.ResultCodes.RESOURCE_CHANGED; -import static java.util.Locale.US; import android.app.Activity; -import android.app.AlertDialog; import android.content.Intent; import android.os.Bundle; import android.support.v4.content.Loader; +import android.support.v7.app.AlertDialog; import android.view.View; import android.view.View.OnClickListener; import android.widget.ListView; +import com.alorma.github.sdk.bean.dto.response.Repo; +import com.alorma.github.sdk.bean.dto.response.User; import com.github.kevinsawicki.wishlist.SingleTypeAdapter; import com.github.kevinsawicki.wishlist.ViewFinder; import com.github.pockethub.R; @@ -35,7 +33,6 @@ import com.github.pockethub.persistence.AccountDataManager; import com.github.pockethub.ui.HeaderFooterListAdapter; import com.github.pockethub.ui.ItemListFragment; -import com.github.pockethub.ui.LightAlertDialog; import com.github.pockethub.ui.user.OrganizationSelectionListener; import com.github.pockethub.ui.user.OrganizationSelectionProvider; import com.github.pockethub.ui.user.UserViewActivity; @@ -47,8 +44,10 @@ import java.util.List; import java.util.concurrent.atomic.AtomicReference; -import com.alorma.github.sdk.bean.dto.response.Repo; -import com.alorma.github.sdk.bean.dto.response.User; +import static com.github.pockethub.Intents.EXTRA_USER; +import static com.github.pockethub.RequestCodes.REPOSITORY_VIEW; +import static com.github.pockethub.ResultCodes.RESOURCE_CHANGED; +import static java.util.Locale.US; /** * Fragment to display a list of {@link Repo} instances @@ -166,11 +165,11 @@ public boolean onListItemLongClick(ListView list, View v, int position, if (repo == null) return false; - final AlertDialog dialog = LightAlertDialog.create(getActivity()); + final AlertDialog dialog = new AlertDialog.Builder(getActivity()) + .setTitle(InfoUtils.createRepoId(repo)) + .create(); dialog.setCanceledOnTouchOutside(true); - dialog.setTitle(InfoUtils.createRepoId(repo)); - View view = getActivity().getLayoutInflater().inflate( R.layout.repo_dialog, null); ViewFinder finder = new ViewFinder(view); diff --git a/app/src/main/java/com/github/pockethub/ui/repo/RepositoryViewActivity.java b/app/src/main/java/com/github/pockethub/ui/repo/RepositoryViewActivity.java index e78a61754..6b91d97dc 100644 --- a/app/src/main/java/com/github/pockethub/ui/repo/RepositoryViewActivity.java +++ b/app/src/main/java/com/github/pockethub/ui/repo/RepositoryViewActivity.java @@ -15,25 +15,17 @@ */ package com.github.pockethub.ui.repo; -import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP; -import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP; -import static com.github.pockethub.Intents.EXTRA_REPOSITORY; -import static com.github.pockethub.ResultCodes.RESOURCE_CHANGED; -import static com.github.pockethub.ui.repo.RepositoryPagerAdapter.ITEM_CODE; -import static com.github.pockethub.util.TypefaceUtils.ICON_CODE; -import static com.github.pockethub.util.TypefaceUtils.ICON_COMMIT; -import static com.github.pockethub.util.TypefaceUtils.ICON_ISSUE_OPEN; -import static com.github.pockethub.util.TypefaceUtils.ICON_NEWS; +import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.ActionBar; +import android.support.v7.app.AlertDialog; import android.text.TextUtils; import android.view.Menu; import android.view.MenuItem; import android.widget.ProgressBar; -import com.afollestad.materialdialogs.MaterialDialog; import com.alorma.github.basesdk.client.BaseClient; import com.alorma.github.sdk.bean.dto.response.Repo; import com.alorma.github.sdk.bean.dto.response.User; @@ -52,7 +44,6 @@ import com.github.pockethub.ui.user.UriLauncherActivity; import com.github.pockethub.ui.user.UserViewActivity; import com.github.pockethub.util.AvatarLoader; -import com.github.pockethub.util.ConvertUtils; import com.github.pockethub.util.InfoUtils; import com.github.pockethub.util.ShareUtils; import com.github.pockethub.util.ToastUtils; @@ -61,6 +52,16 @@ import retrofit.RetrofitError; import retrofit.client.Response; +import static android.content.Intent.FLAG_ACTIVITY_CLEAR_TOP; +import static android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP; +import static com.github.pockethub.Intents.EXTRA_REPOSITORY; +import static com.github.pockethub.ResultCodes.RESOURCE_CHANGED; +import static com.github.pockethub.ui.repo.RepositoryPagerAdapter.ITEM_CODE; +import static com.github.pockethub.util.TypefaceUtils.ICON_CODE; +import static com.github.pockethub.util.TypefaceUtils.ICON_COMMIT; +import static com.github.pockethub.util.TypefaceUtils.ICON_ISSUE_OPEN; +import static com.github.pockethub.util.TypefaceUtils.ICON_NEWS; + /** * Activity to view a repository */ @@ -298,25 +299,22 @@ public void onFail(RetrofitError error) { } private void deleteRepository() { - new MaterialDialog.Builder(this) - .title(R.string.are_you_sure) - .content(R.string.unexpected_bad_things) - .positiveText(R.string.not_sure) - .negativeText(R.string.delete_cap) - .callback(new MaterialDialog.ButtonCallback() { + new AlertDialog.Builder(this) + .setTitle(R.string.are_you_sure) + .setMessage(R.string.unexpected_bad_things) + .setPositiveButton(R.string.not_sure, new DialogInterface.OnClickListener() { @Override - public void onPositive(MaterialDialog dialog) { - super.onPositive(dialog); + public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } - + }) + .setNegativeButton(R.string.delete_cap, new DialogInterface.OnClickListener() { @Override - public void onNegative(MaterialDialog dialog) { - super.onNegative(dialog); + public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); DeleteRepoClient repoClient = new DeleteRepoClient(RepositoryViewActivity.this, - InfoUtils.createRepoInfo(repository)); + InfoUtils.createRepoInfo(repository)); repoClient.setOnResultCallback(new BaseClient.OnResultCallback() { @Override public void onResponseOk(Response response, Response r) { diff --git a/app/src/main/java/com/github/pockethub/ui/user/UriLauncherActivity.java b/app/src/main/java/com/github/pockethub/ui/user/UriLauncherActivity.java index e4c363668..2a5bb1ce1 100644 --- a/app/src/main/java/com/github/pockethub/ui/user/UriLauncherActivity.java +++ b/app/src/main/java/com/github/pockethub/ui/user/UriLauncherActivity.java @@ -15,14 +15,7 @@ */ package com.github.pockethub.ui.user; -import static android.content.DialogInterface.BUTTON_POSITIVE; -import static android.content.Intent.ACTION_VIEW; -import static android.content.Intent.CATEGORY_BROWSABLE; -import static org.eclipse.egit.github.core.client.IGitHubConstants.HOST_DEFAULT; -import static org.eclipse.egit.github.core.client.IGitHubConstants.HOST_GISTS; -import static org.eclipse.egit.github.core.client.IGitHubConstants.PROTOCOL_HTTPS; import android.app.Activity; -import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnCancelListener; @@ -30,9 +23,13 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.support.v7.app.AlertDialog; import android.text.TextUtils; +import com.alorma.github.sdk.bean.dto.response.Gist; import com.alorma.github.sdk.bean.dto.response.Issue; +import com.alorma.github.sdk.bean.dto.response.Repo; +import com.alorma.github.sdk.bean.dto.response.User; import com.github.pockethub.R; import com.github.pockethub.core.commit.CommitMatch; import com.github.pockethub.core.commit.CommitUriMatcher; @@ -40,7 +37,6 @@ import com.github.pockethub.core.issue.IssueUriMatcher; import com.github.pockethub.core.repo.RepositoryUriMatcher; import com.github.pockethub.core.user.UserUriMatcher; -import com.github.pockethub.ui.LightAlertDialog; import com.github.pockethub.ui.commit.CommitViewActivity; import com.github.pockethub.ui.gist.GistsViewActivity; import com.github.pockethub.ui.issue.IssuesViewActivity; @@ -49,9 +45,11 @@ import java.net.URI; import java.text.MessageFormat; -import com.alorma.github.sdk.bean.dto.response.Gist; -import com.alorma.github.sdk.bean.dto.response.Repo; -import com.alorma.github.sdk.bean.dto.response.User; +import static android.content.Intent.ACTION_VIEW; +import static android.content.Intent.CATEGORY_BROWSABLE; +import static org.eclipse.egit.github.core.client.IGitHubConstants.HOST_DEFAULT; +import static org.eclipse.egit.github.core.client.IGitHubConstants.HOST_GISTS; +import static org.eclipse.egit.github.core.client.IGitHubConstants.PROTOCOL_HTTPS; /** * Activity to launch other activities based on the intent's data {@link URI} @@ -162,24 +160,21 @@ static private Intent getIntentForURI(Uri data) { } private void showParseError(String url) { - AlertDialog dialog = LightAlertDialog.create(this); - dialog.setTitle(R.string.title_invalid_github_url); - dialog.setMessage(MessageFormat.format(getString(R.string.message_invalid_github_url), url)); - dialog.setOnCancelListener(new OnCancelListener() { - - @Override - public void onCancel(DialogInterface dialog) { - finish(); - } - }); - dialog.setButton(BUTTON_POSITIVE, getString(android.R.string.ok), - new OnClickListener() { - + new AlertDialog.Builder(this) + .setTitle(R.string.title_invalid_github_url) + .setMessage(MessageFormat.format(getString(R.string.message_invalid_github_url), url)) + .setOnCancelListener(new OnCancelListener() { + @Override + public void onCancel(DialogInterface dialog) { + finish(); + } + }) + .setPositiveButton(android.R.string.ok, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { finish(); } - }); - dialog.show(); + }) + .show(); } } diff --git a/app/src/main/res/layout/progress_dialog.xml b/app/src/main/res/layout/progress_dialog.xml index 7462d5fc8..6a33a4b09 100644 --- a/app/src/main/res/layout/progress_dialog.xml +++ b/app/src/main/res/layout/progress_dialog.xml @@ -14,25 +14,31 @@ See the License for the specific language governing permissions and limitations under the License. --> - + - + - + - \ No newline at end of file + + + \ No newline at end of file diff --git a/app/src/main/res/values/theme.xml b/app/src/main/res/values/theme.xml index c64e187c3..30b1192b4 100644 --- a/app/src/main/res/values/theme.xml +++ b/app/src/main/res/values/theme.xml @@ -16,16 +16,14 @@ --> - - - - - +