Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed895580 authored by Jon Mann's avatar Jon Mann
Browse files

Allow focus from mouse click

Test: added unit tests and updated existing tests
Bug: 32839582
Change-Id: I5526429be3cbdd10a812db06f87c06e839b3da68
parent ab545656
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_focused="true"
        android:state_selected="false"
        android:color="?android:attr/colorAccent"/>
    <item
        android:color="@android:color/transparent" />
+24 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     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

     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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/item_doc_background_selected"
          android:state_selected="true" />
    <item android:drawable="@color/item_doc_background_selected"
          android:state_drag_hovered="true" />
    <item android:drawable="@color/item_doc_background"
          android:state_selected="false" />
</selector>
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     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

     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.
-->

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/item_doc_background_selected"
          android:state_focused="true" />
    <item android:drawable="@color/item_doc_background_selected"
          android:state_selected="true" />
    <item android:drawable="@color/item_doc_background"
          android:state_selected="false"
          android:state_focused="false" />
</selector>
 No newline at end of file
+0 −5
Original line number Diff line number Diff line
@@ -24,11 +24,6 @@
    android:background="@drawable/sort_widget_background"
    android:visibility="gone">

    <!-- Placeholder for focus indicator -->
    <View
        android:layout_width="4dp"
        android:layout_height="match_parent"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
+5 −9
Original line number Diff line number Diff line
@@ -15,18 +15,13 @@
     limitations under the License.
-->

<com.android.documentsui.ListItem xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/item_doc_background"
    android:focusable="true"
    android:background="@drawable/list_item_background"
    android:focusableInTouchMode="true"
    android:orientation="horizontal" >

    <View
        android:id="@+id/focus_indicator"
        android:layout_width="4dp"
        android:layout_height="match_parent" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
@@ -39,6 +34,7 @@

        <FrameLayout
            android:id="@android:id/icon"
            android:pointerIcon="hand"
            android:layout_width="@dimen/list_item_thumbnail_size"
            android:layout_height="@dimen/list_item_thumbnail_size"
            android:layout_marginEnd="16dp"
@@ -132,4 +128,4 @@
        </LinearLayout>
    </LinearLayout>

</com.android.documentsui.ListItem>
</LinearLayout>
Loading