Commit 286a9398 authored by Grigory Fedorov's avatar Grigory Fedorov

Offline shadow for account action buttons returned.

parent 641cc02b
......@@ -8,6 +8,7 @@ import android.widget.LinearLayout;
import com.melnykov.fab.FloatingActionButton;
import com.xabber.android.data.account.AccountManager;
import com.xabber.android.data.account.StatusMode;
import com.xabber.android.data.extension.avatar.AvatarManager;
import com.xabber.androiddev.R;
......@@ -108,7 +109,17 @@ public class AccountActionButtonsAdapter implements UpdatableAdapter {
}
}
view.findViewById(R.id.account_shadow).setVisibility(shadowVisibility);
view.findViewById(R.id.account_unselected_shadow).setVisibility(shadowVisibility);
StatusMode statusMode = AccountManager.getInstance().getAccount(account).getDisplayStatusMode();
int offlineShadowVisibility;
if (statusMode == StatusMode.connection || statusMode == StatusMode.unavailable) {
offlineShadowVisibility = View.VISIBLE;
} else {
offlineShadowVisibility = View.GONE;
}
view.findViewById(R.id.account_offline_shadow).setVisibility(offlineShadowVisibility);
}
}
......
......@@ -323,6 +323,7 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
int color;
viewHolder.groupOfflineIndicator.setVisibility(View.GONE);
viewHolder.offlineShadow.setVisibility(View.GONE);
if (configuration.getUser().equals(GroupManager.ACTIVE_CHATS)) {
color = activeChatsColor;
......@@ -334,13 +335,12 @@ public abstract class GroupedContactAdapter extends BaseAdapter implements Updat
color = accountSubgroupColors[level];
viewHolder.groupOfflineIndicator.setVisibility(View.VISIBLE);
if (!configuration.getAccount().equalsIgnoreCase(GroupManager.NO_ACCOUNT)) {
StatusMode statusMode = AccountManager.getInstance().getAccount(configuration.getAccount()).getDisplayStatusMode();
AccountItem accountItem = AccountManager.getInstance().getAccount(configuration.getAccount());
if (accountItem != null) {
StatusMode statusMode = accountItem.getDisplayStatusMode();
if (statusMode == StatusMode.unavailable || statusMode == StatusMode.connection) {
viewHolder.offlineShadow.setVisibility(View.VISIBLE);
} else {
viewHolder.offlineShadow.setVisibility(View.GONE);
}
}
}
......
......@@ -38,7 +38,21 @@
/>
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/account_shadow"
android:id="@+id/account_offline_shadow"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_offline_shadow_24dp"
android:elevation="8dp"
android:visibility="gone"
android:layout_marginTop="4dp"
android:layout_marginBottom="12dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
/>
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/account_unselected_shadow"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@color/black"
......
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