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

150 lines
8.1 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"
2019-06-14 08:05:51 +00:00
tools:context="com.habitrpg.android.habitica.ui.activities.MainActivity"
2020-09-04 16:17:34 +00:00
android:background="@color/content_background">
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. -->
2018-11-06 15:11:02 +00:00
<androidx.coordinatorlayout.widget.CoordinatorLayout
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activities.MainActivity">
<androidx.fragment.app.FragmentContainerView
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">
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"
2020-08-25 11:21:27 +00:00
app:contentScrim="?attr/headerBackgroundColor"
2020-08-26 10:58:04 +00:00
android:background="?attr/headerBackgroundColor"
2017-11-09 16:25:14 +00:00
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"
2020-08-26 10:58:04 +00:00
android:layout_marginEnd="@dimen/header_border_spacing"
android:layout_marginStart="@dimen/header_border_spacing"
2020-09-15 07:28:34 +00:00
android:layout_marginBottom="@dimen/spacing_medium"
2017-11-09 16:25:14 +00:00
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"
2020-09-04 16:17:34 +00:00
style="@style/Toolbar.Modern"
2020-08-25 11:21:27 +00:00
android:background="?attr/headerBackgroundColor"
2017-11-09 16:25:14 +00:00
app:layout_collapseMode="pin"
2020-09-04 16:17:34 +00:00
app:popupTheme="@style/Theme.AppCompat.DayNight">
2017-11-09 16:25:14 +00:00
<RelativeLayout
2017-07-20 17:59:59 +00:00
android:layout_width="wrap_content"
android:layout_height="match_parent"
2019-06-13 14:41:40 +00:00
android:layout_marginEnd="16dp">
2017-11-09 16:25:14 +00:00
<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"
2020-08-26 10:58:04 +00:00
android:layout_toStartOf="@id/toolbar_accessory_container"
android:layout_alignParentStart="true"
2017-11-09 16:25:14 +00:00
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"
2019-06-13 14:41:40 +00:00
android:layout_alignParentEnd="true"/>
2017-11-09 16:25:14 +00:00
</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"
2021-02-10 17:51:26 +00:00
android:layout_height="48dp"
2017-11-09 16:25:14 +00:00
android:layout_gravity="bottom"
2020-08-25 11:21:27 +00:00
android:background="?headerOffsetColor"
2017-11-09 16:25:14 +00:00
android:elevation="0dp"
android:fillViewport="false"
app:layout_anchor="@+id/collapsing_toolbar"
app:layout_anchorGravity="bottom"
app:layout_collapseMode="pin"
app:tabGravity="fill"
2020-08-25 11:21:27 +00:00
app:tabIndicatorColor="?colorPrimary"
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"
2020-09-04 16:17:34 +00:00
android:background="@color/text_primary"
2019-05-31 09:07:36 +00:00
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
2019-06-06 12:33:29 +00:00
<RelativeLayout
2019-06-13 14:41:40 +00:00
android:id="@+id/overlayFrameLayout"
2017-04-20 13:33:33 +00:00
android:layout_width="match_parent"
2019-06-06 12:33:29 +00:00
android:layout_height="match_parent"
2019-06-08 17:09:52 +00:00
android:layout_gravity="bottom|center_horizontal">
2019-06-06 12:33:29 +00:00
<FrameLayout
android:id="@+id/snackbar_container"
2017-11-09 16:25:14 +00:00
android:layout_width="match_parent"
2021-05-18 08:41:05 +00:00
android:layout_height="400dp"
2019-06-19 09:46:26 +00:00
android:layout_alignParentBottom="true"
2021-05-18 08:41:05 +00:00
android:paddingBottom="50dp"/>
2019-06-06 12:33:29 +00:00
<com.habitrpg.android.habitica.ui.views.navigation.HabiticaBottomNavigationView
2017-11-09 16:25:14 +00:00
android:id="@+id/bottom_navigation"
android:layout_width="match_parent"
2019-06-06 12:33:29 +00:00
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentStart="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
2018-11-06 15:11:02 +00:00
</androidx.coordinatorlayout.widget.CoordinatorLayout>
2017-11-09 16:25:14 +00:00
<!-- The drawer is given a fixed width in dp and extends the full height of
the container. -->
<androidx.fragment.app.FragmentContainerView
2017-11-09 16:25:14 +00:00
android:id="@+id/navigation_drawer"
2019-11-05 14:19:44 +00:00
class="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"
tools:layout="@layout/drawer_main"/>
2018-11-06 15:11:02 +00:00
</androidx.drawerlayout.widget.DrawerLayout>