Commit 28c64525 authored by Grigory Fedorov's avatar Grigory Fedorov

Account floating action button become dark while connecting.

parent 8f6ceda2
......@@ -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;
......@@ -92,15 +93,27 @@ public class AccountActionButtonsAdapter implements UpdatableAdapter {
}
for (int index = 0; index < accounts.size(); index++) {
final CircleImageView circleImageView = (CircleImageView) linearLayout.getChildAt(index).findViewById(R.id.account_avatar);
View view = linearLayout.getChildAt(index);
final CircleImageView circleImageView = (CircleImageView) view.findViewById(R.id.account_avatar);
final String account = accounts.get(index);
circleImageView.setImageDrawable(AvatarManager.getInstance().getAccountAvatar(account));
FloatingActionButton floatingActionButton = (FloatingActionButton) linearLayout.getChildAt(index).findViewById(R.id.fab);
FloatingActionButton backgroundActionButton = (FloatingActionButton) view.findViewById(R.id.fab);
int colorLevel = AccountManager.getInstance().getColorLevel(account);
floatingActionButton.setColorNormal(accountActionBarColors[colorLevel]);
floatingActionButton.setColorPressed(accountStatusBarColors[colorLevel]);
floatingActionButton.setColorRipple(accountBackgroundColors[colorLevel]);
backgroundActionButton.setColorNormal(accountActionBarColors[colorLevel]);
backgroundActionButton.setColorPressed(accountStatusBarColors[colorLevel]);
backgroundActionButton.setColorRipple(accountBackgroundColors[colorLevel]);
StatusMode statusMode = AccountManager.getInstance().getAccount(account).getDisplayStatusMode();
int connectionIndicatorVisibility;
if (statusMode == StatusMode.connection) {
connectionIndicatorVisibility = View.VISIBLE;
} else {
connectionIndicatorVisibility = View.GONE;
}
view.findViewById(R.id.account_connection_indicator).setVisibility(connectionIndicatorVisibility);
}
}
......
......@@ -38,5 +38,19 @@
android:layout_marginRight="16dp"
/>
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/account_connection_indicator"
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@color/black"
android:alpha="0.5"
android:elevation="8dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:visibility="gone"
/>
</FrameLayout>
\ No newline at end of file
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