Fixed issue #110

Fixes for the layout of FileBrowser
Replaced close and folder icons with ones that better match the other icons in design
Improved reset icon
This commit is contained in:
Matteo Hausner 2014-01-19 19:25:47 +01:00
parent a111f22ea0
commit e4e7df1c26
8 changed files with 24 additions and 19 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@ -7,12 +7,9 @@
<LinearLayout
android:id="@+id/childview"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:orientation="horizontal"
android:layout_marginRight="2dp">
android:orientation="horizontal" >
<ImageView
android:id="@+id/item_icon"
@ -21,7 +18,7 @@
android:layout_gravity="center_vertical"
android:layout_marginBottom="2dp"
android:layout_marginLeft="6dp"
android:layout_marginRight="2dp"
android:layout_marginRight="6dp"
android:layout_marginTop="2dp"
android:scaleType="fitCenter"
android:src="@drawable/gdi" />

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TableLayout
android:layout_width="match_parent"

View File

@ -220,27 +220,35 @@ public class FileBrowser extends Fragment {
private void createListHeader(String header_text, View view, boolean hasBios) {
LinearLayout list_header = new LinearLayout(parentActivity);
LinearLayout.LayoutParams listParams = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, 48);
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
int margin_top = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, getResources().getDisplayMetrics());
listParams.setMargins(0, margin_top, 0, 0);
list_header.setLayoutParams(listParams);
ImageView list_icon = new ImageView(parentActivity);
LinearLayout.LayoutParams imageParams = new LinearLayout.LayoutParams(
48, LayoutParams.WRAP_CONTENT);
imageParams.setMargins(3, 0, 0, 0);
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
int size = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 32, getResources().getDisplayMetrics());
imageParams.width = size;
imageParams.height = size;
int margin_left_right = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 6, getResources().getDisplayMetrics());
int margin_top_bottom = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
imageParams.setMargins(margin_left_right, margin_top_bottom, margin_left_right, margin_top_bottom);
imageParams.gravity=Gravity.CENTER_VERTICAL;
list_icon.setLayoutParams(imageParams);
list_icon.setScaleType(ScaleType.FIT_CENTER);
list_icon.setImageResource(R.drawable.open_folder);
list_header.addView(list_icon);
TextView list_text = new TextView(parentActivity);
list_text.setGravity(Gravity.CENTER_VERTICAL);
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(
LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
textParams.setMargins(0, 0, 4, 0);
textParams.gravity=Gravity.CENTER_VERTICAL;
textParams.weight=1;
list_text.setLayoutParams(textParams);
list_text.setTextAppearance(parentActivity,
android.R.style.TextAppearance_Medium);
list_text.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20);
android.R.style.TextAppearance_Large);
list_text.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
list_text.setText(header_text);
list_header.addView(list_text);

View File

@ -94,7 +94,7 @@ public class MainActivity extends FragmentActivity implements
// Add the fragment to the 'fragment_container' FrameLayout
getSupportFragmentManager().beginTransaction()
.add(R.id.fragment_container, firstFragment).commit();
.replace(R.id.fragment_container, firstFragment).commit();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {