瀏覽代碼

initial link of menu buttons

Andy Scherzinger 8 年之前
父節點
當前提交
038f3167ab

+ 15 - 12
res/layout/folder_sync_item_header.xml

@@ -21,7 +21,9 @@
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:padding="@dimen/standard_padding">
+                android:paddingLeft="@dimen/standard_padding"
+                android:paddingTop="@dimen/standard_padding"
+                android:paddingBottom="@dimen/standard_padding">
 
     <TextView
         android:id="@+id/title"
@@ -45,21 +47,22 @@
         android:id="@+id/syncStatusButton"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_margin="@dimen/standard_half_margin"
+        android:padding="@dimen/standard_half_padding"
         android:background="@color/transparent"
         android:clickable="true"
         android:src="@drawable/ic_cloud_sync_off"/>
 
-    <ImageButton
-        android:id="@+id/settingsButton"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginLeft="@dimen/standard_half_margin"
-        android:layout_marginTop="@dimen/standard_half_margin"
-        android:layout_marginBottom="@dimen/standard_half_margin"
-        android:background="@color/transparent"
-        android:clickable="true"
-        android:src="@drawable/ic_dots_vertical"/>
+        <ImageButton
+            android:id="@+id/settingsButton"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingLeft="@dimen/standard_half_padding"
+            android:paddingTop="@dimen/standard_half_padding"
+            android:paddingBottom="@dimen/standard_half_padding"
+            android:paddingRight="@dimen/standard_padding"
+            android:background="@color/transparent"
+            android:clickable="true"
+            android:src="@drawable/ic_dots_vertical"/>
     </LinearLayout>
 
 </RelativeLayout>

+ 7 - 9
res/layout/grid_sync_item.xml

@@ -58,23 +58,21 @@
             android:orientation="horizontal">
 
             <TextView
-                android:id="@+id/counter"
+                android:id="@+id/next"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:src="@android:drawable/checkbox_off_background"
-                android:text="127"
-                android:textColor="#ffffff"
+                android:text="+"
+                android:textColor="#bcbcbc"
                 android:textSize="22dp"
                 android:textStyle="bold"/>
 
             <TextView
-                android:id="@+id/next"
+                android:id="@+id/counter"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
-                android:layout_marginLeft="4dp"
-                android:layout_marginRight="4dp"
-                android:text=">"
-                android:textColor="#dedede"
+                android:src="@android:drawable/checkbox_off_background"
+                android:text="127"
+                android:textColor="#ffffff"
                 android:textSize="22dp"
                 android:textStyle="bold"/>
         </LinearLayout>

+ 21 - 4
src/com/owncloud/android/ui/adapter/FolderSyncAdapter.java

@@ -32,6 +32,7 @@ import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.afollestad.sectionedrecyclerview.SectionedRecyclerViewAdapter;
 import com.owncloud.android.R;
@@ -95,14 +96,30 @@ public class FolderSyncAdapter extends SectionedRecyclerViewAdapter<FolderSyncAd
 
     @Override
     public void onBindHeaderViewHolder(MainViewHolder holder, int section) {
+        final int sectionId = section;
         holder.title.setText(mMediaFolders.get(section).folder.substring(mMediaFolders.get(section).folder
                 .lastIndexOf("/") + 1, mMediaFolders.get(section).folder.length()));
         holder.syncStatusButton.setVisibility(View.VISIBLE);
         holder.syncStatusButton.setTag(section);
-        holder.syncStatusButton.setOnTouchListener(this);
+        holder.syncStatusButton.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                Toast.makeText(mContext, "Sync Status Clicked for " + mMediaFolders.get(sectionId).folder, Toast
+                        .LENGTH_SHORT)
+                        .show();
+                return true;
+            }
+        });
         holder.menuButton.setVisibility(View.VISIBLE);
         holder.menuButton.setTag(section);
-        holder.menuButton.setOnTouchListener(this);
+        holder.menuButton.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                Toast.makeText(mContext, "Menu Clicked for " + mMediaFolders.get(sectionId).folder, Toast.LENGTH_SHORT)
+                        .show();
+                return true;
+            }
+        });
     }
 
     @Override
@@ -199,8 +216,8 @@ public class FolderSyncAdapter extends SectionedRecyclerViewAdapter<FolderSyncAd
             super(itemView);
             image = (ImageView) itemView.findViewById(R.id.thumbnail);
             title = (TextView) itemView.findViewById(R.id.title);
-            menuButton = (ImageButton) itemView.findViewById(R.id.syncStatusButton);
-            syncStatusButton = (ImageButton) itemView.findViewById(R.id.settingsButton);
+            menuButton = (ImageButton) itemView.findViewById(R.id.settingsButton);
+            syncStatusButton = (ImageButton) itemView.findViewById(R.id.syncStatusButton);
             counterBar = (LinearLayout) itemView.findViewById(R.id.counterLayout);
             counterValue = (TextView) itemView.findViewById(R.id.counter);
             thumbnailDarkener = (ImageView) itemView.findViewById(R.id.thumbnailDarkener);