Browse Source

redone layouting ans AppCompat switch implementation

Andy Scherzinger 9 years ago
parent
commit
e195cdadd8

+ 205 - 196
res/layout/share_file_layout.xml

@@ -15,17 +15,17 @@
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
   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
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
-        android:background="@color/background_material_light"
         android:orientation="vertical"
         android:orientation="vertical"
         >
         >
 
 
@@ -33,245 +33,254 @@
             android:id="@+id/shareHeaderContainer"
             android:id="@+id/shareHeaderContainer"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginTop="6dp"
-            android:layout_marginBottom="6dp"
-            android:background="@color/background_color">
+            android:padding="@dimen/standard_padding">
 
 
             <ImageView
             <ImageView
                 android:id="@+id/shareFileIcon"
                 android:id="@+id/shareFileIcon"
                 android:layout_width="@dimen/file_icon_size"
                 android:layout_width="@dimen/file_icon_size"
                 android:layout_height="@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_gravity="center_vertical"
-                android:layout_marginTop="12dp"
-                android:layout_marginBottom="12dp"/>
+                android:layout_marginRight="@dimen/standard_half_margin"
+                android:src="@drawable/file"/>
 
 
             <TextView
             <TextView
                 android:id="@+id/shareFileName"
                 android:id="@+id/shareFileName"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_height="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_marginLeft="4dp"
+                android:layout_marginRight="@dimen/standard_half_margin"
                 android:layout_marginStart="4dp"
                 android:layout_marginStart="4dp"
-                android:layout_marginRight="8dp"
-                android:layout_marginEnd="8dp"
-                android:layout_toRightOf="@+id/shareFileIcon"
                 android:layout_toEndOf="@+id/shareFileIcon"
                 android:layout_toEndOf="@+id/shareFileIcon"
-                android:singleLine="true"
+                android:layout_toRightOf="@+id/shareFileIcon"
                 android:ellipsize="middle"
                 android:ellipsize="middle"
-                android:layout_marginTop="12dp"/>
+                android:singleLine="true"
+                android:text="@string/placeholder_filename"
+                android:textColor="@color/black"
+                android:textSize="16sp"/>
 
 
             <TextView
             <TextView
+                android:id="@+id/shareFileSize"
                 android:layout_width="wrap_content"
                 android:layout_width="wrap_content"
                 android:layout_height="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_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_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>
         </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_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_width="match_parent"
             android:layout_height="wrap_content"
             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_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_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_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_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_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>
     </LinearLayout>
 
 
 </ScrollView>
 </ScrollView>

+ 21 - 15
res/layout/share_user_item.xml

@@ -26,42 +26,48 @@
         android:orientation="horizontal"
         android:orientation="horizontal"
         android:weightSum="1"
         android:weightSum="1"
         android:longClickable="true">
         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
         <TextView
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_weight="0.8"
+            android:layout_weight="1"
             android:textSize="@dimen/two_line_primary_text_size"
             android:textSize="@dimen/two_line_primary_text_size"
             android:text="@string/username"
             android:text="@string/username"
             android:id="@+id/userOrGroupName"
             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:textColor="@color/textColor"
             android:singleLine="true"
             android:singleLine="true"
-            android:ellipsize="middle"/>
+            android:ellipsize="middle"
+            android:layout_gravity="center_vertical"/>
 
 
         <ImageView
         <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:id="@+id/unshareButton"
             android:src="@drawable/ic_action_delete"
             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
         <ImageView
             android:layout_width="wrap_content"
             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:id="@+id/editShareButton"
             android:src="@drawable/ic_navigate_next"
             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>
     </LinearLayout>
 
 
     <View
     <View
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="1dp"
         android:layout_height="1dp"
-        android:background="@color/list_divider_background"></View>
+        android:background="@color/list_divider_background" />
 </LinearLayout>
 </LinearLayout>

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

@@ -27,6 +27,7 @@ import android.graphics.Bitmap;
 import android.os.Bundle;
 import android.os.Bundle;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.Fragment;
 import android.support.v7.widget.AppCompatButton;
 import android.support.v7.widget.AppCompatButton;
