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

Commit cdf9a83f authored by tmfang's avatar tmfang
Browse files

Create a custom drop-down filter spinner

Create a drop-down filter widget let other apps can use it.
UX goal is to use this widget on a bunch of page.
For example, Permissions, All apps, Sunshine, etc.

Change-Id: I0e939388d307deff9bad51e3ef415043814ec49e
Fixes: 112706966
Test: robotests
parent e1a83fef
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ android_library {
        "SettingsLibRestrictedLockUtils",
        "SettingsLibAppPreference",
        "SettingsLibSearchWidget",
        "SettingsLibSettingsSpinner",
    ],

    // ANDROIDMK TRANSLATION ERROR: unsupported assignment to LOCAL_SHARED_JAVA_LIBRARIES
+9 −0
Original line number Diff line number Diff line
android_library {
    name: "SettingsLibSettingsSpinner",

    srcs: ["src/**/*.java"],
    resource_dirs: ["res"],

    sdk_version: "system_current",
    min_sdk_version: "21",
}
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  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.
  -->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.android.settingslib.widget.settingsspinner">

    <uses-sdk android:minSdkVersion="21" />

</manifest>
+26 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  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:viewportWidth="24"
        android:viewportHeight="24"
        android:width="24dp"
        android:height="24dp">
    <path
        android:pathData="M7 10l5 5 5 -5z"
        android:fillColor="?android:attr/textColorPrimary"/>
</vector>
 No newline at end of file
+38 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  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.
  -->

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
            android:paddingMode="stack">
    <item>
        <shape>
            <corners
                android:radius="20dp"/>
            <stroke
                android:color="?android:attr/textColorSecondary"
                android:width="1dp"/>
            <size
                android:height="32dp"/>
        </shape>
    </item>

    <item
        android:gravity="center|end"
        android:width="24dp"
        android:height="24dp"
        android:end="4dp"
        android:drawable="@drawable/arrow_drop_down_24dp"/>
</layer-list>
 No newline at end of file
Loading