Răsfoiți Sursa

Cancel button for downloads in progress replaceed with 'x' icon

David A. Velasco 12 ani în urmă
părinte
comite
93f79c7099

BIN
res/drawable/btn_cancel.png


+ 5 - 3
res/layout/file_details_fragment.xml

@@ -183,7 +183,7 @@
 			        android:id="@+id/fdProgressBlock"
 					android:layout_width="match_parent"
 					android:layout_height="wrap_content"
-					android:gravity="center_horizontal"
+					android:gravity="center"
 					android:layout_marginTop="12dp"
 					android:layout_marginBottom="12dp"
 					android:orientation="horizontal"
@@ -199,12 +199,14 @@
 						android:indeterminateOnly="false" 
 					/>
 				    								
-					<Button
+					<ImageButton
 						android:id="@+id/fdCancelBtn"
 						android:layout_width="wrap_content"
 						android:layout_height="wrap_content"
 						android:layout_marginLeft="12dp"
-						android:text="@string/common_cancel" />
+						android:src="@drawable/btn_cancel"
+						android:background="@android:color/transparent"
+						/>
 						
 				</LinearLayout>
 	

+ 29 - 15
res/layout/file_download_fragment.xml

@@ -32,23 +32,37 @@
 		android:layout_marginBottom="15dp"
 	/>
 	
-	<ProgressBar android:id="@+id/progressBar"
-		android:layout_width="match_parent" 
+    <LinearLayout
+        android:id="@+id/fdProgressBlock"
+		android:layout_width="match_parent"
 		android:layout_height="wrap_content"
-		android:progressDrawable="@android:drawable/progress_horizontal"
-		android:indeterminate="false" 
-		android:indeterminateOnly="false" 
+		android:gravity="center"
+		android:layout_marginTop="12dp"
 		android:layout_marginBottom="15dp"
-	/>
-	
-	<Button
-		android:id="@+id/cancelBtn"
-		android:layout_width="wrap_content"
-		android:layout_height="wrap_content"
-		android:text="@string/common_cancel" 
-		android:layout_marginBottom="15dp"
-	/>
-	
+		android:orientation="horizontal"
+		>
+	    				
+		<ProgressBar android:id="@+id/progressBar"
+			android:layout_width="0dp" 
+			android:layout_height="wrap_content"
+			android:layout_weight="1"
+			android:progressDrawable="@android:drawable/progress_horizontal"
+			android:indeterminate="false" 
+			android:indeterminateOnly="false" 
+			
+		/>
+
+		<ImageButton
+			android:id="@+id/cancelBtn"
+			android:layout_width="wrap_content"
+			android:layout_height="wrap_content"
+			android:layout_marginLeft="12dp"
+			android:src="@drawable/btn_cancel"
+			android:background="@android:color/transparent"
+		/>
+
+	</LinearLayout>
+			
 	<ImageView
 		android:id="@+id/error_image"
 		android:layout_width="wrap_content"

+ 2 - 2
src/com/owncloud/android/ui/preview/FileDownloadFragment.java

@@ -27,7 +27,7 @@ import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View.OnClickListener;
 import android.view.ViewGroup;
-import android.widget.Button;
+import android.widget.ImageButton;
 import android.widget.ProgressBar;
 import android.widget.TextView;
 
@@ -127,7 +127,7 @@ public class FileDownloadFragment extends FileFragment implements OnClickListene
         ProgressBar progressBar = (ProgressBar)mView.findViewById(R.id.progressBar);
         mProgressListener = new ProgressListener(progressBar);
         
-        ((Button)mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
+        ((ImageButton)mView.findViewById(R.id.cancelBtn)).setOnClickListener(this);
         
         if (mError) {
             setButtonsForRemote();