diff options
author | wangqi <wangqi@google.com> | 2018-04-17 14:48:03 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-04-17 15:55:51 -0700 |
commit | e00bbaeceb399da24f06c8f1a626cbbf07eab4ad (patch) | |
tree | 2f18f4411d650f4a162d03da62936e05bdaa088f /java/com/android/dialer/rtt/res | |
parent | 9a14f6a71206add856193cd90971d94c39f079fa (diff) |
Add RTT transcript screen.
Bug: 67596257
Test: CallDetailsCursorLoaderTest
PiperOrigin-RevId: 193259769
Change-Id: I8c6a8eb9a6bf06e9c1c25c45fc035f8db8ae5a65
Diffstat (limited to 'java/com/android/dialer/rtt/res')
7 files changed, 203 insertions, 0 deletions
diff --git a/java/com/android/dialer/rtt/res/color/bubble_background.xml b/java/com/android/dialer/rtt/res/color/bubble_background.xml new file mode 100644 index 000000000..fb29ab6c5 --- /dev/null +++ b/java/com/android/dialer/rtt/res/color/bubble_background.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:state_enabled="false" + android:color="@android:color/white" /> + <item android:color="@color/rtt_transcript_primary_color" /> +</selector>
\ No newline at end of file diff --git a/java/com/android/dialer/rtt/res/drawable/message_bubble.xml b/java/com/android/dialer/rtt/res/drawable/message_bubble.xml new file mode 100644 index 000000000..2b01f62f9 --- /dev/null +++ b/java/com/android/dialer/rtt/res/drawable/message_bubble.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="@android:color/white"/> + <corners android:radius="20dp"/> +</shape>
\ No newline at end of file diff --git a/java/com/android/dialer/rtt/res/layout/activity_rtt_transcript.xml b/java/com/android/dialer/rtt/res/layout/activity_rtt_transcript.xml new file mode 100644 index 000000000..628a7932e --- /dev/null +++ b/java/com/android/dialer/rtt/res/layout/activity_rtt_transcript.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2018 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> + +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/rtt_transcript_background_color"> + + <android.support.v7.widget.RecyclerView + android:id="@+id/rtt_recycler_view" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:paddingTop="16dp" + android:paddingBottom="16dp" + android:clipToPadding="false"/> + +</FrameLayout> diff --git a/java/com/android/dialer/rtt/res/layout/rtt_transcript_list_item.xml b/java/com/android/dialer/rtt/res/layout/rtt_transcript_list_item.xml new file mode 100644 index 000000000..d86a6823a --- /dev/null +++ b/java/com/android/dialer/rtt/res/layout/rtt_transcript_list_item.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginEnd="8dp" + android:orientation="vertical"> + <LinearLayout + android:id="@+id/rtt_chat_message_container" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:orientation="horizontal"> + <ImageView + android:id="@+id/rtt_chat_avatar" + android:layout_width="@dimen/rtt_transcript_avatar_size" + android:layout_height="@dimen/rtt_transcript_avatar_size" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:visibility="gone"/> + <TextView + android:id="@+id/rtt_chat_message" + style="@style/RttTranscriptBubble" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:paddingTop="9dp" + android:paddingBottom="9dp" + android:paddingStart="12dp" + android:paddingEnd="12dp" + android:background="@drawable/message_bubble" + android:backgroundTint="@color/bubble_background" + android:maxWidth="292dp"/> + </LinearLayout> + <TextView + android:id="@+id/rtt_chat_timestamp" + style="@style/RttTranscriptBubble.Timestamp" + android:paddingStart="64dp" + android:paddingEnd="8dp" + android:layout_width="match_parent" + android:layout_height="wrap_content"/> +</LinearLayout>
\ No newline at end of file diff --git a/java/com/android/dialer/rtt/res/values/colors.xml b/java/com/android/dialer/rtt/res/values/colors.xml new file mode 100644 index 000000000..5de06f9f2 --- /dev/null +++ b/java/com/android/dialer/rtt/res/values/colors.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<resources> + <color name="rtt_transcript_primary_color">#37474F</color> + <color name="rtt_transcript_background_color">#ECEFF1</color> +</resources>
\ No newline at end of file diff --git a/java/com/android/dialer/rtt/res/values/dimens.xml b/java/com/android/dialer/rtt/res/values/dimens.xml new file mode 100644 index 000000000..a36cdd746 --- /dev/null +++ b/java/com/android/dialer/rtt/res/values/dimens.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<resources> + <dimen name="rtt_transcript_message_margin_top">16dp</dimen> + <dimen name="rtt_transcript_same_group_message_margin_top">2dp</dimen> + <dimen name="rtt_transcript_avatar_size">40dp</dimen> +</resources> diff --git a/java/com/android/dialer/rtt/res/values/styles.xml b/java/com/android/dialer/rtt/res/values/styles.xml new file mode 100644 index 000000000..d8bc245ef --- /dev/null +++ b/java/com/android/dialer/rtt/res/values/styles.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + ~ Copyright (C) 2018 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License + --> +<resources> + <style name="RttTranscriptBubble"> + <item name="android:fontFamily">sans-serif</item> + <item name="android:textColor">#DD000000</item> + <item name="android:textSize">16sp</item> + </style> + + <style name="RttTranscriptBubble.Remote"> + <item name="android:textColor">#FFFFFF</item> + </style> + + <style name="RttTranscriptBubble.Local"> + <item name="android:textColor">#DD000000</item> + </style> + + <style name="RttTranscriptBubble.Timestamp"> + <item name="android:textColor">#757575</item> + <item name="android:textSize">12sp</item> + </style> +</resources>
\ No newline at end of file |