diff options
author | wangqi <wangqi@google.com> | 2018-03-22 14:32:23 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-26 22:15:53 -0700 |
commit | 009695e477f02b13d563f17a8de0e179d7715bf9 (patch) | |
tree | 14522ec26099cd06ae4a0149b21a2e24ae6ed8d6 /java | |
parent | cdae908f0a3c3754c592996df092722e1a96bde3 (diff) |
Add waiting for join banner to RTT outgoing call.
Bug: 67596257
Test: manual
PiperOrigin-RevId: 190126654
Change-Id: I412f8fbf5b345005f9fb3651c345303d965e4e02
Diffstat (limited to 'java')
3 files changed, 32 insertions, 1 deletions
diff --git a/java/com/android/incallui/rtt/impl/RttChatFragment.java b/java/com/android/incallui/rtt/impl/RttChatFragment.java index e14ee9b06..56ac2429c 100644 --- a/java/com/android/incallui/rtt/impl/RttChatFragment.java +++ b/java/com/android/incallui/rtt/impl/RttChatFragment.java @@ -103,6 +103,8 @@ public class RttChatFragment extends Fragment private boolean isTimerStarted; private RttOverflowMenu overflowMenu; private SecondaryInfo savedSecondaryInfo; + private TextView statusBanner; + private PrimaryInfo primaryInfo; /** * Create a new instance of RttChatFragment. @@ -221,6 +223,7 @@ public class RttChatFragment extends Fragment nameTextView = view.findViewById(R.id.rtt_name_or_number); chronometer = view.findViewById(R.id.rtt_timer); + statusBanner = view.findViewById(R.id.rtt_status_banner); return view; } @@ -334,6 +337,7 @@ public class RttChatFragment extends Fragment public void setPrimary(@NonNull PrimaryInfo primaryInfo) { LogUtil.i("RttChatFragment.setPrimary", primaryInfo.toString()); nameTextView.setText(primaryInfo.name()); + this.primaryInfo = primaryInfo; } @Override @@ -381,6 +385,20 @@ public class RttChatFragment extends Fragment chronometer.start(); isTimerStarted = true; } + if (primaryCallState.state() == State.DIALING) { + showWaitingForJoinBanner(); + } else { + hideWaitingForJoinBanner(); + } + } + + private void showWaitingForJoinBanner() { + statusBanner.setText(getString(R.string.rtt_status_banner_text, primaryInfo.name())); + statusBanner.setVisibility(View.VISIBLE); + } + + private void hideWaitingForJoinBanner() { + statusBanner.setVisibility(View.GONE); } @Override diff --git a/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml b/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml index c4d3a4290..d62cf1849 100644 --- a/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml +++ b/java/com/android/incallui/rtt/impl/res/layout/rtt_banner.xml @@ -83,5 +83,15 @@ android:id="@id/rtt_on_hold_banner" android:layout_width="match_parent" android:layout_height="wrap_content"/> + <TextView + android:id="@+id/rtt_status_banner" + android:layout_width="match_parent" + android:layout_height="48dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:background="@android:color/white" + android:gravity="center_vertical" + android:textColor="#DD000000" + android:textSize="14sp"/> </LinearLayout>
\ No newline at end of file diff --git a/java/com/android/incallui/rtt/impl/res/values/strings.xml b/java/com/android/incallui/rtt/impl/res/values/strings.xml index dce16fdda..b0ac2057e 100644 --- a/java/com/android/incallui/rtt/impl/res/values/strings.xml +++ b/java/com/android/incallui/rtt/impl/res/values/strings.xml @@ -14,7 +14,7 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License --> -<resources> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <!-- Content description for submit chat input button. [CHAR LIMIT=NONE] --> <string name="content_description_rtt_check_button">Go ahead</string> @@ -27,4 +27,7 @@ <!-- Text for back button. [CHAR LIMIT=20] --> <string name="rtt_button_back">Back</string> + <!-- Text for status banner. [CHAT LIMIT=100] --> + <string name="rtt_status_banner_text">Waiting for <xliff:g id="name">%s</xliff:g> to join RTT call…</string> + </resources>
\ No newline at end of file |