activity_main.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:id="@+id/container"
  6. android:layout_width="match_parent"
  7. android:layout_height="match_parent"
  8. android:background="@color/white"
  9. android:orientation="vertical"
  10. tools:context="me.vadik.knigopis.MainActivity">
  11. <android.support.design.widget.AppBarLayout
  12. android:layout_width="match_parent"
  13. android:layout_height="wrap_content"
  14. android:theme="@style/AppBarTheme">
  15. <android.support.v7.widget.Toolbar
  16. android:id="@+id/toolbar"
  17. android:layout_width="match_parent"
  18. android:layout_height="wrap_content"
  19. app:title="@string/app_name" />
  20. </android.support.design.widget.AppBarLayout>
  21. <android.support.v4.widget.SwipeRefreshLayout
  22. android:id="@+id/swipeRefresh"
  23. android:layout_width="match_parent"
  24. android:layout_height="0dp"
  25. android:layout_weight="1">
  26. <FrameLayout
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent">
  29. <android.support.v7.widget.RecyclerView
  30. android:id="@+id/booksRecyclerView"
  31. android:layout_width="match_parent"
  32. android:layout_height="match_parent"
  33. tools:listitem="@layout/book" />
  34. <android.support.v7.widget.RecyclerView
  35. android:id="@+id/usersRecyclerView"
  36. android:layout_width="match_parent"
  37. android:layout_height="match_parent"
  38. android:clipToPadding="false"
  39. android:paddingBottom="8dp"
  40. android:paddingTop="8dp"
  41. tools:listitem="@layout/user"
  42. tools:visibility="gone" />
  43. <android.support.v7.widget.RecyclerView
  44. android:id="@+id/notesRecyclerView"
  45. android:layout_width="match_parent"
  46. android:layout_height="match_parent"
  47. android:clipToPadding="false"
  48. android:paddingBottom="8dp"
  49. android:paddingTop="8dp"
  50. tools:listitem="@layout/note"
  51. tools:visibility="gone" />
  52. <ProgressBar
  53. android:id="@+id/booksProgressBar"
  54. android:layout_width="match_parent"
  55. android:layout_height="wrap_content"
  56. android:layout_gravity="center"
  57. android:alpha="0"
  58. tools:alpha="1" />
  59. <TextView
  60. android:id="@+id/booksPlaceholder"
  61. android:layout_width="wrap_content"
  62. android:layout_height="wrap_content"
  63. android:layout_gravity="center"
  64. android:alpha="0"
  65. android:gravity="center"
  66. android:padding="16dp"
  67. android:textSize="16sp"
  68. android:visibility="gone"
  69. tools:alpha="1"
  70. tools:text="@string/error_loading_books"
  71. tools:visibility="visible" />
  72. <android.support.design.widget.FloatingActionButton
  73. android:id="@+id/addBookButton"
  74. android:layout_width="wrap_content"
  75. android:layout_height="wrap_content"
  76. android:layout_gravity="end|bottom"
  77. android:layout_margin="16dp"
  78. android:tint="@color/white"
  79. app:srcCompat="@drawable/ic_add" />
  80. </FrameLayout>
  81. </android.support.v4.widget.SwipeRefreshLayout>
  82. <android.support.design.widget.BottomNavigationView
  83. android:id="@+id/bottomNavigation"
  84. android:layout_width="match_parent"
  85. android:layout_height="wrap_content"
  86. android:layout_gravity="bottom"
  87. android:background="@color/white"
  88. app:menu="@menu/navigation" />
  89. </LinearLayout>