activity_main.xml 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. <FrameLayout
  22. android:layout_width="match_parent"
  23. android:layout_height="0dp"
  24. android:layout_weight="1">
  25. <android.support.v7.widget.RecyclerView
  26. android:id="@+id/booksRecyclerView"
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent"
  29. tools:listitem="@layout/book" />
  30. <android.support.v7.widget.RecyclerView
  31. android:id="@+id/usersRecyclerView"
  32. android:layout_width="match_parent"
  33. android:layout_height="match_parent"
  34. tools:listitem="@layout/user"
  35. tools:visibility="gone" />
  36. <android.support.v7.widget.RecyclerView
  37. android:id="@+id/notesRecyclerView"
  38. android:layout_width="match_parent"
  39. android:layout_height="match_parent"
  40. android:clipToPadding="false"
  41. android:paddingBottom="8dp"
  42. android:paddingTop="8dp"
  43. tools:listitem="@layout/note"
  44. tools:visibility="gone" />
  45. <ProgressBar
  46. android:id="@+id/booksProgressBar"
  47. android:layout_width="match_parent"
  48. android:layout_height="wrap_content"
  49. android:layout_gravity="center"
  50. android:alpha="0"
  51. tools:alpha="1" />
  52. <TextView
  53. android:id="@+id/booksPlaceholder"
  54. android:layout_width="wrap_content"
  55. android:layout_height="wrap_content"
  56. android:layout_gravity="center"
  57. android:alpha="0"
  58. android:gravity="center"
  59. android:padding="16dp"
  60. android:textSize="16sp"
  61. android:visibility="gone"
  62. tools:alpha="1"
  63. tools:text="@string/error_loading_books"
  64. tools:visibility="visible" />
  65. <android.support.design.widget.FloatingActionButton
  66. android:id="@+id/addBookButton"
  67. android:layout_width="wrap_content"
  68. android:layout_height="wrap_content"
  69. android:layout_gravity="end|bottom"
  70. android:layout_margin="16dp"
  71. android:tint="@color/white"
  72. app:srcCompat="@drawable/ic_add" />
  73. </FrameLayout>
  74. <android.support.design.widget.BottomNavigationView
  75. android:id="@+id/navigation"
  76. android:layout_width="match_parent"
  77. android:layout_height="wrap_content"
  78. android:layout_gravity="bottom"
  79. android:background="@color/white"
  80. app:menu="@menu/navigation" />
  81. </LinearLayout>