updated manage account activity to new colors
This commit is contained in:
parent
ae2536adff
commit
6652135746
|
@ -2177,6 +2177,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());
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 = (ListView) findViewById(R.id.account_list);
|
||||
this.mAccountAdapter = new AccountAdapter(this, accountList, false);
|
||||
|
|
|
@ -174,7 +174,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);
|
||||
|
|
|
@ -7,11 +7,11 @@ import android.graphics.drawable.BitmapDrawable;
|
|||
import android.graphics.drawable.Drawable;
|
||||
import android.os.AsyncTask;
|
||||
import android.support.v7.widget.SwitchCompat;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
|
@ -24,6 +24,7 @@ import eu.siacs.conversations.R;
|
|||
import eu.siacs.conversations.entities.Account;
|
||||
import eu.siacs.conversations.ui.ManageAccountActivity;
|
||||
import eu.siacs.conversations.ui.XmppActivity;
|
||||
import eu.siacs.conversations.ui.util.Color;
|
||||
import eu.siacs.conversations.utils.UIHelper;
|
||||
|
||||
public class AccountAdapter extends ArrayAdapter<Account> {
|
||||
|
@ -67,7 +68,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());
|
||||
|
|
|
@ -31,18 +31,17 @@ package eu.siacs.conversations.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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:layout_toRightOf="@+id/account_image"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingLeft="@dimen/avatar_item_distance"
|
||||
android:layout_toLeftOf="@+id/tgl_account_status"
|
||||
android:layout_toStartOf="@+id/tgl_account_status">
|
||||
|
||||
|
@ -32,17 +32,15 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:scrollHorizontally="false"
|
||||
android:singleLine="true"
|
||||
android:textColor="?attr/color_text_primary"
|
||||
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="?attr/color_text_secondary"
|
||||
android:textSize="?attr/TextSizeBody"
|
||||
android:textStyle="bold" />
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body2"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<android.support.v7.widget.SwitchCompat
|
||||
|
|
|
@ -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"
|
||||
tools:listitem="@layout/contact" />
|
||||
tools:listitem="@layout/contact"
|
||||
android:divider="@android:color/transparent"
|
||||
android:dividerHeight="0dp"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -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"
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="?attr/color_background_secondary" >
|
||||
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" >
|
||||
android:divider="@android:color/transparent"
|
||||
android:dividerHeight="0dp" >
|
||||
</ListView>
|
||||
|
||||
</LinearLayout>
|
|
@ -8,6 +8,8 @@
|
|||
android:id="@+id/choose_conversation_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:listitem="@layout/conversation_list_row" />
|
||||
tools:listitem="@layout/conversation_list_row"
|
||||
android:divider="@android:color/transparent"
|
||||
android:dividerHeight="0dp"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -46,8 +46,7 @@
|
|||
android:paddingRight="4dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead"
|
||||
android:typeface="sans"/>
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Subhead" />
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/conversation_lastwrapper"
|
||||
|
|
Loading…
Reference in a new issue