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

Commit f0ea0ed7 authored by Ivan Chiang's avatar Ivan Chiang
Browse files

Add chips to support mime type query

* Add SearchChipViewManager
* Implement mime type query with checked chips
* Filter chips base on the derivedMimeTypes of the root
  If there is only one matched chip, hide the chip row.
* Add chip move animation

Fix: 111862054
Fix: 120895178
Test: atest DocumentsUITests
Change-Id: If37a7c092eee101306963e4aa05810a86930c693
parent 74e97e0f
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2018 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

      https://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:state_selected="true" android:color="@color/chip_selected_background_color"/>
    <item android:state_enabled="true" android:color="?attr/colorBackgroundFloating"/>
    <item android:state_enabled="false" android:color="@color/g_light_grey"/>
</selector>
 No newline at end of file
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2018 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

      https://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">
    <!-- Selected. -->
    <item android:state_pressed="true" android:state_selected="true"
          android:alpha="0.16" android:color="@color/chip_ripple_color"/>
    <item android:state_focused="true" android:state_hovered="true" android:state_selected="true"
          android:alpha="0.16" android:color="@color/chip_ripple_color"/>
    <item android:state_focused="true" android:state_selected="true"
          android:alpha="0.12" android:color="@color/chip_ripple_color"/>
    <item android:state_hovered="true" android:state_selected="true"
          android:alpha="0.04" android:color="@color/chip_ripple_color"/>
    <item android:state_selected="true"
          android:alpha="0.00" android:color="@color/chip_ripple_color"/>

    <!-- Unselected. -->
    <item android:state_pressed="true" android:alpha="0.16" android:color="@color/text_hint"/>
    <item android:state_focused="true" android:state_hovered="true"
          android:alpha="0.16" android:color="@color/text_hint"/>
    <item android:state_focused="true" android:alpha="0.12" android:color="@color/text_hint"/>
    <item android:state_hovered="true" android:alpha="0.04" android:color="@color/text_hint"/>
    <item android:alpha="0.00" android:color="@color/text_hint"/>
</selector>
 No newline at end of file
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2018 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

      https://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:state_selected="true" android:color="@android:color/transparent"/>
    <item android:state_pressed="true" android:color="@android:color/transparent"/>
    <item android:state_enabled="true" android:color="@color/chip_stroke_color"/>
    <item android:state_enabled="false" android:color="@android:color/transparent"/>
</selector>
 No newline at end of file
+22 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2018 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

      https://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:state_selected="true" android:color="?attr/colorAccent"/>
    <item android:state_enabled="true" android:color="?attr/colorOnSurface"/>
    <item android:state_enabled="false" android:color="@color/text_hint_dark"/>
</selector>
 No newline at end of file
+25 −0
Original line number Diff line number Diff line
<!--
Copyright (C) 2018 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24.0"
        android:viewportHeight="24.0"
        android:tint="?attr/colorAccent">
    <path
        android:fillColor="@android:color/white"
        android:pathData="vM9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</vector>
Loading