Browse Source

tweaked layout for preferences

AndyScherzinger 8 years ago
parent
commit
29d5e1e8cb

+ 50 - 55
res/layout/folder_sync_settings_layout.xml

@@ -33,6 +33,13 @@
         android:text="@string/folder_sync_preferences"
         android:textAppearance="@style/TextAppearance.AppCompat.Title"/>
 
+    <TextView
+        android:id="@+id/folder_sync_settings_subtitle"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:text="@string/placeholder_filename"
+        android:textSize="@dimen/two_line_primary_text_size"/>
+
     <ScrollView
         android:id="@+id/details_scroll"
         android:layout_width="match_parent"
@@ -56,8 +63,8 @@
                     android:layout_width="0dp"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
-                    android:paddingBottom="16dip"
-                    android:paddingTop="16dip">
+                    android:paddingBottom="@dimen/standard_padding"
+                    android:paddingTop="@dimen/standard_padding">
 
                     <TextView
                         android:id="@+id/local_folder_title"
@@ -105,35 +112,27 @@
                 android:layout_height="wrap_content"
                 android:baselineAligned="false"
                 android:gravity="center_vertical"
-                android:minHeight="?android:attr/listPreferredItemHeightSmall">
+                android:minHeight="?android:attr/listPreferredItemHeightSmall"
+                android:orientation="vertical"
+                android:paddingBottom="@dimen/standard_padding"
+                android:paddingTop="@dimen/standard_padding">
 
-                <RelativeLayout
-                    android:layout_width="0dp"
+                <TextView
+                    android:id="@+id/remote_folder_title"
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:paddingBottom="16dip"
-                    android:paddingTop="16dip">
+                    android:maxLines="1"
+                    android:text="@string/prefs_folder_sync_remote_path_title"
+                    android:textAppearance="?attr/textAppearanceListItem"/>
 
-                    <TextView
-                        android:id="@+id/remote_folder_title"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:maxLines="1"
-                        android:text="@string/prefs_folder_sync_remote_path_title"
-                        android:textAppearance="?attr/textAppearanceListItem"/>
-
-                    <TextView
-                        android:id="@+id/remote_folder_summary"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_alignLeft="@id/remote_folder_title"
-                        android:layout_below="@id/remote_folder_title"
-                        android:ellipsize="middle"
-                        android:maxLines="2"
-                        android:text="@string/placeholder_filename"
-                        android:textColor="?android:attr/textColorSecondary"/>
-
-                </RelativeLayout>
+                <TextView
+                    android:id="@+id/remote_folder_summary"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:ellipsize="middle"
+                    android:maxLines="2"
+                    android:text="@string/placeholder_filename"
+                    android:textColor="?android:attr/textColorSecondary"/>
 
             </LinearLayout>
 
@@ -141,6 +140,7 @@
                 android:id="@+id/setting_instant_upload_on_wifi_container"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:baselineAligned="false"
                 android:clipToPadding="false"
                 android:gravity="center_vertical"
                 android:minHeight="?attr/listPreferredItemHeightSmall">
@@ -187,6 +187,7 @@
                 android:id="@+id/setting_instant_upload_on_charging_container"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:baselineAligned="false"
                 android:clipToPadding="false"
                 android:gravity="center_vertical"
                 android:minHeight="?attr/listPreferredItemHeightSmall">
@@ -233,6 +234,7 @@
                 android:id="@+id/setting_instant_upload_path_use_subfolders_container"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:baselineAligned="false"
                 android:clipToPadding="false"
                 android:gravity="center_vertical"
                 android:minHeight="?attr/listPreferredItemHeightSmall">
@@ -291,38 +293,31 @@
                 android:id="@+id/setting_instant_behaviour_container"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
+                android:baselineAligned="false"
                 android:clipToPadding="false"
                 android:gravity="center_vertical"
-                android:minHeight="?attr/listPreferredItemHeightSmall">
+                android:minHeight="?attr/listPreferredItemHeightSmall"
+                android:orientation="vertical"
+                android:paddingBottom="@dimen/standard_padding"
+                android:paddingTop="@dimen/standard_padding">
 
-                <RelativeLayout
-                    android:layout_width="0dp"
+                <TextView
+                    android:id="@+id/setting_instant_behaviour_title"
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_weight="1"
-                    android:paddingBottom="@dimen/standard_padding"
-                    android:paddingTop="@dimen/standard_padding">
-
-                    <TextView
-                        android:id="@+id/setting_instant_behaviour_title"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:ellipsize="marquee"
-                        android:maxLines="1"
-                        android:text="@string/prefs_instant_behaviour_title"
-                        android:textAppearance="?attr/textAppearanceListItem"/>
-
-                    <TextView
-                        android:id="@+id/setting_instant_behaviour_summary"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:layout_alignLeft="@id/setting_instant_behaviour_title"
-                        android:layout_below="@id/setting_instant_behaviour_title"
-                        android:ellipsize="end"
-                        android:maxLines="1"
-                        android:text="@string/placeholder_filename"
-                        android:textColor="?android:attr/textColorSecondary"/>
+                    android:ellipsize="marquee"
+                    android:maxLines="1"
+                    android:text="@string/prefs_instant_behaviour_title"
+                    android:textAppearance="?attr/textAppearanceListItem"/>
 
-                </RelativeLayout>
+                <TextView
+                    android:id="@+id/setting_instant_behaviour_summary"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:ellipsize="end"
+                    android:maxLines="1"
+                    android:text="@string/placeholder_filename"
+                    android:textColor="?android:attr/textColorSecondary"/>
 
             </LinearLayout>
 

+ 1 - 1
res/values/strings.xml

@@ -501,7 +501,7 @@
     <string name="choose_remote_folder">Choose folder&#8230;</string>
     <string name="folder_sync_loading_folders">Loading folders&#8230;</string>
     <string name="folder_sync_no_results">No media folders found.</string>
-    <string name="folder_sync_preferences">Folder Sync Preferences</string>
+    <string name="folder_sync_preferences">Instant Upload Preferences</string>
     <string name="folder_sync_settings">Settings</string>
     <string name="folder_sync_new_info">Instant upload has been revamped completely. Please see the main menu and re-configure your instant upload. Sorry for the inconvenience.\n\nEnjoy the new and extended instant upload capabilities!</string>
     <plurals name="items_selected_count">

+ 3 - 1
src/com/owncloud/android/ui/dialog/SyncedFolderPreferencesDialogFragment.java

@@ -54,12 +54,12 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
     private CharSequence[] mUploadBehaviorItemStrings;
 
     protected View mView = null;
-    private boolean mEnabled;
     private ImageView mEnabledIcon;
     private CheckBox mUploadOnWifiCheckbox;
     private CheckBox mUploadOnChargingCheckbox;
     private CheckBox mUploadUseSubfoldersCheckbox;
     private TextView mUploadBehaviorSummary;
+    private TextView mLocalFolderName;
     private TextView mLocalFolderSummary;
     private TextView mRemoteFolderSummary;
 
@@ -121,6 +121,7 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
      */
     private void setupDialogElements(View view) {
         // find/saves UI elements
+        mLocalFolderName = (TextView )view.findViewById(R.id.folder_sync_settings_subtitle);
         mEnabledIcon = (ImageView) view.findViewById(R.id.local_folder_status_icon);
         mLocalFolderSummary = (TextView) view.findViewById(R.id.local_folder_summary);
         mRemoteFolderSummary = (TextView) view.findViewById(R.id.remote_folder_summary);
@@ -134,6 +135,7 @@ public class SyncedFolderPreferencesDialogFragment extends DialogFragment {
 
         // Set values
         setEnabled(mSyncedFolder.getEnabled());
+        mLocalFolderName.setText(mSyncedFolder.getFolderName());
         mLocalFolderSummary.setText(mSyncedFolder.getLocalPath());
         mRemoteFolderSummary.setText(mSyncedFolder.getRemotePath());
 

+ 12 - 0
src/com/owncloud/android/ui/dialog/parcel/SyncedFolderParcelable.java

@@ -29,6 +29,7 @@ import com.owncloud.android.datamodel.SyncedFolderDisplayItem;
  * Parcelable for {@link SyncedFolderDisplayItem} objects to transport them from/to dialog fragments.
  */
 public class SyncedFolderParcelable implements Parcelable {
+    private String mFolderName;
     private String mLocalPath;
     private String mRemotePath;
     private Boolean mWifiOnly = false;
@@ -45,6 +46,7 @@ public class SyncedFolderParcelable implements Parcelable {
 
     public SyncedFolderParcelable(SyncedFolderDisplayItem syncedFolderDisplayItem, int section) {
         mId = syncedFolderDisplayItem.getId();
+        mFolderName = syncedFolderDisplayItem.getFolderName();
         mLocalPath = syncedFolderDisplayItem.getLocalPath();
         mRemotePath = syncedFolderDisplayItem.getRemotePath();
         mWifiOnly = syncedFolderDisplayItem.getWifiOnly();
@@ -58,6 +60,7 @@ public class SyncedFolderParcelable implements Parcelable {
 
     private SyncedFolderParcelable(Parcel read) {
         mId = read.readLong();
+        mFolderName = read.readString();
         mLocalPath = read.readString();
         mRemotePath = read.readString();
         mWifiOnly = read.readInt()!= 0;
@@ -72,6 +75,7 @@ public class SyncedFolderParcelable implements Parcelable {
     @Override
     public void writeToParcel(Parcel dest, int flags) {
         dest.writeLong(mId);
+        dest.writeString(mFolderName);
         dest.writeString(mLocalPath);
         dest.writeString(mRemotePath);
         dest.writeInt(mWifiOnly ? 1 : 0);
@@ -102,6 +106,14 @@ public class SyncedFolderParcelable implements Parcelable {
         return 0;
     }
 
+    public String getFolderName() {
+        return mFolderName;
+    }
+
+    public void setFolderName(String mFolderName) {
+        this.mFolderName = mFolderName;
+    }
+
     public String getLocalPath() {
         return mLocalPath;
     }