mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 22:56:33 +02:00
Search for settings
This commit is contained in:
@@ -37,6 +37,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -71,6 +72,7 @@ public class FragmentBase extends Fragment {
|
||||
|
||||
private long message = -1;
|
||||
private long attachment = -1;
|
||||
private int scrollTo = 0;
|
||||
|
||||
private static final int REQUEST_ATTACHMENT = 51;
|
||||
private static final int REQUEST_ATTACHMENTS = 52;
|
||||
@@ -97,6 +99,37 @@ public class FragmentBase extends Fragment {
|
||||
updateSubtitle();
|
||||
}
|
||||
|
||||
void scrollTo(int resid) {
|
||||
scrollTo = resid;
|
||||
scrollTo();
|
||||
}
|
||||
|
||||
private void scrollTo() {
|
||||
if (scrollTo == 0)
|
||||
return;
|
||||
|
||||
View view = getView();
|
||||
if (view == null)
|
||||
return;
|
||||
|
||||
final ScrollView scroll = view.findViewById(R.id.scroll);
|
||||
if (scroll == null)
|
||||
return;
|
||||
|
||||
final View child = scroll.findViewById(scrollTo);
|
||||
if (child == null)
|
||||
return;
|
||||
|
||||
scrollTo = 0;
|
||||
|
||||
scroll.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
scroll.scrollTo(0, child.getTop());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void startActivity(Intent intent) {
|
||||
try {
|
||||
@@ -176,6 +209,7 @@ public class FragmentBase extends Fragment {
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
Log.d("Activity " + this + " saved=" + (savedInstanceState != null));
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
scrollTo();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user