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

Commit ee95c1a5 authored by Mill Chen's avatar Mill Chen Committed by Android (Google) Code Review
Browse files

Merge "[Expressive design] Add ValuePreference" into main

parents c163ac12 05ee1e17
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_base_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_base_license"],
}

android_library {
    name: "SettingsLibValuePreference",
    use_resource_processor: true,
    defaults: [
        "SettingsLintDefaults",
    ],

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

    static_libs: [
        "androidx.annotation_annotation",
        "androidx.preference_preference",
        "SettingsLibSettingsTheme",
    ],

    sdk_version: "system_current",
    min_sdk_version: "23",
    apex_available: [
        "//apex_available:platform",
    ],
}
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2025 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.preference.value">

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

</manifest>
+45 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2025 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.
  -->

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:minHeight="72dp"
    android:gravity="center_vertical"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:background="?android:attr/selectableItemBackground"
    android:clipToPadding="false"
    android:baselineAligned="false"
    android:filterTouchesWhenObscured="false">

  <include layout="@layout/settingslib_expressive_preference_icon_frame"/>

  <include layout="@layout/settingslib_expressive_value_preference_text_frame"/>

  <!-- Preference should place its actual preference widget here. -->
  <LinearLayout
      android:id="@android:id/widget_frame"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:gravity="end|center_vertical"
      android:paddingStart="@dimen/settingslib_expressive_space_small1"
      android:paddingEnd="0dp"
      android:orientation="vertical"/>

</LinearLayout>
 No newline at end of file
+49 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2025 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.
  -->

<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="@dimen/settingslib_expressive_space_none"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:paddingVertical="@dimen/settingslib_expressive_space_small1"
    android:paddingStart="@dimen/settingslib_expressive_space_none"
    android:paddingEnd="@dimen/settingslib_expressive_space_small1"
    android:filterTouchesWhenObscured="false">

  <TextView
      android:id="@android:id/title"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_gravity="start"
      android:textAlignment="viewStart"
      android:maxLines="2"
      android:textAppearance="@style/TextAppearance.SettingsLib.ValuePreferenceTitle"
      android:ellipsize="marquee"/>

  <TextView
      android:id="@android:id/summary"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_below="@android:id/title"
      android:layout_alignStart="@android:id/title"
      android:layout_gravity="start"
      android:textAlignment="viewStart"
      android:textAppearance="?android:attr/textAppearanceListItemSecondary"
      android:textColor="?android:attr/textColorSecondary"
      android:maxLines="10"/>
</RelativeLayout>
 No newline at end of file
+23 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright (C) 2025 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.
  -->

<resources xmlns:tools="http://schemas.android.com/tools">
    <style name="TextAppearance.SettingsLib.ValuePreferenceTitle"
        parent="@style/TextAppearance.SettingsLib.DisplaySmall">
        <item name="android:textColor">@color/settingslib_text_color_primary</item>
    </style>
</resources>
Loading