habitica-android/Habitica/res/layout/activity_main.xml

169 lines
8.6 KiB
XML
Raw Normal View History

2017-11-09 16:25:14 +00:00
<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->
2018-11-06 15:11:02 +00:00
<androidx.drawerlayout.widget.DrawerLayout
2017-11-09 16:25:14 +00:00
xmlns:android="http://schemas.android.com/apk/res/android"
2017-04-20 13:33:33 +00:00
xmlns:tools="http://schemas.android.com/tools"
2017-11-09 16:25:14 +00:00
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
2017-11-09 16:25:14 +00:00
android:layout_height="match_parent"
tools:context="com.habitrpg.android.habitica.ui.activities.MainActivity">
2017-04-20 13:33:33 +00:00
2017-11-09 16:25:14 +00:00
<!-- As the main content view, the view below consumes the entire
space available using match_parent in both dimensions. -->
<FrameLayout android:layout_width="match_parent"
android:layout_height="match_parent">
2018-11-06 15:11:02 +00:00
<androidx.coordinatorlayout.widget.CoordinatorLayout
2017-11-09 16:25:14 +00:00
android:id="@+id/coordinatorLayout"
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activities.MainActivity">
<fragment
android:id="@+id/nav_host_fragment"
android:name="androidx.navigation.fragment.NavHostFragment"
2017-11-09 16:25:14 +00:00
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:defaultNavHost="true"
app:navGraph="@navigation/navigation" />
2018-11-06 15:11:02 +00:00
<com.google.android.material.appbar.AppBarLayout
2017-11-09 16:25:14 +00:00
android:id="@+id/appbar"
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
2017-11-09 16:25:14 +00:00
android:layout_height="wrap_content">
2017-04-20 13:33:33 +00:00
2018-11-06 15:11:02 +00:00
<com.google.android.material.appbar.CollapsingToolbarLayout
2017-11-09 16:25:14 +00:00
android:id="@+id/collapsing_toolbar"
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
2017-11-09 16:25:14 +00:00
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" />
2018-11-06 15:11:02 +00:00
<androidx.appcompat.widget.Toolbar
2017-11-09 16:25:14 +00:00
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">
<RelativeLayout
2017-07-20 17:59:59 +00:00
android:layout_width="wrap_content"
android:layout_height="match_parent"
2017-11-09 16:25:14 +00:00
android:layout_marginRight="16dp">
<TextView
android:id="@+id/toolbar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:ellipsize="end"
android:maxLines="1"
android:singleLine="true"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
tools:text="Habitica"/>
2017-07-20 17:59:59 +00:00
2017-11-09 16:25:14 +00:00
<FrameLayout
android:id="@+id/toolbar_accessory_container"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:adjustViewBounds="true"
android:layout_centerVertical="true"
android:layout_alignParentRight="true"/>
</RelativeLayout>
2018-11-06 15:11:02 +00:00
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.CollapsingToolbarLayout>
2017-04-20 13:33:33 +00:00
2018-11-06 15:11:02 +00:00
<com.google.android.material.tabs.TabLayout
2017-11-09 16:25:14 +00:00
android:id="@+id/detail_tabs"
android:layout_width="match_parent"
android:layout_height="54dp"
android:layout_gravity="bottom"
2019-05-17 11:57:29 +00:00
android:background="?colorPrimaryOffset"
2017-11-09 16:25:14 +00:00
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"
2019-05-17 11:57:29 +00:00
app:tabIndicatorColor="?colorContentBackground"
2017-11-09 16:25:14 +00:00
app:tabMode="fixed" />
2019-05-31 09:07:36 +00:00
<TextView
android:id="@+id/connection_issue_textview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:background="@color/gray_50"
android:textSize="14sp"
android:gravity="center_horizontal"
android:padding="@dimen/spacing_small"
android:text="@string/internal_error_api"
android:visibility="gone"/>
2018-11-06 15:11:02 +00:00
</com.google.android.material.appbar.AppBarLayout>
2017-11-09 16:25:14 +00:00
<LinearLayout
android:id="@+id/bottom_wrapper"
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
android:layout_height="wrap_content"
2017-11-09 16:25:14 +00:00
android:orientation="vertical"
android:layout_gravity="bottom|center_horizontal"
android:layout_alignParentBottom="true"
app:layout_behavior="com.habitrpg.android.habitica.ui.helpers.FloatingActionMenuBehavior"
android:padding="0dp">
2018-11-06 15:11:02 +00:00
<androidx.coordinatorlayout.widget.CoordinatorLayout
2017-11-09 16:25:14 +00:00
android:id="@+id/floating_menu_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|right"
android:layout_marginBottom="-5dp"
/>
<com.habitrpg.android.habitica.ui.views.bottombar.BottomBar
2017-11-09 16:25:14 +00:00
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
android:layout_height="60dp"
2019-05-17 11:57:29 +00:00
android:background="?colorPrimary"
2017-11-09 16:25:14 +00:00
app:bb_tabXmlResource="@xml/main_menu_tasks"
2019-05-17 11:57:29 +00:00
app:bb_inActiveTabColor="?colorPrimaryDistinct"
2017-11-09 16:25:14 +00:00
app:bb_activeTabColor="@color/white"
app:bb_badgesHideWhenActive="true"
2019-05-17 11:57:29 +00:00
app:bb_badgeBackgroundColor="?colorBadgeBackground"
2017-11-09 16:25:14 +00:00
android:layout_gravity="bottom"
android:layout_marginBottom="-5dp"
2017-11-09 16:25:14 +00:00
/>
</LinearLayout>
2018-11-06 15:11:02 +00:00
</androidx.coordinatorlayout.widget.CoordinatorLayout>
2017-11-09 16:25:14 +00:00
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/overlayFrameLayout"
android:clickable="false"
/>
</FrameLayout>
<!-- The drawer is given a fixed width in dp and extends the full height of
the container. -->
<fragment
android:id="@+id/navigation_drawer"
android:name="com.habitrpg.android.habitica.ui.fragments.NavigationDrawerFragment"
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
android:layout_height="match_parent"
2017-11-09 16:25:14 +00:00
android:layout_gravity="start"
android:layout_marginRight="32dp"
tools:layout="@layout/drawer_main"/>
2018-11-06 15:11:02 +00:00
</androidx.drawerlayout.widget.DrawerLayout>