Merge "Fix focus issues in directory fragment * Empty directory view gets focus when shown * Skip opening drawer when showing empty search results * Fix typo" into nyc-dev
This commit is contained in:
@@ -46,6 +46,8 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:background="@color/window_background"
|
android:background="@color/window_background"
|
||||||
|
android:focusable="true"
|
||||||
|
android:focusableInTouchMode="true"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ public class State implements android.os.Parcelable {
|
|||||||
return mStackTouched;
|
return mStackTouched;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean initialiLocationHasChanged() {
|
public boolean initialLocationHasChanged() {
|
||||||
return mInitialRootChanged || mInitialDocChanged;
|
return mInitialRootChanged || mInitialDocChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -889,12 +889,14 @@ public class DirectoryFragment extends Fragment implements DocumentsAdapter.Envi
|
|||||||
imageView.setImageResource(drawable);
|
imageView.setImageResource(drawable);
|
||||||
|
|
||||||
mEmptyView.setVisibility(View.VISIBLE);
|
mEmptyView.setVisibility(View.VISIBLE);
|
||||||
|
mEmptyView.requestFocus();
|
||||||
mRecView.setVisibility(View.GONE);
|
mRecView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showDirectory() {
|
private void showDirectory() {
|
||||||
mEmptyView.setVisibility(View.GONE);
|
mEmptyView.setVisibility(View.GONE);
|
||||||
mRecView.setVisibility(View.VISIBLE);
|
mRecView.setVisibility(View.VISIBLE);
|
||||||
|
mRecView.requestFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String findCommonMimeType(List<String> mimeTypes) {
|
private String findCommonMimeType(List<String> mimeTypes) {
|
||||||
|
|||||||
@@ -249,9 +249,10 @@ public abstract class FragmentTuner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void onModelLoaded(Model model, @ResultType int resultType) {
|
void onModelLoaded(Model model, @ResultType int resultType) {
|
||||||
if (DEBUG) Log.d(TAG, "Handling model loaded. Has Location shcnage: " + mState.initialiLocationHasChanged());
|
if (DEBUG) Log.d(TAG, "Handling model loaded. Has Location shcnage: " + mState.initialLocationHasChanged());
|
||||||
// When launched into empty root, open drawer.
|
// When launched into empty root, open drawer.
|
||||||
if (model.isEmpty() && !mState.initialiLocationHasChanged()) {
|
if (model.isEmpty() && !mState.initialLocationHasChanged()
|
||||||
|
&& resultType != DirectoryFragment.TYPE_SEARCH) {
|
||||||
if (DEBUG) Log.d(TAG, "Showing roots drawer cuz stuffs empty.");
|
if (DEBUG) Log.d(TAG, "Showing roots drawer cuz stuffs empty.");
|
||||||
|
|
||||||
// This noops on layouts without drawer, so no need to guard.
|
// This noops on layouts without drawer, so no need to guard.
|
||||||
|
|||||||
Reference in New Issue
Block a user