|
|
@@ -38,6 +38,7 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
|
|
|
private ConstraintLayout drawerView;
|
|
|
private ConstraintLayout menuContainer;
|
|
|
private ConstraintLayout container;
|
|
|
+ private ViewGroup layoutNavigationBar;
|
|
|
private TextView textViewCategory0;
|
|
|
private TextView textViewCategory1;
|
|
|
private TextView textViewCategory2;
|
|
|
@@ -46,6 +47,8 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
|
|
|
private List<TextView> categoryList;
|
|
|
private IEventListener listener;
|
|
|
private NavigationBar navigationBar;
|
|
|
+ private boolean isJoined;
|
|
|
+ private NavigationBar.Builder builder;
|
|
|
|
|
|
AllMenuDriver(Context context, ConstraintLayout drawerView, IEventListener listener) {
|
|
|
this.context = context;
|
|
|
@@ -69,11 +72,12 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
|
|
|
|
|
|
container = this.drawerView.findViewById(R.id.layout_animate);
|
|
|
menuContainer = this.drawerView.findViewById(R.id.layout_container);
|
|
|
+ layoutNavigationBar = this.drawerView.findViewById(R.id.container_navigation_bar);
|
|
|
|
|
|
((ViewGroup.MarginLayoutParams) this.drawerView.getLayoutParams()).topMargin = ResourceUtil.getStatusBarHeightManual();
|
|
|
((ViewGroup.MarginLayoutParams) this.menuContainer.getLayoutParams()).topMargin = ResourceUtil.getDimension(R.dimen.action_bar_height);
|
|
|
this.drawerView.setClickable(true);
|
|
|
- setNavigationBar();
|
|
|
+
|
|
|
|
|
|
textViewCategory0 = this.drawerView.findViewById(R.id.text_view_category_0);
|
|
|
textViewCategory1 = this.drawerView.findViewById(R.id.text_view_category_1);
|
|
|
@@ -132,17 +136,24 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
|
|
|
}
|
|
|
|
|
|
private void setNavigationBar() {
|
|
|
- navigationBar = new NavigationBar.Builder(context)
|
|
|
+
|
|
|
+ layoutNavigationBar.removeAllViews();
|
|
|
+
|
|
|
+ builder = new NavigationBar.Builder(context)
|
|
|
.home(actionBar -> listener.onEvent(new Event.Builder(Event.HOME_PAGE).build()))
|
|
|
.notification(actionBar -> listener.onEvent(new Event.Builder(Event.NOTICE).build()))
|
|
|
.setting(actionBar -> listener.onEvent(new Event.Builder(Event.SETTING).build()))
|
|
|
- .close(actionBar -> listener.onEvent(new Event.Builder(Event.CLOSE).build()))
|
|
|
- .build();
|
|
|
+ .close(actionBar -> listener.onEvent(new Event.Builder(Event.CLOSE).build()));
|
|
|
+
|
|
|
+ if (isJoined) {
|
|
|
+ builder.build();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ builder.textButton(R.string.member_confirm_underline, actionBar -> listener.onEvent(new Event.Builder(Event.SIGN_UP).build())).build();
|
|
|
+ }
|
|
|
|
|
|
- ((ViewGroup) this.drawerView.findViewById(R.id.container_navigation_bar))
|
|
|
- .addView(
|
|
|
- navigationBar.getView()
|
|
|
- );
|
|
|
+ navigationBar = builder.build();
|
|
|
+ layoutNavigationBar.addView(navigationBar.getView());
|
|
|
}
|
|
|
|
|
|
void onOpen() {
|
|
|
@@ -177,4 +188,9 @@ public class AllMenuDriver implements PushMessageBroker.IPushMessageListener {
|
|
|
pushMessageManager = manager;
|
|
|
new Handler(Looper.getMainLooper()).post(this::dispatchMessage);
|
|
|
}
|
|
|
+
|
|
|
+ public void setJoined(boolean isJoined) {
|
|
|
+ this.isJoined = isJoined;
|
|
|
+ setNavigationBar();
|
|
|
+ }
|
|
|
}
|