Merge "Fix navigation to mini drawer" into ub-gmail-ur14-dev
diff --git a/res/layout-sw600dp/floating_actions.xml b/res/layout-sw600dp/floating_actions.xml
index ea5ae51..28bc3cf 100644
--- a/res/layout-sw600dp/floating_actions.xml
+++ b/res/layout-sw600dp/floating_actions.xml
@@ -75,7 +75,6 @@
android:id="@+id/compose_button"
android:contentDescription="@string/compose"
android:focusable="false"
- android:focusableInTouchMode="false"
style="@style/FloatingActionButtonStyle" />
</LinearLayout>
diff --git a/res/layout/floating_actions.xml b/res/layout/floating_actions.xml
index 8df8612..ed4519f 100644
--- a/res/layout/floating_actions.xml
+++ b/res/layout/floating_actions.xml
@@ -25,7 +25,6 @@
android:id="@+id/compose_button"
android:contentDescription="@string/compose"
android:focusable="false"
- android:focusableInTouchMode="false"
style="@style/FloatingActionButtonStyle" />
<com.android.mail.ui.ActionableToastBar
diff --git a/res/layout/folder_list.xml b/res/layout/folder_list.xml
index 6cca4e0..acc375d 100644
--- a/res/layout/folder_list.xml
+++ b/res/layout/folder_list.xml
@@ -31,6 +31,7 @@
android:id="@+id/mini_drawer"
android:layout_width="@dimen/two_pane_drawer_width_mini"
android:layout_height="match_parent"
+ android:focusable="true"
android:paddingTop="20dp"
android:paddingBottom="18dp"
android:orientation="vertical">
diff --git a/src/com/android/mail/ui/ConversationListFragment.java b/src/com/android/mail/ui/ConversationListFragment.java
index 4e2c818..f9badb0 100644
--- a/src/com/android/mail/ui/ConversationListFragment.java
+++ b/src/com/android/mail/ui/ConversationListFragment.java
@@ -496,7 +496,7 @@
// For tablets, the default left focus is the mini-drawer
if (mTabletDevice && mNextFocusStartId == 0) {
- mNextFocusStartId = R.id.current_account_avatar;
+ mNextFocusStartId = R.id.mini_drawer;
}
setNextFocusStartOnList();
diff --git a/src/com/android/mail/ui/MiniDrawerView.java b/src/com/android/mail/ui/MiniDrawerView.java
index 7aaac12..34483cc 100644
--- a/src/com/android/mail/ui/MiniDrawerView.java
+++ b/src/com/android/mail/ui/MiniDrawerView.java
@@ -18,6 +18,7 @@
import android.content.Context;
import android.database.DataSetObserver;
+import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
@@ -141,6 +142,15 @@
}
}
+ @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 55b9e58..f2ccd71 100644
--- a/src/com/android/mail/ui/TwoPaneController.java
+++ b/src/com/android/mail/ui/TwoPaneController.java
@@ -316,7 +316,7 @@
}
private @IdRes int getClfNextFocusStartId(boolean drawerMinimized) {
- return (drawerMinimized) ? R.id.current_account_avatar : android.R.id.list;
+ return (drawerMinimized) ? R.id.mini_drawer : android.R.id.list;
}
@Override