Skip to content
Snippets Groups Projects
Commit 05bdbbc1 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed minor issues with "save changes" dialogs

parent 4175f526
Branches
Tags
No related merge requests found
Showing with 31 additions and 2 deletions
......@@ -120,6 +120,7 @@ public class ChatListEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
save();
super.onBackPressed();
......@@ -134,6 +135,9 @@ public class ChatListEditActivity extends BoundActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case R.id.action_delete: {
new MaterialDialog.Builder(this)
.content(getString(R.string.confirmationDelete, config.bufferViewName()))
......@@ -141,6 +145,7 @@ public class ChatListEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
finish();
context.client().bufferViewManager().deleteBufferView(config.bufferViewId());
......
......@@ -154,6 +154,7 @@ public class IdentityEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
save();
super.onBackPressed();
......@@ -168,6 +169,9 @@ public class IdentityEditActivity extends BoundActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case R.id.action_delete: {
new MaterialDialog.Builder(this)
.content(getString(R.string.confirmationDelete, identity.identityName()))
......@@ -175,6 +179,7 @@ public class IdentityEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
finish();
context.client().removeIdentity(identity.id());
......
......@@ -71,6 +71,7 @@ public class IdentityNickListActivity extends BoundActivity implements OnStartDr
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.neutralColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog1, which) -> {
String text = dialog1.getInputEditText().getText().toString().trim();
nicks.set(nicks.indexOf(nick), text);
......@@ -116,6 +117,7 @@ public class IdentityNickListActivity extends BoundActivity implements OnStartDr
.negativeText("Cancel")
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog1, which) -> {
String nick = dialog1.getInputEditText().getText().toString().trim();
if (!nicks.contains(nick))
......@@ -138,6 +140,9 @@ public class IdentityNickListActivity extends BoundActivity implements OnStartDr
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case R.id.action_confirm: {
Intent intent = new Intent();
intent.putStringArrayListExtra("nicks", nicks);
......
......@@ -124,6 +124,7 @@ public class IgnoreRuleEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
save();
super.onBackPressed();
......@@ -138,6 +139,9 @@ public class IgnoreRuleEditActivity extends BoundActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case R.id.action_delete: {
new MaterialDialog.Builder(this)
.content(getString(R.string.confirmationDelete, this.item.getIgnoreRule().rule()))
......@@ -145,6 +149,7 @@ public class IgnoreRuleEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
delete();
finish();
......
......@@ -229,6 +229,7 @@ public class NetworkEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
save();
super.onBackPressed();
......@@ -243,6 +244,9 @@ public class NetworkEditActivity extends BoundActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
onBackPressed();
return true;
case R.id.action_delete: {
new MaterialDialog.Builder(this)
.content(getString(R.string.confirmationDelete, network.networkName()))
......@@ -250,6 +254,7 @@ public class NetworkEditActivity extends BoundActivity {
.negativeText(R.string.actionNo)
.positiveColor(context.themeUtil().res.colorAccent)
.negativeColor(context.themeUtil().res.colorForeground)
.backgroundColorAttr(R.attr.colorBackgroundDialog)
.onPositive((dialog, which) -> {
finish();
context.client().removeNetwork(network.networkId());
......
......@@ -39,7 +39,6 @@ import com.afollestad.materialdialogs.MaterialDialog;
import java.lang.reflect.Field;
import de.kuschku.quasseldroid_ng.R;
import de.kuschku.util.annotationbind.AutoBinder;
/**
......@@ -121,7 +120,7 @@ public class MaterialListPreference extends ListPreference {
break;
}
})
.backgroundColor(AutoBinder.obtainColor(R.attr.colorBackground, context.getTheme()))
.backgroundColor(AutoBinder.obtainColor(de.kuschku.quasseldroid_ng.R.attr.colorBackgroundDialog, context.getTheme()))
.negativeText(getNegativeButtonText())
.items(getEntries())
.autoDismiss(true) // immediately close the dialog after selection
......
......@@ -76,6 +76,7 @@
<attr name="colorBackgroundHighlight" format="color"/>
<attr name="colorBackgroundSecondary" format="color"/>
<attr name="colorBackgroundCard" format="color"/>
<attr name="colorBackgroundDialog" format="color"/>
<!-- Tint colors for drawer -->
......
......@@ -55,6 +55,7 @@
<item name="colorBackgroundHighlight">#ff8811</item>
<item name="colorBackgroundSecondary">@null</item>
<item name="colorBackgroundCard">#FFFFFF</item>
<item name="colorBackgroundDialog">#FAFAFA</item>
<item name="colorTintActivity">#88cc33</item>
<item name="colorTintMessage">#2277dd</item>
......@@ -97,6 +98,7 @@
<item name="colorBackgroundHighlight">#ff8811</item>
<item name="colorBackgroundSecondary">@null</item>
<item name="colorBackgroundCard">#424242</item>
<item name="colorBackgroundDialog">#303030</item>
<item name="colorTintActivity">#88cc33</item>
<item name="colorTintMessage">#2277dd</item>
......
......@@ -61,6 +61,7 @@
<item name="colorBackgroundHighlight">#268bd2</item>
<item name="colorBackgroundSecondary">@null</item>
<item name="colorBackgroundCard">#EEE8D5</item>
<item name="colorBackgroundDialog">#FDF6E3</item>
<item name="colorTintActivity">#88cc33</item>
<item name="colorTintMessage">#2277dd</item>
......@@ -108,6 +109,7 @@
<item name="colorBackgroundHighlight">#268bd2</item>
<item name="colorBackgroundSecondary">@null</item>
<item name="colorBackgroundCard">#073642</item>
<item name="colorBackgroundDialog">#002B36</item>
<item name="colorTintActivity">#88cc33</item>
<item name="colorTintMessage">#2277dd</item>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment