diff options
author | Jason Monk <jmonk@google.com> | 2014-09-11 13:36:42 -0400 |
---|---|---|
committer | Jason Monk <jmonk@google.com> | 2014-11-07 11:09:19 -0500 |
commit | 18f99d91349a4f5ce55e22ed33f1f57eb1b0297b (patch) | |
tree | 21e42ee68f245bf833c6a02f3dce6ed3963bcfd0 /packages/SystemUI/res/layout | |
parent | 5565cb42f2ac07fcdbe3aab2503de07fbeb39504 (diff) | |
download | frameworks_base-18f99d91349a4f5ce55e22ed33f1f57eb1b0297b.zip frameworks_base-18f99d91349a4f5ce55e22ed33f1f57eb1b0297b.tar.gz frameworks_base-18f99d91349a4f5ce55e22ed33f1f57eb1b0297b.tar.bz2 |
Material design for screen pinning cling
Switching from a dialog to a cling-like view to be more material.
Also moving it into SysUI as it highlights the buttons in nav bar.
This will be triggered directly from recents, but from apps it
will be triggered by the PhoneStatusBar. In the case that apps
trigger the request, there will be a 'no thanks' button so that
users can refuse.
Bug: 16957435
Change-Id: Ie880f82c66f4b2be98283ed3fa789703c4bd7ed5
Diffstat (limited to 'packages/SystemUI/res/layout')
5 files changed, 435 insertions, 0 deletions
diff --git a/packages/SystemUI/res/layout/screen_pinning_request.xml b/packages/SystemUI/res/layout/screen_pinning_request.xml new file mode 100644 index 0000000..fea45cc --- /dev/null +++ b/packages/SystemUI/res/layout/screen_pinning_request.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2014, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="@dimen/screen_pinning_request_width" + android:layout_height="wrap_content" + android:gravity="bottom|center_horizontal" + android:layoutDirection="ltr" + android:orientation="vertical" > + + <include + android:layout_width="@dimen/screen_pinning_request_width" + android:layout_height="wrap_content" + layout="@layout/screen_pinning_request_text_area" /> + + <View + android:id="@+id/spacer" + android:layout_width="@dimen/screen_pinning_request_width" + android:layout_height="18dp" + android:background="@color/screen_pinning_request_bg" /> + + <include + android:layout_width="@dimen/screen_pinning_request_width" + android:layout_height="wrap_content" + layout="@layout/screen_pinning_request_buttons" /> + +</LinearLayout> diff --git a/packages/SystemUI/res/layout/screen_pinning_request_buttons.xml b/packages/SystemUI/res/layout/screen_pinning_request_buttons.xml new file mode 100644 index 0000000..224a0a0 --- /dev/null +++ b/packages/SystemUI/res/layout/screen_pinning_request_buttons.xml @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2014, 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 layout matches the structure of navigation_bar.xml and will need + to be kept up to sync with changes there. + On sw600dp, dimensions are changed to be large enough such that the + empty views between the buttons is reduced to nothing, if (nav bar) + sw600dp layout is changed then this will likely have to be adjusted + and possibly need a sw600dp specific one. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/screen_pinning_buttons" + android:layout_width="match_parent" + android:layout_height="@dimen/screen_pinning_request_button_height" + android:background="@color/screen_pinning_request_bg" > + + <View + android:layout_width="@dimen/screen_pinning_request_side_width" + android:layout_height="match_parent" + android:layout_weight="0" + android:visibility="invisible" /> + + <FrameLayout + android:id="@+id/screen_pinning_back_group" + android:layout_width="@dimen/screen_pinning_request_button_width" + android:layout_height="@dimen/screen_pinning_request_button_height" + android:layout_weight="0" + android:paddingStart="@dimen/screen_pinning_request_frame_padding" + android:paddingEnd="@dimen/screen_pinning_request_frame_padding" > + + <ImageView + android:id="@+id/screen_pinning_back_bg_light" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="matrix" + android:src="@drawable/screen_pinning_light_bg_circ" /> + + <ImageView + android:id="@+id/screen_pinning_back_bg" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingEnd="@dimen/screen_pinning_request_inner_padding" + android:paddingStart="@dimen/screen_pinning_request_inner_padding" + android:paddingTop="@dimen/screen_pinning_request_inner_padding" + android:scaleType="matrix" + android:src="@drawable/screen_pinning_bg_circ" /> + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingEnd="@dimen/screen_pinning_request_nav_side_padding" + android:paddingStart="@dimen/screen_pinning_request_nav_side_padding" + android:paddingTop="@dimen/screen_pinning_request_nav_icon_padding" + android:scaleType="center" + android:src="@drawable/ic_sysbar_back" /> + </FrameLayout> + + <View + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:visibility="invisible" /> + + <FrameLayout + android:id="@+id/screen_pinning_home_group" + android:layout_width="@dimen/screen_pinning_request_button_width" + android:layout_height="@dimen/screen_pinning_request_button_height" + android:layout_weight="0" + android:paddingStart="@dimen/screen_pinning_request_frame_padding" + android:paddingEnd="@dimen/screen_pinning_request_frame_padding" > + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingEnd="@dimen/screen_pinning_request_nav_side_padding" + android:paddingStart="@dimen/screen_pinning_request_nav_side_padding" + android:paddingTop="@dimen/screen_pinning_request_nav_icon_padding" + android:scaleType="center" + android:src="@drawable/ic_sysbar_home" /> + </FrameLayout> + + <View + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:visibility="invisible" /> + + <FrameLayout + android:id="@+id/screen_pinning_recents_group" + android:layout_width="@dimen/screen_pinning_request_button_width" + android:layout_height="@dimen/screen_pinning_request_button_height" + android:layout_weight="0" + android:paddingStart="@dimen/screen_pinning_request_frame_padding" + android:paddingEnd="@dimen/screen_pinning_request_frame_padding" > + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:scaleType="matrix" + android:src="@drawable/screen_pinning_light_bg_circ" /> + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingEnd="@dimen/screen_pinning_request_inner_padding" + android:paddingStart="@dimen/screen_pinning_request_inner_padding" + android:paddingTop="@dimen/screen_pinning_request_inner_padding" + android:scaleType="matrix" + android:src="@drawable/screen_pinning_bg_circ" /> + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingEnd="@dimen/screen_pinning_request_nav_side_padding" + android:paddingStart="@dimen/screen_pinning_request_nav_side_padding" + android:paddingTop="@dimen/screen_pinning_request_nav_icon_padding" + android:scaleType="center" + android:src="@drawable/ic_sysbar_recent" /> + </FrameLayout> + + <View + android:layout_width="@dimen/screen_pinning_request_side_width" + android:layout_height="match_parent" + android:layout_weight="0" + android:visibility="invisible" /> + +</LinearLayout> diff --git a/packages/SystemUI/res/layout/screen_pinning_request_buttons_land.xml b/packages/SystemUI/res/layout/screen_pinning_request_buttons_land.xml new file mode 100644 index 0000000..1e5193f --- /dev/null +++ b/packages/SystemUI/res/layout/screen_pinning_request_buttons_land.xml @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2014, 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. + */ +--> +<!-- Note all width/height dimensions are switched here to handle landspace + rather than duplicating them all. + This layout matches the structure of navigation_bar.xml (rot90) and + will need to be kept up to sync with changes there. +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/screen_pinning_buttons" + android:layout_height="match_parent" + android:layout_width="@dimen/screen_pinning_request_button_height" + android:background="@color/screen_pinning_request_bg" + android:orientation="vertical" > + + <View + android:layout_height="@dimen/screen_pinning_request_side_width" + android:layout_width="match_parent" + android:layout_weight="0" + android:visibility="invisible" /> + + <FrameLayout + android:id="@+id/screen_pinning_recents_group" + android:layout_height="@dimen/screen_pinning_request_button_width" + android:layout_width="@dimen/screen_pinning_request_button_height" + android:layout_weight="0" > + + <ImageView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:scaleType="matrix" + android:src="@drawable/screen_pinning_light_bg_circ" /> + + <ImageView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:scaleType="matrix" + android:paddingLeft="@dimen/screen_pinning_request_inner_padding" + android:paddingTop="@dimen/screen_pinning_request_inner_padding" + android:paddingBottom="@dimen/screen_pinning_request_inner_padding" + android:src="@drawable/screen_pinning_bg_circ" /> + + <ImageView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:scaleType="center" + android:paddingLeft="@dimen/screen_pinning_request_nav_icon_padding" + android:paddingTop="@dimen/screen_pinning_request_nav_side_padding" + android:paddingBottom="@dimen/screen_pinning_request_nav_side_padding" + android:src="@drawable/ic_sysbar_recent" /> + </FrameLayout> + + <View + android:layout_height="match_parent" + android:layout_width="match_parent" + android:layout_weight="1" + android:visibility="invisible" /> + + <FrameLayout + android:id="@+id/screen_pinning_home_group" + android:layout_height="@dimen/screen_pinning_request_button_width" + android:layout_width="@dimen/screen_pinning_request_button_height" + android:layout_weight="0" > + + <ImageView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:scaleType="center" + android:paddingLeft="@dimen/screen_pinning_request_nav_icon_padding" + android:paddingTop="@dimen/screen_pinning_request_nav_side_padding" + android:paddingBottom="@dimen/screen_pinning_request_nav_side_padding" + android:src="@drawable/ic_sysbar_home" /> + </FrameLayout> + + <View + android:layout_height="match_parent" + android:layout_width="match_parent" + android:layout_weight="1" + android:visibility="invisible" /> + + <FrameLayout + android:id="@+id/screen_pinning_back_group" + android:layout_height="@dimen/screen_pinning_request_button_width" + android:layout_width="@dimen/screen_pinning_request_button_height" + android:layout_weight="0" > + + <ImageView + android:id="@+id/screen_pinning_back_bg_light" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:scaleType="matrix" + android:src="@drawable/screen_pinning_light_bg_circ" /> + + <ImageView + android:id="@+id/screen_pinning_back_bg" + android:layout_height="match_parent" + android:layout_width="match_parent" + android:scaleType="matrix" + android:paddingLeft="@dimen/screen_pinning_request_inner_padding" + android:paddingTop="@dimen/screen_pinning_request_inner_padding" + android:paddingBottom="@dimen/screen_pinning_request_inner_padding" + android:src="@drawable/screen_pinning_bg_circ" /> + + <ImageView + android:layout_height="match_parent" + android:layout_width="match_parent" + android:scaleType="center" + android:paddingLeft="@dimen/screen_pinning_request_nav_icon_padding" + android:paddingTop="@dimen/screen_pinning_request_nav_side_padding" + android:paddingBottom="@dimen/screen_pinning_request_nav_side_padding" + android:src="@drawable/ic_sysbar_back" /> + </FrameLayout> + + <View + android:layout_height="@dimen/screen_pinning_request_side_width" + android:layout_width="match_parent" + android:layout_weight="0" + android:visibility="invisible" /> + +</LinearLayout> diff --git a/packages/SystemUI/res/layout/screen_pinning_request_land_phone.xml b/packages/SystemUI/res/layout/screen_pinning_request_land_phone.xml new file mode 100644 index 0000000..e6c22d4 --- /dev/null +++ b/packages/SystemUI/res/layout/screen_pinning_request_land_phone.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2014, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_height="@dimen/screen_pinning_request_width" + android:layout_width="wrap_content" + android:gravity="right|center_vertical" + android:orientation="horizontal" > + + <include + android:layout_width="360dp" + android:layout_height="@dimen/screen_pinning_request_width" + layout="@layout/screen_pinning_request_text_area" /> + + <include + android:layout_width="wrap_content" + android:layout_height="@dimen/screen_pinning_request_width" + layout="@layout/screen_pinning_request_buttons_land" /> + +</LinearLayout> diff --git a/packages/SystemUI/res/layout/screen_pinning_request_text_area.xml b/packages/SystemUI/res/layout/screen_pinning_request_text_area.xml new file mode 100644 index 0000000..df957f4 --- /dev/null +++ b/packages/SystemUI/res/layout/screen_pinning_request_text_area.xml @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2014, The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +--> +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/screen_pinning_text_area" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:background="@color/screen_pinning_request_bg" + android:gravity="center_vertical" > + + <TextView + android:id="@+id/screen_pinning_title" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingEnd="48dp" + android:paddingStart="48dp" + android:paddingTop="43dp" + android:text="@string/screen_pinning_title" + android:textColor="@color/screen_pinning_primary_text" + android:textSize="24sp" /> + + <TextView + android:id="@+id/screen_pinning_description" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_below="@id/screen_pinning_title" + android:paddingEnd="48dp" + android:paddingStart="48dp" + android:paddingTop="12.6dp" + android:text="@string/screen_pinning_description" + android:textColor="@color/screen_pinning_primary_text" + android:textSize="16sp" /> + + <Button + android:id="@+id/screen_pinning_ok_button" + style="@android:style/Widget.Material.Button" + android:layout_width="wrap_content" + android:layout_height="36dp" + android:layout_alignParentEnd="true" + android:layout_below="@+id/screen_pinning_description" + android:layout_marginEnd="40dp" + android:layout_marginTop="18dp" + android:background="@null" + android:paddingEnd="8dp" + android:paddingStart="8dp" + android:text="@string/screen_pinning_positive" + android:textColor="@android:color/white" + android:textSize="14sp" /> + + <Button + android:id="@+id/screen_pinning_cancel_button" + style="@android:style/Widget.Material.Button" + android:layout_width="wrap_content" + android:layout_height="36dp" + android:layout_alignTop="@id/screen_pinning_ok_button" + android:layout_marginEnd="4dp" + android:layout_toStartOf="@id/screen_pinning_ok_button" + android:background="@null" + android:paddingEnd="8dp" + android:paddingStart="8dp" + android:text="@string/screen_pinning_negative" + android:textColor="@android:color/white" + android:textSize="14sp" /> + +</RelativeLayout> |