summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
Diffstat (limited to 'java')
-rw-r--r--java/com/android/dialer/main/impl/OldMainActivityPeer.java28
-rw-r--r--java/com/android/dialer/main/impl/res/values/styles.xml16
2 files changed, 36 insertions, 8 deletions
diff --git a/java/com/android/dialer/main/impl/OldMainActivityPeer.java b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
index 489de1a64..c7410d541 100644
--- a/java/com/android/dialer/main/impl/OldMainActivityPeer.java
+++ b/java/com/android/dialer/main/impl/OldMainActivityPeer.java
@@ -30,6 +30,7 @@ import android.provider.CallLog.Calls;
import android.provider.ContactsContract.QuickContact;
import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
+import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import com.android.contacts.common.list.OnPhoneNumberPickerActionListener;
@@ -159,7 +160,8 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
bottomNav.addOnTabSelectedListener(bottomNavTabListener);
callLogFragmentListener =
- new MainCallLogFragmentListener(mainActivity, mainActivity.getContentResolver(), bottomNav);
+ new MainCallLogFragmentListener(
+ mainActivity, mainActivity.getContentResolver(), bottomNav, toolbar);
bottomNav.addOnTabSelectedListener(callLogFragmentListener);
searchController = new MainSearchController(mainActivity, bottomNav, fab, toolbar);
@@ -388,16 +390,20 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
}
/** @see CallLogAdapter.OnActionModeStateChangedListener */
- // TODO(a bug): handle multiselect mode
+ // TODO(calderwoodra): What is the purpose of this listener?
private static final class MainCallLogAdapterOnActionModeStateChangedListener
implements CallLogAdapter.OnActionModeStateChangedListener {
+ private boolean isEnabled;
+
@Override
- public void onActionModeStateChanged(boolean isEnabled) {}
+ public void onActionModeStateChanged(boolean isEnabled) {
+ this.isEnabled = isEnabled;
+ }
@Override
public boolean isActionModeStateEnabled() {
- return false;
+ return isEnabled;
}
}
@@ -458,18 +464,23 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
OnBottomNavTabSelectedListener {
private final CallLogQueryHandler callLogQueryHandler;
- private final BottomNavBar bottomNavBar;
private final Context context;
+ private final BottomNavBar bottomNavBar;
+ private final Toolbar toolbar;
private @TabIndex int currentTab = TabIndex.SPEED_DIAL;
private long timeSelected = -1;
private boolean activityIsAlive;
MainCallLogFragmentListener(
- Context context, ContentResolver contentResolver, BottomNavBar bottomNavBar) {
+ Context context,
+ ContentResolver contentResolver,
+ BottomNavBar bottomNavBar,
+ Toolbar toolbar) {
callLogQueryHandler = new CallLogQueryHandler(context, contentResolver, this);
- this.bottomNavBar = bottomNavBar;
this.context = context;
+ this.bottomNavBar = bottomNavBar;
+ this.toolbar = toolbar;
}
@Override
@@ -480,7 +491,8 @@ public class OldMainActivityPeer implements MainActivityPeer, FragmentUtilListen
@Override
public void showMultiSelectRemoveView(boolean show) {
- // TODO(a bug): handle multiselect mode
+ bottomNavBar.setVisibility(show ? View.GONE : View.VISIBLE);
+ toolbar.setVisibility(show ? View.GONE : View.VISIBLE);
}
@Override
diff --git a/java/com/android/dialer/main/impl/res/values/styles.xml b/java/com/android/dialer/main/impl/res/values/styles.xml
index 26f880dc4..2865f2587 100644
--- a/java/com/android/dialer/main/impl/res/values/styles.xml
+++ b/java/com/android/dialer/main/impl/res/values/styles.xml
@@ -22,5 +22,21 @@
<!-- Theme needed for DialpadFragment -->
<item name="dialpad_style">@style/Dialpad.Light</item>
+
+ <!-- Required for actionmode/multiselect to render properly. -->
+ <!-- TODO(calderwoodra): Check to see if we can remove this after NewVoicemailFragment launches -->
+ <item name="actionModeStyle">@style/ActionModeStyle</item>
+ <item name="actionBarTheme">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item>
+ </style>
+
+ <!-- Colors our actionbar in action mode to dialer theme color. -->
+ <style name="ActionModeStyle" parent="@style/Widget.AppCompat.ActionMode">
+ <item name="background">@color/dialer_theme_color</item>
+ <item name="titleTextStyle">@style/ActionModeTitleTextStyle</item>
+ </style>
+
+ <!-- Colors our actionbar text in action mode to dialer white text color. -->
+ <style name="ActionModeTitleTextStyle" parent="@style/TextAppearance.AppCompat.Widget.ActionMode.Title">
+ <item name="android:textColor">@color/dialer_primary_text_color_white</item>
</style>
</resources>