It already works, although not to my standard yet
This commit is contained in:
parent
f510ee3b4d
commit
a0c26b748a
|
@ -235,6 +235,11 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene
|
|||
new AccountSwitcherSheet(getActivity()).show();
|
||||
return true;
|
||||
}
|
||||
if(tab==R.id.tab_search){
|
||||
searchFragment.selectSearch(true);
|
||||
onTabSelected(tab);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,8 @@ package org.joinmastodon.android.fragments.discover;
|
|||
|
||||
import android.app.Fragment;
|
||||
import android.app.FragmentTransaction;
|
||||
import android.content.Context;
|
||||
import android.hardware.input.InputManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
|
@ -46,6 +48,7 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||
private TabLayoutMediator tabLayoutMediator;
|
||||
private EditText searchEdit;
|
||||
private boolean searchActive;
|
||||
private boolean wasTriggeredByLongPress = false;
|
||||
private FrameLayout searchView;
|
||||
private ImageButton searchBack, searchClear;
|
||||
private ProgressBar searchProgress;
|
||||
|
@ -358,4 +361,12 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
|||
return position;
|
||||
}
|
||||
}
|
||||
|
||||
public void selectSearch(boolean selectSearch){
|
||||
wasTriggeredByLongPress=selectSearch;
|
||||
searchEdit.requestFocus();
|
||||
onSearchEditFocusChanged(searchEdit, selectSearch);
|
||||
getActivity().getSystemService(InputMethodManager.class).showSoftInput(searchEdit, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue