drawer_header.xml 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. Nextcloud Android client application
  4. Copyright (C) 2016 Andy Scherzinger
  5. Copyright (C) 2016 Nextcloud.
  6. This program is free software; you can redistribute it and/or
  7. modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  8. License as published by the Free Software Foundation; either
  9. version 3 of the License, or any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  14. You should have received a copy of the GNU Affero General Public
  15. License along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. -->
  17. <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
  18. android:id="@+id/drawer_header_view"
  19. android:layout_width="match_parent"
  20. android:layout_height="@dimen/nav_drawer_header_height"
  21. android:fitsSystemWindows="true">
  22. <ImageView
  23. android:id="@+id/drawer_header_background"
  24. android:layout_width="match_parent"
  25. android:layout_height="match_parent"
  26. android:contentDescription="@string/drawer_header_background"
  27. android:src="@drawable/background"
  28. android:scaleType="centerCrop"/>
  29. <RelativeLayout
  30. android:id="@+id/drawer_active_user"
  31. android:layout_width="match_parent"
  32. android:layout_height="wrap_content"
  33. android:layout_gravity="bottom"
  34. android:paddingTop="@dimen/standard_padding"
  35. android:paddingRight="@dimen/standard_padding"
  36. android:paddingLeft="@dimen/standard_padding"
  37. android:paddingBottom="@dimen/zero">
  38. <FrameLayout
  39. android:id="@+id/drawer_user_avatars"
  40. android:layout_width="match_parent"
  41. android:layout_height="wrap_content"
  42. android:layout_gravity="top"
  43. android:layout_marginBottom="@dimen/standard_half_margin">
  44. <ImageView
  45. android:id="@+id/drawer_current_account"
  46. android:layout_width="@dimen/nav_drawer_header_avatar"
  47. android:layout_height="@dimen/nav_drawer_header_avatar"
  48. android:src="@drawable/account_circle_white"
  49. android:contentDescription="@string/drawer_current_account"/>
  50. <ImageView
  51. android:id="@+id/drawer_account_middle"
  52. android:layout_width="@dimen/nav_drawer_header_avatar_other_accounts_size"
  53. android:layout_height="@dimen/nav_drawer_header_avatar_other_accounts_size"
  54. android:layout_gravity="end"
  55. android:layout_marginEnd="@dimen/nav_drawer_header_avatar_second_account_margin"
  56. android:layout_marginRight="@dimen/nav_drawer_header_avatar_second_account_margin"
  57. android:src="@drawable/account_circle_white"
  58. android:onClick="onAccountDrawerClick"
  59. android:contentDescription="@string/drawer_middle_account"/>
  60. <ImageView
  61. android:id="@+id/drawer_account_end"
  62. android:layout_width="@dimen/nav_drawer_header_avatar_other_accounts_size"
  63. android:layout_height="@dimen/nav_drawer_header_avatar_other_accounts_size"
  64. android:layout_gravity="end"
  65. android:src="@drawable/account_circle_white"
  66. android:onClick="onAccountDrawerClick"
  67. android:contentDescription="@string/drawer_end_account"/>
  68. </FrameLayout>
  69. <LinearLayout
  70. android:layout_width="match_parent"
  71. android:layout_height="wrap_content"
  72. android:layout_below="@+id/drawer_user_avatars"
  73. >
  74. <LinearLayout
  75. android:layout_width="0dp"
  76. android:layout_height="wrap_content"
  77. android:layout_gravity="center_vertical"
  78. android:layout_weight="1"
  79. android:orientation="vertical"
  80. android:paddingEnd="@dimen/standard_half_padding"
  81. android:paddingRight="@dimen/standard_half_padding"
  82. android:paddingStart="@dimen/zero"
  83. android:paddingLeft="@dimen/zero">
  84. <TextView
  85. android:id="@+id/drawer_username"
  86. android:layout_width="match_parent"
  87. android:layout_height="wrap_content"
  88. android:ellipsize="end"
  89. android:shadowColor="@color/drawer_shadow"
  90. android:shadowDx="0.5"
  91. android:shadowDy="0"
  92. android:shadowRadius="2"
  93. android:maxLines="1"
  94. android:text="@string/app_name"
  95. android:textColor="@color/text_color"
  96. android:textSize="@dimen/drawer_header_text"
  97. android:textStyle="bold"/>
  98. <TextView
  99. android:id="@+id/drawer_username_full"
  100. android:layout_width="match_parent"
  101. android:layout_height="28dp"
  102. android:ellipsize="end"
  103. android:lines="1"
  104. android:maxLines="1"
  105. android:shadowColor="@color/drawer_shadow"
  106. android:shadowDx="0.5"
  107. android:shadowDy="0"
  108. android:shadowRadius="2"
  109. android:text="@string/app_name"
  110. android:textColor="@color/text_color"
  111. android:textSize="@dimen/drawer_header_subtext"/>
  112. </LinearLayout>
  113. <ImageView
  114. android:id="@+id/drawer_account_chooser_toggle"
  115. android:layout_width="wrap_content"
  116. android:layout_height="wrap_content"
  117. android:layout_gravity="center_vertical"
  118. android:layout_marginBottom="8dp"
  119. android:contentDescription="@string/drawer_manage_accounts"
  120. android:src="@drawable/ic_down"/>
  121. </LinearLayout>
  122. </RelativeLayout>
  123. </FrameLayout>