drawer_header.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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:padding="@dimen/standard_padding">
  35. <FrameLayout
  36. android:id="@+id/drawer_user_avatars"
  37. android:layout_width="match_parent"
  38. android:layout_height="wrap_content"
  39. android:layout_gravity="top"
  40. android:layout_marginBottom="@dimen/standard_half_margin">
  41. <ImageView
  42. android:id="@+id/drawer_current_account"
  43. android:layout_width="@dimen/nav_drawer_header_avatar"
  44. android:layout_height="@dimen/nav_drawer_header_avatar"
  45. android:src="@drawable/ic_account_circle"
  46. android:contentDescription="@string/drawer_current_account"/>
  47. <ImageView
  48. android:id="@+id/drawer_account_middle"
  49. android:layout_width="@dimen/nav_drawer_header_avatar_other_accounts_size"
  50. android:layout_height="@dimen/nav_drawer_header_avatar_other_accounts_size"
  51. android:layout_gravity="end"
  52. android:layout_marginEnd="@dimen/nav_drawer_header_avatar_second_account_margin"
  53. android:layout_marginRight="@dimen/nav_drawer_header_avatar_second_account_margin"
  54. android:src="@drawable/ic_account_circle"
  55. android:onClick="onAccountDrawerClick"
  56. android:contentDescription="@string/drawer_middle_account"/>
  57. <ImageView
  58. android:id="@+id/drawer_account_end"
  59. android:layout_width="@dimen/nav_drawer_header_avatar_other_accounts_size"
  60. android:layout_height="@dimen/nav_drawer_header_avatar_other_accounts_size"
  61. android:layout_gravity="end"
  62. android:src="@drawable/ic_account_circle"
  63. android:onClick="onAccountDrawerClick"
  64. android:contentDescription="@string/drawer_end_account"/>
  65. </FrameLayout>
  66. <LinearLayout
  67. android:layout_width="match_parent"
  68. android:layout_height="wrap_content"
  69. android:layout_below="@+id/drawer_user_avatars"
  70. >
  71. <LinearLayout
  72. android:layout_width="0dp"
  73. android:layout_height="wrap_content"
  74. android:layout_gravity="center_vertical"
  75. android:layout_weight="1"
  76. android:orientation="vertical"
  77. android:paddingEnd="@dimen/standard_half_padding"
  78. android:paddingRight="@dimen/standard_half_padding"
  79. android:paddingStart="@dimen/zero"
  80. android:paddingLeft="@dimen/zero">
  81. <TextView
  82. android:id="@+id/drawer_username"
  83. android:layout_width="match_parent"
  84. android:layout_height="wrap_content"
  85. android:ellipsize="end"
  86. android:shadowColor="@color/black"
  87. android:shadowDx="0.5"
  88. android:shadowDy="0"
  89. android:shadowRadius="2"
  90. android:maxLines="1"
  91. android:text="@string/app_name"
  92. android:textColor="@android:color/white"
  93. android:textSize="@dimen/drawer_header_text"
  94. android:textStyle="bold"/>
  95. <TextView
  96. android:id="@+id/drawer_username_full"
  97. android:layout_width="match_parent"
  98. android:layout_height="wrap_content"
  99. android:ellipsize="end"
  100. android:lines="1"
  101. android:maxLines="1"
  102. android:shadowColor="@color/black"
  103. android:shadowDx="0.5"
  104. android:shadowDy="0"
  105. android:shadowRadius="2"
  106. android:text="@string/app_name"
  107. android:textColor="@android:color/white"
  108. android:textSize="@dimen/drawer_header_subtext"/>
  109. </LinearLayout>
  110. <ImageView
  111. android:id="@+id/drawer_account_chooser_toggle"
  112. android:layout_width="wrap_content"
  113. android:layout_height="wrap_content"
  114. android:layout_gravity="bottom"
  115. android:contentDescription="@string/drawer_manage_accounts"
  116. android:src="@drawable/ic_down"/>
  117. </LinearLayout>
  118. </RelativeLayout>
  119. </FrameLayout>