+import android.support.v7.widget.SwitchCompat;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
@@ -36,7 +37,6 @@ import android.widget.ImageView;
 import android.widget.ListAdapter;
 import android.widget.ListAdapter;
 import android.widget.ListView;
 import android.widget.ListView;
 import android.widget.ScrollView;
 import android.widget.ScrollView;
-import android.widget.Switch;
 import android.widget.TextView;
 import android.widget.TextView;
 import android.widget.Toast;
 import android.widget.Toast;
 
 
@@ -252,7 +252,7 @@ public class ShareFileFragment extends Fragment
      */
      */
     private void initShareViaLinkListener(View shareView) {
     private void initShareViaLinkListener(View shareView) {
         mOnShareViaLinkSwitchCheckedChangeListener = new OnShareViaLinkListener();
         mOnShareViaLinkSwitchCheckedChangeListener = new OnShareViaLinkListener();
-        Switch shareViaLinkSwitch = (Switch) shareView.findViewById(R.id.shareViaLinkSectionSwitch);
+        SwitchCompat shareViaLinkSwitch = (SwitchCompat) shareView.findViewById(R.id.shareViaLinkSectionSwitch);
         shareViaLinkSwitch.setOnCheckedChangeListener(mOnShareViaLinkSwitchCheckedChangeListener);
         shareViaLinkSwitch.setOnCheckedChangeListener(mOnShareViaLinkSwitchCheckedChangeListener);
     }
     }
 
 
@@ -265,7 +265,7 @@ public class ShareFileFragment extends Fragment
         /**
         /**
          * Called by R.id.shareViaLinkSectionSwitch to create or delete a public link.
          * 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.
          * @param isChecked  New switch state.
          */
          */
         @Override
         @Override
