Make fab appear nicer

This commit is contained in:
Mario Danic 2017-02-15 07:57:11 +01:00 committed by AndyScherzinger
parent 7a15e20b20
commit 43a82f7dcb
No known key found for this signature in database
GPG key ID: 6CADC7E3523C308B
2 changed files with 11 additions and 4 deletions

View file

@ -389,13 +389,13 @@ public class FileDisplayActivity extends HookActivity
}
private void createMinFragments() {
/*OCFileListFragment listOfFiles = new OCFileListFragment();
OCFileListFragment listOfFiles = new OCFileListFragment();
Bundle args = new Bundle();
args.putBoolean(OCFileListFragment.ARG_ALLOW_CONTEXTUAL_ACTIONS, true);
listOfFiles.setArguments(args);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(R.id.left_fragment_container, listOfFiles, TAG_LIST_OF_FILES);
transaction.commit();*/
transaction.commit();
}
private void initFragmentsWithFile() {

View file

@ -161,14 +161,21 @@ public class ExtendedListFragment extends Fragment
searchView = (SearchView) MenuItemCompat.getActionView(item);
searchView.setOnQueryTextListener(this);
final Handler handler = new Handler();
searchView.setMaxWidth(Integer.MAX_VALUE);
searchView.setOnQueryTextFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
public void onFocusChange(View v, final boolean hasFocus) {
if (hasFocus) {
mFabMain.collapse();
}
setFabEnabled(!hasFocus);
handler.postDelayed(new Runnable() {
@Override
public void run() {
setFabEnabled(!hasFocus);
}
}, 100);
}
});