Fixed scrolling to found option

pull/199/head
M66B 4 years ago
parent 74f605bb4e
commit 56ac9612bc

@ -29,6 +29,7 @@ import android.content.IntentFilter;
import android.content.IntentSender; import android.content.IntentSender;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.graphics.Rect;
import android.net.Uri; import android.net.Uri;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -37,6 +38,7 @@ import android.text.TextUtils;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.ScrollView; import android.widget.ScrollView;
import android.widget.TextView; import android.widget.TextView;
@ -129,7 +131,10 @@ public class FragmentBase extends Fragment {
scroll.post(new Runnable() { scroll.post(new Runnable() {
@Override @Override
public void run() { public void run() {
scroll.scrollTo(0, child.getTop()); Rect rect = new Rect();
child.getDrawingRect(rect);
scroll.offsetDescendantRectToMyCoords(child, rect);
scroll.scrollTo(0, rect.top - scroll.getPaddingTop());
} }
}); });
} }

Loading…
Cancel
Save