Use consistent styling for dialogs. #296

This commit is contained in:
akwizgran
2016-04-25 12:52:28 +01:00
parent 1b08720200
commit b5fc7cf724
6 changed files with 18 additions and 14 deletions

View File

@@ -1,10 +1,10 @@
package org.briarproject.android;
import android.app.AlertDialog;
import android.support.annotation.AnimRes;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AlertDialog;
import org.briarproject.R;
import org.briarproject.android.contact.ContactListFragment;
@@ -68,7 +68,8 @@ public abstract class BriarFragmentActivity extends BriarActivity {
protected void showMessageDialog(int titleStringId, int msgStringId) {
// TODO replace with custom dialog fragment ?
AlertDialog.Builder builder = new AlertDialog.Builder(this);
AlertDialog.Builder builder = new AlertDialog.Builder(this,
R.style.BriarDialogTheme);
builder.setTitle(titleStringId);
builder.setMessage(msgStringId);
builder.setPositiveButton(R.string.dialog_button_ok, null);

View File

@@ -2,7 +2,6 @@ package org.briarproject.android;
import android.annotation.SuppressLint;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.content.DialogInterface;
import android.content.Intent;
@@ -15,6 +14,7 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.Settings;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
@@ -104,7 +104,8 @@ public class CrashReportActivity extends AppCompatActivity
public void onClick(View view) {
// TODO Encapsulate the dialog in a re-usable fragment
AlertDialog.Builder builder = new AlertDialog.Builder(this);
AlertDialog.Builder builder = new AlertDialog.Builder(this,
R.style.BriarDialogTheme);
builder.setTitle(R.string.dialog_title_share_crash_report);
builder.setMessage(R.string.dialog_message_share_crash_report);
builder.setNegativeButton(R.string.cancel_button, null);

View File

@@ -1,10 +1,10 @@
package org.briarproject.android;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TextInputLayout;
import android.support.v7.app.AlertDialog;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
@@ -116,7 +116,8 @@ public class PasswordActivity extends BaseActivity {
public void onForgottenPasswordClick(View v) {
// TODO Encapsulate the dialog in a re-usable fragment
AlertDialog.Builder builder = new AlertDialog.Builder(this);
AlertDialog.Builder builder = new AlertDialog.Builder(this,
R.style.BriarDialogTheme);
builder.setTitle(R.string.dialog_title_lost_password);
builder.setMessage(R.string.dialog_message_lost_password);
builder.setNegativeButton(R.string.cancel_button, null);

View File

@@ -1,10 +1,10 @@
package org.briarproject.android.contact;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.support.v7.app.AlertDialog;
import org.briarproject.R;
import org.briarproject.api.contact.Contact;
@@ -37,7 +37,8 @@ public class SelectContactsDialog implements OnMultiChoiceClickListener {
public Dialog build(Context ctx) {
if (listener == null || contacts == null || selected == null)
throw new IllegalStateException();
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
AlertDialog.Builder builder = new AlertDialog.Builder(ctx,
R.style.BriarDialogTheme);
int size = contacts.size();
String[] names = new String[size];
boolean[] checked = new boolean[size];

View File

@@ -1,9 +1,9 @@
package org.briarproject.android.forum;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import org.briarproject.R;
@@ -17,7 +17,8 @@ public class NoContactsDialog {
public Dialog build(Context ctx) {
if (listener == null) throw new IllegalStateException();
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
AlertDialog.Builder builder = new AlertDialog.Builder(ctx,
R.style.BriarDialogTheme);
builder.setMessage(R.string.no_contacts_prompt);
builder.setPositiveButton(R.string.add_button,
new DialogInterface.OnClickListener() {

View File

@@ -227,10 +227,9 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
}
};
AlertDialog.Builder builder =
new AlertDialog.Builder(getContext());
builder.setTitle(
getString(R.string.dialog_title_connect_panic_app));
AlertDialog.Builder builder = new AlertDialog.Builder(getContext(),
R.style.BriarDialogTheme);
builder.setTitle(getString(R.string.dialog_title_connect_panic_app));
CharSequence app = getString(R.string.unknown_app);
String packageName = getCallingPackageName();