Improve library layout
Remove unessecary layout when using controls; place search/limits in the proper layout
This commit is contained in:
parent
0ff18ca932
commit
d1837655a2
@ -27,6 +27,7 @@ THE SOFTWARE.
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1">
|
||||
<LinearLayout
|
||||
android:id="@+id/content"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
@ -65,37 +66,37 @@ THE SOFTWARE.
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:id="@+id/limiter_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|left" />
|
||||
<LinearLayout
|
||||
android:id="@+id/search_box"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:paddingTop="4dip"
|
||||
android:paddingLeft="4dip"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/search_background">
|
||||
<EditText
|
||||
android:id="@+id/filter_text"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:inputType="textFilter" />
|
||||
<ImageButton
|
||||
android:id="@+id/clear_button"
|
||||
android:scaleType="fitCenter"
|
||||
android:paddingLeft="4dip"
|
||||
android:paddingRight="4dip"
|
||||
android:paddingBottom="4dip"
|
||||
<LinearLayout
|
||||
android:id="@+id/limiter_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@null"
|
||||
android:src="@drawable/close" />
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|left" />
|
||||
<LinearLayout
|
||||
android:id="@+id/search_box"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:paddingTop="4dip"
|
||||
android:paddingLeft="4dip"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/search_background">
|
||||
<EditText
|
||||
android:id="@+id/filter_text"
|
||||
android:layout_width="0px"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:inputType="textFilter" />
|
||||
<ImageButton
|
||||
android:id="@+id/clear_button"
|
||||
android:scaleType="fitCenter"
|
||||
android:paddingLeft="4dip"
|
||||
android:paddingRight="4dip"
|
||||
android:paddingBottom="4dip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@null"
|
||||
android:src="@drawable/close" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</TabHost>
|
||||
|
||||
|
103
res/layout/library_controls.xml
Normal file
103
res/layout/library_controls.xml
Normal file
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2010, 2011 Christopher Eby <kreed@kreed.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-->
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/controls"
|
||||
android:background="@drawable/music_bottom_playback_bg"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dip">
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:scaleType="fitCenter"
|
||||
android:maxWidth="80dip"
|
||||
android:layout_width="80dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center" />
|
||||
<LinearLayout
|
||||
android:id="@+id/state_buttons"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentRight="true">
|
||||
<ImageButton
|
||||
android:id="@+id/shuffle"
|
||||
android:layout_height="0px"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/shuffle_inactive" />
|
||||
<ImageButton
|
||||
android:id="@+id/end_action"
|
||||
android:layout_height="0px"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/repeat_inactive" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/status_text"
|
||||
android:text="@string/none"
|
||||
android:textSize="16sp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/cover"
|
||||
android:layout_toLeftOf="@id/state_buttons" />
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/status_text"
|
||||
android:layout_toRightOf="@id/cover"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_toLeftOf="@id/state_buttons" >
|
||||
<ImageButton
|
||||
android:id="@+id/previous"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/previous" />
|
||||
<ImageButton
|
||||
android:id="@+id/play_pause"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/play" />
|
||||
<ImageButton
|
||||
android:id="@+id/next"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/next" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
@ -1,109 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2010, 2011 Christopher Eby <kreed@kreed.org>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
-->
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:orientation="vertical">
|
||||
<include layout="@layout/library_content" />
|
||||
<RelativeLayout
|
||||
android:id="@+id/controls"
|
||||
android:background="@drawable/music_bottom_playback_bg"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="80dip">
|
||||
<ImageView
|
||||
android:id="@+id/cover"
|
||||
android:scaleType="fitCenter"
|
||||
android:maxWidth="80dip"
|
||||
android:layout_width="80dip"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_gravity="center" />
|
||||
<LinearLayout
|
||||
android:id="@+id/state_buttons"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_alignParentRight="true">
|
||||
<ImageButton
|
||||
android:id="@+id/shuffle"
|
||||
android:layout_height="0px"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/shuffle_inactive" />
|
||||
<ImageButton
|
||||
android:id="@+id/end_action"
|
||||
android:layout_height="0px"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/repeat_inactive" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/status_text"
|
||||
android:text="@string/none"
|
||||
android:textSize="16sp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:gravity="center"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_toRightOf="@id/cover"
|
||||
android:layout_toLeftOf="@id/state_buttons" />
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/status_text"
|
||||
android:layout_toRightOf="@id/cover"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_toLeftOf="@id/state_buttons" >
|
||||
<ImageButton
|
||||
android:id="@+id/previous"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/previous" />
|
||||
<ImageButton
|
||||
android:id="@+id/play_pause"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/play" />
|
||||
<ImageButton
|
||||
android:id="@+id/next"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="0px"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@drawable/next" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user