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 | |
parent | dbe8ee40eced09e4721b9e0d9b27d49fe668a12e (diff) |
updated manage account activity to new colors
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConversationFragment.java | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ManageAccountActivity.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ShareViaAccountActivity.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ShareWithActivity.java | 2 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/adapter/AccountAdapter.java | 3 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/util/Color.java | 11 | ||||
-rw-r--r-- | src/main/res/layout/account_row.xml | 9 | ||||
-rw-r--r-- | src/main/res/layout/activity_choose_contact.xml | 5 | ||||
-rw-r--r-- | src/main/res/layout/activity_contact_details.xml | 4 | ||||
-rw-r--r-- | src/main/res/layout/activity_manage_accounts.xml (renamed from src/main/res/layout/manage_accounts.xml) | 6 | ||||
-rw-r--r-- | src/main/res/layout/activity_share_with.xml (renamed from src/main/res/layout/share_with.xml) | 2 | ||||
-rw-r--r-- | src/main/res/layout/conversation_list_row.xml | 4 |
12 files changed, 25 insertions, 26 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 diff --git a/src/main/res/layout/account_row.xml b/src/main/res/layout/account_row.xml index c50485f56..d0cf3d96c 100644 --- a/src/main/res/layout/account_row.xml +++ b/src/main/res/layout/account_row.xml @@ -24,7 +24,7 @@ android:layout_centerVertical="true" android:layout_toRightOf="@+id/account_image" android:orientation="vertical" - android:paddingLeft="8dp"> + android:paddingLeft="@dimen/avatar_item_distance"> <TextView android:id="@+id/account_jid" @@ -32,17 +32,14 @@ android:layout_height="wrap_content" android:scrollHorizontally="false" android:singleLine="true" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeHeadline" /> + android:textAppearance="@style/TextAppearance.AppCompat.Subhead" /> <TextView android:id="@+id/account_status" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/account_status_unknown" - android:textColor="@color/black54" - android:textSize="?attr/TextSizeBody" - android:textStyle="bold" /> + android:textAppearance="@style/TextAppearance.AppCompat.Body2" /> </LinearLayout> </RelativeLayout>
\ No newline at end of file diff --git a/src/main/res/layout/activity_choose_contact.xml b/src/main/res/layout/activity_choose_contact.xml index 66e416de5..c5158510b 100644 --- a/src/main/res/layout/activity_choose_contact.xml +++ b/src/main/res/layout/activity_choose_contact.xml @@ -2,12 +2,15 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:background="?attr/color_background_primary"> <ListView android:id="@+id/choose_contact_list" android:layout_width="match_parent" android:layout_height="match_parent" + android:divider="@android:color/transparent" + android:dividerHeight="0dp" tools:listitem="@layout/contact" /> </LinearLayout>
\ No newline at end of file diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml index 75ef17978..ef8fe4134 100644 --- a/src/main/res/layout/activity_contact_details.xml +++ b/src/main/res/layout/activity_contact_details.xml @@ -1,7 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<layout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - xmlns:tools="http://schemas.android.com/tools"> +<layout xmlns:android="http://schemas.android.com/apk/res/android"> <ScrollView android:layout_width="fill_parent" diff --git a/src/main/res/layout/manage_accounts.xml b/src/main/res/layout/activity_manage_accounts.xml index 8d7167ea6..99b6ad920 100644 --- a/src/main/res/layout/manage_accounts.xml +++ b/src/main/res/layout/activity_manage_accounts.xml @@ -2,13 +2,13 @@ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" - android:background="@color/grey50"> + android:background="?attr/color_background_primary"> <ListView android:id="@+id/account_list" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:divider="@color/black12" - android:dividerHeight="1dp"></ListView> + android:divider="@android:color/transparent" + android:dividerHeight="0dp"></ListView> </LinearLayout>
\ No newline at end of file diff --git a/src/main/res/layout/share_with.xml b/src/main/res/layout/activity_share_with.xml index 162d02efe..0b0e11f54 100644 --- a/src/main/res/layout/share_with.xml +++ b/src/main/res/layout/activity_share_with.xml @@ -8,6 +8,8 @@ android:id="@+id/choose_conversation_list" android:layout_width="match_parent" android:layout_height="match_parent" + android:divider="@android:color/transparent" + android:dividerHeight="0dp" tools:listitem="@layout/conversation_list_row" /> </LinearLayout>
\ No newline at end of file diff --git a/src/main/res/layout/conversation_list_row.xml b/src/main/res/layout/conversation_list_row.xml index 9addc66cb..08d176f11 100644 --- a/src/main/res/layout/conversation_list_row.xml +++ b/src/main/res/layout/conversation_list_row.xml @@ -50,9 +50,7 @@ android:ellipsize="end" android:maxLines="1" android:paddingRight="4dp" - android:textAppearance="@style/TextAppearance.AppCompat.Subhead" - android:textColor="@color/black87" - android:textSize="?attr/TextSizeHeadline" /> + android:textAppearance="@style/TextAppearance.AppCompat.Subhead" /> <RelativeLayout android:id="@+id/conversation_lastwrapper" |