summaryrefslogtreecommitdiff
path: root/java/com/android/incallui/sessiondata
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-02-22 16:32:36 -0800
committerEric Erfanian <erfanian@google.com>2017-03-01 09:56:52 -0800
commitccca31529c07970e89419fb85a9e8153a5396838 (patch)
treea7034c0a01672b97728c13282a2672771cd28baa /java/com/android/incallui/sessiondata
parente7ae4624ba6f25cb8e648db74e0d64c0113a16ba (diff)
Update dialer sources.
Test: Built package and system image. This change clobbers the old source, and is an export from an internal Google repository. The internal repository was forked form Android in March, and this change includes modifications since then, to near the v8 release. Since the fork, we've moved code from monolithic to independent modules. In addition, we've switched to Blaze/Bazel as the build sysetm. This export, however, still uses make. New dependencies have been added: - Dagger - Auto-Value - Glide - Libshortcutbadger Going forward, development will still be in Google3, and the Gerrit release will become an automated export, with the next drop happening in ~ two weeks. Android.mk includes local modifications from ToT. Abridged changelog: Bug fixes ● Not able to mute, add a call when using Phone app in multiwindow mode ● Double tap on keypad triggering multiple key and tones ● Reported spam numbers not showing as spam in the call log ● Crash when user tries to block number while Phone app is not set as default ● Crash when user picks a number from search auto-complete list Visual Voicemail (VVM) improvements ● Share Voicemail audio via standard exporting mechanisms that support file attachment (email, MMS, etc.) ● Make phone number, email and web sites in VVM transcript clickable ● Set PIN before declining VVM Terms of Service {Carrier} ● Set client type for outbound visual voicemail SMS {Carrier} New incoming call and incall UI on older devices (Android M) ● Updated Phone app icon ● New incall UI (large buttons, button labels) ● New and animated Answer/Reject gestures Accessibility ● Add custom answer/decline call buttons on answer screen for touch exploration accessibility services ● Increase size of touch target ● Add verbal feedback when a Voicemail fails to load ● Fix pressing of Phone buttons while in a phone call using Switch Access ● Fix selecting and opening contacts in talkback mode ● Split focus for ‘Learn More’ link in caller id & spam to help distinguish similar text Other ● Backup & Restore for App Preferences ● Prompt user to enable Wi-Fi calling if the call ends due to out of service and Wi-Fi is connected ● Rename “Dialpad” to “Keypad” ● Show "Private number" for restricted calls ● Delete unused items (vcard, add contact, call history) from Phone menu Change-Id: I2a7e53532a24c21bf308bf0a6d178d7ddbca4958
Diffstat (limited to 'java/com/android/incallui/sessiondata')
-rw-r--r--java/com/android/incallui/sessiondata/AndroidManifest.xml18
-rw-r--r--java/com/android/incallui/sessiondata/AvatarPresenter.java31
-rw-r--r--java/com/android/incallui/sessiondata/MultimediaFragment.java231
-rw-r--r--java/com/android/incallui/sessiondata/res/drawable/answer_data_background.xml22
-rw-r--r--java/com/android/incallui/sessiondata/res/layout/fragment_composer_frag.xml42
-rw-r--r--java/com/android/incallui/sessiondata/res/layout/fragment_composer_image.xml50
-rw-r--r--java/com/android/incallui/sessiondata/res/layout/fragment_composer_image_frag.xml59
-rw-r--r--java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml43
-rw-r--r--java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_frag.xml61
-rw-r--r--java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image.xml62
-rw-r--r--java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image_frag.xml78
-rw-r--r--java/com/android/incallui/sessiondata/res/values/dimens.xml21
-rw-r--r--java/com/android/incallui/sessiondata/res/values/ids.xml23
-rw-r--r--java/com/android/incallui/sessiondata/res/values/styles.xml24
14 files changed, 765 insertions, 0 deletions
diff --git a/java/com/android/incallui/sessiondata/AndroidManifest.xml b/java/com/android/incallui/sessiondata/AndroidManifest.xml
new file mode 100644
index 000000000..11babd94d
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/AndroidManifest.xml
@@ -0,0 +1,18 @@
+<!--
+ ~ 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
+ package="com.android.incallui.sessiondata">
+</manifest>
diff --git a/java/com/android/incallui/sessiondata/AvatarPresenter.java b/java/com/android/incallui/sessiondata/AvatarPresenter.java
new file mode 100644
index 000000000..e7303b90a
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/AvatarPresenter.java
@@ -0,0 +1,31 @@
+/*
+ * 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.incallui.sessiondata;
+
+import android.support.annotation.Nullable;
+import android.widget.ImageView;
+
+/** Interface for interacting with Fragments that can be put in the data container */
+public interface AvatarPresenter {
+
+ @Nullable
+ ImageView getAvatarImageView();
+
+ int getAvatarSize();
+
+ boolean shouldShowAnonymousAvatar();
+}
diff --git a/java/com/android/incallui/sessiondata/MultimediaFragment.java b/java/com/android/incallui/sessiondata/MultimediaFragment.java
new file mode 100644
index 000000000..d6f671d58
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/MultimediaFragment.java
@@ -0,0 +1,231 @@
+/*
+ * 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.incallui.sessiondata;
+
+import android.graphics.drawable.Drawable;
+import android.location.Location;
+import android.net.Uri;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.annotation.VisibleForTesting;
+import android.support.v4.app.Fragment;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+import com.android.dialer.common.Assert;
+import com.android.dialer.common.FragmentUtils;
+import com.android.dialer.common.LogUtil;
+import com.android.dialer.multimedia.MultimediaData;
+import com.android.incallui.maps.StaticMapBinding;
+import com.android.incallui.maps.StaticMapFactory;
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.DataSource;
+import com.bumptech.glide.load.engine.GlideException;
+import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions;
+import com.bumptech.glide.request.RequestListener;
+import com.bumptech.glide.request.target.Target;
+
+/**
+ * Displays info from {@link MultimediaData MultimediaData}.
+ *
+ * <p>Currently displays image, location (as a map), and message that come bundled with
+ * MultimediaData when calling {@link #newInstance(MultimediaData, boolean, boolean)}.
+ */
+public class MultimediaFragment extends Fragment implements AvatarPresenter {
+
+ private static final String ARG_SUBJECT = "subject";
+ private static final String ARG_IMAGE = "image";
+ private static final String ARG_LOCATION = "location";
+ private static final String ARG_INTERACTIVE = "interactive";
+ private static final String ARG_SHOW_AVATAR = "show_avatar";
+ private ImageView avatarImageView;
+ // TODO: add click listeners
+ @SuppressWarnings("unused")
+ private boolean isInteractive;
+
+ private boolean showAvatar;
+ private StaticMapFactory mapFactory;
+
+ public static MultimediaFragment newInstance(
+ @NonNull MultimediaData multimediaData, boolean isInteractive, boolean showAvatar) {
+ return newInstance(
+ multimediaData.getSubject(),
+ multimediaData.getImageUri(),
+ multimediaData.getLocation(),
+ isInteractive,
+ showAvatar);
+ }
+
+ @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE)
+ public static MultimediaFragment newInstance(
+ @Nullable String subject,
+ @Nullable Uri imageUri,
+ @Nullable Location location,
+ boolean isInteractive,
+ boolean showAvatar) {
+ Bundle args = new Bundle();
+ args.putString(ARG_SUBJECT, subject);
+ args.putParcelable(ARG_IMAGE, imageUri);
+ args.putParcelable(ARG_LOCATION, location);
+ args.putBoolean(ARG_INTERACTIVE, isInteractive);
+ args.putBoolean(ARG_SHOW_AVATAR, showAvatar);
+ MultimediaFragment fragment = new MultimediaFragment();
+ fragment.setArguments(args);
+ return fragment;
+ }
+
+ @Override
+ public void onCreate(@Nullable Bundle bundle) {
+ super.onCreate(bundle);
+ isInteractive = getArguments().getBoolean(ARG_INTERACTIVE);
+ showAvatar = getArguments().getBoolean(ARG_SHOW_AVATAR);
+ }
+
+ @Nullable
+ @Override
+ public View onCreateView(
+ LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
+ boolean hasImage = getImageUri() != null;
+ boolean hasSubject = !TextUtils.isEmpty(getSubject());
+ boolean hasMap = getLocation() != null;
+ if (hasMap) {
+ mapFactory = StaticMapBinding.get(getActivity().getApplication());
+ }
+ if (mapFactory != null) {
+ if (hasImage) {
+ if (hasSubject) {
+ return layoutInflater.inflate(
+ R.layout.fragment_composer_text_image_frag, viewGroup, false);
+ } else {
+ return layoutInflater.inflate(R.layout.fragment_composer_image_frag, viewGroup, false);
+ }
+ } else if (hasSubject) {
+ return layoutInflater.inflate(R.layout.fragment_composer_text_frag, viewGroup, false);
+ } else {
+ return layoutInflater.inflate(R.layout.fragment_composer_frag, viewGroup, false);
+ }
+ } else if (hasImage) {
+ if (hasSubject) {
+ return layoutInflater.inflate(R.layout.fragment_composer_text_image, viewGroup, false);
+ } else {
+ return layoutInflater.inflate(R.layout.fragment_composer_image, viewGroup, false);
+ }
+ } else {
+ return layoutInflater.inflate(R.layout.fragment_composer_text, viewGroup, false);
+ }
+ }
+
+ @Override
+ public void onViewCreated(View view, @Nullable Bundle bundle) {
+ super.onViewCreated(view, bundle);
+ TextView messageText = (TextView) view.findViewById(R.id.answer_message_text);
+ if (messageText != null) {
+ messageText.setText(getSubject());
+ }
+ ImageView mainImage = (ImageView) view.findViewById(R.id.answer_message_image);
+ if (mainImage != null) {
+ Glide.with(this)
+ .load(getImageUri())
+ .transition(DrawableTransitionOptions.withCrossFade())
+ .listener(
+ new RequestListener<Drawable>() {
+ @Override
+ public boolean onLoadFailed(
+ @Nullable GlideException e,
+ Object model,
+ Target<Drawable> target,
+ boolean isFirstResource) {
+ view.findViewById(R.id.loading_spinner).setVisibility(View.GONE);
+ LogUtil.e("MultimediaFragment.onLoadFailed", null, e);
+ // TODO(b/34720074) handle error cases nicely
+ return false; // Let Glide handle the rest
+ }
+
+ @Override
+ public boolean onResourceReady(
+ Drawable drawable,
+ Object model,
+ Target<Drawable> target,
+ DataSource dataSource,
+ boolean isFirstResource) {
+ view.findViewById(R.id.loading_spinner).setVisibility(View.GONE);
+ return false;
+ }
+ })
+ .into(mainImage);
+ mainImage.setClipToOutline(true);
+ }
+ FrameLayout fragmentHolder = (FrameLayout) view.findViewById(R.id.answer_message_frag);
+ if (fragmentHolder != null) {
+ fragmentHolder.setClipToOutline(true);
+ Fragment mapFragment =
+ Assert.isNotNull(mapFactory).getStaticMap(Assert.isNotNull(getLocation()));
+ getChildFragmentManager()
+ .beginTransaction()
+ .replace(R.id.answer_message_frag, mapFragment)
+ .commitNow();
+ }
+ avatarImageView = ((ImageView) view.findViewById(R.id.answer_message_avatar));
+ avatarImageView.setVisibility(showAvatar ? View.VISIBLE : View.GONE);
+
+ Holder parent = FragmentUtils.getParent(this, Holder.class);
+ if (parent != null) {
+ parent.updateAvatar(this);
+ }
+ }
+
+ @Nullable
+ @Override
+ public ImageView getAvatarImageView() {
+ return avatarImageView;
+ }
+
+ @Override
+ public int getAvatarSize() {
+ return getResources().getDimensionPixelSize(R.dimen.answer_message_avatar_size);
+ }
+
+ @Override
+ public boolean shouldShowAnonymousAvatar() {
+ return showAvatar;
+ }
+
+ @Nullable
+ public String getSubject() {
+ return getArguments().getString(ARG_SUBJECT);
+ }
+
+ @Nullable
+ public Uri getImageUri() {
+ return getArguments().getParcelable(ARG_IMAGE);
+ }
+
+ @Nullable
+ public Location getLocation() {
+ return getArguments().getParcelable(ARG_LOCATION);
+ }
+
+ /** Interface for notifying the fragment parent of changes. */
+ public interface Holder {
+ void updateAvatar(AvatarPresenter sessionDataScreen);
+ }
+}
diff --git a/java/com/android/incallui/sessiondata/res/drawable/answer_data_background.xml b/java/com/android/incallui/sessiondata/res/drawable/answer_data_background.xml
new file mode 100644
index 000000000..8826f904b
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/drawable/answer_data_background.xml
@@ -0,0 +1,22 @@
+<?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"
+ android:shape="rectangle">
+ <corners android:radius="16dp"/>
+ <solid android:color="@android:color/white"/>
+</shape>
diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_frag.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_frag.xml
new file mode 100644
index 000000000..ed2bee0d1
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_frag.xml
@@ -0,0 +1,42 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="24dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@id/answer_message_avatar"
+ android:layout_width="@dimen/answer_message_avatar_size"
+ android:layout_height="@dimen/answer_message_avatar_size"
+ android:elevation="@dimen/answer_data_elevation"/>
+
+ <FrameLayout
+ android:id="@id/answer_message_frag"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"/>
+</LinearLayout>
diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_image.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_image.xml
new file mode 100644
index 000000000..7000f83b5
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_image.xml
@@ -0,0 +1,50 @@
+<?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
+ -->
+
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="24dp">
+
+ <ImageView
+ android:id="@id/answer_message_avatar"
+ android:layout_width="@dimen/answer_message_avatar_size"
+ android:layout_height="@dimen/answer_message_avatar_size"
+ android:elevation="@dimen/answer_data_elevation"/>
+
+ <ImageView
+ android:id="@id/answer_message_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:layout_centerInParent="true"
+ android:layout_toEndOf="@+id/answer_message_avatar"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"
+ android:adjustViewBounds="true"
+ android:scaleType="fitXY"/>
+
+ <ProgressBar
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:id="@+id/loading_spinner"
+ android:layout_centerInParent="true"/>
+</RelativeLayout>
diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_image_frag.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_image_frag.xml
new file mode 100644
index 000000000..9959f4dcc
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_image_frag.xml
@@ -0,0 +1,59 @@
+<?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
+ -->
+
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="24dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@id/answer_message_avatar"
+ android:layout_width="@dimen/answer_message_avatar_size"
+ android:layout_height="@dimen/answer_message_avatar_size"
+ android:layout_rowSpan="2"
+ android:elevation="@dimen/answer_data_elevation"/>
+
+ <ImageView
+ android:id="@id/answer_message_image"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginStart="8dp"
+ android:layout_columnWeight="1"
+ android:layout_rowWeight="1"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"
+ android:scaleType="centerCrop"/>
+
+ <FrameLayout
+ android:id="@id/answer_message_frag"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:layout_column="1"
+ android:layout_columnWeight="1"
+ android:layout_row="1"
+ android:layout_rowWeight="1"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"/>
+</GridLayout>
diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml
new file mode 100644
index 000000000..c69973042
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text.xml
@@ -0,0 +1,43 @@
+<?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:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="24dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@id/answer_message_avatar"
+ android:layout_width="@dimen/answer_message_avatar_size"
+ android:layout_height="@dimen/answer_message_avatar_size"
+ android:elevation="@dimen/answer_data_elevation"/>
+
+ <TextView
+ android:id="@id/answer_message_text"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:padding="18dp"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:textAppearance="@style/Dialer.Incall.TextAppearance.Message"/>
+</LinearLayout>
diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_frag.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_frag.xml
new file mode 100644
index 000000000..5a1cf728b
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_frag.xml
@@ -0,0 +1,61 @@
+<?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
+ -->
+
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="24dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@id/answer_message_avatar"
+ android:layout_width="@dimen/answer_message_avatar_size"
+ android:layout_height="@dimen/answer_message_avatar_size"
+ android:layout_rowSpan="2"
+ android:elevation="@dimen/answer_data_elevation"/>
+
+ <TextView
+ android:id="@id/answer_message_text"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginStart="8dp"
+ android:layout_columnWeight="1"
+ android:layout_rowWeight="1"
+ android:padding="18dp"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:gravity="center_vertical"
+ android:maxLines="2"
+ android:textAppearance="@style/Dialer.Incall.TextAppearance.Message"/>
+
+ <FrameLayout
+ android:id="@id/answer_message_frag"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:layout_column="1"
+ android:layout_columnWeight="1"
+ android:layout_row="1"
+ android:layout_rowWeight="1"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"/>
+</GridLayout>
diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image.xml
new file mode 100644
index 000000000..995565455
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image.xml
@@ -0,0 +1,62 @@
+<?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
+ -->
+
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="24dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@id/answer_message_avatar"
+ android:layout_width="@dimen/answer_message_avatar_size"
+ android:layout_height="@dimen/answer_message_avatar_size"
+ android:layout_rowSpan="2"
+ android:elevation="@dimen/answer_data_elevation"/>
+
+ <TextView
+ android:id="@id/answer_message_text"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginStart="8dp"
+ android:layout_columnWeight="1"
+ android:layout_rowWeight="1"
+ android:padding="18dp"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:gravity="center_vertical"
+ android:maxLines="2"
+ android:textAppearance="@style/Dialer.Incall.TextAppearance.Message"/>
+
+ <ImageView
+ android:id="@id/answer_message_image"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:layout_column="1"
+ android:layout_columnWeight="1"
+ android:layout_row="1"
+ android:layout_rowWeight="1"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"
+ android:scaleType="centerCrop"/>
+</GridLayout>
diff --git a/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image_frag.xml b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image_frag.xml
new file mode 100644
index 000000000..387c5cf68
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/layout/fragment_composer_text_image_frag.xml
@@ -0,0 +1,78 @@
+<?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
+ -->
+
+<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="16dp"
+ android:paddingStart="16dp"
+ android:paddingEnd="24dp"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:id="@id/answer_message_avatar"
+ android:layout_width="@dimen/answer_message_avatar_size"
+ android:layout_height="@dimen/answer_message_avatar_size"
+ android:layout_rowSpan="2"
+ android:elevation="@dimen/answer_data_elevation"/>
+
+ <TextView
+ android:id="@id/answer_message_text"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginStart="8dp"
+ android:layout_columnWeight="2"
+ android:layout_columnSpan="2"
+ android:layout_rowWeight="1"
+ android:padding="18dp"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:gravity="center_vertical"
+ android:maxLines="2"
+ android:textAppearance="@style/Dialer.Incall.TextAppearance.Message"/>
+
+ <ImageView
+ android:id="@id/answer_message_image"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:layout_column="1"
+ android:layout_columnWeight="1"
+ android:layout_row="1"
+ android:layout_rowWeight="1"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"
+ android:scaleType="centerCrop"/>
+
+ <FrameLayout
+ android:id="@id/answer_message_frag"
+ android:layout_width="0dp"
+ android:layout_height="0dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"
+ android:layout_marginStart="8dp"
+ android:layout_column="2"
+ android:layout_columnWeight="1"
+ android:layout_row="1"
+ android:layout_rowWeight="1"
+ android:background="@drawable/answer_data_background"
+ android:elevation="@dimen/answer_data_elevation"
+ android:outlineProvider="background"/>
+</GridLayout>
diff --git a/java/com/android/incallui/sessiondata/res/values/dimens.xml b/java/com/android/incallui/sessiondata/res/values/dimens.xml
new file mode 100644
index 000000000..76c7edb1b
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/values/dimens.xml
@@ -0,0 +1,21 @@
+<?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="answer_message_avatar_size">40dp</dimen>
+ <dimen name="answer_data_elevation">2dp</dimen>
+</resources>
diff --git a/java/com/android/incallui/sessiondata/res/values/ids.xml b/java/com/android/incallui/sessiondata/res/values/ids.xml
new file mode 100644
index 000000000..077474c81
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/values/ids.xml
@@ -0,0 +1,23 @@
+<?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>
+ <item name="answer_message_avatar" type="id"/>
+ <item name="answer_message_text" type="id"/>
+ <item name="answer_message_image" type="id"/>
+ <item name="answer_message_frag" type="id"/>
+</resources>
diff --git a/java/com/android/incallui/sessiondata/res/values/styles.xml b/java/com/android/incallui/sessiondata/res/values/styles.xml
new file mode 100644
index 000000000..dd898a4e2
--- /dev/null
+++ b/java/com/android/incallui/sessiondata/res/values/styles.xml
@@ -0,0 +1,24 @@
+<?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="Dialer.Incall.TextAppearance.Message" parent="Dialer.Incall.TextAppearance">
+ <item name="android:fontFamily">sans-serif</item>
+ <item name="android:textColor">@android:color/black</item>
+ <item name="android:textSize">24sp</item>
+ </style>
+</resources>