diff options
author | Anthony Chen <ajchen@google.com> | 2017-09-20 11:40:11 -0700 |
---|---|---|
committer | Anthony Chen <ajchen@google.com> | 2017-09-20 11:40:11 -0700 |
commit | 86c7559a3a0b23a92ba5b48c671080f989df1482 (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
parent | 484a7bd48cb51b32a7b37d4d2fb570d62029d050 (diff) | |
download | Overview-86c7559a3a0b23a92ba5b48c671080f989df1482.tar.gz |
Remove Overview app.
This application is no longer being used. The home screen has been
replaced with the notifications shade.
Test: boot up and ensure nothing is broken.
Bug: 66187160
Change-Id: I93edd8b506ad56148f52d82135d7eb9b288b386d
41 files changed, 0 insertions, 2316 deletions
diff --git a/Android.mk b/Android.mk deleted file mode 100644 index 2257429..0000000 --- a/Android.mk +++ /dev/null @@ -1,75 +0,0 @@ -# -# Copyright (C) 2016 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. -# -ifneq ($(TARGET_BUILD_PDK), true) - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res - -LOCAL_PACKAGE_NAME := OverviewApp - -LOCAL_OVERRIDES_PACKAGES += Launcher2 Launcher3 - -LOCAL_MODULE_TAGS := optional - -include packages/apps/Car/libs/car-apps-common/car-apps-common.mk -include packages/apps/Car/libs/car-stream-ui-lib/car-stream-ui-lib.mk - -LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4 -LOCAL_STATIC_JAVA_LIBRARIES += car-stream-lib - -LOCAL_PROGUARD_ENABLED := disabled - -LOCAL_DEX_PREOPT := false - -# Include android-support-annotations, if not already included -ifeq (,$(findstring android-support-annotations,$(LOCAL_STATIC_JAVA_LIBRARIES))) -LOCAL_STATIC_JAVA_LIBRARIES += android-support-annotations -endif - -# Include support-v7-appcompat, if not already included -ifeq (,$(findstring android-support-v7-appcompat,$(LOCAL_STATIC_JAVA_LIBRARIES))) -LOCAL_RESOURCE_DIR += frameworks/support/v7/appcompat/res -LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.appcompat -LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-appcompat -endif - -# Include support-v7-recyclerview, if not already included -ifeq (,$(findstring android-support-v7-recyclerview,$(LOCAL_STATIC_JAVA_LIBRARIES))) -LOCAL_RESOURCE_DIR += frameworks/support/v7/recyclerview/res -LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.recyclerview -LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview -endif - -# Include support-v7-cardview, if not already included -ifeq (,$(findstring android-support-v7-cardview,$(LOCAL_STATIC_JAVA_LIBRARIES))) -LOCAL_RESOURCE_DIR += frameworks/support/v7/cardview/res -LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.cardview -LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-cardview -endif - -include $(BUILD_PACKAGE) - -################################################################## - -include $(CLEAR_VARS) - -include $(BUILD_MULTI_PREBUILT) - -endif diff --git a/AndroidManifest.xml b/AndroidManifest.xml deleted file mode 100644 index 415a877..0000000 --- a/AndroidManifest.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2016 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.car.overview"> - <uses-sdk - android:minSdkVersion="23" - android:targetSdkVersion='23'/> - - <!-- GSA permissions. --> - <uses-permission android:name="android.permission.CALL_PHONE" /> - - <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> - - <application android:label="OverviewApp" - android:icon="@drawable/ic_launcher_auto"> - - <activity - android:name=".StreamOverviewActivity" - android:theme="@style/CarLauncherAppTheme" - android:launchMode="singleInstance" - android:label="OverviewApp" - android:resizeableActivity="true"> - <intent-filter> - <action android:name="android.intent.action.MAIN" /> - <category android:name="android.intent.category.LAUNCHER" /> - <category android:name="android.intent.category.DEFAULT" /> - - <!-- Screen off --> - <action android:name="android.speech.action.VOICE_SEARCH_HANDS_FREE" /> - <!-- Screen on --> - <action android:name="android.speech.action.WEB_SEARCH" /> - </intent-filter> - </activity> - </application> -</manifest> diff --git a/res/drawable-hdpi/ic_launcher_auto.png b/res/drawable-hdpi/ic_launcher_auto.png Binary files differdeleted file mode 100644 index 0127f9a..0000000 --- a/res/drawable-hdpi/ic_launcher_auto.png +++ /dev/null diff --git a/res/drawable-mdpi/ic_launcher_auto.png b/res/drawable-mdpi/ic_launcher_auto.png Binary files differdeleted file mode 100644 index 6a57e41..0000000 --- a/res/drawable-mdpi/ic_launcher_auto.png +++ /dev/null diff --git a/res/drawable-night-nodpi/background.png b/res/drawable-night-nodpi/background.png Binary files differdeleted file mode 100644 index d31db2b..0000000 --- a/res/drawable-night-nodpi/background.png +++ /dev/null diff --git a/res/drawable-nodpi/background.png b/res/drawable-nodpi/background.png Binary files differdeleted file mode 100644 index 63110e7..0000000 --- a/res/drawable-nodpi/background.png +++ /dev/null diff --git a/res/drawable-xhdpi/ic_launcher_auto.png b/res/drawable-xhdpi/ic_launcher_auto.png Binary files differdeleted file mode 100644 index ef382b6..0000000 --- a/res/drawable-xhdpi/ic_launcher_auto.png +++ /dev/null diff --git a/res/drawable-xxhdpi/ic_launcher_auto.png b/res/drawable-xxhdpi/ic_launcher_auto.png Binary files differdeleted file mode 100644 index a03318b..0000000 --- a/res/drawable-xxhdpi/ic_launcher_auto.png +++ /dev/null diff --git a/res/drawable/dark_card_ripple.xml b/res/drawable/dark_card_ripple.xml deleted file mode 100644 index 1f71c08..0000000 --- a/res/drawable/dark_card_ripple.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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. -*/ ---> -<ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="@color/car_card_ripple_background_light" /> diff --git a/res/drawable/ic_mic.xml b/res/drawable/ic_mic.xml deleted file mode 100644 index 82585f3..0000000 --- a/res/drawable/ic_mic.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="48" - android:viewportHeight="48"> - - <path - android:fillColor="#FFFFFF" - android:pathData="M24 28c3.31 0 5.98-2.69 5.98-6L30 10c0-3.32-2.68-6-6-6-3.31 0-6 2.68-6 6v12c0 -3.31 2.69 6 6 6zm10.6-6c0 6-5.07 10.2-10.6 10.2-5.52 0-10.6-4.2-10.6-10.2H10c0 -6.83 5.44 12.47 12 13.44V42h4v-6.56c6.56-.97 12-6.61 12-13.44h-3.4z" /> - <path - android:pathData="M0 0h48v48H0z" /> -</vector> diff --git a/res/drawable/ic_mic_muted.xml b/res/drawable/ic_mic_muted.xml deleted file mode 100644 index b7fa904..0000000 --- a/res/drawable/ic_mic_muted.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="48" - android:viewportHeight="48"> - - <path - android:pathData="M0 0h48v48H0zm0 0h48v48H0z" /> - <path - android:fillColor="#FFFFFF" - android:pathData="M38 22h-3.4c0 1.49-.31 2.87-.87 4.1l2.46 2.46C37.33 26.61 38 24.38 38 22zm-8.03 -.33 c0-.11 .03 -.22 .03 -.33V10c0-3.32-2.69-6-6-6s-6 2.68-6 6v.37l11.97 -11.96zM8.55 6L6 8.55l12.02 12.02v1.44c0 3.31 2.67 6 5.98 6 .45 0 .88-.06 -1.3-.15l3.32 3.32c-1.43 .66 -3 1.03-4.62 1.03-5.52 0-10.6-4.2-10.6-10.2H10c0 -6.83 5.44 12.47 12 13.44V42h4v-6.56c1.81-.27 3.53-.9 5.08-1.81L39.45 42 42 39.46 -8.55 6z" /> -</vector> diff --git a/res/drawable/ic_pause.xml b/res/drawable/ic_pause.xml deleted file mode 100644 index 50635af..0000000 --- a/res/drawable/ic_pause.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="48" - android:viewportHeight="48"> - - <path - android:fillColor="#000000" - android:pathData="M12 38h8V10h-8v28zm16-28v28h8V10h-8z" /> - <path - android:pathData="M0 0h48v48H0z" /> -</vector> diff --git a/res/drawable/ic_phone_hangup.xml b/res/drawable/ic_phone_hangup.xml deleted file mode 100644 index 655333b..0000000 --- a/res/drawable/ic_phone_hangup.xml +++ /dev/null @@ -1,26 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="24.0" - android:viewportHeight="24.0"> - <path - android:pathData="M12,9c-1.6,0 -3.15,0.25 -4.6,0.72v3.1c0,0.39 -0.23,0.74 -0.56,0.9 -0.98,0.49 -1.87,1.12 -2.66,1.85 -0.18,0.18 -0.43,0.28 -0.7,0.28 -0.28,0 -0.53,-0.11 -0.71,-0.29L0.29,13.08c-0.18,-0.17 -0.29,-0.42 -0.29,-0.7 0,-0.28 0.11,-0.53 0.29,-0.71C3.34,8.78 7.46,7 12,7s8.66,1.78 11.71,4.67c0.18,0.18 0.29,0.43 0.29,0.71 0,0.28 -0.11,0.53 -0.29,0.71l-2.48,2.48c-0.18,0.18 -0.43,0.29 -0.71,0.29 -0.27,0 -0.52,-0.11 -0.7,-0.28 -0.79,-0.74 -1.69,-1.36 -2.67,-1.85 -0.33,-0.16 -0.56,-0.5 -0.56,-0.9v-3.1C15.15,9.25 13.6,9 12,9z" - android:fillColor="#ffffff"/> -</vector> diff --git a/res/drawable/ic_play_arrow.xml b/res/drawable/ic_play_arrow.xml deleted file mode 100644 index 1941698..0000000 --- a/res/drawable/ic_play_arrow.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="48" - android:viewportHeight="48"> - - <path - android:pathData="M-838-2232H562v3600H-838z" /> - <path - android:fillColor="#000000" - android:pathData="M16 10v28l22-14z" /> - <path - android:pathData="M0 0h48v48H0z" /> -</vector> diff --git a/res/drawable/ic_settings.xml b/res/drawable/ic_settings.xml deleted file mode 100644 index 9c9bd35..0000000 --- a/res/drawable/ic_settings.xml +++ /dev/null @@ -1,38 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="24dp" - android:height="24dp" - android:viewportWidth="24" - android:viewportHeight="24"> - - <path - android:pathData="M0 0h24v24H0z" /> - <path - android:fillColor="#ffffff" - android:pathData="M19.43 12.98c.04-.32 .07 -.64 .07 -.98s-.03-.66-.07-.98l2.11-1.65c.19-.15 .24 --.42 .12 -.64l-2-3.46c-.12-.22-.39-.3-.61-.22l-2.49 -1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46 .18 --.49 .42 l-.38 2.65c-.61 .25 -1.17 .59 -1.69 .98 l-2.49-1c-.23-.09-.49 0-.61 .22 -l-2 3.46c-.13 .22 -.07 .49 .12 .64 l2.11 1.65c-.04 .32 -.07 .65 -.07 .98 s.03 -.66 .07 .98 l-2.11 1.65c-.19 .15 -.24 .42 -.12 .64 l2 3.46c.12 .22 .39 .3 .61 -.22 l2.49-1c.52 .4 1.08 .73 1.69 .98 l.38 2.65c.03 .24 .24 .42 .49 .42 h4c.25 0 -.46-.18 .49 -.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.23 .09 .49 0 -.61-.22l2-3.46c.12-.22 .07 -.49-.12-.64l-2.11-1.65zM12 15.5c-1.93 -0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5z" /> -</vector>
\ No newline at end of file diff --git a/res/drawable/ic_skip_next.xml b/res/drawable/ic_skip_next.xml deleted file mode 100644 index 15f505c..0000000 --- a/res/drawable/ic_skip_next.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="48" - android:viewportHeight="48"> - <path - android:fillColor="#FFFFFF" - android:pathData="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z" /> - <path - android:pathData="M0 0h48v48H0z" /> -</vector> diff --git a/res/drawable/ic_skip_previous.xml b/res/drawable/ic_skip_previous.xml deleted file mode 100644 index 16537cb..0000000 --- a/res/drawable/ic_skip_previous.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="48" - android:viewportHeight="48"> - <path - android:fillColor="#FFFFFF" - android:pathData="M12 12h4v24h-4zm7 12l17 12V12z" /> - <path - android:pathData="M0 0h48v48H0z" /> -</vector> diff --git a/res/drawable/ic_stop.xml b/res/drawable/ic_stop.xml deleted file mode 100644 index 4eadee5..0000000 --- a/res/drawable/ic_stop.xml +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="@dimen/stream_card_action_icon_size" - android:height="@dimen/stream_card_action_icon_size" - android:viewportWidth="48" - android:viewportHeight="48"> - - <path - android:pathData="M0 0h48v48H0z" /> - <path - android:fillColor="#000000" - android:pathData="M12 12h24v24H12z" /> -</vector> diff --git a/res/drawable/ic_voice_assistant_mic.xml b/res/drawable/ic_voice_assistant_mic.xml deleted file mode 100644 index 3698758..0000000 --- a/res/drawable/ic_voice_assistant_mic.xml +++ /dev/null @@ -1,30 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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:width="24dp" - android:height="24dp" - android:viewportWidth="24" - android:viewportHeight="24"> - <path - android:fillColor="#000000" - android:pathData="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 -3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 -6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z" /> - <path - android:pathData="M0 0h24v24H0z" /> -</vector> diff --git a/res/drawable/stream_card_ripple_bg.xml b/res/drawable/stream_card_ripple_bg.xml deleted file mode 100644 index 7b7a672..0000000 --- a/res/drawable/stream_card_ripple_bg.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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. -*/ ---> -<ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="@color/car_card_ripple_background" /> diff --git a/res/drawable/stream_media_card_divider.xml b/res/drawable/stream_media_card_divider.xml deleted file mode 100644 index 3807191..0000000 --- a/res/drawable/stream_media_card_divider.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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. -*/ ---> -<shape xmlns:android="http://schemas.android.com/apk/res/android" > - <size android:height="1dp"/> - <solid android:color="@color/car_list_divider_light"/> -</shape> diff --git a/res/layout/overview_activity.xml b/res/layout/overview_activity.xml deleted file mode 100644 index 90a79ae..0000000 --- a/res/layout/overview_activity.xml +++ /dev/null @@ -1,64 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:id="@+id/container" - android:background="@drawable/background" - android:layout_width="match_parent" - android:layout_height="match_parent"> - - <FrameLayout - android:id="@+id/action_icon_bar" - android:layout_width="match_parent" - android:layout_height="@dimen/lens_header_height"> - <FrameLayout android:layout_width="@dimen/stream_action_button_side_margin" - android:layout_height="match_parent" - android:layout_gravity="center_vertical|end"> - <ImageView - android:id="@+id/voice_button" - android:layout_gravity="center" - android:src="@drawable/ic_voice_assistant_mic" - style="@style/OverviewButton"/> - </FrameLayout> - <FrameLayout android:layout_width="@dimen/stream_action_button_side_margin" - android:layout_height="match_parent" - android:layout_gravity="center_vertical|start"> - <ImageView - android:id="@+id/gear_button" - android:layout_gravity="center" - android:src="@drawable/ic_settings" - style="@style/OverviewButton"/> - </FrameLayout> - </FrameLayout> - <TextView - android:id="@+id/permission_text" - android:layout_gravity="center" - android:layout_width="@dimen/permission_text_width" - android:layout_height="wrap_content" - android:text="@string/permission_request_string" - android:background="?android:attr/selectableItemBackground" - style="@style/PermissionsRequest" /> - - <com.android.car.view.PagedListView - android:id="@+id/list_view" - android:background="@android:color/transparent" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:visibility="gone" - app:offsetRows="true" - app:showDivider="false" /> -</FrameLayout> diff --git a/res/layout/stream_card_container.xml b/res/layout/stream_card_container.xml deleted file mode 100644 index 701bf1f..0000000 --- a/res/layout/stream_card_container.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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. ---> - -<!-- This FrameLayout is used to center the CardView since the CardView's container will be larger - than its width. --> -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:app="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:minHeight="@dimen/stream_card_container_height" > - - <com.android.car.stream.ui.StreamCardView - style="@style/StreamCardStyle" - android:id="@+id/stream_item_container" - android:layout_gravity="center_horizontal" - android:layout_width="wrap_content" - android:layout_height="match_parent" - app:cardElevation="1dp" - app:columnSpan="8" /> -</FrameLayout> diff --git a/res/layout/stream_card_current_call.xml b/res/layout/stream_card_current_call.xml deleted file mode 100644 index 3d58b10..0000000 --- a/res/layout/stream_card_current_call.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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:background="@color/phone_theme" - android:layout_width="match_parent" - android:layout_height="@dimen/stream_item_large_height"> - <ImageView - android:id="@+id/background_image" - android:alpha="0.1" - android:layout_gravity="center" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:scaleType="centerCrop"/> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> - <!-- This LinearLayout ensures that the primary action only affects the top half of the - card and not where the action icons are. --> - <LinearLayout - android:id="@+id/primary_action_container" - android:background="@drawable/dark_card_ripple" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical"> - <TextView - android:id="@+id/display_name" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/stream_call_text_margin" - android:layout_marginEnd="@dimen/stream_call_text_margin" - android:layout_marginStart="@dimen/stream_call_text_margin" - style="@style/StreamBody1" - android:singleLine="true" - android:textColor="@color/car_body1_light" - android:ellipsize="end"/> - <LinearLayout - android:id="@+id/call_info" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/stream_item_text_top_margin" - android:layout_marginEnd="@dimen/stream_call_text_margin" - android:layout_marginStart="@dimen/stream_call_text_margin" - android:orientation="horizontal"> - <TextView - android:id="@+id/call_state" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:singleLine="true" - android:textColor="@color/stream_body2_lighter" - style="@style/StreamBody2"/> - <Chronometer - android:id="@+id/timer" - android:visibility="gone" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:textColor="@color/stream_body2_lighter" - style="@style/StreamBody2"/> - </LinearLayout> - </LinearLayout> - <View - android:layout_width="match_parent" - android:layout_height="1dp" - android:background="@color/car_list_divider_light" - android:layout_marginTop="@dimen/stream_call_text_margin" /> - <RelativeLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginStart="@dimen/stream_content_keyline_1" - android:layout_marginEnd="@dimen/stream_content_keyline_1" - android:paddingTop="@dimen/stream_card_action_container_padding" - android:paddingBottom="@dimen/stream_card_action_container_padding" > - <ImageButton - android:id="@+id/mute_button" - android:background="@drawable/dark_card_ripple" - android:layout_width="@dimen/stream_card_action_button_size" - android:layout_height="@dimen/stream_card_action_button_size" - android:layout_alignParentStart="true" - android:layout_centerVertical="true" - android:visibility="gone" /> - <com.android.car.overview.OverviewFabButton - android:id="@+id/call_button" - android:layout_width="@dimen/stream_card_large_center_button_size" - android:layout_height="@dimen/stream_card_large_center_button_size" - android:layout_centerInParent="true" - android:scaleType="center" /> - </RelativeLayout> - </LinearLayout> -</FrameLayout> diff --git a/res/layout/stream_card_media.xml b/res/layout/stream_card_media.xml deleted file mode 100644 index 1c4356c..0000000 --- a/res/layout/stream_card_media.xml +++ /dev/null @@ -1,102 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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="@dimen/stream_item_large_height" - android:background="@color/car_card_dark"> - - <ImageView - android:id="@+id/media_player_background" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:alpha="0.1" - android:visibility="gone" - android:scaleType="centerCrop" /> - - <LinearLayout - android:id="@+id/stream_card_container" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" - android:divider="@drawable/stream_media_card_divider" - android:showDividers="middle"> - - <LinearLayout - android:id="@+id/primary_action_container" - android:background="@drawable/dark_card_ripple" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginStart="@dimen/stream_card_keyline_1" - android:layout_marginEnd="@dimen/stream_card_keyline_1" - android:layout_marginBottom="@dimen/stream_media_text_margin" - android:orientation="vertical"> - <TextView - android:id="@+id/title" - style="@style/StreamBody1" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/stream_card_margin" - android:layout_marginEnd="16dp" - android:singleLine="true" - android:textColor="@color/car_body1_light" - android:ellipsize="end"/> - <TextView - android:id="@+id/subtitle" - style="@style/StreamBody2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="8dp" - android:layout_marginEnd="16dp" - android:layout_marginBottom="2dp" - android:singleLine="true" - android:textColor="@color/car_body2_light" - android:ellipsize="end"/> - </LinearLayout> - - <RelativeLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginStart="@dimen/stream_content_keyline_1" - android:layout_marginEnd="@dimen/stream_content_keyline_1" - android:paddingTop="@dimen/stream_card_action_container_padding" - android:paddingBottom="@dimen/stream_card_action_container_padding"> - <ImageButton - android:id="@+id/skip_previous" - android:layout_width="@dimen/stream_card_action_button_size" - android:layout_height="@dimen/stream_card_action_button_size" - android:layout_alignParentStart="true" - android:layout_centerVertical="true" - android:scaleType="center" - android:background="@drawable/dark_card_ripple"/> - <com.android.car.overview.OverviewFabButton - android:id="@+id/play_pause" - android:layout_width="@dimen/stream_card_large_center_button_size" - android:layout_height="@dimen/stream_card_large_center_button_size" - android:layout_centerInParent="true" - android:scaleType="center" - android:background="?android:attr/selectableItemBackgroundBorderless"/> - <ImageButton - android:id="@+id/skip_next" - android:layout_width="@dimen/stream_card_action_button_size" - android:layout_height="@dimen/stream_card_action_button_size" - android:layout_alignParentEnd="true" - android:layout_centerVertical="true" - android:scaleType="center" - android:background="@drawable/dark_card_ripple"/> - </RelativeLayout> - </LinearLayout> -</FrameLayout> diff --git a/res/layout/stream_card_simple.xml b/res/layout/stream_card_simple.xml deleted file mode 100644 index 3c75c34..0000000 --- a/res/layout/stream_card_simple.xml +++ /dev/null @@ -1,66 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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:id="@+id/primary_action_container" - android:layout_width="match_parent" - android:layout_height="@dimen/stream_item_small_height" - android:background="@drawable/stream_card_ripple_bg" - android:paddingTop="@dimen/stream_card_padding" - android:paddingBottom="@dimen/stream_card_padding" - android:orientation="horizontal"> - <ImageButton - android:clickable="false" - android:id="@+id/primary_icon_button" - android:layout_width="@dimen/stream_card_action_icon_size" - android:layout_height="@dimen/stream_card_action_icon_size" - android:layout_marginStart="@dimen/stream_card_keyline_1" - android:layout_gravity="center_vertical" - android:scaleType="fitCenter" - android:tint="@color/car_tint" - android:background="@android:color/transparent"/> - <LinearLayout - android:layout_width="0dp" - android:layout_height="wrap_content" - android:layout_weight="1" - android:layout_marginStart="@dimen/stream_card_text_start_margin" - android:layout_marginEnd="@dimen/stream_card_text_end_margin" - android:layout_gravity="center_vertical" - android:orientation="vertical"> - <TextView - android:id="@+id/primary_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - style="@style/StreamBody1" - android:singleLine="true" - android:ellipsize="end"/> - <TextView - android:id="@+id/secondary_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="@dimen/stream_item_text_top_margin" - style="@style/StreamBody2" - android:singleLine="true" - android:ellipsize="end"/> - </LinearLayout> - <ImageView - android:id="@+id/secondary_icon_button" - android:layout_marginEnd="@dimen/stream_card_keyline_1" - android:layout_width="@dimen/stream_secondary_icon_size" - android:layout_height="@dimen/stream_secondary_icon_size" - android:layout_gravity="center_vertical" - android:scaleType="fitCenter"/> -</LinearLayout> diff --git a/res/values-night/colors.xml b/res/values-night/colors.xml deleted file mode 100644 index d2deb12..0000000 --- a/res/values-night/colors.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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> - <color name="phone_theme">@color/car_light_blue_900</color> - <color name="overview_background">#ff455A64</color> -</resources> diff --git a/res/values-w840dp/dimens.xml b/res/values-w840dp/dimens.xml deleted file mode 100644 index d6924f4..0000000 --- a/res/values-w840dp/dimens.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - * Copyright (c) 2016, 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> - <dimen name="stream_action_button_side_margin">@dimen/stream_content_keyline_1</dimen> -</resources>
\ No newline at end of file diff --git a/res/values/colors.xml b/res/values/colors.xml deleted file mode 100644 index 9430acf..0000000 --- a/res/values/colors.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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> - <color name="car_tint_dark">@color/car_grey_900</color> - <color name="car_tint">@color/car_tint_dark</color> - <color name="car_card_dark">@color/car_dark_blue_grey_700</color> - <color name="car_button_tint">@color/car_grey_50</color> - - <!-- phone themes --> - <color name="phone_theme">@color/car_light_blue_800</color> - - <color name="stream_body2_lighter">#bfffffff</color> - - <color name="overview_background">@color/car_grey_300</color> -</resources> diff --git a/res/values/dimens.xml b/res/values/dimens.xml deleted file mode 100644 index d9e66df..0000000 --- a/res/values/dimens.xml +++ /dev/null @@ -1,46 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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> - <!-- stream --> - <dimen name="stream_card_padding">32dp</dimen> - <dimen name="stream_card_bottom_margin">5dp</dimen> - <dimen name="stream_card_corner_radius">16dp</dimen> - <dimen name="stream_card_container_height">152dp</dimen> - <dimen name="stream_item_text_top_margin">2dp</dimen> - <dimen name="stream_secondary_icon_size">64dp</dimen> - <dimen name="stream_item_large_height">270dp</dimen> - <dimen name="stream_item_small_height">152dp</dimen> - - <dimen name="stream_card_action_container_padding">8dp</dimen> - <dimen name="stream_card_action_icon_size">56dp</dimen> - <dimen name="stream_card_action_button_size">86dp</dimen> - - <dimen name="stream_card_margin">32dp</dimen> - <dimen name="stream_card_text_start_margin">52dp</dimen> - <dimen name="stream_card_text_end_margin">16dp</dimen> - - <dimen name="stream_media_text_margin">32dp</dimen> - <dimen name="stream_call_text_margin">32dp</dimen> - - <dimen name="stream_card_large_center_button_size">96dp</dimen> - - <!-- The height of the container holding the background image. --> - <dimen name="overview_icon_size">72dp</dimen> - - <dimen name="stream_card_container_bottom_margin">8dp</dimen> - <dimen name="stream_action_button_side_margin">@dimen/stream_content_keyline_2</dimen> - <dimen name="permission_text_width">600dp</dimen> -</resources> diff --git a/res/values/strings.xml b/res/values/strings.xml deleted file mode 100644 index f3c4ade..0000000 --- a/res/values/strings.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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> - <string name="car_stream_item_manager_package_name" translatable="false">com.android.car.stream</string> - <string name="car_stream_item_manager_class_name" translatable="false">com.android.car.stream.StreamService</string> - <string name="car_stream_item_manager_permissions_activity" translatable="false">com.android.car.stream.PermissionsActivity</string> - - <!-- Label for incoming call [CHAR LIMIT=30] --> - <string name="notification_incoming_call">Select to answer</string> - <!-- Label for when a call is coming from an unknown caller [CHAR LIMIT=30] --> - <string name="unknown">Unknown</string> - <!-- Label for the currently ongoing call. This value should be followed by a space, a bullet, - and another space. [CHAR LIMIT=30] --> - <string name="ongoing_call">Active • </string> - <!-- Label for the currently dialed call [CHAR LIMIT=30] --> - <string name="dialing_call">Dialing</string> - <!-- Label for a call being disconnected [CHAR LIMIT=30] --> - <string name="disconnecting_call">Disconnecting Call</string> - - <string name="voice_assistant_help_msg">Voice assistant not integrated. Contact your car manufacturer</string> - <string name="permission_request_string">Not all required permissions have been granted yet, click here enable them.</string> -</resources> diff --git a/res/values/styles.xml b/res/values/styles.xml deleted file mode 100644 index 6ab21f7..0000000 --- a/res/values/styles.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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> - <!-- Stream --> - <style name="StreamCardStyle"> - <item name="android:layout_marginBottom">@dimen/stream_card_container_bottom_margin</item> - <item name="android:foreground">@drawable/car_list_item_background</item> - <item name="cardBackgroundColor">@color/car_card</item> - <item name="cardCornerRadius">@dimen/stream_card_corner_radius</item> - </style> - - <style name="StreamBody1" parent="@style/CarBody1"> - <item name="android:fontFamily">sans-serif</item> - <item name="android:textSize">40sp</item> - </style> - - <style name="StreamBody2" parent="@style/CarBody2"> - <item name="android:fontFamily">sans-serif</item> - <item name="android:textSize">32sp</item> - </style> - <style name="OverviewButton"> - <item name="android:layout_width">@dimen/overview_icon_size</item> - <item name="android:layout_height">@dimen/overview_icon_size</item> - <item name="android:padding">6dp</item> - <item name="android:background">?android:attr/selectableItemBackgroundBorderless</item> - <item name="android:tint">@color/car_button_tint</item> - <item name="android:scaleType">fitCenter</item> - <item name="android:clickable">true</item> - </style> - - <style name="PermissionsRequest" parent="@style/CarBody2"> - <item name="android:textColor">@color/car_grey_50</item> - </style> -</resources> diff --git a/res/values/themes.xml b/res/values/themes.xml deleted file mode 100644 index 631ff21..0000000 --- a/res/values/themes.xml +++ /dev/null @@ -1,21 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2016 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> - <style name="CarLauncherAppTheme" parent="@android:style/Theme.Material.Light.NoActionBar"> - <item name="android:windowTranslucentStatus">true</item> - <item name="colorAccent">@color/car_red_500</item> - </style> -</resources>
\ No newline at end of file diff --git a/src/com/android/car/overview/CurrentCallStreamViewHolder.java b/src/com/android/car/overview/CurrentCallStreamViewHolder.java deleted file mode 100644 index f627746..0000000 --- a/src/com/android/car/overview/CurrentCallStreamViewHolder.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ -package com.android.car.overview; - -import android.app.PendingIntent; -import android.content.Context; -import android.graphics.Color; -import android.telecom.Call; -import android.util.Log; -import android.view.View; -import android.widget.Chronometer; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.TextView; -import com.android.car.overview.utils.BitmapUtils; -import com.android.car.stream.CurrentCallExtension; -import com.android.car.stream.StreamCard; - -/** - * A {@link StreamViewHolder} that binds a {@link CurrentCallExtension} to - * an interactive in call UI. - */ -public class CurrentCallStreamViewHolder extends StreamViewHolder { - private static final String TAG = "CurrentCallStreamVH"; - - private final ImageView mBackgroundImage; - private final TextView mDisplayNameTextView; - - private final TextView mCallStateTextView; - private final Chronometer mTimerView; - - private final OverviewFabButton mCallActionButton; - private final ImageButton mMuteActionButton; - - private PendingIntent mCallAction; - private PendingIntent mMuteAction; - private PendingIntent mContainerClickAction; - - public CurrentCallStreamViewHolder(Context context, View itemView) { - super(context, itemView); - - mBackgroundImage = (ImageView) itemView.findViewById(R.id.background_image); - mDisplayNameTextView = (TextView) itemView.findViewById(R.id.display_name); - mCallStateTextView = (TextView) itemView.findViewById(R.id.call_state); - mTimerView = (Chronometer) itemView.findViewById(R.id.timer); - - mCallActionButton = (OverviewFabButton) itemView.findViewById(R.id.call_button); - mMuteActionButton = (ImageButton) itemView.findViewById(R.id.mute_button); - - mCallActionButton.setAccentColor(Color.RED); - mCallActionButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mCallAction == null) { - return; - } - try { - mCallAction.send(mContext, 0 /* resultCode */, null /* intent */); - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send call action pending intent", e); - } - } - }); - - mMuteActionButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mMuteAction == null) { - return; - } - try { - mMuteAction.send(mContext, 0 /* resultCode */, null /* intent */); - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send mute action pending intent", e); - } - } - }); - - mActionContainer.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mContainerClickAction == null) { - return; - } - try { - mContainerClickAction.send(mContext, 0 /* resultCode */, null /* intent */); - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send call action pending intent", e); - } - } - }); - } - - @Override - public void bindStreamCard(StreamCard card) { - super.bindStreamCard(card); - - if (!(card.getCardExtension() instanceof CurrentCallExtension)) { - Log.e(TAG, "StreamCard does not contain a CurrentCallExtension"); - return; - } - - mContainerClickAction = card.getContentPendingIntent(); - - CurrentCallExtension call = (CurrentCallExtension) card.getCardExtension(); - int callState = call.getCallState(); - - mDisplayNameTextView.setText(call.getDisplayName()); - mCallStateTextView.setText(getCallState(mContext, callState)); - - // For active calls set up mute button and timer view. - if (callState == Call.STATE_ACTIVE) { - mTimerView.setVisibility(View.VISIBLE); - mTimerView.setBase(call.getCallStartTime()); - mTimerView.start(); - - int muteIconRes = call.isMuted() ? R.drawable.ic_mic_muted : R.drawable.ic_mic; - mMuteActionButton.setVisibility(View.VISIBLE); - mMuteActionButton.setImageResource(muteIconRes); - mMuteAction = call.isMuted() ? call.getUnMuteAction() : call.getMuteAction(); - } - - // Setup the call button. - if (callState == Call.STATE_DIALING || callState == Call.STATE_ACTIVE - || callState == Call.STATE_RINGING) { - mCallActionButton.setVisibility(View.VISIBLE); - mCallActionButton.setImageResource(R.drawable.ic_phone_hangup); - - if (callState == Call.STATE_RINGING) { - mCallAction = call.getAcceptCallAction(); - } else { - mCallAction = call.getHangupCallAction(); - } - } - - if (call.getContactPhoto() != null) { - mBackgroundImage - .setImageBitmap(BitmapUtils.applySaturation(call.getContactPhoto(), 01.f)); - } - } - - private String getCallState(Context context, int state) { - switch (state) { - case Call.STATE_ACTIVE: - return context.getString(R.string.ongoing_call); - case Call.STATE_DIALING: - return context.getString(R.string.dialing_call); - case Call.STATE_DISCONNECTING: - return context.getString(R.string.disconnecting_call); - case Call.STATE_RINGING: - return context.getString(R.string.notification_incoming_call); - default: - return context.getString(R.string.unknown); - } - } - - @Override - protected void resetViews() { - mBackgroundImage.setImageBitmap(null); - mDisplayNameTextView.setText(null); - mCallStateTextView.setText(null); - - mTimerView.setText(null); - mTimerView.setVisibility(View.INVISIBLE); - - mCallActionButton.setImageBitmap(null); - mCallActionButton.setVisibility(View.INVISIBLE); - - mMuteActionButton.setImageBitmap(null); - mMuteActionButton.setVisibility(View.INVISIBLE); - - mCallAction = null; - mMuteAction = null; - } -} diff --git a/src/com/android/car/overview/MediaStreamViewHolder.java b/src/com/android/car/overview/MediaStreamViewHolder.java deleted file mode 100644 index 7a5f354..0000000 --- a/src/com/android/car/overview/MediaStreamViewHolder.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ -package com.android.car.overview; - -import android.app.PendingIntent; -import android.content.Context; -import android.text.TextUtils; -import android.util.Log; -import android.view.View; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.TextView; -import com.android.car.stream.MediaPlaybackExtension; -import com.android.car.stream.StreamCard; - -/** - * A {@link StreamViewHolder} that binds a {@link MediaPlaybackExtension} to - * an interactive in playback UI card. - */ -public class MediaStreamViewHolder extends StreamViewHolder { - private static final String TAG = "MediaStreamViewHolder"; - - private static final String ELLIPSIS = "\u2026"; - // limit the subtitle to 20 chars, and the rest space is given to the app name. - private static final int MAX_TEXT_LENGTH = 20; - private static final String UNICODE_BULLET_SPACER = " \u2022 "; - - private final ImageView mPlayerBackground; - private final TextView mTitleTextView; - private final TextView mSubtitleTextview; - - private final ImageButton mSkipToPreviousButton; - private final ImageButton mSkipToNextButton; - private final OverviewFabButton mPlayPauseButton; - - private PendingIntent mPlayPauseAction; - private PendingIntent mSkipToNextAction; - private PendingIntent mSkipToPreviousAction; - - private PendingIntent mContentPendingIntent; - - public MediaStreamViewHolder(Context context, View itemView) { - super(context, itemView); - - mPlayerBackground = (ImageView) itemView.findViewById(R.id.media_player_background); - mTitleTextView = (TextView) itemView.findViewById(R.id.title); - mSubtitleTextview = (TextView) itemView.findViewById(R.id.subtitle); - - mSkipToPreviousButton = (ImageButton) itemView.findViewById(R.id.skip_previous); - mSkipToNextButton = (ImageButton) itemView.findViewById(R.id.skip_next); - mPlayPauseButton = (OverviewFabButton) itemView.findViewById(R.id.play_pause); - - mSkipToPreviousButton.setImageResource(R.drawable.ic_skip_previous); - mSkipToNextButton.setImageResource(R.drawable.ic_skip_next); - - mPlayPauseButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - try { - if (mPlayPauseAction != null) { - mPlayPauseAction.send(); - } - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send play/pause action pending intent", e); - } - } - }); - - mSkipToPreviousButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - try { - if (mSkipToPreviousAction != null) { - mSkipToPreviousAction.send(); - } - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send play/pause action pending intent", e); - } - } - }); - - mSkipToNextButton.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - try { - if (mSkipToNextAction != null) { - mSkipToNextAction.send(); - } - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send play/pause action pending intent", e); - } - } - }); - - mActionContainer.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - try { - if (mContentPendingIntent != null) { - mContentPendingIntent.send(); - } - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send content pending intent in media card", e); - } - } - }); - } - - @Override - public void bindStreamCard(StreamCard card) { - super.bindStreamCard(card); - MediaPlaybackExtension extension = (MediaPlaybackExtension) card.getCardExtension(); - - if (extension.getAlbumArt() != null) { - mPlayerBackground.setImageBitmap(extension.getAlbumArt()); - mPlayerBackground.setVisibility(View.VISIBLE); - } - - String title = extension.getTitle(); - if (!TextUtils.isEmpty(title)) { - mTitleTextView.setVisibility(View.VISIBLE); - mTitleTextView.setText(title); - } - - String subtitle = getSubtitle(extension); - if (!TextUtils.isEmpty(title)) { - mSubtitleTextview.setVisibility(View.VISIBLE); - mSubtitleTextview.setText(subtitle); - } - - int playPauseIcon; - if (extension.isPlaying()) { - if (extension.hasPause()) { - playPauseIcon = R.drawable.ic_pause; - mPlayPauseAction = extension.getPauseAction(); - } else { - playPauseIcon = R.drawable.ic_stop; - mPlayPauseAction = extension.getStopAction(); - } - } else { - playPauseIcon = R.drawable.ic_play_arrow; - mPlayPauseAction = extension.getPlayAction(); - } - - mPlayPauseButton.setImageResource(playPauseIcon); - mPlayPauseButton.setAccentColor(extension.getAppAccentColor()); - - mSkipToPreviousAction = extension.getSkipToPreviousAction(); - mSkipToNextAction = extension.getSkipToNextAction(); - - if (!extension.canSkipToNext()) { - mSkipToNextButton.setColorFilter(mContext.getColor(R.color.car_grey_700)); - mSkipToNextButton.setEnabled(false); - } - - if (!extension.canSkipToPrevious()) { - mSkipToPreviousButton.setColorFilter(mContext.getColor(R.color.car_grey_700)); - mSkipToPreviousButton.setEnabled(false); - } - - mContentPendingIntent = card.getContentPendingIntent(); - } - - @Override - protected void resetViews() { - mSubtitleTextview.setText(null); - mTitleTextView.setText(null); - - mSubtitleTextview.setVisibility(View.GONE); - mTitleTextView.setVisibility(View.GONE); - mPlayerBackground.setVisibility(View.GONE); - - mSkipToNextButton.setEnabled(true); - mSkipToPreviousButton.setEnabled(true); - mSkipToNextButton.setColorFilter(0); - mSkipToPreviousButton.setColorFilter(0); - } - - /** - * Ellipsize the subtitle and append the app name if available. - */ - private String getSubtitle(MediaPlaybackExtension extension) { - String appName = extension.getAppName(); - - StringBuilder sb = new StringBuilder(); - if (!TextUtils.isEmpty(extension.getSubtitle())) { - sb.append(ellipsizeText(extension.getSubtitle(), MAX_TEXT_LENGTH)); - if (!TextUtils.isEmpty(appName)) { - sb.append(UNICODE_BULLET_SPACER); - sb.append(appName); - } - } - return sb.toString(); - } - - /** - * Ellipsize text and append "..." to the end if its length exceeds the {@code maxLen}. - * <p/> - * We are not using the ellipsize in the TextView because we are ellipsizing - * 2 strings separately. - */ - private static CharSequence ellipsizeText(CharSequence text, int maxLen) { - if (text == null || text.length() <= maxLen) { - return text; - } - - if (maxLen <= ELLIPSIS.length()) { - Log.e(TAG, "Unable to truncate string to " + maxLen); - return text; - } - StringBuilder sb = new StringBuilder(); - // now, maxLen > ellip.length() - sb.append(text.subSequence(0, maxLen - ELLIPSIS.length())); - sb.append(ELLIPSIS); - return sb.toString(); - } -} diff --git a/src/com/android/car/overview/OverviewFabButton.java b/src/com/android/car/overview/OverviewFabButton.java deleted file mode 100644 index 12f35eb..0000000 --- a/src/com/android/car/overview/OverviewFabButton.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ - -package com.android.car.overview; - -import android.content.Context; -import android.support.annotation.ColorInt; -import android.util.AttributeSet; -import android.widget.ImageView; -import com.android.car.apps.common.FabDrawable; - -/** - * A FAB button with an affordance for setting the accent color. - */ -public class OverviewFabButton extends ImageView { - private final FabDrawable mFabDrawable; - - public OverviewFabButton(Context context) { - super(context); - } - - public OverviewFabButton(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public OverviewFabButton(Context context, AttributeSet attrs, int defStyleAttrs) { - super(context, attrs, defStyleAttrs); - } - - public OverviewFabButton(Context context, AttributeSet attrs, int defStyleAttrs, - int defStyleRes) { - super(context, attrs, defStyleAttrs, defStyleRes); - } - - { - Context context = getContext(); - - mFabDrawable = new FabDrawable(context); - setBackground(mFabDrawable); - } - - /** - * Sets the color that the FAB button will be. - */ - public void setAccentColor(@ColorInt int color) { - mFabDrawable.setFabAndStrokeColor(color); - } -} diff --git a/src/com/android/car/overview/SimpleStreamViewHolder.java b/src/com/android/car/overview/SimpleStreamViewHolder.java deleted file mode 100644 index 21b5241..0000000 --- a/src/com/android/car/overview/SimpleStreamViewHolder.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ -package com.android.car.overview; - -import android.app.PendingIntent; -import android.content.Context; -import android.text.TextUtils; -import android.util.Log; -import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; -import com.android.car.stream.StreamCard; - -/** - * A {@link StreamViewHolder} that binds a {@link StreamCard} to a basic card layout. - */ -public class SimpleStreamViewHolder extends StreamViewHolder { - private static final String TAG = "SimpleStreamCardVH"; - - private final TextView mPrimaryTextView; - private final TextView mSecondaryTextView; - private final ImageView mPrimaryIconView; - private final ImageView mSecondaryIconView; - - private PendingIntent mContentPendingIntent; - - public SimpleStreamViewHolder(Context context, View itemView) { - super(context, itemView); - mPrimaryTextView = (TextView) itemView.findViewById(R.id.primary_text); - mSecondaryTextView = (TextView) itemView.findViewById(R.id.secondary_text); - mPrimaryIconView = (ImageView) itemView.findViewById(R.id.primary_icon_button); - mSecondaryIconView = (ImageView) itemView.findViewById(R.id.secondary_icon_button); - - mActionContainer.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mContentPendingIntent == null) { - return; - } - - try { - mContentPendingIntent.send(mContext, 0 /* resultCode */, null /* intent */); - } catch (PendingIntent.CanceledException e) { - Log.e(TAG, "Failed to send pending intent for card"); - } - } - }); - } - - @Override - public void bindStreamCard(StreamCard card) { - super.bindStreamCard(card); - - if (!TextUtils.isEmpty(card.getPrimaryText())) { - mPrimaryTextView.setText(card.getPrimaryText()); - } - - if (!TextUtils.isEmpty(card.getSecondaryText())) { - mSecondaryTextView.setText(card.getSecondaryText()); - } - - if (card.getPrimaryIcon() != null) { - mPrimaryIconView.setImageBitmap(card.getPrimaryIcon()); - } - - if (card.getSecondaryIcon() != null) { - mSecondaryIconView.setImageBitmap(card.getSecondaryIcon()); - } - mContentPendingIntent = card.getContentPendingIntent(); - } - - @Override - protected void resetViews() { - mPrimaryTextView.setText(null); - mSecondaryTextView.setText(null); - mPrimaryIconView.setImageBitmap(null); - mSecondaryIconView.setImageBitmap(null); - mContentPendingIntent = null; - } -} diff --git a/src/com/android/car/overview/StreamAdapter.java b/src/com/android/car/overview/StreamAdapter.java deleted file mode 100644 index 9cc2b31..0000000 --- a/src/com/android/car/overview/StreamAdapter.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ -package com.android.car.overview; - -import android.content.Context; -import android.support.annotation.Nullable; -import android.support.v7.widget.CardView; -import android.support.v7.widget.RecyclerView; -import android.util.Log; -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import com.android.car.stream.AbstractBundleable; -import com.android.car.stream.MediaPlaybackExtension; -import com.android.car.stream.StreamCard; -import com.android.car.stream.StreamConstants; -import com.android.car.view.PagedListView; - -import java.util.ArrayList; -import java.util.Iterator; - -/** - * A {@link RecyclerView.Adapter} that binds {@link StreamCard} to their respective views. - */ -public class StreamAdapter extends RecyclerView.Adapter<StreamViewHolder> - implements PagedListView.ItemCap { - - private static final int BASIC_CARD_LAYOUT_TYPE = 0; - private static final int CURRENT_CALL_CARD_LAYOUT_TYPE = 1; - private static final int MEDIA_CARD_LAYOUT_TYPE = 2; - - private static final String TAG = "StreamAdapter"; - - private static final int MAX_NUMBER_ITEMS = 25; - private int mMaxItems = MAX_NUMBER_ITEMS; - - private final ArrayList<StreamCard> mStreamCards = new ArrayList<>(mMaxItems); - private final Context mContext; - - public StreamAdapter(Context context) { - mContext = context; - } - - @Override - public StreamViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { - View view = LayoutInflater.from(mContext) - .inflate(R.layout.stream_card_container, parent, false); - CardView container = (CardView) view.findViewById(R.id.stream_item_container); - switch (viewType) { - case CURRENT_CALL_CARD_LAYOUT_TYPE: - container.addView(LayoutInflater.from(parent.getContext()) - .inflate(R.layout.stream_card_current_call, container, false)); - return new CurrentCallStreamViewHolder(mContext, view); - case MEDIA_CARD_LAYOUT_TYPE: - container.addView(LayoutInflater.from(parent.getContext()) - .inflate(R.layout.stream_card_media, container, false)); - return new MediaStreamViewHolder(mContext, view); - default: - // For all cards that do not have their own view holder/layout, use the basic stream - // card layout. - View contentView = LayoutInflater.from(parent.getContext()) - .inflate(R.layout.stream_card_simple, container, false); - container.addView(contentView); - - return new SimpleStreamViewHolder(mContext, view); - } - } - - @Override - public void onBindViewHolder(StreamViewHolder holder, int position) { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Stream Card being bound: " + mStreamCards.get(position)); - } - holder.bindStreamCard(mStreamCards.get(position)); - } - - @Override - public int getItemViewType(int position) { - StreamCard card = mStreamCards.get(position); - - // If the card has no extensions, then render as a basic card. - if (card.getCardExtension() == null) { - return BASIC_CARD_LAYOUT_TYPE; - } - - switch (card.getType()) { - case StreamConstants.CARD_TYPE_CURRENT_CALL: - return CURRENT_CALL_CARD_LAYOUT_TYPE; - case StreamConstants.CARD_TYPE_MEDIA: - return MEDIA_CARD_LAYOUT_TYPE; - default: - return BASIC_CARD_LAYOUT_TYPE; - } - } - - @Override - public int getItemCount() { - return mStreamCards.size(); - } - - @Override - public void setMaxItems(int max) { - if (max < 1) { - return; - } - mMaxItems = Math.min(max, MAX_NUMBER_ITEMS); - } - - /** - * Remove all {@link StreamCard} in the adapter. - */ - public void removeAllCards() { - mStreamCards.clear(); - notifyDataSetChanged(); - } - - public void addCard(StreamCard card) { - // There should only be one card in the stream that is of type MEDIA. As a result, handle - // this case specially. Otherwise, check if the card matches a stream card that already - // exists and replace it. - if (card.getType() == StreamConstants.CARD_TYPE_MEDIA && !canAddMediaCard(card)) { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Card: " + card + " does not have focus, so will not be added."); - } - return; - } else if (maybeReplaceCard(card)) { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Card: " + card + " was replaced in stream"); - } - return; - } - - if (mStreamCards.size() >= mMaxItems) { - StreamCard removedCard = mStreamCards.remove(mStreamCards.size() - 1); - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Card: " + removedCard + " was pushed out the stream"); - } - } - - int size = mStreamCards.size(); - for (int i = 0; i < size; i++) { - if (mStreamCards.get(i).getPriority() <= card.getPriority()) { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Card: " + card + " was inserted at i: " + i); - } - mStreamCards.add(i, card); - notifyDataSetChanged(); - return; - } - } - - // The card had lower priority than all existing cards, add to the end. - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Card: " + card + " was inserted at the end"); - } - mStreamCards.add(card); - notifyDataSetChanged(); - } - - public void removeCard(StreamCard card) { - for (Iterator<StreamCard> iterator = mStreamCards.iterator(); iterator.hasNext();) { - StreamCard existingCard = iterator.next(); - if (existingCard.getType() == card.getType() && existingCard.getId() == card.getId()) { - iterator.remove(); - notifyDataSetChanged(); - break; - } - } - } - - /** - * Replaces a card in the adapter if the new card has the same priority. Otherwise it removes - * the card from the adapter. - */ - private boolean maybeReplaceCard(StreamCard newCard) { - for (int i = 0, size = mStreamCards.size(); i < size; i++) { - StreamCard existingCard = mStreamCards.get(i); - - if (existingCard.getType() == newCard.getType() - && existingCard.getId() == newCard.getId()) { - mStreamCards.set(i, newCard); - if (existingCard.getPriority() == newCard.getPriority()) { - mStreamCards.set(i, newCard); - notifyDataSetChanged(); - return true; - } else { - // If the priority is no longer the same, just remove the card - // and let it be added again. - mStreamCards.remove(i); - return false; - } - } - } - return false; - } - - /** - * Searches through {@link #mStreamCards} and returns the first card in the list that has a - * card type of {@link StreamConstants#CARD_TYPE_MEDIA}. If none is found, then {@code null} - * is returned. - */ - @Nullable - private StreamCard getExistingMediaCard() { - for (StreamCard streamCard : mStreamCards) { - if (streamCard.getType() == StreamConstants.CARD_TYPE_MEDIA) { - return streamCard; - } - } - - return null; - } - - /** - * Returns {@code true} if the given {@link StreamCard} of type - * {@link StreamConstants#CARD_TYPE_MEDIA} can be added to the set of stream cards. This method - * is responsible for ensuring that there is only a single instance of a media card at all - * times. - */ - private boolean canAddMediaCard(StreamCard card) { - StreamCard existingMediaCard = getExistingMediaCard(); - - // If there is no other media StreamCard, then it is ok to add. - if (existingMediaCard == null) { - return true; - } - - // If this update is coming from the same application, then add the StreamCard. - if (existingMediaCard.getId() == card.getId()) { - return true; - } - - AbstractBundleable cardExtension = card.getCardExtension(); - - // Cannot infer play state from the card to be added, so just add it. - if (!(cardExtension instanceof MediaPlaybackExtension)) { - return true; - } - - // Otherwise, ensure only the application that currently has focus has the ability to show - // their card. When a card is currently playing, it implies that it has focus. - boolean hasFocus = ((MediaPlaybackExtension) cardExtension).isPlaying(); - - // Since this new card has focus, remove the existing card from the list. - if (hasFocus) { - mStreamCards.remove(existingMediaCard); - } - - return hasFocus; - } -} diff --git a/src/com/android/car/overview/StreamOverviewActivity.java b/src/com/android/car/overview/StreamOverviewActivity.java deleted file mode 100644 index 3f1e191..0000000 --- a/src/com/android/car/overview/StreamOverviewActivity.java +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ -package com.android.car.overview; - -import android.app.Activity; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.ServiceConnection; -import android.graphics.Canvas; -import android.graphics.Rect; -import android.os.Bundle; -import android.os.Handler; -import android.os.IBinder; -import android.os.RemoteException; -import android.support.v7.widget.RecyclerView; -import android.util.Log; -import android.view.Gravity; -import android.view.View; -import android.widget.FrameLayout; -import android.widget.Toast; -import com.android.car.stream.IStreamConsumer; -import com.android.car.stream.IStreamService; -import com.android.car.stream.StreamCard; -import com.android.car.stream.StreamConstants; -import com.android.car.view.PagedListView; - -import java.util.List; - -/** - * An overview activity that presents {@link StreamCard} as scrollable list. - */ -public class StreamOverviewActivity extends Activity { - private static final String TAG = "Overview"; - private static final int SERVICE_CONNECTION_RETRY_DELAY_MS = 5000; - private static final String ACTION_CAR_OVERVIEW_STATE_CHANGE - = "android.intent.action.CAR_OVERVIEW_APP_STATE_CHANGE"; - private static final String EXTRA_CAR_OVERVIEW_FOREGROUND - = "android.intent.action.CAR_APP_STATE"; - - private static final int PERMISSION_ACTIVITY_REQUEST_CODE = 5151; - - private PagedListView mPageListView; - private View mPermissionText; - private StreamAdapter mAdapter; - private final Handler mHandler = new Handler(); - private int mConnectionRetryCount; - - private IStreamService mService; - private StreamServiceConnection mConnection; - - private int mCardBottomMargin; - private Toast mToast; - - boolean mCheckPermissionsOnResume; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.overview_activity); - mCardBottomMargin = getResources().getDimensionPixelSize(R.dimen.stream_card_bottom_margin); - - int statusBarHeight = getStatusBarHeight(); - - FrameLayout.LayoutParams params - = (FrameLayout.LayoutParams) findViewById(R.id.action_icon_bar).getLayoutParams(); - params.setMargins(0, statusBarHeight, 0, 0); - - mAdapter = new StreamAdapter(this /* context */); - - mPageListView = (PagedListView) findViewById(R.id.list_view); - mPageListView.setAdapter(mAdapter); - mPageListView.addItemDecoration(new DefaultDecoration()); - mPageListView.setLightMode(); - - int listTopMargin = statusBarHeight - + getResources().getDimensionPixelSize(R.dimen.lens_header_height); - FrameLayout.LayoutParams listViewParams - = (FrameLayout.LayoutParams) mPageListView.getLayoutParams(); - listViewParams.setMargins(0, listTopMargin, 0, 0); - - mPermissionText = findViewById(R.id.permission_text); - mPermissionText.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - startPermissionsActivity(false /* checkPermissionsOnly */); - } - }); - - mToast = Toast.makeText(StreamOverviewActivity.this, - getString(R.string.voice_assistant_help_msg), Toast.LENGTH_SHORT); - mToast.setGravity(Gravity.CENTER, 0, 0); - findViewById(R.id.voice_button).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - mToast.show(); - } - }); - - findViewById(R.id.gear_button).setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS)); - } - }); - - startPermissionsActivity(true /* checkPermissionsOnly */); - } - - private void startPermissionsActivity(boolean checkPermissionsOnly) { - // Start StreamService's permission activity before binding to it. - Intent intent = new Intent(); - intent.setComponent(new ComponentName( - getString(R.string.car_stream_item_manager_package_name), - getString(R.string.car_stream_item_manager_permissions_activity))); - intent.putExtra(StreamConstants.STREAM_PERMISSION_CHECK_PERMISSIONS_ONLY, - checkPermissionsOnly); - startActivityForResult(intent, PERMISSION_ACTIVITY_REQUEST_CODE); - } - - @Override - protected void onResume() { - super.onResume(); - if (mCheckPermissionsOnResume) { - startPermissionsActivity(true /* checkPermissionsOnly */); - } else { - mCheckPermissionsOnResume = true; - } - } - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == PERMISSION_ACTIVITY_REQUEST_CODE) { - // onResume is called after onActivityResult, if the permissions activity has - // already finished, then don't bother checking for permissions again on resume. - mCheckPermissionsOnResume = false; - if (resultCode == Activity.RESULT_OK) { - mPermissionText.setVisibility(View.GONE); - mPageListView.setVisibility(View.VISIBLE); - bindStreamService(); - } else { - mPermissionText.setVisibility(View.VISIBLE); - mPageListView.setVisibility(View.GONE); - } - } - } - - @Override - protected void onDestroy() { - // Do a tear down to avoid leaks - mHandler.removeCallbacks(mServiceConnectionRetry); - - if (mConnection != null) { - unbindService(mConnection); - } - super.onDestroy(); - } - - @Override - protected void onStart() { - super.onStart(); - Intent i = new Intent(ACTION_CAR_OVERVIEW_STATE_CHANGE); - i.putExtra(EXTRA_CAR_OVERVIEW_FOREGROUND, true); - sendBroadcast(i); - } - - @Override - protected void onStop() { - Intent i = new Intent(ACTION_CAR_OVERVIEW_STATE_CHANGE); - i.putExtra(EXTRA_CAR_OVERVIEW_FOREGROUND, false); - sendBroadcast(i); - super.onStop(); - } - - private class StreamServiceConnection implements ServiceConnection { - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - mConnectionRetryCount = 1; - // If there is currently a retry scheduled, cancel it. - if (mServiceConnectionRetry != null) { - mHandler.removeCallbacks(mServiceConnectionRetry); - } - - mService = IStreamService.Stub.asInterface(service); - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Service connected"); - } - try { - mService.registerConsumer(mStreamConsumer); - - List<StreamCard> cards = mService.fetchAllStreamCards(); - if (cards != null) { - for (StreamCard card : cards) { - mAdapter.addCard(card); - } - } - - - } catch (RemoteException e) { - throw new IllegalStateException("not connected to IStreamItemManagerService"); - } - } - - @Override - public void onServiceDisconnected(ComponentName name) { - mService = null; - mAdapter.removeAllCards(); - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Service disconnected, reconnecting..."); - } - - mHandler.removeCallbacks(mServiceConnectionRetry); - mHandler.postDelayed(mServiceConnectionRetry, SERVICE_CONNECTION_RETRY_DELAY_MS); - } - } - - private Runnable mServiceConnectionRetry = new Runnable() { - @Override - public void run() { - if (mService != null) { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Stream service rebound by framework, no need to bind again"); - } - return; - } - mConnectionRetryCount++; - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Rebinding disconnected Stream Service, retry count: " - + mConnectionRetryCount); - } - - if (!bindStreamService()) { - mHandler.postDelayed(mServiceConnectionRetry, - mConnectionRetryCount * SERVICE_CONNECTION_RETRY_DELAY_MS); - } - } - }; - - private final IStreamConsumer mStreamConsumer = new IStreamConsumer.Stub() { - @Override - public void onStreamCardAdded(StreamCard card) throws RemoteException { - StreamOverviewActivity.this.runOnUiThread(new Runnable() { - public void run() { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Stream Card added: " + card); - } - mAdapter.addCard(card); - } - }); - } - - @Override - public void onStreamCardRemoved(StreamCard card) throws RemoteException { - StreamOverviewActivity.this.runOnUiThread(new Runnable() { - public void run() { - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "Stream Card removed: " + card); - } - mAdapter.removeCard(card); - } - }); - } - - @Override - public void onStreamCardChanged(StreamCard newStreamCard) throws RemoteException { - } - }; - - private boolean bindStreamService() { - mConnection = new StreamServiceConnection(); - Intent intent = new Intent(); - intent.setAction(StreamConstants.STREAM_CONSUMER_BIND_ACTION); - intent.setComponent(new ComponentName( - getString(R.string.car_stream_item_manager_package_name), - getString(R.string.car_stream_item_manager_class_name))); - - boolean bound = bindService(intent, mConnection, BIND_AUTO_CREATE); - if (Log.isLoggable(TAG, Log.DEBUG)) { - Log.d(TAG, "IStreamItemManagerService bound: " + bound - + "; component: " + intent.getComponent()); - } - - return bound; - } - - private class DefaultDecoration extends RecyclerView.ItemDecoration { - @Override - public void getItemOffsets(Rect outRect, View view, RecyclerView parent, - RecyclerView.State state) { - outRect.bottom = mCardBottomMargin; - } - } - - private int getStatusBarHeight() { - int result = 0; - int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); - if (resourceId > 0) { - result = getResources().getDimensionPixelSize(resourceId); - } - return result; - } -} diff --git a/src/com/android/car/overview/StreamViewHolder.java b/src/com/android/car/overview/StreamViewHolder.java deleted file mode 100644 index ef801d4..0000000 --- a/src/com/android/car/overview/StreamViewHolder.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ -package com.android.car.overview; - -import android.content.Context; -import android.support.annotation.CallSuper; -import android.support.v7.widget.RecyclerView; -import android.view.View; -import com.android.car.stream.StreamCard; - -/** - * A base {@link RecyclerView.ViewHolder} for binding by the {@link StreamAdapter}. - */ -public abstract class StreamViewHolder extends RecyclerView.ViewHolder { - protected View mActionContainer; - protected Context mContext; - - public StreamViewHolder(Context context, View itemView) { - super(itemView); - mContext = context; - mActionContainer = itemView.findViewById(R.id.primary_action_container); - if (mActionContainer == null) { - throw new IllegalStateException("primary_action_container not found in layout." + - " Cards must have an affordance for the a primary action."); - } - } - - /** - * Bind a {@link StreamCard} to the views being held by this {@link RecyclerView.ViewHolder} - * @param card - */ - @CallSuper - public void bindStreamCard(StreamCard card) { - resetViews(); - } - - protected abstract void resetViews(); -} diff --git a/src/com/android/car/overview/utils/BitmapUtils.java b/src/com/android/car/overview/utils/BitmapUtils.java deleted file mode 100644 index bb037f5..0000000 --- a/src/com/android/car/overview/utils/BitmapUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ -package com.android.car.overview.utils; - -import android.graphics.Bitmap; -import android.graphics.Canvas; -import android.graphics.ColorMatrix; -import android.graphics.ColorMatrixColorFilter; -import android.graphics.Paint; - -/** - * Utility functions used by the Stream Service. - */ -public class BitmapUtils { - /** - * Apply saturation to a bitmap - */ - public static Bitmap applySaturation(Bitmap bitmap, float saturation) { - Bitmap mutableBitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true); - Canvas canvas = new Canvas(mutableBitmap); - - Paint paint = new Paint(); - ColorMatrix colorMatrix = new ColorMatrix(); - colorMatrix.setSaturation(saturation); - ColorMatrixColorFilter filter = new ColorMatrixColorFilter(colorMatrix); - paint.setColorFilter(filter); - canvas.drawBitmap(bitmap, 0, 0, paint); - return mutableBitmap; - } -} |