I am hoping someone has seen this problem before. I have a listview where all the elements have a checkbox. This all works well, except that there is one checkbox that is unselectable (can't check and uncheck it). It isn't the first item in the list, and the problem isn't there on all devices. Works fine on a Samsung S3, but has a problem on the Nexus 6P.
After some investigating I turned on 'Show layout bounds' in the developer options. This is where I saw something very interesting, the unclickable element didn't draw any bounds. In the example below the checkbox for 'Bar Tunes' is unselectable.
Does anyone have an idea why this might be happening. Here is the layout file.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://ift.tt/nIICcg"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingRight="@dimen/list_10sp"
android:gravity="center_vertical"
android:id="@+id/listRow"
android:background="@color/GreyLight">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<CheckBox
android:layout_width="@dimen/list_40sp"
android:layout_height="@dimen/list_40sp"
android:layout_marginLeft="@dimen/list_5sp"
android:checked="true"
android:id="@+id/selectedCheckbox"
android:button="@drawable/button_checkbox_image"
android:layout_gravity="center_vertical"/>
<ImageView
android:id="@+id/connectedIcon"
android:src="@drawable/tick_raw"
android:adjustViewBounds="true"
android:layout_width="@dimen/list_20sp"
android:layout_height="@dimen/list_20sp"
android:layout_marginLeft="@dimen/list_20sp"/>
</FrameLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textBackground">
<LinearLayout
android:orientation="vertical"
android:layout_width="0dp"
android:layout_weight="1"
android:paddingRight="@dimen/list_10sp"
android:paddingTop="@dimen/list_5sp"
android:paddingBottom="@dimen/list_5sp"
android:clickable="true"
android:id="@+id/searchList"
android:background="@drawable/button_list_item"
android:layout_height="wrap_content">
<com.hdms.manager.Drawable.NightlifeTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List Name"
android:textSize="@dimen/list_text_size"
android:textStyle="bold"
android:id="@+id/listName"
android:singleLine="true"
android:ellipsize="middle"/>
<com.hdms.manager.Drawable.NightlifeTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/playlist_neg_2sp"
android:text="(User Friendly Name)"
android:textSize="@dimen/playlist_text_size"
android:singleLine="true"
android:id="@+id/friendlyName" />
<com.hdms.manager.Drawable.NightlifeTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="List Description"
android:textSize="@dimen/list_text_size_smaller"
android:singleLine="true"
android:id="@+id/listDescription" />
</LinearLayout>
<ImageButton
android:layout_width="@dimen/playlist_40sp"
android:layout_height="@dimen/playlist_40sp"
android:padding="@dimen/account_2sp"
android:layout_marginLeft="@dimen/account_5sp"
android:layout_gravity="center"
android:visibility="gone"
android:scaleType="fitCenter"
android:id="@+id/crowdDJButton"
android:src="@drawable/crowddj_icon"
android:background="@drawable/button_background_green"/>
<ImageButton
android:layout_width="@dimen/playlist_40sp"
android:layout_height="@dimen/playlist_40sp"
android:src="@drawable/icon_nm"
android:layout_gravity="center"
android:visibility="gone"
android:layout_marginLeft="@dimen/account_5sp"
android:scaleType="fitCenter"
android:tint="@color/White"
android:background="@drawable/button_background_green"
android:padding="@dimen/account_2sp"
android:id="@+id/musicSystemButton"/>
<ImageView
android:layout_width="@dimen/playlist_20sp"
android:layout_height="@dimen/playlist_20sp"
android:padding="@dimen/playlist_2sp"
android:layout_marginRight="@dimen/player_5sp"
android:layout_gravity="center_vertical"
android:visibility="gone"
android:id="@+id/crowdDJSearchable"
android:background="@color/StormGreen"
android:src="@drawable/crowddj_icon"/>
<com.hdms.manager.Drawable.NightlifeTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/White"
android:text="0"
android:textSize="@dimen/list_text_size_smaller"
android:minWidth="@dimen/list_45sp"
android:minHeight="@dimen/list_25sp"
android:singleLine="true"
android:ellipsize="marquee"
android:id="@+id/songCount"
android:layout_gravity="center_vertical"
android:background="@drawable/border_rounded_darkgrey"/>
<ImageView
android:id="@+id/dot"
android:src="@drawable/dot_dot_dot"
android:adjustViewBounds="true"
android:visibility="gone"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/account_10sp"
android:layout_width="@dimen/list_20sp"
android:layout_height="@dimen/list_20sp"/>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/list_1sp"
android:background="@drawable/verticalline"/>
</LinearLayout>
Any suggestions for how to fix or track down this problem? Thanks
Aucun commentaire:
Enregistrer un commentaire