Fix selector on host lists

This commit is contained in:
Synced Synapse 2015-03-11 19:02:38 +00:00
parent 5193afd4b6
commit aed029187e
2 changed files with 71 additions and 82 deletions

View File

@ -45,14 +45,16 @@
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/remote_content_hmargin"
android:layout_marginRight="@dimen/remote_content_hmargin"
android:layout_marginTop="@dimen/remote_content_hmargin"
android:layout_marginBottom="@dimen/remote_content_hmargin"
android:choiceMode="singleChoice"
style="@style/Widget.GridView"
android:listSelector="@drawable/selector"
android:layout_below="@id/search_host_message"/>
android:layout_below="@id/search_host_message"
android:paddingLeft="@dimen/small_padding"
android:paddingRight="@dimen/small_padding"
android:paddingTop="@dimen/small_padding"
android:paddingBottom="@dimen/default_padding"
android:clipToPadding="false"
android:choiceMode="none"
android:listSelector="?attr/selectableItemBackground"
android:drawSelectorOnTop="true"
style="@style/Widget.GridView"/>
<ProgressBar
android:id="@+id/progress_bar"

View File

@ -1,84 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2015 Synced Synapse. All rights reserved.
<!--
Copyright 2015 Synced Synapse. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
card_view:cardElevation="@dimen/default_card_elevation"
card_view:cardBackgroundColor="?attr/appCardBackgroundColor">
<RelativeLayout
android:layout_width="match_parent"
>
android:layout_height="wrap_content"
android:padding="@dimen/default_padding">
<android.support.v7.widget.CardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
<ImageView
android:id="@+id/status_indicator"
android:layout_width="@dimen/default_icon_size"
android:layout_height="@dimen/default_icon_size"
android:padding="@dimen/default_icon_padding"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:src="?attr/iconHosts"/>
<ImageView
android:id="@+id/list_context_menu"
android:layout_width="@dimen/default_icon_size"
android:layout_height="@dimen/default_icon_size"
android:padding="@dimen/default_icon_padding"
android:layout_alignTop="@id/status_indicator"
android:layout_alignParentRight="true"
style="@style/Widget.Button.Borderless"
android:src="?attr/iconOverflow"
android:contentDescription="@string/action_options"/>
<TextView
android:id="@+id/host_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/status_indicator"
android:layout_toLeftOf="@id/list_context_menu"
android:layout_alignTop="@id/status_indicator"
android:layout_alignWithParentIfMissing="true"
style="@style/TextAppearance.HostName"/>
<TextView
android:id="@+id/host_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="@dimen/default_card_elevation"
android:layout_marginLeft="@dimen/default_card_elevation"
android:layout_marginRight="@dimen/default_card_elevation"
android:layout_marginTop="@dimen/default_card_elevation"
card_view:cardUseCompatPadding="true"
card_view:cardElevation="@dimen/default_card_elevation"
card_view:cardBackgroundColor="?attr/appCardBackgroundColor">
android:layout_below="@+id/host_name"
android:layout_alignLeft="@+id/host_name"
android:layout_alignRight="@+id/host_name"
style="@style/TextAppearance.HostDetails"/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/default_padding">
<ImageView
android:id="@+id/status_indicator"
android:layout_width="@dimen/default_icon_size"
android:layout_height="@dimen/default_icon_size"
android:padding="@dimen/default_icon_padding"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:src="?attr/iconHosts"/>
<ImageView
android:id="@+id/list_context_menu"
android:layout_width="@dimen/default_icon_size"
android:layout_height="@dimen/default_icon_size"
android:padding="@dimen/default_icon_padding"
android:layout_alignTop="@id/status_indicator"
android:layout_alignParentRight="true"
style="@style/Widget.Button.Borderless"
android:src="?attr/iconOverflow"
android:contentDescription="@string/action_options"/>
<TextView
android:id="@+id/host_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/status_indicator"
android:layout_toLeftOf="@id/list_context_menu"
android:layout_alignTop="@id/status_indicator"
android:layout_alignWithParentIfMissing="true"
style="@style/TextAppearance.HostName"/>
<TextView
android:id="@+id/host_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/host_name"
android:layout_alignLeft="@+id/host_name"
android:layout_alignRight="@+id/host_name"
style="@style/TextAppearance.HostDetails"/>
</RelativeLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>