summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorwangqi <wangqi@google.com>2018-05-31 15:14:03 -0700
committerCopybara-Service <copybara-piper@google.com>2018-06-01 18:16:21 -0700
commit3fe4d2bda429e632713c37ef0c5bf71c3dc15c81 (patch)
tree2c5c65bca7d202306a28f54984a7ad8fd0f02143 /java
parentba2a369716543f954a33bd04c4af5bafbb127393 (diff)
Change RTT transcript screen to use toolbar.
This also fixes crash bug under new theme. Test: manual PiperOrigin-RevId: 198787768 Change-Id: I0b26dcefd519d40987f7338c32d1a47759b237c0
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/rtt/RttTranscriptActivity.java11
-rw-r--r--java/com/android/dialer/rtt/res/layout/activity_rtt_transcript.xml12
-rw-r--r--java/com/android/dialer/rtt/res/values/colors.xml1
3 files changed, 16 insertions, 8 deletions
diff --git a/java/com/android/dialer/rtt/RttTranscriptActivity.java b/java/com/android/dialer/rtt/RttTranscriptActivity.java
index 18ae20c08..574cdb2e2 100644
--- a/java/com/android/dialer/rtt/RttTranscriptActivity.java
+++ b/java/com/android/dialer/rtt/RttTranscriptActivity.java
@@ -20,7 +20,6 @@ import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
-import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
@@ -30,6 +29,7 @@ import com.android.dialer.common.concurrent.DialerExecutorComponent;
import com.android.dialer.common.concurrent.UiListener;
import com.android.dialer.glidephotomanager.PhotoInfo;
import com.android.dialer.protos.ProtoParsers;
+import com.android.dialer.widget.DialerToolbar;
/** Activity holds RTT transcript. */
public class RttTranscriptActivity extends AppCompatActivity {
@@ -40,6 +40,7 @@ public class RttTranscriptActivity extends AppCompatActivity {
private RttTranscriptAdapter adapter;
private UiListener<RttTranscript> rttTranscriptUiListener;
+ private DialerToolbar toolbar;
public static Intent getIntent(
Context context, String transcriptId, String primaryText, PhotoInfo photoInfo) {
@@ -54,9 +55,9 @@ public class RttTranscriptActivity extends AppCompatActivity {
protected void onCreate(@Nullable Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.activity_rtt_transcript);
- ActionBar actionBar = getSupportActionBar();
- actionBar.setDisplayShowHomeEnabled(true);
- actionBar.setDisplayHomeAsUpEnabled(true);
+ toolbar = findViewById(R.id.toolbar);
+ toolbar.setBackgroundColor(getColor(R.color.rtt_transcript_primary_color));
+ getWindow().setStatusBarColor(getColor(R.color.rtt_transcript_primary_color_dark));
RecyclerView recyclerView = findViewById(R.id.rtt_recycler_view);
LinearLayoutManager layoutManager = new LinearLayoutManager(this);
@@ -86,7 +87,7 @@ public class RttTranscriptActivity extends AppCompatActivity {
});
String primaryText = intent.getStringExtra(EXTRA_PRIMARY_TEXT);
- getSupportActionBar().setTitle(primaryText);
+ toolbar.setTitle(primaryText);
PhotoInfo photoInfo =
ProtoParsers.getTrusted(intent, EXTRA_PHOTO_INFO, PhotoInfo.getDefaultInstance());
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
index 628a7932e..772fde1cd 100644
--- a/java/com/android/dialer/rtt/res/layout/activity_rtt_transcript.xml
+++ b/java/com/android/dialer/rtt/res/layout/activity_rtt_transcript.xml
@@ -14,10 +14,16 @@
limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout 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:background="@color/rtt_transcript_background_color"
+ android:orientation="vertical">
+
+ <com.android.dialer.widget.DialerToolbar
+ android:id="@+id/toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/rtt_recycler_view"
@@ -27,4 +33,4 @@
android:paddingBottom="16dp"
android:clipToPadding="false"/>
-</FrameLayout>
+</LinearLayout>
diff --git a/java/com/android/dialer/rtt/res/values/colors.xml b/java/com/android/dialer/rtt/res/values/colors.xml
index 5de06f9f2..3b27a5707 100644
--- a/java/com/android/dialer/rtt/res/values/colors.xml
+++ b/java/com/android/dialer/rtt/res/values/colors.xml
@@ -16,5 +16,6 @@
-->
<resources>
<color name="rtt_transcript_primary_color">#37474F</color>
+ <color name="rtt_transcript_primary_color_dark">#263238</color>
<color name="rtt_transcript_background_color">#ECEFF1</color>
</resources> \ No newline at end of file