mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-20 04:39:04 +00:00
Fix bottom bar layout issues
This commit is contained in:
parent
8ef8301b64
commit
c0c3e047b2
5 changed files with 173 additions and 172 deletions
|
|
@ -1,96 +1,107 @@
|
|||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/overlayFrameLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:elevation="0dp"
|
||||
tools:context=".ui.activities.MainActivity"
|
||||
android:fitsSystemWindows="false">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing_toolbar"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:id="@+id/coordinatorLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:titleEnabled="false"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:expandedTitleMarginEnd="?attr/actionBarSize"
|
||||
app:expandedTitleMarginStart="0dp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".ui.activities.MainActivity"
|
||||
android:fitsSystemWindows="false">
|
||||
|
||||
<include
|
||||
android:id="@+id/avatar_with_bars"
|
||||
layout="@layout/avatar_with_bars"
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:id="@+id/appbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.CollapsingToolbarLayout
|
||||
android:id="@+id/collapsing_toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:titleEnabled="false"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:expandedTitleMarginEnd="?attr/actionBarSize"
|
||||
app:expandedTitleMarginStart="0dp"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed">
|
||||
|
||||
<include
|
||||
android:id="@+id/avatar_with_bars"
|
||||
layout="@layout/avatar_with_bars"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
app:layout_collapseMode="parallax" />
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/Toolbar"
|
||||
app:layout_collapseMode="pin"
|
||||
app:popupTheme="@style/Theme.AppCompat.Light"
|
||||
android:fitsSystemWindows="true"/>
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/detail_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/brand_200"
|
||||
android:elevation="0dp"
|
||||
android:fillViewport="false"
|
||||
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:layout_anchor="@+id/collapsing_toolbar"
|
||||
app:layout_anchorGravity="bottom"
|
||||
|
||||
app:layout_collapseMode="pin"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabMode="fixed"
|
||||
android:fitsSystemWindows="true" />
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="?attr/actionBarSize"
|
||||
app:layout_collapseMode="parallax" />
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:theme="@style/Toolbar"
|
||||
app:layout_collapseMode="pin"
|
||||
app:popupTheme="@style/Theme.AppCompat.Light"
|
||||
android:fitsSystemWindows="true"/>
|
||||
</android.support.design.widget.CollapsingToolbarLayout>
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/detail_tabs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="54dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@color/brand_200"
|
||||
android:elevation="0dp"
|
||||
android:fillViewport="false"
|
||||
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:layout_anchor="@+id/collapsing_toolbar"
|
||||
app:layout_anchorGravity="bottom"
|
||||
|
||||
app:layout_collapseMode="pin"
|
||||
app:tabGravity="fill"
|
||||
app:tabIndicatorColor="@android:color/white"
|
||||
app:tabMode="fixed"
|
||||
android:fitsSystemWindows="true" />
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<com.roughike.bottombar.BottomBar
|
||||
android:id="@+id/bottom_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:background="@color/brand_100"
|
||||
app:bb_tabXmlResource="@xml/main_menu_tasks"
|
||||
app:bb_inActiveTabColor="@color/brand_500"
|
||||
app:bb_activeTabColor="@color/white"
|
||||
app:bb_behavior="underNavbar"
|
||||
/>
|
||||
android:orientation="vertical"
|
||||
android:layout_gravity="bottom|center"
|
||||
android:layout_alignParentBottom="true">
|
||||
<android.support.design.widget.CoordinatorLayout
|
||||
android:id="@+id/floating_menu_wrapper"
|
||||
app:layout_behavior="com.habitrpg.android.habitica.ui.helpers.FloatingActionMenuBehavior"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_marginBottom="-5dp"
|
||||
/>
|
||||
<com.roughike.bottombar.BottomBar
|
||||
android:id="@+id/bottom_navigation"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:background="@color/brand_100"
|
||||
app:bb_tabXmlResource="@xml/main_menu_tasks"
|
||||
app:bb_inActiveTabColor="@color/brand_500"
|
||||
app:bb_activeTabColor="@color/white"
|
||||
app:bb_behavior="underNavbar"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
<FrameLayout
|
||||
android:id="@+id/floating_menu_wrapper"
|
||||
app:layout_behavior="com.habitrpg.android.habitica.ui.helpers.FloatingActionMenuBehavior"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|right"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginBottom="44dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:fitsSystemWindows="true"
|
||||
/>
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/overlayFrameLayout"
|
||||
android:clickable="false"
|
||||
android:fitsSystemWindows="true"
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
|
@ -1,74 +1,75 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:clickable="true"
|
||||
android:id="@+id/background">
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:clickable="true"
|
||||
android:fitsSystemWindows="true"
|
||||
android:id="@+id/background">
|
||||
<View android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@android:color/black"
|
||||
android:alpha="0.6"/>
|
||||
android:layout_width="match_parent"
|
||||
android:background="@android:color/black"
|
||||
android:alpha="0.6"/>
|
||||
<LinearLayout
|
||||
android:orientation="horizontal" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:orientation="horizontal" android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/imageView8"
|
||||
android:src="@drawable/npc_justin_only"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"/>
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/imageView8"
|
||||
android:src="@drawable/npc_justin_only"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginStart="8dp"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/speech_bubble"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<TextView
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/tutorialTextView"
|
||||
android:background="@drawable/speech_bubble"
|
||||
android:layout_gravity="bottom"
|
||||
android:textSize="20sp" />
|
||||
android:layout_marginLeft="6dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginEnd="12dp"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/tutorialTextView"
|
||||
android:layout_gravity="bottom"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="?android:attr/buttonBarStyle" >
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
style="?android:attr/buttonBarStyle" >
|
||||
|
||||
<Button
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dismiss_tutorial"
|
||||
android:id="@+id/dismissButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/dismiss_tutorial"
|
||||
android:id="@+id/dismissButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
|
||||
<Button
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/complete_tutorial"
|
||||
android:id="@+id/completeButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/complete_tutorial"
|
||||
android:id="@+id/completeButton"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:theme="@style/DialogButton"
|
||||
style="?android:attr/buttonBarButtonStyle" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import android.content.pm.PackageInfo;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.database.sqlite.SQLiteDoneException;
|
||||
import android.databinding.DataBindingUtil;
|
||||
import android.graphics.Bitmap;
|
||||
|
|
@ -19,23 +18,19 @@ import android.os.Build;
|
|||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.FragmentTransaction;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
import android.support.v4.view.OnApplyWindowInsetsListener;
|
||||
import android.support.v4.view.ViewCompat;
|
||||
import android.support.v4.view.WindowInsetsCompat;
|
||||
import android.support.v4.widget.DrawerLayout;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.FrameLayout;
|
||||
|
|
@ -133,7 +128,6 @@ import com.magicmicky.habitrpgwrapper.lib.models.tasks.Task;
|
|||
import com.magicmicky.habitrpgwrapper.lib.models.tasks.TaskTag;
|
||||
import com.mikepenz.materialdrawer.AccountHeader;
|
||||
import com.mikepenz.materialdrawer.Drawer;
|
||||
import com.mikepenz.materialdrawer.DrawerBuilder;
|
||||
import com.mikepenz.materialdrawer.holder.BadgeStyle;
|
||||
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem;
|
||||
import com.mikepenz.materialdrawer.model.interfaces.IDrawerItem;
|
||||
|
|
@ -193,8 +187,7 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
public MaintenanceApiService maintenanceService;
|
||||
public HabitRPGUser user;
|
||||
@BindView(R.id.floating_menu_wrapper)
|
||||
public
|
||||
FrameLayout floatingMenuWrapper;
|
||||
public ViewGroup floatingMenuWrapper;
|
||||
@BindView(R.id.bottom_navigation)
|
||||
BottomBar bottomNavigation;
|
||||
@Inject
|
||||
|
|
@ -210,7 +203,7 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
@BindView(R.id.avatar_with_bars)
|
||||
View avatar_with_bars;
|
||||
@BindView(R.id.overlayFrameLayout)
|
||||
CoordinatorLayout overlayFrameLayout;
|
||||
ViewGroup overlayLayout;
|
||||
PushNotificationManager pushNotificationManager;
|
||||
// region UseCases
|
||||
|
||||
|
|
@ -318,7 +311,6 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
toolbar.setPadding(0, getStatusBarHeight(), 0, 0);
|
||||
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 16, getResources().getDisplayMetrics());
|
||||
avatar_with_bars.setPadding((int)px, getStatusBarHeight(), (int)px, 0);
|
||||
floatingMenuWrapper.setPadding(0, 0, 0, getNavigationBarHeight());
|
||||
}
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
|
|
@ -1353,7 +1345,7 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
return super.onKeyUp(keyCode, event);
|
||||
}
|
||||
|
||||
public FrameLayout getFloatingMenuWrapper() {
|
||||
public ViewGroup getFloatingMenuWrapper() {
|
||||
return floatingMenuWrapper;
|
||||
}
|
||||
|
||||
|
|
@ -1375,7 +1367,7 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
TutorialView view = new TutorialView(this, step, this);
|
||||
view.setTutorialText(text);
|
||||
view.onReaction = this;
|
||||
this.overlayFrameLayout.addView(view);
|
||||
this.overlayLayout.addView(view);
|
||||
this.activeTutorialView = view;
|
||||
|
||||
Map<String, Object> additionalData = new HashMap<>();
|
||||
|
|
@ -1394,7 +1386,7 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
|
||||
.subscribe(new MergeUserCallback(this, user), throwable -> {
|
||||
});
|
||||
this.overlayFrameLayout.removeView(this.activeTutorialView);
|
||||
this.overlayLayout.removeView(this.activeTutorialView);
|
||||
this.removeActiveTutorialView();
|
||||
|
||||
Map<String, Object> additionalData = new HashMap<>();
|
||||
|
|
@ -1414,7 +1406,7 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
|
||||
private void removeActiveTutorialView() {
|
||||
if (this.activeTutorialView != null) {
|
||||
this.overlayFrameLayout.removeView(this.activeTutorialView);
|
||||
this.overlayLayout.removeView(this.activeTutorialView);
|
||||
this.activeTutorialView = null;
|
||||
}
|
||||
}
|
||||
|
|
@ -1448,17 +1440,13 @@ public class MainActivity extends BaseActivity implements Action1<Throwable>, Ha
|
|||
switch (event.Task.type) {
|
||||
case Task.TYPE_DAILY: {
|
||||
dailyCheckUseCase.observable(new DailyCheckUseCase.RequestValues(event.Task, !event.Task.getCompleted()))
|
||||
.subscribe(res -> {
|
||||
EventBus.getDefault().post(new TaskUpdatedEvent(event.Task));
|
||||
}, error -> {
|
||||
.subscribe(res -> EventBus.getDefault().post(new TaskUpdatedEvent(event.Task)), error -> {
|
||||
});
|
||||
}
|
||||
break;
|
||||
case Task.TYPE_TODO: {
|
||||
todoCheckUseCase.observable(new TodoCheckUseCase.RequestValues(event.Task, !event.Task.getCompleted()))
|
||||
.subscribe(res -> {
|
||||
EventBus.getDefault().post(new TaskUpdatedEvent(event.Task));
|
||||
}, error -> {
|
||||
.subscribe(res -> EventBus.getDefault().post(new TaskUpdatedEvent(event.Task)), error -> {
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public abstract class BaseMainFragment extends BaseFragment {
|
|||
public MainActivity activity;
|
||||
public TabLayout tabLayout;
|
||||
public BottomBar bottomNavigation;
|
||||
public FrameLayout floatingMenuWrapper;
|
||||
public ViewGroup floatingMenuWrapper;
|
||||
public boolean usesTabLayout;
|
||||
public boolean usesBottomNavigation = false;
|
||||
public int fragmentSidebarPosition;
|
||||
|
|
@ -51,7 +51,7 @@ public abstract class BaseMainFragment extends BaseFragment {
|
|||
this.bottomNavigation = bottomNavigation;
|
||||
}
|
||||
|
||||
public void setFloatingMenuWrapper(FrameLayout view) {
|
||||
public void setFloatingMenuWrapper(ViewGroup view) {
|
||||
this.floatingMenuWrapper = view;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.content.Intent;
|
|||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.design.widget.CoordinatorLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.support.v4.view.GravityCompat;
|
||||
|
|
@ -74,16 +75,16 @@ public class TasksFragment extends BaseMainFragment {
|
|||
this.usesBottomNavigation = true;
|
||||
this.displayingTaskForm = false;
|
||||
super.onCreateView(inflater, container, savedInstanceState);
|
||||
View v = inflater.inflate(R.layout.fragment_fading_viewpager, container, false);
|
||||
View v = inflater.inflate(R.layout.fragment_viewpager, container, false);
|
||||
|
||||
|
||||
viewPager = (ViewPager) v.findViewById(R.id.view_pager);
|
||||
View view = inflater.inflate(R.layout.floating_menu_tasks, floatingMenuWrapper, true);
|
||||
if (view.getClass() == FrameLayout.class) {
|
||||
FrameLayout frame = (FrameLayout) view;
|
||||
floatingMenu = (FloatingActionMenu) frame.findViewById(R.id.fab_menu);
|
||||
} else {
|
||||
if (view.getClass() == FloatingActionMenu.class) {
|
||||
floatingMenu = (FloatingActionMenu) view;
|
||||
} else {
|
||||
ViewGroup frame = (ViewGroup) view;
|
||||
floatingMenu = (FloatingActionMenu) frame.findViewById(R.id.fab_menu);
|
||||
}
|
||||
FloatingActionButton habit_fab = (FloatingActionButton) floatingMenu.findViewById(R.id.fab_new_habit);
|
||||
habit_fab.setOnClickListener(v1 -> openNewTaskActivity("habit"));
|
||||
|
|
|
|||
Loading…
Reference in a new issue