Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
resolve merge conflicts of 7a7bc1f to pi-dev-plus-aosp
Browse files Browse the repository at this point in the history
Test: I solemnly swear I tested this conflict resolution.
Bug: None
Change-Id: I19f7941a72dc7a78f68156b0f2e162bc816a4e49
  • Loading branch information
Aarthi Balachander committed Jun 12, 2018
2 parents 9c96147 + 7a7bc1f commit 952d18c
Show file tree
Hide file tree
Showing 15 changed files with 580 additions and 18 deletions.
24 changes: 8 additions & 16 deletions car/build.gradle
Expand Up @@ -7,22 +7,14 @@ plugins {
}

dependencies {
api project(':appcompat')
api project(':cardview')
api "com.android.temp.support:design-widget:28.0.0-alpha1", {
exclude group: 'androidx.annotation'
exclude group: 'androidx.core'
exclude group: 'androidx.legacy'
exclude group: 'androidx.fragment'
exclude group: 'androidx.transition'
exclude group: 'androidx.appcompat'
exclude group: 'androidx.recyclerview'
exclude group: 'androidx.cardview'
}
api project(':annotation')
api project(':legacy-support-v4')
api project(':recyclerview')
api project(':gridlayout')
api(project(":appcompat"))
api(project(":cardview"))
api(project(":annotation"))
api(project(":legacy-support-v4"))
api(project(":recyclerview"))
api(project(":gridlayout"))
api(project(":preference"))
api(SUPPORT_DESIGN, libs.exclude_for_material)

androidTestImplementation(TEST_RUNNER_TMP, libs.exclude_for_espresso)
androidTestImplementation(ESPRESSO_CORE_TMP, libs.exclude_for_espresso)
Expand Down
53 changes: 53 additions & 0 deletions car/res/layout/preference_category_material_car.xml
@@ -0,0 +1,53 @@
<?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
~
~ 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="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingVertical="@dimen/car_preference_list_margin"
android:background="@drawable/car_card_ripple_background"
android:focusable="true"
android:orientation="horizontal">

<androidx.preference.internal.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="@dimen/car_drawer_list_item_icon_size"
android:layout_height="@dimen/car_drawer_list_item_icon_size" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@android:id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Car.Subheader"/>
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="?android:attr/textColorSecondary"/>
</LinearLayout>

</LinearLayout>
63 changes: 63 additions & 0 deletions car/res/layout/preference_dropdown_material_car.xml
@@ -0,0 +1,63 @@
<?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
~
~ 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="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingVertical="@dimen/car_preference_list_margin"
android:background="@drawable/car_card_ripple_background"
android:focusable="true"
android:orientation="horizontal">

<Spinner
android:id="@+id/spinner"
android:layout_width="0dp"
android:layout_weight="0"
android:layout_height="wrap_content"
android:visibility="invisible" />

<androidx.preference.internal.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="@dimen/car_drawer_list_item_icon_size"
android:layout_height="@dimen/car_drawer_list_item_icon_size" />

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingTop="@dimen/car_preference_list_margin"
android:paddingBottom="@dimen/car_preference_list_margin">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Car.Body1" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Car.Body2" />
</LinearLayout>

</LinearLayout>
67 changes: 67 additions & 0 deletions car/res/layout/preference_material_car.xml
@@ -0,0 +1,67 @@
<?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
~
~ 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="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingVertical="@dimen/car_preference_list_margin"
android:background="@drawable/car_card_ripple_background"
android:focusable="true">

<androidx.preference.internal.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="@dimen/car_drawer_list_item_icon_size"
android:layout_height="@dimen/car_drawer_list_item_icon_size"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"/>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toEndOf="@android:id/icon"
android:layout_centerVertical="true">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.Car.Body1" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Car.Body2" />

</LinearLayout>

<!-- Preference should place its actual preference widget here. -->
<FrameLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true" />

</RelativeLayout>
76 changes: 76 additions & 0 deletions car/res/layout/preference_material_car_child.xml
@@ -0,0 +1,76 @@
<?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
~
~ 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.
-->

<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingVertical="@dimen/car_preference_list_margin"
android:background="@drawable/car_card_ripple_background"
android:focusable="true">

<!-- Wrap in a FrameLayout so the full list item has a touch ripple -->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="?android:attr/listPreferredItemPaddingStart">

<androidx.preference.internal.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="@dimen/car_drawer_list_item_small_icon_size"
android:layout_height="@dimen/car_drawer_list_item_small_icon_size"
android:layout_centerVertical="true"
android:layout_alignParentStart="true"/>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toEndOf="@android:id/icon"
android:layout_centerVertical="true">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.Car.Label1" />

<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.Car.Body3" />

</LinearLayout>

<!-- Preference should place its actual preference widget here. -->
<FrameLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true" />

</RelativeLayout>

</FrameLayout>

88 changes: 88 additions & 0 deletions car/res/layout/preference_widget_seekbar_material_car.xml
@@ -0,0 +1,88 @@
<?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
~
~ 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.
-->
<!-- Layout used by SeekBarPreference for the seekbar widget style. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingVertical="@dimen/car_preference_list_margin"
android:orientation="horizontal">

<androidx.preference.internal.PreferenceImageView
android:id="@android:id/icon"
android:layout_width="@dimen/car_drawer_list_item_icon_size"
android:layout_height="@dimen/car_drawer_list_item_icon_size" />

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="end"
android:textAppearance="@style/TextAppearance.Car.Body1"/>

<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:textAppearance="@style/TextAppearance.Car.Body2"/>

<!-- Using UnPressableLinearLayout as a workaround to disable the pressed state propagation
to the children of this container layout. Otherwise, the animated pressed state will also
play for the thumb in the AbsSeekBar in addition to the preference's ripple background.
The background of the SeekBar is also set to null to disable the ripple background -->
<androidx.preference.UnPressableLinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@android:id/summary"
android:layout_alignStart="@android:id/title"
android:clipChildren="false"
android:clipToPadding="false">
<SeekBar
android:id="@+id/seekbar"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:paddingStart="@dimen/preference_seekbar_padding_start"
android:paddingEnd="@dimen/preference_seekbar_padding_end"
android:focusable="false"
android:clickable="false"
android:background="@null" />

<TextView
android:id="@+id/seekbar_value"
android:layout_width="@dimen/preference_seekbar_value_width"
android:layout_height="match_parent"
android:gravity="right|center_vertical"
android:textAppearance="@style/TextAppearance.Car.Body2"
android:fadingEdge="horizontal"
android:scrollbars="none"/>
</androidx.preference.UnPressableLinearLayout>

</RelativeLayout>

</LinearLayout>
4 changes: 4 additions & 0 deletions car/res/values/dimens.xml
Expand Up @@ -215,4 +215,8 @@ limitations under the License.
<dimen name="speed_bump_lock_out_message_height">96dp</dimen>
<dimen name="speed_bump_lock_out_drawable_margin_bottom">8dp</dimen>

<!-- Preferences -->
<!-- list margin won't be necessary after PagedListView is brought in -->
<dimen name="car_preference_list_margin">8dp</dimen>

</resources>

0 comments on commit 952d18c

Please sign in to comment.