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();
|
new AccountSwitcherSheet(getActivity()).show();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if(tab==R.id.tab_search){
|
||||||
|
searchFragment.selectSearch(true);
|
||||||
|
onTabSelected(tab);
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@ package org.joinmastodon.android.fragments.discover;
|
||||||
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.app.FragmentTransaction;
|
import android.app.FragmentTransaction;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.hardware.input.InputManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
|
@ -46,6 +48,7 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
||||||
private TabLayoutMediator tabLayoutMediator;
|
private TabLayoutMediator tabLayoutMediator;
|
||||||
private EditText searchEdit;
|
private EditText searchEdit;
|
||||||
private boolean searchActive;
|
private boolean searchActive;
|
||||||
|
private boolean wasTriggeredByLongPress = false;
|
||||||
private FrameLayout searchView;
|
private FrameLayout searchView;
|
||||||
private ImageButton searchBack, searchClear;
|
private ImageButton searchBack, searchClear;
|
||||||
private ProgressBar searchProgress;
|
private ProgressBar searchProgress;
|
||||||
|
@ -358,4 +361,12 @@ public class DiscoverFragment extends AppKitFragment implements ScrollableToTop,
|
||||||
return position;
|
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