Commit e8b5e274 authored by Grigory Fedorov's avatar Grigory Fedorov

ContactList: accounts panel returned. Refactoring made.

Unused drawable resources (accounts panel background and icon) removed.
parent 82b57286
......@@ -14,9 +14,6 @@
*/
package com.xabber.android.ui.adapter;
import java.util.ArrayList;
import java.util.Collections;
import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
......@@ -30,6 +27,9 @@ import com.xabber.android.data.account.StatusMode;
import com.xabber.android.data.extension.avatar.AvatarManager;
import com.xabber.androiddev.R;
import java.util.ArrayList;
import java.util.Collections;
/**
* Adapter for the list of accounts in the title of contact list.
*
......@@ -60,7 +60,7 @@ public class AccountToggleAdapter implements UpdatableAdapter {
this.activity = activity;
this.onClickListener = onClickListener;
this.linearLayout = linearLayout;
accounts = new ArrayList<String>();
accounts = new ArrayList<>();
}
/**
......@@ -105,11 +105,9 @@ public class AccountToggleAdapter implements UpdatableAdapter {
.getColorLevel(account);
view.getBackground().setLevel(colorLevel);
if (contactsShowAccounts)
accountViewHolder.statusMode
.setBackgroundResource(R.drawable.account_border);
accountViewHolder.statusMode.setBackgroundResource(R.drawable.account_border);
else
accountViewHolder.statusMode
.setBackgroundResource(R.drawable.account_border_persistent);
accountViewHolder.statusMode.setBackgroundResource(R.drawable.account_border_persistent);
if (selected == null || account.equals(selected))
accountViewHolder.disabled.setVisibility(View.GONE);
else
......
......@@ -43,7 +43,7 @@ public class AccountChooseDialogFragment extends AbstractDialogFragment {
public void onClick(DialogInterface dialog, int which) {
String account = (String) adapter.getItem(which);
OnChoosedListener listener = (OnChoosedListener) getActivity();
listener.onChoosed(account, user, text);
listener.onChoose(account, user, text);
}
});
return builder;
......@@ -73,7 +73,7 @@ public class AccountChooseDialogFragment extends AbstractDialogFragment {
public interface OnChoosedListener {
void onChoosed(String account, String user, String text);
void onChoose(String account, String user, String text);
}
......
......@@ -15,7 +15,63 @@
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:layout_height="match_parent">
<RelativeLayout
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_height"
android:layout_alignParentTop="true"
>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/contact_list_status_mode_width"
android:orientation="horizontal" >
<HorizontalScrollView
android:id="@+id/account_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="72dip" >
<LinearLayout
android:id="@+id/account_list"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal" >
</LinearLayout>
</HorizontalScrollView>
<TextView
android:id="@+id/common_status_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="left"
android:layout_marginLeft="-72dip"
android:gravity="left|center_vertical"
android:padding="2dip"
android:singleLine="true"
android:text="online"
android:textColor="?android:attr/textColorPrimary" />
</LinearLayout>
<ImageButton
android:id="@+id/common_status_mode"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@drawable/btn_status_mode"
android:paddingLeft="@dimen/active_chat_padding_right"
android:paddingRight="@dimen/active_chat_padding_right"
android:src="@drawable/ic_status" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/container"
......
......@@ -19,7 +19,6 @@
<item name="expanderAccountColor">?android:attr/textColorPrimaryInverse</item>
<item name="accountBackground">@drawable/account_background</item>
<item name="expanderIndicator">@drawable/expander_indicator_dark</item>
<item name="titleMainBackground">@drawable/title_main_background_dark</item>
<item name="titleAccountBackground">@drawable/title_account_background_dark</item>
<item name="textColorPrimaryNoSelected">@color/bright_foreground_dark</item>
</style>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment