فهرست منبع

Merge pull request #1551 from owncloud/1413_share_view_enhancement_redo

Share view enhancement
David A. Velasco 9 سال پیش
والد
کامیت
5edc4a1df8
31فایلهای تغییر یافته به همراه362 افزوده شده و 271 حذف شده
  1. 1 1
      AndroidManifest.xml
  2. BIN
      res/drawable-hdpi/ic_close.png
  3. BIN
      res/drawable-hdpi/ic_group.png
  4. BIN
      res/drawable-hdpi/ic_search.png
  5. BIN
      res/drawable-hdpi/ic_user.png
  6. BIN
      res/drawable-mdpi/ic_close.png
  7. BIN
      res/drawable-mdpi/ic_group.png
  8. BIN
      res/drawable-mdpi/ic_search.png
  9. BIN
      res/drawable-mdpi/ic_user.png
  10. BIN
      res/drawable-xhdpi/ic_close.png
  11. BIN
      res/drawable-xhdpi/ic_group.png
  12. BIN
      res/drawable-xhdpi/ic_search.png
  13. BIN
      res/drawable-xhdpi/ic_user.png
  14. BIN
      res/drawable-xxhdpi/ic_close.png
  15. BIN
      res/drawable-xxhdpi/ic_group.png
  16. BIN
      res/drawable-xxhdpi/ic_search.png
  17. BIN
      res/drawable-xxhdpi/ic_user.png
  18. 33 11
      res/layout/edit_share_layout.xml
  19. 2 1
      res/layout/password_dialog.xml
  20. 17 4
      res/layout/search_users_groups_layout.xml
  21. 205 196
      res/layout/share_file_layout.xml
  22. 21 15
      res/layout/share_user_item.xml
  23. 3 0
      res/values/strings.xml
  24. 23 0
      res/values/styles.xml
  25. 7 1
      src/com/owncloud/android/providers/UsersAndGroupsSearchProvider.java
  26. 2 2
      src/com/owncloud/android/ui/activity/Uploader.java
  27. 5 0
      src/com/owncloud/android/ui/adapter/ShareUserListAdapter.java
  28. 2 1
      src/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java
  29. 15 11
      src/com/owncloud/android/ui/fragment/EditShareFragment.java
  30. 2 2
      src/com/owncloud/android/ui/fragment/SearchShareesFragment.java
  31. 24 26
      src/com/owncloud/android/ui/fragment/ShareFileFragment.java

+ 1 - 1
AndroidManifest.xml

@@ -208,7 +208,7 @@
         <activity
             android:name=".ui.activity.ShareActivity"
             android:label="@string/share_dialog_title"
-            android:theme="@style/Theme.ownCloud.Dialog"
+            android:theme="@style/Theme.ownCloud.Dialog.NoTitle"
             android:launchMode="singleTop"
             android:windowSoftInputMode="adjustResize" >
             <intent-filter>

BIN
res/drawable-hdpi/ic_close.png


BIN
res/drawable-hdpi/ic_group.png


BIN
res/drawable-hdpi/ic_search.png


BIN
res/drawable-hdpi/ic_user.png


BIN
res/drawable-mdpi/ic_close.png


BIN
res/drawable-mdpi/ic_group.png


BIN
res/drawable-mdpi/ic_search.png


BIN
res/drawable-mdpi/ic_user.png


BIN
res/drawable-xhdpi/ic_close.png


BIN
res/drawable-xhdpi/ic_group.png


BIN
res/drawable-xhdpi/ic_search.png


BIN
res/drawable-xhdpi/ic_user.png


BIN
res/drawable-xxhdpi/ic_close.png


BIN
res/drawable-xxhdpi/ic_group.png


BIN
res/drawable-xxhdpi/ic_search.png


BIN
res/drawable-xxhdpi/ic_user.png


+ 33 - 11
res/layout/edit_share_layout.xml

@@ -27,18 +27,41 @@
     <LinearLayout android:orientation="vertical"
                   android:layout_width="match_parent"
                   android:layout_height="wrap_content">
+        <TextView
+            android:id="@+id/editShareTitle"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:text="@string/share_with_edit_title"
+            android:textAppearance="@style/TextAppearance.AppCompat.Title"
+            android:padding="@dimen/standard_padding"
+            android:singleLine="true"
+            android:ellipsize="middle"
+            />
+
+        <View
+            android:id="@+id/share_header_divider"
+            android:layout_width="match_parent"
+            android:layout_height="2dp"
+            android:background="@color/owncloud_blue"
+            />
+    <LinearLayout
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/standard_margin"
+        android:layout_marginRight="@dimen/standard_margin"
+        android:layout_marginBottom="@dimen/standard_margin">
 
-        <Switch
+        <android.support.v7.widget.SwitchCompat
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:textSize="@dimen/two_line_primary_text_size"
             android:text="@string/share_privilege_can_edit"
             android:id="@+id/canEditSwitch"
             android:layout_gravity="start"
-            android:padding="@dimen/standard_half_padding"
             android:layout_marginTop="@dimen/standard_half_margin"
-            android:background="@color/actionbar_start_color"
-            android:textColor="@color/white"
+            android:textColor="@color/color_accent"
+            android:paddingLeft="0dp"
+            style="?android:attr/listSeparatorTextViewStyle"
             />
 
         <CheckBox
@@ -65,19 +88,18 @@
             android:visibility="gone"
             />
 
-        <Switch
+        <android.support.v7.widget.SwitchCompat
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:textSize="@dimen/two_line_primary_text_size"
             android:text="@string/share_privilege_can_share"
             android:id="@+id/canShareSwitch"
             android:layout_gravity="start"
-            android:padding="@dimen/standard_half_padding"
             android:layout_marginTop="@dimen/standard_half_margin"
-            android:background="@color/actionbar_start_color"
-            android:textColor="@color/white"
+            android:textColor="@color/color_accent"
+            android:paddingLeft="0dp"
+            style="?android:attr/listSeparatorTextViewStyle"
             />
-
+    </LinearLayout>
     </LinearLayout>
 
 </ScrollView>

+ 2 - 1
res/layout/password_dialog.xml

@@ -27,7 +27,8 @@
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:ems="10"
-		android:inputType="textPassword">
+		android:inputType="textPassword"
+        android:layout_margin="@dimen/standard_margin">
     </EditText>
 
 </LinearLayout>

+ 17 - 4
res/layout/search_users_groups_layout.xml

@@ -21,18 +21,31 @@
     android:layout_height="match_parent"
     android:orientation="vertical"
     android:id="@+id/search_layout"
-    android:minWidth="200dp">
+    android:minWidth="200dp"
+    android:layout_marginRight="@dimen/standard_margin"
+    android:layout_marginBottom="20dp">
 
-    <SearchView
+    <TextView
+        android:id="@+id/searchUserGroupsTitle"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/share_with_title"
+        android:textAppearance="@style/TextAppearance.AppCompat.Title"
+        android:padding="@dimen/standard_padding"/>
+
+    <android.support.v7.widget.SearchView
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:id="@+id/searchView"
-        android:hint="@string/share_search"/>
+        android:hint="@string/share_search"
+        style="@style/ownCloud.SearchView"/>
 
     <ListView
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:id="@+id/searchUsersListView"
-        android:scrollbars="vertical"/>
+        android:scrollbars="vertical"
+        android:layout_marginLeft="20dp"
+        android:layout_marginRight="@dimen/standard_half_margin"/>
 
 </LinearLayout>

+ 205 - 196
res/layout/share_file_layout.xml

@@ -15,17 +15,17 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
-            xmlns:tools="http://schemas.android.com/tools"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
-            tools:context="com.owncloud.android.ui.fragment.ShareFileFragment"
-            android:id="@+id/shareScroll">
+<ScrollView
+    android:id="@+id/shareScroll"
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    tools:context="com.owncloud.android.ui.fragment.ShareFileFragment">
 
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@color/background_material_light"
         android:orientation="vertical"
         >
 
@@ -33,245 +33,254 @@
             android:id="@+id/shareHeaderContainer"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_marginTop="6dp"
-            android:layout_marginBottom="6dp"
-            android:background="@color/background_color">
+            android:padding="@dimen/standard_padding">
 
             <ImageView
                 android:id="@+id/shareFileIcon"
                 android:layout_width="@dimen/file_icon_size"
                 android:layout_height="@dimen/file_icon_size"
-                android:src="@drawable/file"
-                android:layout_marginLeft="12dp"
-                android:layout_marginRight="12dp"
                 android:layout_gravity="center_vertical"
-                android:layout_marginTop="12dp"
-                android:layout_marginBottom="12dp"/>
+                android:layout_marginRight="@dimen/standard_half_margin"
+                android:src="@drawable/file"/>
 
             <TextView
                 android:id="@+id/shareFileName"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:text="@string/placeholder_filename"
-                android:textSize="16sp"
-                android:layout_gravity="center_vertical"
+                android:layout_marginEnd="@dimen/standard_half_margin"
                 android:layout_marginLeft="4dp"
+                android:layout_marginRight="@dimen/standard_half_margin"
                 android:layout_marginStart="4dp"
-                android:layout_marginRight="8dp"
-                android:layout_marginEnd="8dp"
-                android:layout_toRightOf="@+id/shareFileIcon"
                 android:layout_toEndOf="@+id/shareFileIcon"
-                android:singleLine="true"
+                android:layout_toRightOf="@+id/shareFileIcon"
                 android:ellipsize="middle"
-                android:layout_marginTop="12dp"/>
+                android:singleLine="true"
+                android:text="@string/placeholder_filename"
+                android:textColor="@color/black"
+                android:textSize="16sp"/>
 
             <TextView
+                android:id="@+id/shareFileSize"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:textSize="12sp"
-                android:text="@string/placeholder_filesize"
-                android:id="@+id/shareFileSize"
                 android:layout_below="@+id/shareFileName"
-                android:layout_toRightOf="@+id/shareFileIcon"
-                android:layout_toEndOf="@+id/shareFileIcon"
-                android:layout_marginTop="4dp"
+                android:layout_gravity="center_vertical"
                 android:layout_marginLeft="4dp"
-                android:layout_marginStart="4dp"
-                android:layout_marginBottom="12dp"
-                android:layout_gravity="center_vertical"/>
+                android:layout_toEndOf="@+id/shareFileIcon"
+                android:layout_toRightOf="@+id/shareFileIcon"
+                android:text="@string/placeholder_filesize"
+                android:textSize="12sp"/>
 
         </RelativeLayout>
 
-        <TextView
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:textSize="16sp"
-            android:text="@string/share_with_user_section_title"
-            android:id="@+id/shareWithUsersSectionTitle"
-            android:layout_gravity="start"
-            android:padding="8dp"
-            android:background="@color/actionbar_start_color"
-            android:textColor="@color/white"/>
-
-        <ListView
+        <View
+            android:id="@+id/share_header_divider"
             android:layout_width="match_parent"
-            android:layout_height="0dip"
-            android:id="@+id/shareUsersList"
-            android:visibility="gone"
-            android:scrollbars="vertical"
-            android:layout_weight="1"/>
+            android:layout_height="2dp"
+            android:background="@color/owncloud_blue"
+            />
 
-        <TextView
+        <LinearLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:id="@+id/shareNoUsers"
-            android:text="@string/share_no_users"
-            android:textSize="12sp"
-            android:padding="12dp" />
-
-        <android.support.v7.widget.AppCompatButton
-            android:id="@+id/addUserButton"
-            style="@style/ownCloud.Button"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_horizontal"
-            android:theme="@style/Button.Primary"
-            android:text="@string/share_add_user_or_group"
-            android:contentDescription="shareAddUserButton"/>
+            android:orientation="vertical"
+            android:padding="@dimen/standard_padding">
 
-        <Switch
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:textSize="16sp"
-            android:text="@string/share_via_link_section_title"
-            android:id="@+id/shareViaLinkSectionSwitch"
-            android:layout_gravity="start"
-            android:padding="8dp"
-            android:background="@color/actionbar_start_color"
-            android:textColor="@color/white"/>
+            <TextView
+                android:id="@+id/shareWithUsersSectionTitle"
+                style="?android:attr/listSeparatorTextViewStyle"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="start"
+                android:text="@string/share_with_user_section_title"
+                android:textColor="@color/color_accent"/>
 
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:id="@+id/shareViaLinkExpirationSection"
-            >
+            <ListView
+                android:id="@+id/shareUsersList"
+                android:layout_width="match_parent"
+                android:layout_height="0dip"
+                android:layout_weight="1"
+                android:paddingLeft="@dimen/standard_half_padding"
+                android:scrollbars="vertical"
+                android:visibility="gone"/>
 
-            <Switch
-                android:id="@+id/shareViaLinkExpirationSwitch"
-                android:layout_width="wrap_content"
+            <TextView
+                android:id="@+id/shareNoUsers"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:layout_alignParentEnd="true"
-                android:layout_centerInParent="true"
-                android:padding="8dp"
-                />
+                android:padding="@dimen/standard_half_padding"
+                android:text="@string/share_no_users"
+                android:textSize="12sp"/>
 
-            <TextView
-                android:id="@+id/shareViaLinkExpirationLabel"
-                android:layout_width="wrap_content"
+            <android.support.v7.widget.AppCompatButton
+                android:id="@+id/addUserButton"
+                style="@style/ownCloud.Button"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true"
-                android:layout_toLeftOf="@id/shareViaLinkExpirationSwitch"
-                android:layout_toStartOf="@id/shareViaLinkExpirationSwitch"
-                android:paddingTop="8dp"
-                android:paddingLeft="8dp"
-                android:paddingRight="8dp"
-                android:text="@string/share_via_link_expiration_date_label"
-                android:textSize="16sp"
-                />
+                android:layout_gravity="center_horizontal"
+                android:contentDescription="shareAddUserButton"
+                android:text="@string/share_add_user_or_group"
+                android:theme="@style/Button.Primary"/>
 
-            <TextView
-                android:id="@+id/shareViaLinkExpirationValue"
-                android:layout_width="wrap_content"
+            <android.support.v7.widget.SwitchCompat
+                android:id="@+id/shareViaLinkSectionSwitch"
+                style="?android:attr/listSeparatorTextViewStyle"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true"
-                android:layout_toLeftOf="@id/shareViaLinkExpirationSwitch"
-                android:layout_toStartOf="@id/shareViaLinkExpirationSwitch"
-                android:layout_below="@id/shareViaLinkExpirationLabel"
-                android:paddingLeft="8dp"
-                android:paddingRight="8dp"
-                android:paddingBottom="8dp"
-                android:textSize="12sp"
-                />
+                android:layout_gravity="start"
+                android:layout_marginTop="@dimen/standard_half_margin"
+                android:checked="false"
+                android:paddingRight="@dimen/standard_half_padding"
+                android:text="@string/share_via_link_section_title"
+                android:textColor="@color/color_accent"/>
 
-        </RelativeLayout>
+            <RelativeLayout
+                android:id="@+id/shareViaLinkExpirationSection"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="@dimen/standard_half_margin"
+                >
 
-        <RelativeLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:id="@+id/shareViaLinkPasswordSection"
-            >
+                <android.support.v7.widget.SwitchCompat
+                    android:id="@+id/shareViaLinkExpirationSwitch"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentEnd="true"
+                    android:layout_alignParentRight="true"
+                    android:layout_alignParentTop="true"
+                    android:checked="false"
+                    android:padding="@dimen/standard_half_padding"/>
 
-            <Switch
-                android:id="@+id/shareViaLinkPasswordSwitch"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:layout_alignParentEnd="true"
-                android:layout_centerInParent="true"
-                android:padding="8dp"
-            />
+                <TextView
+                    android:id="@+id/shareViaLinkExpirationLabel"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:layout_toLeftOf="@id/shareViaLinkExpirationSwitch"
+                    android:layout_toStartOf="@id/shareViaLinkExpirationSwitch"
+                    android:paddingLeft="@dimen/standard_half_padding"
+                    android:paddingRight="@dimen/standard_half_padding"
+                    android:paddingTop="@dimen/standard_half_padding"
+                    android:text="@string/share_via_link_expiration_date_label"
+                    android:textColor="@color/black"
+                    android:textSize="14sp"
+                    />
 
-            <TextView
-                android:id="@+id/shareViaLinkPasswordLabel"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true"
-                android:layout_toLeftOf="@id/shareViaLinkPasswordSwitch"
-                android:layout_toStartOf="@id/shareViaLinkPasswordSwitch"
-                android:paddingTop="8dp"
-                android:paddingLeft="8dp"
-                android:paddingRight="8dp"
-                android:text="@string/share_via_link_password_label"
-                android:textSize="16sp"
-                />
+                <TextView
+                    android:id="@+id/shareViaLinkExpirationValue"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:layout_below="@id/shareViaLinkExpirationLabel"
+                    android:layout_toLeftOf="@id/shareViaLinkExpirationSwitch"
+                    android:layout_toStartOf="@id/shareViaLinkExpirationSwitch"
+                    android:paddingBottom="@dimen/standard_half_padding"
+                    android:paddingLeft="@dimen/standard_half_padding"
+                    android:paddingRight="@dimen/standard_half_padding"
+                    android:textSize="12sp"
+                    />
 
-            <TextView
-                android:id="@+id/shareViaLinkPasswordValue"
-                android:layout_width="wrap_content"
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:id="@+id/shareViaLinkPasswordSection"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true"
-                android:layout_toLeftOf="@id/shareViaLinkPasswordSwitch"
-                android:layout_toStartOf="@id/shareViaLinkPasswordSwitch"
-                android:layout_below="@id/shareViaLinkPasswordLabel"
-                android:paddingLeft="8dp"
-                android:paddingRight="8dp"
-                android:paddingBottom="8dp"
-                android:text="@string/share_via_link_password_title"
-                android:textSize="12sp"
-                android:visibility="invisible"
-                />
+                >
 
-        </RelativeLayout>
+                <android.support.v7.widget.SwitchCompat
+                    android:id="@+id/shareViaLinkPasswordSwitch"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentEnd="true"
+                    android:layout_alignParentRight="true"
+                    android:layout_alignParentTop="true"
+                    android:padding="@dimen/standard_half_padding"
+                    />
 
-        <RelativeLayout
-            android:id="@+id/shareViaLinkEditPermissionSection"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="invisible"
-            >
+                <TextView
+                    android:id="@+id/shareViaLinkPasswordLabel"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:layout_toLeftOf="@id/shareViaLinkPasswordSwitch"
+                    android:layout_toStartOf="@id/shareViaLinkPasswordSwitch"
+                    android:paddingLeft="@dimen/standard_half_padding"
+                    android:paddingRight="@dimen/standard_half_padding"
+                    android:paddingTop="@dimen/standard_half_padding"
+                    android:text="@string/share_via_link_password_label"
+                    android:textColor="@color/black"
+                    android:textSize="14sp"
+                    />
 
-            <Switch
-                android:id="@+id/shareViaLinkEditPermissionSwitch"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_alignParentRight="true"
-                android:layout_alignParentEnd="true"
-                android:layout_centerInParent="true"
-                android:padding="8dp"
-                />
+                <TextView
+                    android:id="@+id/shareViaLinkPasswordValue"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:layout_below="@id/shareViaLinkPasswordLabel"
+                    android:layout_toLeftOf="@id/shareViaLinkPasswordSwitch"
+                    android:layout_toStartOf="@id/shareViaLinkPasswordSwitch"
+                    android:paddingBottom="@dimen/standard_half_padding"
+                    android:paddingLeft="@dimen/standard_half_padding"
+                    android:paddingRight="@dimen/standard_half_padding"
+                    android:text="@string/share_via_link_password_title"
+                    android:textSize="12sp"
+                    android:visibility="invisible"
+                    />
 
-            <TextView
-                android:id="@+id/shareViaLinkEditPermissionLabel"
-                android:layout_width="wrap_content"
+            </RelativeLayout>
+
+            <RelativeLayout
+                android:id="@+id/shareViaLinkEditPermissionSection"
+                android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_alignParentLeft="true"
-                android:layout_alignParentStart="true"
-                android:layout_toLeftOf="@id/shareViaLinkEditPermissionSwitch"
-                android:layout_toStartOf="@id/shareViaLinkEditPermissionSwitch"
-                android:paddingTop="8dp"
-                android:paddingLeft="8dp"
-                android:paddingRight="8dp"
-                android:text="@string/share_via_link_edit_permission_label"
-                android:textSize="16sp"
-                />
+                android:visibility="invisible"
+                >
 
-        </RelativeLayout>
+                <android.support.v7.widget.SwitchCompat
+                    android:id="@+id/shareViaLinkEditPermissionSwitch"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentEnd="true"
+                    android:layout_alignParentRight="true"
+                    android:layout_centerInParent="true"
+                    android:padding="@dimen/standard_half_padding"
+                    />
 
-        <android.support.v7.widget.AppCompatButton
-            android:id="@+id/shareViaLinkGetLinkButton"
-            style="@style/ownCloud.Button"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center_horizontal"
-            android:theme="@style/Button.Primary"
-            android:text="@string/share_get_public_link_button"
-            android:contentDescription="shareGetLinkButton"/>
+                <TextView
+                    android:id="@+id/shareViaLinkEditPermissionLabel"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_alignParentLeft="true"
+                    android:layout_alignParentStart="true"
+                    android:layout_toLeftOf="@id/shareViaLinkEditPermissionSwitch"
+                    android:layout_toStartOf="@id/shareViaLinkEditPermissionSwitch"
+                    android:paddingLeft="@dimen/standard_half_padding"
+                    android:paddingRight="@dimen/standard_half_padding"
+                    android:paddingTop="@dimen/standard_half_padding"
+                    android:text="@string/share_via_link_edit_permission_label"
+                    android:textColor="@color/black"
+                    android:textSize="14sp"
+                    />
+
+            </RelativeLayout>
+
+            <android.support.v7.widget.AppCompatButton
+                android:id="@+id/shareViaLinkGetLinkButton"
+                style="@style/ownCloud.Button"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_gravity="center_horizontal"
+                android:contentDescription="shareGetLinkButton"
+                android:text="@string/share_get_public_link_button"
+                android:theme="@style/Button.Primary"/>
 
+        </LinearLayout>
     </LinearLayout>
 
 </ScrollView>

+ 21 - 15
res/layout/share_user_item.xml

@@ -26,42 +26,48 @@
         android:orientation="horizontal"
         android:weightSum="1"
         android:longClickable="true">
+        <ImageView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:id="@+id/icon"
+            android:src="@drawable/ic_user"
+            android:layout_gravity="center_vertical"/>
+
         <TextView
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_weight="0.8"
+            android:layout_weight="1"
             android:textSize="@dimen/two_line_primary_text_size"
             android:text="@string/username"
             android:id="@+id/userOrGroupName"
-            android:layout_margin="12dp"
+            android:layout_marginTop="@dimen/standard_half_margin"
+            android:layout_marginBottom="@dimen/standard_half_margin"
+            android:layout_marginLeft="@dimen/standard_half_margin"
             android:textColor="@color/textColor"
             android:singleLine="true"
-            android:ellipsize="middle"/>
+            android:ellipsize="middle"
+            android:layout_gravity="center_vertical"/>
 
         <ImageView
-            android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_weight="0.1"
+            android:layout_width="36dp"
+            android:layout_height="36dp"
             android:id="@+id/unshareButton"
             android:src="@drawable/ic_action_delete"
-            android:layout_marginRight="@dimen/standard_margin"
-            android:layout_marginEnd="@dimen/standard_margin"
-            android:layout_gravity="center_horizontal"/>
+            android:layout_gravity="center_vertical"
+            android:padding="@dimen/standard_half_padding"/>
 
         <ImageView
             android:layout_width="wrap_content"
-            android:layout_height="match_parent"
-            android:layout_weight="0.1"
+            android:layout_height="wrap_content"
             android:id="@+id/editShareButton"
             android:src="@drawable/ic_navigate_next"
-            android:layout_marginRight="@dimen/standard_margin"
-            android:layout_marginEnd="@dimen/standard_margin"
-            android:layout_gravity="center_horizontal"/>
+            android:padding="@dimen/standard_half_padding"
+            android:layout_gravity="center_vertical"/>
 
     </LinearLayout>
 
     <View
         android:layout_width="match_parent"
         android:layout_height="1dp"
-        android:background="@color/list_divider_background"></View>
+        android:background="@color/list_divider_background" />
 </LinearLayout>

+ 3 - 0
res/values/strings.xml

@@ -375,6 +375,7 @@
     <string name="pref_behaviour_entries_move">moved to app folder</string>
 
     <string name="share_dialog_title">Sharing</string>
+    <string name="share_file">Share %1$s</string>
     <string name="share_with_user_section_title">Share with users and groups</string>
     <string name="share_no_users">No data shared with users yet</string>
     <string name="share_add_user_or_group">Add user or group</string>
@@ -384,6 +385,8 @@
     <string name="share_via_link_password_title">Secured</string>
     <string name="share_via_link_edit_permission_label">Allow editing</string>
     <string name="share_get_public_link_button">Get link</string>
+    <string name="share_with_title">Share with &#8230;</string>
+    <string name="share_with_edit_title">Share with %1$s</string>
 
     <string name="share_search">Search</string>
 

+ 23 - 0
res/values/styles.xml

@@ -29,6 +29,7 @@
 		<item name="colorAccent">@color/color_accent</item>
 		<item name="android:alertDialogTheme">@style/Theme.ownCloud.Dialog</item>
 		<item name="alertDialogTheme">@style/ownCloud.AlertDialog</item>
+		<item name="searchViewStyle">@style/ownCloud.SearchView</item>
 	</style>
 
 	<!-- seperate action bar style for activities without an action bar -->
@@ -40,6 +41,7 @@
 		<item name="colorAccent">@color/color_accent</item>
 		<item name="android:alertDialogTheme">@style/Theme.ownCloud.Dialog</item>
 		<item name="alertDialogTheme">@style/ownCloud.AlertDialog</item>
+		<item name="searchViewStyle">@style/ownCloud.SearchView</item>
     </style>
 
 	<style name="Theme.ownCloud.noActionBar.Login" parent="Theme.ownCloud.noActionBar">
@@ -49,10 +51,12 @@
 	<style name="ownCloud.AlertDialog" parent="Theme.AppCompat.Light.Dialog.Alert">
 		<item name="colorAccent">@color/color_accent</item>
 		<item name="android:textColorPrimary">@color/primary</item>
+		<item name="searchViewStyle">@style/ownCloud.SearchView</item>
 	</style>
 
 	<style name="ownCloud.Dialog" parent="Theme.AppCompat.Light.Dialog">
 		<item name="colorAccent">@color/color_accent</item>
+		<item name="searchViewStyle">@style/ownCloud.SearchView</item>
 	</style>
 
 	<style name="ProgressDialogTheme" parent="ownCloud.Dialog">
@@ -63,6 +67,15 @@
 		<item name="android:windowTitleBackgroundStyle">@drawable/process_dialog_background</item>
 	</style>
 
+	<style name="ownCloud.SearchView" parent="Widget.AppCompat.SearchView">
+		<!-- Close button icon -->
+		<item name="closeIcon">@drawable/ic_close</item>
+		<!-- Search button icon -->
+		<item name="searchIcon">@drawable/ic_search</item>
+		<!-- Layout for query suggestion rows // unused for now, staying with the standard layout -->
+		<!--<item name="suggestionRowLayout">...</item>-->
+	</style>
+
 	<style name="ownCloud.Button" parent="Widget.AppCompat.Button">
 		<item name="colorButtonNormal">@color/primary</item>
 	</style>
@@ -130,6 +143,16 @@
 		<item name="buttonBarStyle">@style/Theme.ownCloud.Dialog.ButtonBar</item>
 	</style>
 
+	<style name="Theme.ownCloud.Dialog.NoTitle" parent="style/Theme.ownCloud.Dialog">
+		<item name="windowNoTitle">true</item>
+		<item name="colorAccent">@color/owncloud_blue_accent</item>
+	</style>
+
+	<style name="Theme.ownCloud.Dialog.NoButtonBarStyle" parent="style/Theme.AppCompat.Light.Dialog.Alert">
+		<item name="windowNoTitle">false</item>
+		<item name="colorAccent">@color/owncloud_blue_accent</item>
+	</style>
+
 	<style name="menu_labels_style">
 		<item name="android:background">@drawable/fab_label_background</item>
 		<item name="android:textColor">@color/fab_white</item>

+ 7 - 1
src/com/owncloud/android/providers/UsersAndGroupsSearchProvider.java

@@ -63,6 +63,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
     private static final String[] COLUMNS = {
             BaseColumns._ID,
             SearchManager.SUGGEST_COLUMN_TEXT_1,
+            SearchManager.SUGGEST_COLUMN_ICON_1,
             SearchManager.SUGGEST_COLUMN_INTENT_DATA
     };
 
@@ -122,7 +123,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
      * @param selection     Expected to be NULL.
      * @param selectionArgs Expected to be NULL.
      * @param sortOrder     Expected to be NULL.
-     * @return Cursor with users and groups in the ownCloud server that match 'userQuery'.
+     * @return              Cursor with users and groups in the ownCloud server that match 'userQuery'.
      */
     @Nullable
     @Override
@@ -171,6 +172,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
             Iterator<JSONObject> namesIt = names.iterator();
             JSONObject item;
             String displayName = null;
+            int icon = 0;
             Uri dataUri = null;
             int count = 0;
 
@@ -192,8 +194,10 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
 
                     if (ShareType.GROUP.getValue() == type) {
                         displayName = getContext().getString(R.string.share_group_clarification, userName);
+                        icon = R.drawable.ic_group;
                         dataUri = Uri.withAppendedPath(groupBaseUri, shareWith);
                     } else if (ShareType.FEDERATED.getValue() == type && federatedShareAllowed) {
+                        icon = R.drawable.ic_user;
                         if (userName.equals(shareWith)) {
                             displayName = getContext().getString(R.string.share_remote_clarification, userName);
                         } else {
@@ -204,6 +208,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
                         dataUri = Uri.withAppendedPath(remoteBaseUri, shareWith);
                     } else if (ShareType.USER.getValue() == type) {
                         displayName = userName;
+                        icon = R.drawable.ic_user;
                         dataUri = Uri.withAppendedPath(userBaseUri, shareWith);
                     }
 
@@ -211,6 +216,7 @@ public class UsersAndGroupsSearchProvider extends ContentProvider {
                         response.newRow()
                             .add(count++)             // BaseColumns._ID
                             .add(displayName)         // SearchManager.SUGGEST_COLUMN_TEXT_1
+                            .add(icon)                // SearchManager.SUGGEST_COLUMN_ICON_1
                             .add(dataUri);
                     }
                 }

+ 2 - 2
src/com/owncloud/android/ui/activity/Uploader.java

@@ -242,7 +242,7 @@ public class Uploader extends FileActivity
             });
             return pDialog;
         case DIALOG_NO_ACCOUNT:
-            builder.setIcon(android.R.drawable.ic_dialog_alert);
+            builder.setIcon(R.drawable.ic_warning);
             builder.setTitle(R.string.uploader_wrn_no_account_title);
             builder.setMessage(String.format(
                     getString(R.string.uploader_wrn_no_account_text), getString(R.string.app_name)));
@@ -307,7 +307,7 @@ public class Uploader extends FileActivity
             });
             return builder.create();
         case DIALOG_NO_STREAM:
-            builder.setIcon(android.R.drawable.ic_dialog_alert);
+            builder.setIcon(R.drawable.ic_warning);
             builder.setTitle(R.string.uploader_wrn_no_content_title);
             builder.setMessage(R.string.uploader_wrn_no_content_text);
             builder.setCancelable(false);

+ 5 - 0
src/com/owncloud/android/ui/adapter/ShareUserListAdapter.java

@@ -21,6 +21,7 @@
 package com.owncloud.android.ui.adapter;
 
 import android.content.Context;
+import android.graphics.drawable.Drawable;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -76,11 +77,15 @@ public class ShareUserListAdapter extends ArrayAdapter {
             OCShare share = mShares.get(position);
 
             TextView userName = (TextView) view.findViewById(R.id.userOrGroupName);
+            ImageView iconView = (ImageView) view.findViewById(R.id.icon);
             String name = share.getSharedWithDisplayName();
+            Drawable icon = getContext().getResources().getDrawable(R.drawable.ic_user);
             if (share.getShareType() == ShareType.GROUP) {
                 name = getContext().getString(R.string.share_group_clarification, name);
+                icon = getContext().getResources().getDrawable(R.drawable.ic_group);
             }
             userName.setText(name);
+            iconView.setImageDrawable(icon);
 
             /// bind listener to edit privileges
             final ImageView editShareButton = (ImageView) view.findViewById(R.id.editShareButton);

+ 2 - 1
src/com/owncloud/android/ui/dialog/SharePasswordDialogFragment.java

@@ -83,7 +83,8 @@ public class SharePasswordDialogFragment extends DialogFragment
         inputText.requestFocus();
 
         // Build the dialog
-        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
+        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(),
+                R.style.Theme_ownCloud_Dialog_NoButtonBarStyle);
         builder.setView(v)
                .setPositiveButton(R.string.common_ok, this)
                .setNegativeButton(R.string.common_cancel, this)

+ 15 - 11
src/com/owncloud/android/ui/fragment/EditShareFragment.java

@@ -24,12 +24,13 @@ package com.owncloud.android.ui.fragment;
 import android.accounts.Account;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
+import android.support.v7.widget.SwitchCompat;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.CheckBox;
 import android.widget.CompoundButton;
-import android.widget.Switch;
+import android.widget.TextView;
 
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.FileDataStorageManager;
@@ -130,6 +131,9 @@ public class EditShareFragment extends Fragment {
         // Inflate the layout for this fragment
         View view = inflater.inflate(R.layout.edit_share_layout, container, false);
 
+        ((TextView)view.findViewById(R.id.editShareTitle)).setText(
+                getResources().getString(R.string.share_with_edit_title, mShare.getSharedWithDisplayName()));
+
         // Setup layout
         refreshUiFromState(view);
 
@@ -224,7 +228,7 @@ public class EditShareFragment extends Fragment {
             implements CompoundButton.OnCheckedChangeListener {
 
         /**
-         * Called by every {@link Switch} and {@link CheckBox} in the fragment to update
+         * Called by every {@link SwitchCompat} and {@link CheckBox} in the fragment to update
          * the state of its associated permission.
          *
          * @param compound  {@link CompoundButton} toggled by the user
@@ -309,7 +313,7 @@ public class EditShareFragment extends Fragment {
         }
 
         /**
-         * Sync value of "can edit" {@link Switch} according to a change in one of its subordinate checkboxes.
+         * Sync value of "can edit" {@link SwitchCompat} according to a change in one of its subordinate checkboxes.
          *
          * If all the subordinates are disabled, "can edit" has to be disabled.
          *
@@ -427,23 +431,23 @@ public class EditShareFragment extends Fragment {
     }
 
     /**
-     * Shortcut to access {@link Switch} R.id.canShareSwitch
+     * Shortcut to access {@link SwitchCompat} R.id.canShareSwitch
      *
-     * @return  {@link Switch} R.id.canShareCheckBox or null if called before
+     * @return  {@link SwitchCompat} R.id.canShareCheckBox or null if called before
      *          {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)} finished.
      */
-    private Switch getCanShareSwitch() {
-        return (Switch) getView().findViewById(R.id.canShareSwitch);
+    private SwitchCompat getCanShareSwitch() {
+        return (SwitchCompat) getView().findViewById(R.id.canShareSwitch);
     }
 
     /**
-     * Shortcut to access {@link Switch} R.id.canEditSwitch
+     * Shortcut to access {@link SwitchCompat} R.id.canEditSwitch
      *
-     * @return  {@link Switch} R.id.canEditSwitch or null if called before
+     * @return  {@link SwitchCompat} R.id.canEditSwitch or null if called before
      *          {@link #onCreateView(LayoutInflater, ViewGroup, Bundle)} finished.
      */
-    private Switch getCanEditSwitch() {
-        return (Switch) getView().findViewById(R.id.canEditSwitch);
+    private SwitchCompat getCanEditSwitch() {
+        return (SwitchCompat) getView().findViewById(R.id.canEditSwitch);
     }
 
     /**

+ 2 - 2
src/com/owncloud/android/ui/fragment/SearchShareesFragment.java

@@ -27,13 +27,13 @@ import android.app.SearchManager;
 import android.content.Context;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
+import android.support.v7.widget.SearchView;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.ListView;
-import android.widget.SearchView;
 
 import com.owncloud.android.R;
 import com.owncloud.android.datamodel.OCFile;
@@ -147,7 +147,7 @@ public class SearchShareesFragment extends Fragment implements ShareUserListAdap
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
 
-        getActivity().setTitle(R.string.share_dialog_title);
+        getActivity().setTitle(R.string.share_with_title);
 
         // Load data into the list
         refreshUsersOrGroupsListFromDB();

+ 24 - 26
src/com/owncloud/android/ui/fragment/ShareFileFragment.java

@@ -27,6 +27,7 @@ import android.graphics.Bitmap;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.SwitchCompat;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -36,7 +37,6 @@ import android.widget.ImageView;
 import android.widget.ListAdapter;
 import android.widget.ListView;
 import android.widget.ScrollView;
-import android.widget.Switch;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -201,8 +201,8 @@ public class ShareFileFragment extends Fragment
             }
         }
         // Name
-        TextView filename = (TextView) view.findViewById(R.id.shareFileName);
-        filename.setText(mFile.getFileName());
+        TextView fileNameHeader = (TextView) view.findViewById(R.id.shareFileName);
+        fileNameHeader.setText(getResources().getString(R.string.share_file, mFile.getFileName()));
         // Size
         TextView size = (TextView) view.findViewById(R.id.shareFileSize);
         if (mFile.isFolder()) {
@@ -252,7 +252,7 @@ public class ShareFileFragment extends Fragment
      */
     private void initShareViaLinkListener(View shareView) {
         mOnShareViaLinkSwitchCheckedChangeListener = new OnShareViaLinkListener();
-        Switch shareViaLinkSwitch = (Switch) shareView.findViewById(R.id.shareViaLinkSectionSwitch);
+        SwitchCompat shareViaLinkSwitch = (SwitchCompat) shareView.findViewById(R.id.shareViaLinkSectionSwitch);
         shareViaLinkSwitch.setOnCheckedChangeListener(mOnShareViaLinkSwitchCheckedChangeListener);
     }
 
@@ -265,7 +265,7 @@ public class ShareFileFragment extends Fragment
         /**
          * Called by R.id.shareViaLinkSectionSwitch to create or delete a public link.
          *
-         * @param switchView {@link Switch} toggled by the user, R.id.shareViaLinkSectionSwitch
+         * @param switchView {@link SwitchCompat} toggled by the user, R.id.shareViaLinkSectionSwitch
          * @param isChecked  New switch state.
          */
         @Override
@@ -314,7 +314,7 @@ public class ShareFileFragment extends Fragment
     private void initExpirationListener(View shareView) {
         mOnExpirationDateInteractionListener = new OnExpirationDateInteractionListener();
 
-        ((Switch) shareView.findViewById(R.id.shareViaLinkExpirationSwitch)).
+        ((SwitchCompat) shareView.findViewById(R.id.shareViaLinkExpirationSwitch)).
                 setOnCheckedChangeListener(mOnExpirationDateInteractionListener);
 
         shareView.findViewById(R.id.shareViaLinkExpirationLabel).
@@ -333,7 +333,7 @@ public class ShareFileFragment extends Fragment
         /**
          * Called by R.id.shareViaLinkExpirationSwitch to set or clear the expiration date.
          *
-         * @param switchView {@link Switch} toggled by the user, R.id.shareViaLinkExpirationSwitch
+         * @param switchView {@link SwitchCompat} toggled by the user, R.id.shareViaLinkExpirationSwitch
          * @param isChecked  New switch state.
          */
         @Override
@@ -398,7 +398,7 @@ public class ShareFileFragment extends Fragment
     private void initPasswordListener(View shareView) {
         mOnPasswordInteractionListener = new OnPasswordInteractionListener();
 
-        ((Switch) shareView.findViewById(R.id.shareViaLinkPasswordSwitch)).
+        ((SwitchCompat) shareView.findViewById(R.id.shareViaLinkPasswordSwitch)).
                 setOnCheckedChangeListener(mOnPasswordInteractionListener);
 
         shareView.findViewById(R.id.shareViaLinkPasswordLabel).
@@ -418,7 +418,7 @@ public class ShareFileFragment extends Fragment
         /**
          * Called by R.id.shareViaLinkPasswordSwitch to set or clear the password.
          *
-         * @param switchView {@link Switch} toggled by the user, R.id.shareViaLinkPasswordSwitch
+         * @param switchView {@link SwitchCompat} toggled by the user, R.id.shareViaLinkPasswordSwitch
          * @param isChecked  New switch state.
          */
         @Override
@@ -466,7 +466,7 @@ public class ShareFileFragment extends Fragment
     private void initEditPermissionListener(View shareView) {
         mOnEditPermissionInteractionListener = new OnEditPermissionInteractionListener();
 
-        ((Switch) shareView.findViewById(R.id.shareViaLinkEditPermissionSwitch)).
+        ((SwitchCompat) shareView.findViewById(R.id.shareViaLinkEditPermissionSwitch)).
                 setOnCheckedChangeListener(mOnEditPermissionInteractionListener);
 
     }
@@ -480,7 +480,7 @@ public class ShareFileFragment extends Fragment
         /**
          * Called by R.id.shareViaLinkEditPermissionSwitch to set or clear the edit permission.
          *
-         * @param switchView {@link Switch} toggled by the user, R.id.shareViaLinkEditPermissionSwitch
+         * @param switchView {@link SwitchCompat} toggled by the user, R.id.shareViaLinkEditPermissionSwitch
          * @param isChecked  New switch state.
          */
         @Override
@@ -512,8 +512,6 @@ public class ShareFileFragment extends Fragment
         super.onActivityCreated(savedInstanceState);
         Log_OC.d(TAG, "onActivityCreated");
 
-        getActivity().setTitle(R.string.share_dialog_title);
-
         // Load known capabilities of the server from DB
         refreshCapabilitiesFromDB();
 
@@ -660,7 +658,7 @@ public class ShareFileFragment extends Fragment
     private void updatePublicShareSection() {
         if (mPublicShare != null && ShareType.PUBLIC_LINK.equals(mPublicShare.getShareType())) {
             /// public share bound -> expand section
-            Switch shareViaLinkSwitch = getShareViaLinkSwitch();
+            SwitchCompat shareViaLinkSwitch = getShareViaLinkSwitch();
             if (!shareViaLinkSwitch.isChecked()) {
                 // set null listener before setChecked() to prevent infinite loop of calls
                 shareViaLinkSwitch.setOnCheckedChangeListener(null);
@@ -690,7 +688,7 @@ public class ShareFileFragment extends Fragment
             });
 
             /// update state of expiration date switch and message depending on expiration date
-            Switch expirationDateSwitch = getExpirationDateSwitch();
+            SwitchCompat expirationDateSwitch = getExpirationDateSwitch();
             // set null listener before setChecked() to prevent infinite loop of calls
             expirationDateSwitch.setOnCheckedChangeListener(null);
             long expirationDate = mPublicShare.getExpirationDate();
@@ -715,7 +713,7 @@ public class ShareFileFragment extends Fragment
             );
 
             /// update state of password switch and message depending on password protection
-            Switch passwordSwitch = getPasswordSwitch();
+            SwitchCompat passwordSwitch = getPasswordSwitch();
             // set null listener before setChecked() to prevent infinite loop of calls
             passwordSwitch.setOnCheckedChangeListener(null);
             if (mPublicShare.isPasswordProtected()) {
@@ -735,7 +733,7 @@ public class ShareFileFragment extends Fragment
             );
 
             /// update state of the edit permission switch
-            Switch editPermissionSwitch = getEditPermissionSwitch();
+            SwitchCompat editPermissionSwitch = getEditPermissionSwitch();
 
             // set null listener before setChecked() to prevent infinite loop of calls
             editPermissionSwitch.setOnCheckedChangeListener(null);
@@ -755,7 +753,7 @@ public class ShareFileFragment extends Fragment
 
         } else {
             /// no public share -> collapse section
-            Switch shareViaLinkSwitch = getShareViaLinkSwitch();
+            SwitchCompat shareViaLinkSwitch = getShareViaLinkSwitch();
             if (shareViaLinkSwitch.isChecked()) {
                 shareViaLinkSwitch.setOnCheckedChangeListener(null);
                 getShareViaLinkSwitch().setChecked(false);
@@ -773,16 +771,16 @@ public class ShareFileFragment extends Fragment
 
     /// BEWARE: next methods will failed with NullPointerException if called before onCreateView() finishes
 
-    private Switch getShareViaLinkSwitch() {
-        return (Switch) getView().findViewById(R.id.shareViaLinkSectionSwitch);
+    private SwitchCompat getShareViaLinkSwitch() {
+        return (SwitchCompat) getView().findViewById(R.id.shareViaLinkSectionSwitch);
     }
 
     private View getExpirationDateSection() {
         return getView().findViewById(R.id.shareViaLinkExpirationSection);
     }
 
-    private Switch getExpirationDateSwitch() {
-        return (Switch) getView().findViewById(R.id.shareViaLinkExpirationSwitch);
+    private SwitchCompat getExpirationDateSwitch() {
+        return (SwitchCompat) getView().findViewById(R.id.shareViaLinkExpirationSwitch);
     }
 
     private TextView getExpirationDateValue() {
@@ -793,8 +791,8 @@ public class ShareFileFragment extends Fragment
         return getView().findViewById(R.id.shareViaLinkPasswordSection);
     }
 
-    private Switch getPasswordSwitch() {
-        return (Switch) getView().findViewById(R.id.shareViaLinkPasswordSwitch);
+    private SwitchCompat getPasswordSwitch() {
+        return (SwitchCompat) getView().findViewById(R.id.shareViaLinkPasswordSwitch);
     }
 
     private TextView getPasswordValue() {
@@ -805,8 +803,8 @@ public class ShareFileFragment extends Fragment
         return getView().findViewById(R.id.shareViaLinkEditPermissionSection);
     }
 
-    private Switch getEditPermissionSwitch() {
-        return (Switch) getView().findViewById(R.id.shareViaLinkEditPermissionSwitch);
+    private SwitchCompat getEditPermissionSwitch() {
+        return (SwitchCompat) getView().findViewById(R.id.shareViaLinkEditPermissionSwitch);
     }
 
     private AppCompatButton getGetLinkButton() {