summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Chen <ajchen@google.com>2018-07-25 11:38:20 -0700
committerAnthony Chen <ajchen@google.com>2018-07-26 18:19:11 +0000
commitf77ee2dc0e7f5eb06b691f574db30442a1ad1bbc (patch)
tree790b566c4946e0ef33dfdbf6b33c325622e5670c
parentdd6ee8feb7a036c3f59e11938f10c5ae3ae0cb2b (diff)
downloadLensPicker-f77ee2dc0e7f5eb06b691f574db30442a1ad1bbc.tar.gz
Remove usage of DayNightStyle.
This attribute has been deprecated. Instead, ensure that the PagedListView is set correctly in color through extending the car theme. Bug: 111807700 Test: build LensPicker and ensure that the scroll bar has a light color upon opening Change-Id: I14f2b80a2eb29c20d0084fecd5e42c1e59a4f536
-rw-r--r--res/values/themes.xml17
-rw-r--r--src/com/android/support/car/lenspicker/LensPickerActivity.java4
-rw-r--r--src/com/android/support/car/lenspicker/LensResolverActivity.java2
3 files changed, 16 insertions, 7 deletions
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 6df092e..00a53c0 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -1,7 +1,22 @@
<?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.
+-->
<resources>
<!-- A custom theme for the LensPicker to enable animation when it is activated. -->
- <style name="Theme.FloatingLensPicker" parent="android:Theme.Material.Light.NoActionBar">
+ <style name="Theme.FloatingLensPicker" parent="Theme.Car.Dark.NoActionBar">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
diff --git a/src/com/android/support/car/lenspicker/LensPickerActivity.java b/src/com/android/support/car/lenspicker/LensPickerActivity.java
index 686795a..75ac933 100644
--- a/src/com/android/support/car/lenspicker/LensPickerActivity.java
+++ b/src/com/android/support/car/lenspicker/LensPickerActivity.java
@@ -26,7 +26,6 @@ import android.service.media.MediaBrowserService;
import android.text.TextUtils;
import android.util.Log;
-import androidx.car.widget.DayNightStyle;
import androidx.car.widget.PagedListView;
import java.util.ArrayList;
@@ -58,9 +57,6 @@ public class LensPickerActivity extends Activity implements LensPickerSelectionH
setContentView(R.layout.lens_list);
mPagedListView = (PagedListView) findViewById(R.id.list_view);
- // Set this to light mode, since the scroll bar buttons always appear
- // on top of a dark scrim.
- mPagedListView.setDayNightStyle(DayNightStyle.ALWAYS_LIGHT);
findViewById(R.id.dismiss_area).setOnClickListener(v -> finish());
}
diff --git a/src/com/android/support/car/lenspicker/LensResolverActivity.java b/src/com/android/support/car/lenspicker/LensResolverActivity.java
index 1894272..3c55b03 100644
--- a/src/com/android/support/car/lenspicker/LensResolverActivity.java
+++ b/src/com/android/support/car/lenspicker/LensResolverActivity.java
@@ -36,7 +36,6 @@ import android.widget.TextView;
import androidx.annotation.StringRes;
import androidx.car.util.ColumnCalculator;
-import androidx.car.widget.DayNightStyle;
import androidx.car.widget.PagedListView;
import java.util.Iterator;
@@ -122,7 +121,6 @@ public class LensResolverActivity extends Activity implements
mAlwaysCheckbox = (CheckBox) findViewById(R.id.always_checkbox);
PagedListView pagedListView = (PagedListView) findViewById(R.id.list_view);
- pagedListView.setDayNightStyle(DayNightStyle.ALWAYS_LIGHT);
ResolverAdapter adapter = new ResolverAdapter(this /* context */, infos);
adapter.setSelectionHandler(this);