diff options
| -rw-r--r-- | Android.bp | 1 | ||||
| -rw-r--r-- | AndroidManifest.xml | 9 | ||||
| -rw-r--r-- | res/values/themes.xml | 17 | ||||
| -rw-r--r-- | src/com/android/support/car/lenspicker/LensPickerActivity.java | 4 | ||||
| -rw-r--r-- | src/com/android/support/car/lenspicker/LensResolverActivity.java | 6 |
5 files changed, 26 insertions, 11 deletions
@@ -37,4 +37,5 @@ android_app { enabled: false, }, }, + required: ["privapp_whitelist_com.android.car.lenspicker"] } diff --git a/AndroidManifest.xml b/AndroidManifest.xml index a8766e4..2cfd841 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -33,7 +33,9 @@ android:resizeableActivity="true" android:excludeFromRecents="true" android:launchMode="singleTask" - android:noHistory="true" /> + android:noHistory="true"> + <meta-data android:name="distractionOptimized" android:value="true"/> + </activity> <activity android:name=".LensResolverActivity" android:theme="@style/Theme.FloatingLensPicker" @@ -41,7 +43,9 @@ android:resizeableActivity="true" android:excludeFromRecents="true" android:launchMode="singleTask" - android:noHistory="true" /> + android:noHistory="true"> + <meta-data android:name="distractionOptimized" android:value="true"/> + </activity> <activity android:name=".LensPickerTrampolineActivity" android:theme="@style/Theme.FloatingLensPicker" @@ -49,6 +53,7 @@ android:resizeableActivity="true" android:excludeFromRecents="true" android:noHistory="true" > + <meta-data android:name="distractionOptimized" android:value="true"/> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> 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 bd69a0d..b08d5ac 100644 --- a/src/com/android/support/car/lenspicker/LensResolverActivity.java +++ b/src/com/android/support/car/lenspicker/LensResolverActivity.java @@ -35,8 +35,7 @@ import android.widget.CheckBox; import android.widget.TextView; import androidx.annotation.StringRes; -import androidx.car.utils.ColumnCalculator; -import androidx.car.widget.DayNightStyle; +import androidx.car.util.ColumnCalculator; import androidx.car.widget.PagedListView; import java.util.Iterator; @@ -114,7 +113,7 @@ public class LensResolverActivity extends Activity implements // As a result, need to set the width of the title container programmatically. int defaultColumnSpan = getResources().getInteger(R.integer.column_card_default_column_span); - int cardWidth = ColumnCalculator.getInstance(this /* context */).getSizeForColumnSpan( + int cardWidth = ColumnCalculator.getInstance(this /* context */).getColumnSpanWidth( defaultColumnSpan); View titleAndCheckboxContainer = findViewById(R.id.title_checkbox_container); titleAndCheckboxContainer.getLayoutParams().width = cardWidth; @@ -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.FORCE_DAY); ResolverAdapter adapter = new ResolverAdapter(this /* context */, infos); adapter.setSelectionHandler(this); |
