From d1837655a2238458f55b0e3c33a80d60b28789c1 Mon Sep 17 00:00:00 2001 From: Christopher Eby Date: Wed, 26 Oct 2011 16:43:46 -0500 Subject: [PATCH] Improve library layout Remove unessecary layout when using controls; place search/limits in the proper layout --- res/layout/library_content.xml | 61 ++++++------ res/layout/library_controls.xml | 103 +++++++++++++++++++ res/layout/library_withcontrols.xml | 109 --------------------- src/org/kreed/vanilla/LibraryActivity.java | 7 +- 4 files changed, 138 insertions(+), 142 deletions(-) create mode 100644 res/layout/library_controls.xml delete mode 100644 res/layout/library_withcontrols.xml diff --git a/res/layout/library_content.xml b/res/layout/library_content.xml index 63970418..106a5fad 100644 --- a/res/layout/library_content.xml +++ b/res/layout/library_content.xml @@ -27,6 +27,7 @@ THE SOFTWARE. android:layout_width="fill_parent" android:layout_weight="1"> @@ -65,37 +66,37 @@ THE SOFTWARE. android:layout_width="fill_parent" android:layout_height="fill_parent" /> - - - - - + android:layout_height="wrap_content" + android:layout_gravity="bottom|left" /> + + + + diff --git a/res/layout/library_controls.xml b/res/layout/library_controls.xml new file mode 100644 index 00000000..3caa053d --- /dev/null +++ b/res/layout/library_controls.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/res/layout/library_withcontrols.xml b/res/layout/library_withcontrols.xml deleted file mode 100644 index 1d64c511..00000000 --- a/res/layout/library_withcontrols.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/org/kreed/vanilla/LibraryActivity.java b/src/org/kreed/vanilla/LibraryActivity.java index 7e7ee84d..ef807c0e 100644 --- a/src/org/kreed/vanilla/LibraryActivity.java +++ b/src/org/kreed/vanilla/LibraryActivity.java @@ -41,6 +41,7 @@ import android.text.TextUtils; import android.text.TextWatcher; import android.view.ContextMenu; import android.view.KeyEvent; +import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.SubMenu; @@ -114,10 +115,12 @@ public class LibraryActivity super.onCreate(state); MediaView.init(this); + setContentView(R.layout.library_content); SharedPreferences settings = PlaybackService.getSettings(this); if (settings.getBoolean("controls_in_selector", false)) { - setContentView(R.layout.library_withcontrols); + ViewGroup content = (ViewGroup)findViewById(R.id.content); + LayoutInflater.from(this).inflate(R.layout.library_controls, content, true); mControls = findViewById(R.id.controls); @@ -138,8 +141,6 @@ public class LibraryActivity mEndButton = (ImageButton)findViewById(R.id.end_action); mEndButton.setOnClickListener(this); registerForContextMenu(mEndButton); - } else { - setContentView(R.layout.library_content); } mSearchBox = findViewById(R.id.search_box);