diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-03-31 15:25:57 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-03-31 15:25:57 +0200 |
commit | ea7aa63bb951ce8680d28a131f4f7230076708ef (patch) | |
tree | aab6e1b04a55fc7b3a6fee4a8ee5ae28418ba136 /src/main/java/de/pixart/messenger/ui | |
parent | dbe8ee40eced09e4721b9e0d9b27d49fe668a12e (diff) |
updated manage account activity to new colors
Diffstat (limited to '')
6 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java index 8fb0cceb1..dbf303cd5 100644 --- a/src/main/java/de/pixart/messenger/ui/ConversationFragment.java +++ b/src/main/java/de/pixart/messenger/ui/ConversationFragment.java @@ -2488,6 +2488,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke @Override public void success(Message message) { + //TODO the following two call can be made before the callback message.setEncryption(Message.ENCRYPTION_DECRYPTED); activity.xmppConnectionService.sendMessage(message); getActivity().runOnUiThread(() -> messageSent()); diff --git a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java index b98efde3b..3c1b58fc0 100644 --- a/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java @@ -74,7 +74,7 @@ public class ManageAccountActivity extends XmppActivity implements OnAccountUpda super.onCreate(savedInstanceState); - setContentView(R.layout.manage_accounts); + setContentView(R.layout.activity_manage_accounts); if (savedInstanceState != null) { String jid = savedInstanceState.getString(STATE_SELECTED_ACCOUNT); diff --git a/src/main/java/de/pixart/messenger/ui/ShareViaAccountActivity.java b/src/main/java/de/pixart/messenger/ui/ShareViaAccountActivity.java index e7ee427db..509cd63f4 100644 --- a/src/main/java/de/pixart/messenger/ui/ShareViaAccountActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShareViaAccountActivity.java @@ -43,7 +43,7 @@ public class ShareViaAccountActivity extends XmppActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.manage_accounts); + setContentView(R.layout.activity_manage_accounts); accountListView = findViewById(R.id.account_list); this.mAccountAdapter = new AccountAdapter(this, accountList); diff --git a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java index f0d41e998..a061bcded 100644 --- a/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ShareWithActivity.java @@ -176,7 +176,7 @@ public class ShareWithActivity extends XmppActivity implements XmppConnectionSer getSupportActionBar().setHomeButtonEnabled(false); } - setContentView(R.layout.share_with); + setContentView(R.layout.activity_share_with); setTitle(getString(R.string.title_activity_sharewith)); mListView = findViewById(R.id.choose_conversation_list); diff --git a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java index 792d365ef..81a3017a8 100644 --- a/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java +++ b/src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java @@ -21,6 +21,7 @@ import de.pixart.messenger.Config; import de.pixart.messenger.R; import de.pixart.messenger.entities.Account; import de.pixart.messenger.ui.XmppActivity; +import de.pixart.messenger.ui.util.Color; import de.pixart.messenger.utils.UIHelper; public class AccountAdapter extends ArrayAdapter<Account> { @@ -56,7 +57,7 @@ public class AccountAdapter extends ArrayAdapter<Account> { break; case DISABLED: case CONNECTING: - statusView.setTextColor(activity.getSecondaryTextColor()); + statusView.setTextColor(Color.get(activity, android.R.attr.textColorSecondary)); break; default: statusView.setTextColor(activity.getWarningTextColor()); diff --git a/src/main/java/de/pixart/messenger/ui/util/Color.java b/src/main/java/de/pixart/messenger/ui/util/Color.java index 4a4ec45df..58ce6a465 100644 --- a/src/main/java/de/pixart/messenger/ui/util/Color.java +++ b/src/main/java/de/pixart/messenger/ui/util/Color.java @@ -31,19 +31,18 @@ package de.pixart.messenger.ui.util; import android.content.Context; -import android.content.res.Resources; +import android.content.res.TypedArray; import android.support.annotation.AttrRes; import android.support.annotation.ColorInt; -import android.util.TypedValue; public class Color { public static @ColorInt int get(Context context, @AttrRes int attr) { - TypedValue typedValue = new TypedValue(); - Resources.Theme theme = context.getTheme(); - theme.resolveAttribute(attr, typedValue, true); - return typedValue.data; + TypedArray typedArray = context.obtainStyledAttributes(new int[]{attr}); + int color = typedArray.getColor(0, 0); + typedArray.recycle(); + return color; } }
\ No newline at end of file |