@@ -314,7 +314,7 @@ public class ShareFileFragment extends Fragment
     private void initExpirationListener(View shareView) {
     private void initExpirationListener(View shareView) {
         mOnExpirationDateInteractionListener = new OnExpirationDateInteractionListener();
         mOnExpirationDateInteractionListener = new OnExpirationDateInteractionListener();
 
 
-        ((Switch) shareView.findViewById(R.id.shareViaLinkExpirationSwitch)).
+        ((SwitchCompat) shareView.findViewById(R.id.shareViaLinkExpirationSwitch)).
                 setOnCheckedChangeListener(mOnExpirationDateInteractionListener);
                 setOnCheckedChangeListener(mOnExpirationDateInteractionListener);
 
 
         shareView.findViewById(R.id.shareViaLinkExpirationLabel).
         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.
          * 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.
          * @param isChecked  New switch state.
          */
          */
         @Override
         @Override
@@ -398,7 +398,7 @@ public class ShareFileFragment extends Fragment
     private void initPasswordListener(View shareView) {
     private void initPasswordListener(View shareView) {
         mOnPasswordInteractionListener = new OnPasswordInteractionListener();
         mOnPasswordInteractionListener = new OnPasswordInteractionListener();
 
 
-        ((Switch) shareView.findViewById(R.id.shareViaLinkPasswordSwitch)).
+        ((SwitchCompat) shareView.findViewById(R.id.shareViaLinkPasswordSwitch)).
                 setOnCheckedChangeListener(mOnPasswordInteractionListener);
                 setOnCheckedChangeListener(mOnPasswordInteractionListener);
 
 
         shareView.findViewById(R.id.shareViaLinkPasswordLabel).
         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.
          * 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.
          * @param isChecked  New switch state.
          */
          */
         @Override
         @Override
@@ -466,7 +466,7 @@ public class ShareFileFragment extends Fragment
     private void initEditPermissionListener(View shareView) {
     private void initEditPermissionListener(View shareView) {
         mOnEditPermissionInteractionListener = new OnEditPermissionInteractionListener();
         mOnEditPermissionInteractionListener = new OnEditPermissionInteractionListener();
 
 
-        ((Switch) shareView.findViewById(R.id.shareViaLinkEditPermissionSwitch)).
+        ((SwitchCompat) shareView.findViewById(R.id.shareViaLinkEditPermissionSwitch)).
                 setOnCheckedChangeListener(mOnEditPermissionInteractionListener);
                 setOnCheckedChangeListener(mOnEditPermissionInteractionListener);
 
 
     }
     }
@@ -480,7 +480,7 @@ public class ShareFileFragment extends Fragment
         /**
         /**
          * Called by R.id.shareViaLinkEditPermissionSwitch to set or clear the edit permission.
          * 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.
          * @param isChecked  New switch state.
          */
          */
         @Override
         @Override
@@ -660,7 +660,7 @@ public class ShareFileFragment extends Fragment
     private void updatePublicShareSection() {
     private void updatePublicShareSection() {
         if (mPublicShare != null && ShareType.PUBLIC_LINK.equals(mPublicShare.getShareType())) {
         if (mPublicShare != null && ShareType.PUBLIC_LINK.equals(mPublicShare.getShareType())) {
             /// public share bound -> expand section
             /// public share bound -> expand section
-            Switch shareViaLinkSwitch = getShareViaLinkSwitch();
+            SwitchCompat shareViaLinkSwitch = getShareViaLinkSwitch();
             if (!shareViaLinkSwitch.isChecked()) {
             if (!shareViaLinkSwitch.isChecked()) {
                 // set null listener before setChecked() to prevent infinite loop of calls
                 // set null listener before setChecked() to prevent infinite loop of calls
                 shareViaLinkSwitch.setOnCheckedChangeListener(null);
                 shareViaLinkSwitch.setOnCheckedChangeListener(null);
@@ -690,7 +690,7 @@ public class ShareFileFragment extends Fragment
             });
             });
 
 
             /// update state of expiration date switch and message depending on expiration date
             /// 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
             // set null listener before setChecked() to prevent infinite loop of calls
             expirationDateSwitch.setOnCheckedChangeListener(null);
             expirationDateSwitch.setOnCheckedChangeListener(null);
             long expirationDate = mPublicShare.getExpirationDate();
             long expirationDate = mPublicShare.getExpirationDate();
@@ -715,7 +715,7 @@ public class ShareFileFragment extends Fragment
             );
             );
 
 
             /// update state of password switch and message depending on password protection
             /// 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
             // set null listener before setChecked() to prevent infinite loop of calls
             passwordSwitch.setOnCheckedChangeListener(null);
             passwordSwitch.setOnCheckedChangeListener(null);
             if (mPublicShare.isPasswordProtected()) {
             if (mPublicShare.isPasswordProtected()) {
@@ -735,7 +735,7 @@ public class ShareFileFragment extends Fragment
             );
             );
 
 
             /// update state of the edit permission switch
             /// update state of the edit permission switch
-            Switch editPermissionSwitch = getEditPermissionSwitch();
+            SwitchCompat editPermissionSwitch = getEditPermissionSwitch();
 
 
             // set null listener before setChecked() to prevent infinite loop of calls
             // set null listener before setChecked() to prevent infinite loop of calls
             editPermissionSwitch.setOnCheckedChangeListener(null);
             editPermissionSwitch.setOnCheckedChangeListener(null);
@@ -755,7 +755,7 @@ public class ShareFileFragment extends Fragment
 
 
         } else {
         } else {
             /// no public share -> collapse section
             /// no public share -> collapse section
-            Switch shareViaLinkSwitch = getShareViaLinkSwitch();
+            SwitchCompat shareViaLinkSwitch = getShareViaLinkSwitch();
             if (shareViaLinkSwitch.isChecked()) {
             if (shareViaLinkSwitch.isChecked()) {
                 shareViaLinkSwitch.setOnCheckedChangeListener(null);
                 shareViaLinkSwitch.setOnCheckedChangeListener(null);
                 getShareViaLinkSwitch().setChecked(false);
                 getShareViaLinkSwitch().setChecked(false);
@@ -773,16 +773,16 @@ public class ShareFileFragment extends Fragment
 
 
     /// BEWARE: next methods will failed with NullPointerException if called before onCreateView() finishes
     /// 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() {
     private View getExpirationDateSection() {
         return getView().findViewById(R.id.shareViaLinkExpirationSection);
         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() {
     private TextView getExpirationDateValue() {
@@ -793,8 +793,8 @@ public class ShareFileFragment extends Fragment
         return getView().findViewById(R.id.shareViaLinkPasswordSection);
         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() {
     private TextView getPasswordValue() {
@@ -805,8 +805,8 @@ public class ShareFileFragment extends Fragment
         return getView().findViewById(R.id.shareViaLinkEditPermissionSection);
         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() {
     private AppCompatButton getGetLinkButton() {