diff options
-rw-r--r-- | vdrmanager/res/layout/recording_list.xml | 43 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java | 5 |
2 files changed, 34 insertions, 14 deletions
diff --git a/vdrmanager/res/layout/recording_list.xml b/vdrmanager/res/layout/recording_list.xml index fd56e00..865e403 100644 --- a/vdrmanager/res/layout/recording_list.xml +++ b/vdrmanager/res/layout/recording_list.xml @@ -48,25 +48,39 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" + android:layout_alignWithParentIfMissing="true" android:layout_marginTop="4dp" android:background="@drawable/back" - android:layout_alignWithParentIfMissing="true" - android:orientation="horizontal" + android:orientation="vertical" android:padding="2dp" > - <ImageView - android:id="@+id/drive_image" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:src="@drawable/ic_drive" - android:contentDescription="@string/drive_img"/> + <LinearLayout + android:layout_width="fill_parent" + android:layout_height="fill_parent" + android:orientation="horizontal" > - <TextView - android:id="@+id/drive_info" + <ImageView + android:id="@+id/drive_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:contentDescription="@string/drive_img" + android:src="@drawable/ic_drive" /> + + <TextView + android:id="@+id/drive_info" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:layout_marginLeft="5dp" + android:gravity="center" /> + </LinearLayout> + + <ProgressBar + android:id="@+id/drive_info_pb" + style="?android:attr/progressBarStyleHorizontal" android:layout_width="fill_parent" - android:layout_height="wrap_content" - android:layout_marginLeft="5dp" - /> + android:layout_height="1dip" + android:indeterminate="false" + android:progress="40" /> </LinearLayout> </RelativeLayout> @@ -86,7 +100,8 @@ <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:src="@drawable/sad" android:contentDescription="@string/sad_img"/> + android:contentDescription="@string/sad_img" + android:src="@drawable/sad" /> <Button android:id="@+id/retry_button" diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java index 187042c..0d65b0c 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java @@ -21,6 +21,7 @@ import android.view.View; import android.widget.AdapterView; import android.widget.AdapterView.OnItemLongClickListener; import android.widget.ListView; +import android.widget.ProgressBar; import android.widget.TextView; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.data.Event; @@ -75,6 +76,8 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> private View driverInfoContainer; + private ProgressBar drive_info_pb; + private int totalMB = -1; private int freeMB = -1; @@ -92,6 +95,7 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> folderInfo = (TextView) findViewById(R.id.folder_info); driverInfoContainer = findViewById(R.id.driver_info_container); driverInfo = (TextView) driverInfoContainer.findViewById(R.id.drive_info); + drive_info_pb = (ProgressBar) driverInfoContainer.findViewById(R.id.drive_info_pb); currentCount = (TextView) findViewById(R.id.current_count); listView.setAdapter(adapter); @@ -495,6 +499,7 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> percent = Integer.valueOf(split[2]); driverInfoContainer.setVisibility(View.VISIBLE); driverInfo.setText(getString(R.string.drive_info, (freeMB) / 1024, totalMB / 1024, 100 - percent)); + drive_info_pb.setProgress(percent); } catch (Exception ex) { Log.w(TAG, ex.getMessage(), ex); } |