Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.37 KB | None | 0 0
  1. Использовал DrawerLayout вместе с CollapsingToolbarLayout и Tablayout .
  2.  
  3. <?xml version="1.0" encoding="utf-8"?>
  4. <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5. xmlns:app="http://schemas.android.com/apk/res-auto"
  6. xmlns:tools="http://schemas.android.com/tools"
  7. android:id="@+id/drawer_layout"
  8. android:layout_width="match_parent"
  9. android:layout_height="match_parent"
  10. android:fitsSystemWindows="true"
  11. android:animateLayoutChanges="true">
  12. <android.support.design.widget.CoordinatorLayout
  13. xmlns:android="http://schemas.android.com/apk/res/android"
  14. xmlns:app="http://schemas.android.com/apk/res-auto"
  15. xmlns:tools="http://schemas.android.com/tools"
  16. android:layout_width="match_parent"
  17. android:layout_height="match_parent"
  18. android:fitsSystemWindows="true"
  19. tools:context=".sferaActivity"
  20. android:id="@+id/coordinatorLayout">
  21. <android.support.design.widget.AppBarLayout
  22. android:layout_width="match_parent"
  23. android:layout_height="wrap_content"
  24. android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
  25. <android.support.design.widget.CollapsingToolbarLayout
  26. android:id="@+id/main.collapsing"
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent"
  29. app:layout_scrollFlags="scroll|exitUntilCollapsed"
  30. android:fitsSystemWindows="true"
  31. app:contentScrim="?attr/colorPrimary"
  32. app:expandedTitleMarginStart="48dp"
  33. app:expandedTitleMarginEnd="64dp">
  34. <ImageView
  35. android:id="@+id/main.backdrop"
  36. android:layout_width="match_parent"
  37. android:layout_height="250dp"
  38. android:scaleType="centerCrop"
  39. android:fitsSystemWindows="true"
  40. android:src="@drawable/nav_header_bg"
  41. app:layout_collapseMode="parallax"/>
  42.  
  43. <android.support.v7.widget.Toolbar
  44. android:id="@+id/myToolBar"
  45. android:layout_width="match_parent"
  46. android:layout_height="?attr/actionBarSize"
  47. app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
  48. app:layout_scrollFlags="scroll|snap"
  49. app:layout_collapseMode="pin"/>
  50. </android.support.design.widget.CollapsingToolbarLayout>
  51. <android.support.design.widget.TabLayout
  52. android:id="@+id/tabs"
  53. android:layout_width="match_parent"
  54. android:layout_height="wrap_content"
  55. app:tabMode="fixed"
  56. app:tabGravity="fill"/>
  57. </android.support.design.widget.AppBarLayout>
  58. <ru.qwerq.qwerq.MyNestedScrollView
  59. android:layout_width="match_parent"
  60. android:layout_height="match_parent"
  61. app:layout_behavior="@string/appbar_scrolling_view_behavior">
  62.  
  63. <LinearLayout
  64. android:id="@+id/lin"
  65. android:layout_width="match_parent"
  66. android:layout_height="wrap_content"
  67. android:orientation="vertical"
  68. android:visibility="visible">
  69.  
  70. <ru.qwerq.qwerq.WrapContentHeightViewPager
  71. android:id="@+id/viewPager"
  72. android:layout_width="match_parent"
  73. android:layout_height="wrap_content" />
  74. </LinearLayout>
  75. </ru.qwerq.qwerq.MyNestedScrollView>
  76. <android.support.design.widget.FloatingActionButton
  77. android:id="@+id/fab"
  78. android:layout_width="wrap_content"
  79. android:layout_height="wrap_content"
  80. android:layout_gravity="bottom|end"
  81. android:layout_margin="@dimen/fab_margin"
  82. android:src="@android:drawable/stat_sys_phone_call" />
  83. </android.support.design.widget.CoordinatorLayout>
  84. <android.support.design.widget.NavigationView
  85. android:id="@+id/nav_view"
  86. android:layout_width="wrap_content"
  87. android:layout_height="match_parent"
  88. android:layout_gravity="start"
  89. android:fitsSystemWindows="true"
  90. app:headerLayout="@layout/nav_header"
  91. app:menu="@menu/drawer_menu"/>
  92. </android.support.v4.widget.DrawerLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement