Lots of polish to the files control set

pull/14/head
Sam Bosley 13 years ago
parent dcc228c4c2
commit 263649b508

@ -52,8 +52,10 @@ public class FilesControlSet extends PopupControlSet {
protected void refreshDisplayView() {
fileDisplayList.removeAllViews();
for (final Metadata m : files) {
View fileRow = inflater.inflate(R.layout.file_row, null);
setUpFileRow(m, fileRow, fileDisplayList);
View fileRow = inflater.inflate(R.layout.file_display_row, null);
LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.RIGHT;
setUpFileRow(m, fileRow, fileDisplayList, lp);
}
}
@ -99,10 +101,11 @@ public class FilesControlSet extends PopupControlSet {
fileList = (LinearLayout) getView().findViewById(R.id.files_list);
final LinearLayout finalList = fileList;
fileList.removeAllViews();
LayoutParams lp = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
for (final Metadata m : files) {
final View fileRow = inflater.inflate(R.layout.file_row, null);
setUpFileRow(m, fileRow, fileList);
setUpFileRow(m, fileRow, fileList, lp);
View name = fileRow.findViewById(R.id.file_text);
View clearFile = fileRow.findViewById(R.id.remove_file);
clearFile.setVisibility(View.VISIBLE);
@ -135,7 +138,7 @@ public class FilesControlSet extends PopupControlSet {
}
}
private void setUpFileRow(Metadata m, View row, LinearLayout parent) {
private void setUpFileRow(Metadata m, View row, LinearLayout parent, LayoutParams lp) {
TextView nameView = (TextView) row.findViewById(R.id.file_text);
TextView typeView = (TextView) row.findViewById(R.id.file_type);
String name = getNameString(m);
@ -147,8 +150,6 @@ public class FilesControlSet extends PopupControlSet {
else
typeView.setText(type);
LayoutParams lp = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
lp.gravity = Gravity.RIGHT;
parent.addView(row, lp);
}

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="5dip"/>
<stroke
android:width="2dip"
android:color="#b7b7b7"/>
<solid android:color="@android:color/transparent"/>
</shape>

@ -14,8 +14,7 @@
android:id="@+id/files_list"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right">
android:layout_height="wrap_content">
</LinearLayout>
</ScrollView>
<include layout="@layout/control_dialog_ok"/>

@ -8,7 +8,8 @@
android:id="@+id/display_row_body"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="50dip"
android:layout_height="wrap_content"
android:minHeight="50dip"
android:paddingLeft="10dip"
android:paddingRight="10dip"
android:gravity="center_vertical">
@ -26,6 +27,8 @@
android:layout_weight="1"
android:gravity="right"
android:paddingLeft="10dip"
android:paddingTop="5dip"
android:paddingBottom="5dip"
android:orientation="vertical"/>
</LinearLayout>
<View

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<TextView
android:id="@+id/file_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.EditRowDisplay"/>
<TextView
android:id="@+id/file_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/file_type_background"
android:layout_marginLeft="5dip"
android:paddingLeft="4dip"
android:paddingRight="4dip"
android:textColor="?attr/asTextColorInverse"/>
<ImageView
android:id="@+id/remove_file"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_menu_close"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:visibility="gone"/>
</LinearLayout>

@ -1,15 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal" >
<TextView
android:id="@+id/file_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.EditRowDisplay"/>
android:layout_width="fill_parent"
android:layout_height="40dip"
android:layout_marginTop="5dip"
android:layout_marginBottom="5dip"
android:layout_marginLeft="10dip"
android:layout_weight="1"
android:textAppearance="@style/TextAppearance.EditRowDisplay"
android:background="@drawable/file_name_background"
android:gravity="center"/>
<TextView
android:id="@+id/file_type"
android:layout_width="wrap_content"
@ -24,7 +30,5 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_menu_close"
android:layout_marginLeft="5dip"
android:layout_marginRight="5dip"
android:visibility="gone"/>
android:layout_marginRight="5dip"/>
</LinearLayout>
Loading…
Cancel
Save