Set status bar color in CAB mode. b/17471621.
Change-Id: If23bdce538aa647952d193a9976d6a27bcfd5829
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index e4ef81f..24d6834 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -51,6 +51,7 @@
import android.support.v4.app.RemoteInput;
import android.support.v7.app.ActionBar;
import android.support.v7.app.ActionBarActivity;
+import android.support.v7.view.ActionMode;
import android.text.Editable;
import android.text.Html;
import android.text.SpanWatcher;
@@ -69,6 +70,7 @@
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
+import android.view.Window;
import android.view.inputmethod.BaseInputConnection;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
@@ -3961,4 +3963,30 @@
mBodyView.addTextChangedListener(ComposeActivity.this);
}
}
+
+ @SuppressLint("NewApi")
+ @Override
+ public void onSupportActionModeStarted(ActionMode mode) {
+ super.onSupportActionModeStarted(mode);
+ if (Utils.isRunningLOrLater()) {
+ final Window window = getWindow();
+ if (window != null) {
+ window.setStatusBarColor(
+ getResources().getColor(R.color.action_mode_statusbar_color));
+ }
+ }
+ }
+
+ @SuppressLint("NewApi")
+ @Override
+ public void onSupportActionModeFinished(ActionMode mode) {
+ super.onSupportActionModeFinished(mode);
+ if (Utils.isRunningLOrLater()) {
+ final Window window = getWindow();
+ if (window != null) {
+ window.setStatusBarColor(
+ getResources().getColor(R.color.statusbar_color));
+ }
+ }
+ }
}
diff --git a/src/com/android/mail/ui/MailActivity.java b/src/com/android/mail/ui/MailActivity.java
index 8aa8fbc..bcba078 100644
--- a/src/com/android/mail/ui/MailActivity.java
+++ b/src/com/android/mail/ui/MailActivity.java
@@ -17,8 +17,8 @@
package com.android.mail.ui;
+import android.annotation.SuppressLint;
import android.app.Dialog;
-import android.app.LoaderManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@@ -29,11 +29,13 @@
import android.nfc.NfcEvent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
+import android.support.v7.view.ActionMode;
import android.support.v7.widget.Toolbar;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
+import android.view.Window;
import android.view.accessibility.AccessibilityManager;
import com.android.bitmap.BitmapCache;
@@ -489,4 +491,30 @@
public SearchRecentSuggestionsProvider getSuggestionsProvider() {
return new SuggestionsProvider(this);
}
+
+ @SuppressLint("NewApi")
+ @Override
+ public void onSupportActionModeStarted(ActionMode mode) {
+ super.onSupportActionModeStarted(mode);
+ if (Utils.isRunningLOrLater()) {
+ final Window window = getWindow();
+ if (window != null) {
+ window.setStatusBarColor(
+ getResources().getColor(R.color.action_mode_statusbar_color));
+ }
+ }
+ }
+
+ @SuppressLint("NewApi")
+ @Override
+ public void onSupportActionModeFinished(ActionMode mode) {
+ super.onSupportActionModeFinished(mode);
+ if (Utils.isRunningLOrLater()) {
+ final Window window = getWindow();
+ if (window != null) {
+ window.setStatusBarColor(
+ getResources().getColor(R.color.statusbar_color));
+ }
+ }
+ }
}