Commit f135794e authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Update RoomToolbar.java

parent 8195ecd8
...@@ -8,6 +8,7 @@ import android.support.annotation.StringRes; ...@@ -8,6 +8,7 @@ import android.support.annotation.StringRes;
import android.support.graphics.drawable.VectorDrawableCompat; import android.support.graphics.drawable.VectorDrawableCompat;
import android.support.v4.content.ContextCompat; import android.support.v4.content.ContextCompat;
import android.support.v4.graphics.drawable.DrawableCompat; import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.graphics.drawable.DrawerArrowDrawable;
import android.support.v7.widget.AppCompatImageView; import android.support.v7.widget.AppCompatImageView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.AttributeSet; import android.util.AttributeSet;
...@@ -30,6 +31,8 @@ public class RoomToolbar extends Toolbar { ...@@ -30,6 +31,8 @@ public class RoomToolbar extends Toolbar {
private Drawable publicChannelDrawable; private Drawable publicChannelDrawable;
private Drawable userStatusDrawable; private Drawable userStatusDrawable;
private DrawerArrowDrawable drawerArrowDrawable;
public static final int STATUS_ONLINE = 1; public static final int STATUS_ONLINE = 1;
public static final int STATUS_BUSY = 2; public static final int STATUS_BUSY = 2;
public static final int STATUS_AWAY = 3; public static final int STATUS_AWAY = 3;
...@@ -52,7 +55,7 @@ public class RoomToolbar extends Toolbar { ...@@ -52,7 +55,7 @@ public class RoomToolbar extends Toolbar {
private void initialize(Context context) { private void initialize(Context context) {
View.inflate(context, R.layout.toolbar, this); View.inflate(context, R.layout.toolbar, this);
setNavigationIcon(); setNavigationIcon(context);
toolbarText = findViewById(R.id.text_toolbar); toolbarText = findViewById(R.id.text_toolbar);
roomTypeImage = findViewById(R.id.image_room_type); roomTypeImage = findViewById(R.id.image_room_type);
...@@ -63,9 +66,18 @@ public class RoomToolbar extends Toolbar { ...@@ -63,9 +66,18 @@ public class RoomToolbar extends Toolbar {
userStatusDrawable = VectorDrawableCompat.create(getResources(), R.drawable.ic_user_status_black_24dp, null); userStatusDrawable = VectorDrawableCompat.create(getResources(), R.drawable.ic_user_status_black_24dp, null);
} }
private void setNavigationIcon() { private void setNavigationIcon(Context context) {
Drawable menuDrawable = VectorDrawableCompat.create(getResources(), R.drawable.ic_menu_white_24dp, null); drawerArrowDrawable = new DrawerArrowDrawable(context);
super.setNavigationIcon(menuDrawable); drawerArrowDrawable.setColor(ContextCompat.getColor(context, android.R.color.white));
super.setNavigationIcon(drawerArrowDrawable);
}
public void setNavigationIconProgress(float progress) {
drawerArrowDrawable.setProgress(progress);
}
public void setNavigationIconVerticalMirror(boolean verticalMirror) {
drawerArrowDrawable.setVerticalMirror(verticalMirror);
} }
@Override @Override
...@@ -168,7 +180,7 @@ public class RoomToolbar extends Toolbar { ...@@ -168,7 +180,7 @@ public class RoomToolbar extends Toolbar {
.beginConfig() .beginConfig()
.useFont(Typeface.SANS_SERIF) .useFont(Typeface.SANS_SERIF)
.endConfig() .endConfig()
.buildRound(icon, ContextCompat.getColor(getContext(), android.R.color.white)); .buildRound(icon, ContextCompat.getColor(getContext(), R.color.color_user_status_busy));
} }
@Override @Override
......
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