From 3fe4d2bda429e632713c37ef0c5bf71c3dc15c81 Mon Sep 17 00:00:00 2001 From: wangqi Date: Thu, 31 May 2018 15:14:03 -0700 Subject: Change RTT transcript screen to use toolbar. This also fixes crash bug under new theme. Test: manual PiperOrigin-RevId: 198787768 Change-Id: I0b26dcefd519d40987f7338c32d1a47759b237c0 --- java/com/android/dialer/rtt/RttTranscriptActivity.java | 11 ++++++----- .../dialer/rtt/res/layout/activity_rtt_transcript.xml | 12 +++++++++--- java/com/android/dialer/rtt/res/values/colors.xml | 1 + 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'java') 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 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. --> - + android:background="@color/rtt_transcript_background_color" + android:orientation="vertical"> + + - + 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 @@ --> #37474F + #263238 #ECEFF1 \ No newline at end of file -- cgit v1.2.3