Merge "Ad icon is misplaced in RTL format" into ub-gmail-ur14-dev
diff --git a/res/layout-sw600dp/floating_actions.xml b/res/layout-sw600dp/floating_actions.xml
index 28bc3cf..0a6cb45 100644
--- a/res/layout-sw600dp/floating_actions.xml
+++ b/res/layout-sw600dp/floating_actions.xml
@@ -16,11 +16,9 @@
limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:id="@+id/floating_actions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_gravity="bottom"
- android:visibility="invisible">
+ android:layout_gravity="bottom">
<com.android.mail.ui.ActionableToastBar
android:id="@+id/toast_bar"
diff --git a/res/layout/compose.xml b/res/layout/compose.xml
index de76bda..d95b5c6 100644
--- a/res/layout/compose.xml
+++ b/res/layout/compose.xml
@@ -18,7 +18,9 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/holo_light_background_color"
+ android:layout_gravity="center_horizontal"
+ android:paddingLeft="@dimen/compose_wrapper_side_padding"
+ android:paddingRight="@dimen/compose_wrapper_side_padding"
style="@style/ComposeAreaWrapper">
<include layout="@layout/wait_fragment" />
@@ -90,7 +92,6 @@
android:id="@+id/composearea_tap_trap_bottom"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:background="@color/compose_background_color"
android:clickable="true" />
</LinearLayout>
diff --git a/res/layout/drawer_footer_item.xml b/res/layout/drawer_footer_item.xml
index ebfa996..c632616 100644
--- a/res/layout/drawer_footer_item.xml
+++ b/res/layout/drawer_footer_item.xml
@@ -18,45 +18,25 @@
<!-- Item in the drawer that launches the Help or Feedback activities. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="vertical" >
+ android:layout_width="match_parent"
+ android:paddingLeft="@dimen/drawer_footer_item_padding"
+ android:paddingRight="@dimen/drawer_footer_item_padding"
+ android:minHeight="@dimen/drawer_footer_item_minimum_height"
+ android:gravity="center_vertical"
+ android:background="@drawable/nonfolder_item">
- <View
- android:id="@+id/top_border"
- android:layout_width="match_parent"
- android:layout_height="@dimen/divider_height"
- android:background="@color/folder_list_divider_color"
- android:layout_marginTop="8dp"
- android:layout_marginBottom="8dp" />
+ <ImageView
+ android:id="@+id/drawer_footer_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content" />
- <LinearLayout
+ <TextView
+ android:id="@+id/drawer_footer_text"
android:layout_height="wrap_content"
- android:layout_width="match_parent"
- android:paddingLeft="@dimen/drawer_footer_item_padding"
- android:paddingRight="@dimen/drawer_footer_item_padding"
- android:minHeight="@dimen/drawer_footer_item_minimum_height"
- android:gravity="center_vertical"
- android:background="@drawable/nonfolder_item">
-
- <ImageView
- android:id="@+id/drawer_footer_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content" />
-
- <TextView
- android:id="@+id/drawer_footer_text"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:ellipsize="end"
- android:textColor="@color/folder_item_text_color_normal"
- android:textSize="@dimen/drawer_item_font_size"
- style="@style/DrawerFooterListItemStyle"/>
- </LinearLayout>
-
- <Space
- android:id="@+id/bottom_margin"
- android:layout_width="match_parent"
- android:layout_height="8dp" />
-
+ android:layout_width="wrap_content"
+ android:ellipsize="end"
+ android:textColor="@color/text_color_black"
+ android:textSize="@dimen/drawer_item_font_size"
+ style="@style/DrawerFooterListItemStyle"/>
</LinearLayout>
diff --git a/res/layout/folder_list.xml b/res/layout/folder_list.xml
index acc375d..a5097ba 100644
--- a/res/layout/folder_list.xml
+++ b/res/layout/folder_list.xml
@@ -32,19 +32,12 @@
android:layout_width="@dimen/two_pane_drawer_width_mini"
android:layout_height="match_parent"
android:focusable="true"
+ android:descendantFocusability="afterDescendants"
android:paddingTop="20dp"
android:paddingBottom="18dp"
android:orientation="vertical">
- <ImageView
- android:id="@+id/current_account_avatar"
- android:layout_width="match_parent"
- android:layout_height="64dp"
- android:paddingTop="16dp"
- android:paddingBottom="16dp"
- android:paddingLeft="20dp"
- android:paddingRight="20dp"
- style="@style/MiniDrawerItemStyleBase" />
+ <include layout="@layout/mini_drawer_recent_account_item" />
<ImageView
android:id="@+id/dotdotdot"
diff --git a/res/layout/folder_list_blank_header.xml b/res/layout/folder_list_blank_header.xml
index 71994a4..2285ce2 100644
--- a/res/layout/folder_list_blank_header.xml
+++ b/res/layout/folder_list_blank_header.xml
@@ -15,12 +15,8 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_height="wrap_content"
- android:layout_width="match_parent">
- <View
- android:layout_width="match_parent"
- android:layout_height="@dimen/divider_height"
- android:layout_marginBottom="8dp"
- android:background="@color/folder_list_divider_color" />
-</FrameLayout>
+<View xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/divider_height"
+ android:layout_marginBottom="8dp"
+ android:background="@color/folder_list_divider_color" />
diff --git a/res/layout/folder_list_bottom_space.xml b/res/layout/folder_list_bottom_space.xml
new file mode 100644
index 0000000..114a463
--- /dev/null
+++ b/res/layout/folder_list_bottom_space.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 Google Inc.
+ Licensed to The Android Open Source Project.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<Space xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_height="8dp"
+ android:layout_width="match_parent" />
diff --git a/res/raw/template_conversation_upper.html b/res/raw/template_conversation_upper.html
index 5966596..c3354aa 100644
--- a/res/raw/template_conversation_upper.html
+++ b/res/raw/template_conversation_upper.html
@@ -9,9 +9,9 @@
color: purple;
}
.mail-elided-text {
- color: #666;
- font: bold 11px sans-serif;
- margin: 12px 0 6px;
+ color: #4285f4;
+ font: 12px sans-serif;
+ padding: 24px 0;
}
.mail-message-content {
}
diff --git a/res/values-sw600dp/colors.xml b/res/values-sw600dp/colors.xml
index 85bc9a9..bf545aa 100644
--- a/res/values-sw600dp/colors.xml
+++ b/res/values-sw600dp/colors.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="folder_list_divider_color">#b2b2b2</color>
- <color name="drawer_item_selected_background_color">#e4e4e4</color>
<color name="mail_activity_status_bar_color">@color/primary_dark_color</color>
</resources>
diff --git a/res/values-sw600dp/styles.xml b/res/values-sw600dp/styles.xml
index 3c86c8a..6242d35 100644
--- a/res/values-sw600dp/styles.xml
+++ b/res/values-sw600dp/styles.xml
@@ -25,4 +25,8 @@
<item name="android:layout_width">@dimen/vacation_responder_width</item>
<item name="android:layout_height">match_parent</item>
</style>
+
+ <style name="ComposeAreaWrapper">
+ <item name="android:background">@color/holo_light_background_color</item>
+ </style>
</resources>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index d143900..afbf7c8 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -53,7 +53,7 @@
<color name="account_item_selected_text_color">@color/mail_app_blue</color>
<color name="folder_list_heading_text_color">@color/text_color_medium_grey</color>
<color name="list_background_color">@android:color/white</color>
- <color name="drawer_item_selected_background_color">#eeeeee</color>
+ <color name="drawer_item_selected_background_color">#12000000</color>
<!-- overridden in sw600dp -->
<color name="folder_list_divider_color">@color/divider_color</color>
@@ -62,8 +62,6 @@
<color name="compose_user_text">@color/text_color_black</color>
<color name="compose_label_hint">@color/text_color_hint_grey</color>
<color name="compose_divider_color">@color/light_gray</color>
- <!-- Must match the quoted_text_background_color_string -->
- <color name="compose_background_color">@android:color/white</color>
<string name="quoted_text_font_color_string" translatable="false">@color/text_color_grey</string>
<color name="conv_header_add_label_text">@android:color/black</color>
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 0c9e109..12a0d18 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -138,11 +138,7 @@
<style name="ComposeArea" parent="AbstractComposeAreaWithRtl" />
- <style name="ComposeAreaWrapper">
- <item name="android:layout_gravity">center_horizontal</item>
- <item name="android:paddingLeft">@dimen/compose_wrapper_side_padding</item>
- <item name="android:paddingRight">@dimen/compose_wrapper_side_padding</item>
- </style>
+ <style name="ComposeAreaWrapper" />
<style name="ComposeAttachmentTileTextEndStyle">
<item name="android:paddingRight">@dimen/compose_attachment_tile_text_end_padding</item>
diff --git a/res/values/themes.xml b/res/values/themes.xml
index 325745f..d82975b 100644
--- a/res/values/themes.xml
+++ b/res/values/themes.xml
@@ -27,6 +27,7 @@
</style>
<style name="UnifiedEmailTheme.Appcompat.Toolbar" parent="@style/Theme.AppCompat.Light.NoActionBar">
+ <item name="actionBarPopupTheme">@style/ThemeOverlay.AppCompat.Light</item>
<item name="actionModeBackground">@color/action_mode_background</item>
<item name="actionOverflowButtonStyle">@style/ActionBarOverflowButtonStyle.Appcompat</item>
<item name="colorPrimary">@color/actionbar_color</item>
@@ -38,7 +39,7 @@
<!-- Tell SystemUI that our activity window will draw the background for the status bar. -->
<item name="android:windowDrawsSystemBarBackgrounds" tools:ignore="NewApi">true</item>
<!-- Set the status bar to fully transparent. We’ll draw it ourselves since we want to draw other content over it. -->
- <item name="android:statusBarColor">@color/mail_activity_status_bar_color</item>
+ <item name="android:statusBarColor" tools:ignore="NewApi">@color/mail_activity_status_bar_color</item>
</style>
<style name="MailActivityTheme" parent="@style/UnifiedEmailTheme.Appcompat.Toolbar" />
diff --git a/src/com/android/mail/adapter/DrawerItem.java b/src/com/android/mail/adapter/DrawerItem.java
index 0276b2c..191c365 100644
--- a/src/com/android/mail/adapter/DrawerItem.java
+++ b/src/com/android/mail/adapter/DrawerItem.java
@@ -60,12 +60,14 @@
public static final int VIEW_FOLDER = 0;
/** A text-label which serves as a header in sectioned lists. */
public static final int VIEW_HEADER = 1;
- /** A text-label which serves as a header in sectioned lists. */
+ /** A blank divider which serves as a header in sectioned lists. */
public static final int VIEW_BLANK_HEADER = 2;
+ /** A spacer which serves as a footer below the last item. */
+ public static final int VIEW_BOTTOM_SPACE = 3;
/** An account object, which allows switching accounts rather than folders. */
- public static final int VIEW_ACCOUNT = 3;
+ public static final int VIEW_ACCOUNT = 4;
/** An expandable object for expanding/collapsing more of the list */
- public static final int VIEW_WAITING_FOR_SYNC = 4;
+ public static final int VIEW_WAITING_FOR_SYNC = 5;
/** The value (1-indexed) of the last View type. Useful when returning the number of types. */
private static final int LAST_FIELD = VIEW_WAITING_FOR_SYNC + 1;
@@ -110,6 +112,8 @@
return headerToString();
case VIEW_BLANK_HEADER:
return blankHeaderToString();
+ case VIEW_BOTTOM_SPACE:
+ return bottomSpaceToString();
case VIEW_ACCOUNT:
return accountToString();
case VIEW_WAITING_FOR_SYNC:
@@ -230,6 +234,15 @@
return "[DrawerItem VIEW_BLANK_HEADER]";
}
+ public static DrawerItem ofBottomSpace(ControllableActivity activity) {
+ return new DrawerItem(VIEW_BOTTOM_SPACE, activity, null, INERT_HEADER, null, 0, false, null,
+ null);
+ }
+
+ private String bottomSpaceToString() {
+ return "[DrawerItem VIEW_BOTTOM_SPACE]";
+ }
+
/**
* Create a "waiting for initialization" item.
*
@@ -242,7 +255,7 @@
}
private static String waitToString() {
- return "[DrawerItem VIEW_WAITING_FOR_SYNC ]";
+ return "[DrawerItem VIEW_WAITING_FOR_SYNC]";
}
/**
@@ -261,6 +274,9 @@
case VIEW_BLANK_HEADER:
result = getBlankHeaderView(convertView, parent);
break;
+ case VIEW_BOTTOM_SPACE:
+ result = getBottomSpaceView(convertView, parent);
+ break;
case VIEW_ACCOUNT:
result = getAccountView(convertView, parent);
break;
@@ -297,6 +313,7 @@
switch (mType) {
case VIEW_HEADER:
case VIEW_BLANK_HEADER:
+ case VIEW_BOTTOM_SPACE:
// Headers are never enabled.
return false;
case VIEW_FOLDER:
@@ -333,6 +350,7 @@
switch (mType) {
case VIEW_HEADER:
case VIEW_BLANK_HEADER:
+ case VIEW_BOTTOM_SPACE:
// Headers are never highlighted
return false;
case VIEW_FOLDER:
@@ -410,6 +428,23 @@
}
/**
+ * Returns a blank spacer
+ *
+ * @param convertView A previous view, perhaps null
+ * @param parent the parent of this view
+ * @return a blank spacer
+ */
+ private View getBottomSpaceView(View convertView, ViewGroup parent) {
+ final View blankHeaderView;
+ if (convertView != null) {
+ blankHeaderView = convertView;
+ } else {
+ blankHeaderView = mInflater.inflate(R.layout.folder_list_bottom_space, parent, false);
+ }
+ return blankHeaderView;
+ }
+
+ /**
* Return a folder: either a parent folder or a normal (child or flat)
* folder.
*
diff --git a/src/com/android/mail/ui/AbstractActivityController.java b/src/com/android/mail/ui/AbstractActivityController.java
index c5425e4..a087369 100644
--- a/src/com/android/mail/ui/AbstractActivityController.java
+++ b/src/com/android/mail/ui/AbstractActivityController.java
@@ -1162,7 +1162,8 @@
@Override
public void onConversationListVisibilityChanged(boolean visible) {
- mFloatingComposeButton.setVisibility(visible ? View.VISIBLE : View.GONE);
+ mFloatingComposeButton.setVisibility(
+ !ViewMode.isSearchMode(mViewMode.getMode()) && visible ? View.VISIBLE : View.GONE);
informCursorVisiblity(visible);
commitAutoAdvanceOperation();
diff --git a/src/com/android/mail/ui/FolderListFragment.java b/src/com/android/mail/ui/FolderListFragment.java
index 2d6a6ef..75bf213 100644
--- a/src/com/android/mail/ui/FolderListFragment.java
+++ b/src/com/android/mail/ui/FolderListFragment.java
@@ -1301,7 +1301,7 @@
private class FooterAdapter extends BaseAdapter {
- private final List<FooterItem> mFooterItems = Lists.newArrayList();
+ private final List<Object> mFooterItems = Lists.newArrayList();
private FooterAdapter() {
update();
@@ -1329,31 +1329,35 @@
*/
@Override
public View getView(int position, View convertView, ViewGroup parent) {
- final ViewGroup footerItemView;
- if (convertView != null) {
- footerItemView = (ViewGroup) convertView;
+ final Object item = getItem(position);
+ if (item instanceof FooterItem) {
+ final ViewGroup footerItemView;
+ if (convertView != null) {
+ footerItemView = (ViewGroup) convertView;
+ } else {
+ footerItemView = (ViewGroup) getActivity().getLayoutInflater().
+ inflate(R.layout.drawer_footer_item, parent, false);
+ }
+
+ final FooterItem footerItem = (FooterItem) item;
+
+ // adjust the text of the footer item
+ final TextView textView = (TextView) footerItemView.
+ findViewById(R.id.drawer_footer_text);
+ textView.setText(footerItem.getTextResourceID());
+
+ // adjust the icon of the footer item
+ final ImageView imageView = (ImageView) footerItemView.
+ findViewById(R.id.drawer_footer_image);
+ imageView.setImageResource(footerItem.getImageResourceID());
+ return footerItemView;
+ } else if (item instanceof DrawerItem) {
+ final DrawerItem drawerItem = (DrawerItem) item;
+ return drawerItem.getView(convertView, parent);
} else {
- footerItemView = (ViewGroup) getActivity().getLayoutInflater().
- inflate(R.layout.drawer_footer_item, parent, false);
+ throw new IllegalStateException("Only DrawerItems and FooterItems allowed, " +
+ item.toString());
}
-
- final FooterItem item = (FooterItem) getItem(position);
-
- footerItemView.findViewById(R.id.top_border).setVisibility(
- item.shouldShowTopBorder() ? View.VISIBLE : View.GONE);
- footerItemView.findViewById(R.id.bottom_margin).setVisibility(
- item.shouldIncludeBottomMargin() ? View.VISIBLE : View.GONE);
-
- // adjust the text of the footer item
- final TextView textView = (TextView) footerItemView.
- findViewById(R.id.drawer_footer_text);
- textView.setText(item.getTextResourceID());
-
- // adjust the icon of the footer item
- final ImageView imageView = (ImageView) footerItemView.
- findViewById(R.id.drawer_footer_image);
- imageView.setImageResource(item.getImageResourceID());
- return footerItemView;
}
/**
@@ -1378,8 +1382,8 @@
}
if (!mFooterItems.isEmpty()) {
- mFooterItems.get(0).setShowTopBorder(true);
- mFooterItems.get(mFooterItems.size() - 1).setIncludeBottomMargin(true);
+ mFooterItems.add(0, DrawerItem.ofBlankHeader(mActivity));
+ mFooterItems.add(DrawerItem.ofBottomSpace(mActivity));
}
notifyDataSetChanged();
@@ -1501,9 +1505,6 @@
private final int mImageResourceID;
private final int mTextResourceID;
- private boolean mShowTopBorder;
- private boolean mIncludeBottomMargin;
-
private FooterItem(final int imageResourceID, final int textResourceID) {
mImageResourceID = imageResourceID;
mTextResourceID = textResourceID;
@@ -1540,22 +1541,6 @@
}
}
- public boolean shouldShowTopBorder() {
- return mShowTopBorder;
- }
-
- public void setShowTopBorder(boolean show) {
- mShowTopBorder = show;
- }
-
- public boolean shouldIncludeBottomMargin() {
- return mIncludeBottomMargin;
- }
-
- public void setIncludeBottomMargin(boolean include) {
- mIncludeBottomMargin = include;
- }
-
// for analytics
String getEventLabel() {
final StringBuilder sb = new StringBuilder("drawer_footer");
diff --git a/src/com/android/mail/ui/MiniDrawerView.java b/src/com/android/mail/ui/MiniDrawerView.java
index 34483cc..7544c30 100644
--- a/src/com/android/mail/ui/MiniDrawerView.java
+++ b/src/com/android/mail/ui/MiniDrawerView.java
@@ -71,6 +71,22 @@
});
}
+ @Override
+ public boolean requestFocus(int direction, Rect previouslyFocusedRect) {
+ // This ViewGroup is focusable purely so it can act as a stable target for other views to
+ // designate as their left/right focus ID. When focus comes to this view, the XML
+ // declaration of descendantFocusability=FOCUS_AFTER_DESCENDANTS means it will always try
+ // to focus one of its children before resorting to this (great! we basically never want
+ // this container to gain focus).
+ //
+ // But the usual focus search towards the LEFT (in LTR) actually starts at the bottom,
+ // which is weird. So override all focus requests that land on this parent to use the
+ // FORWARD direction so the top-most item gets first focus. This will not affect focus
+ // traversal within this ViewGroup as the descendantFocusability prevents the parent from
+ // gaining focus.
+ return super.requestFocus(FOCUS_DOWN, previouslyFocusedRect);
+ }
+
public void setController(FolderListFragment flf) {
mController = flf;
final ListAdapter adapter = mController.getMiniDrawerAccountsAdapter();
@@ -99,6 +115,8 @@
removeView(oldCurrentAccountView);
}
final View newCurrentAccountView = adapter.getView(0, oldCurrentAccountView, this);
+ newCurrentAccountView.setClickable(false);
+ newCurrentAccountView.setFocusable(false);
addView(newCurrentAccountView, 0);
}
@@ -142,15 +160,6 @@
}
}
- @Override
- protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyFocusedRect) {
- if (gainFocus && getFocusedChild() == null) {
- if (getChildCount() > 0) {
- getChildAt(0).requestFocus();
- }
- }
- }
-
private class FolderItem implements View.OnClickListener {
public final Folder folder;
public final ImageView view;
diff --git a/src/com/android/mail/ui/TwoPaneController.java b/src/com/android/mail/ui/TwoPaneController.java
index f2ccd71..4dc77b6 100644
--- a/src/com/android/mail/ui/TwoPaneController.java
+++ b/src/com/android/mail/ui/TwoPaneController.java
@@ -134,7 +134,7 @@
fragmentTransaction.commitAllowingStateLoss();
// Set default navigation here once the ConversationListFragment is created.
conversationListFragment.setNextFocusStartId(
- getClfNextFocusStartId(getFolderListFragment().isMinimized()));
+ getClfNextFocusStartId());
}
@Override
@@ -271,7 +271,7 @@
final ConversationListFragment clf = getConversationListFragment();
if (clf != null) {
- clf.setNextFocusStartId(getClfNextFocusStartId(flf.isMinimized()));
+ clf.setNextFocusStartId(getClfNextFocusStartId());
final SwipeableListView list = clf.getListView();
if (list != null) {
@@ -315,8 +315,8 @@
}
}
- private @IdRes int getClfNextFocusStartId(boolean drawerMinimized) {
- return (drawerMinimized) ? R.id.mini_drawer : android.R.id.list;
+ private @IdRes int getClfNextFocusStartId() {
+ return (isDrawerOpen()) ? android.R.id.list : R.id.mini_drawer;
}
@Override
diff --git a/src/com/android/mail/ui/TwoPaneLayout.java b/src/com/android/mail/ui/TwoPaneLayout.java
index 6cf560c..a5fa76d 100644
--- a/src/com/android/mail/ui/TwoPaneLayout.java
+++ b/src/com/android/mail/ui/TwoPaneLayout.java
@@ -102,10 +102,6 @@
private View mConversationView;
private View mFoldersView;
private View mListView;
- private View mFloatingActions;
- private View mFloatingActionButton;
-
- private int mFloatingActionButtonEndMargin;
private final List<Runnable> mTransitionCompleteJobs = Lists.newArrayList();
@@ -136,8 +132,6 @@
// don't show the conversation list, but in landscape we do. This information is stored
// in the constants
mListCollapsible = !res.getBoolean(R.bool.is_tablet_landscape);
- mFloatingActionButtonEndMargin =
- res.getDimensionPixelOffset(R.dimen.floating_action_bar_margin);
mDrawerWidthMini = res.getDimensionPixelSize(R.dimen.two_pane_drawer_width_mini);
mDrawerWidthOpen = res.getDimensionPixelSize(R.dimen.two_pane_drawer_width_open);
@@ -159,8 +153,6 @@
mListView = findViewById(R.id.conversation_list_pane);
mConversationView = findViewById(R.id.conversation_pane);
mMiscellaneousView = findViewById(MISCELLANEOUS_VIEW_ID);
- mFloatingActions = findViewById(R.id.floating_actions);
- mFloatingActionButton = findViewById(R.id.compose_button);
// all panes start GONE in initial UNKNOWN mode to avoid drawing misplaced panes
mCurrentMode = ViewMode.UNKNOWN;
@@ -270,13 +262,7 @@
}
}
- // manually set FAB position the first time so it doesn't animate to its initial position
- if (mFloatingActions.getVisibility() != VISIBLE && mCurrentMode != ViewMode.UNKNOWN) {
- mFloatingActionButton.setX(computeFloatingActionButtonX(isRtl ? listX : convX, isRtl));
- mFloatingActions.setVisibility(VISIBLE);
- }
-
- animatePanes(foldersX, listX, convX, isRtl);
+ animatePanes(foldersX, listX, convX);
// For views that are not on the screen, let's set their visibility for accessibility.
final boolean folderVisible = isRtl ?
@@ -297,7 +283,7 @@
mPositionedIsDrawerOpen = isDrawerOpen;
}
- private void animatePanes(int foldersX, int listX, int convX, boolean isRtl) {
+ private void animatePanes(int foldersX, int listX, int convX) {
// If positioning has not yet happened, we don't need to animate panes into place.
// This happens on first layout, rotate, and when jumping straight to a conversation from
// a view intent.
@@ -321,16 +307,8 @@
mFoldersView.animate().x(foldersX);
mListView.animate().x(listX).setListener(mPaneAnimationListener);
- mFloatingActionButton.animate()
- .x(computeFloatingActionButtonX(isRtl ? listX : convX, isRtl));
- configureAnimations(mConversationView, mFoldersView, mListView, mMiscellaneousView,
- mFloatingActionButton);
- }
-
- private int computeFloatingActionButtonX(int edgeX, boolean isRtl) {
- return isRtl ? edgeX + mFloatingActionButtonEndMargin :
- edgeX - mFloatingActionButton.getWidth() - mFloatingActionButtonEndMargin;
+ configureAnimations(mConversationView, mFoldersView, mListView, mMiscellaneousView);
}
private void configureAnimations(View... views) {