Scroll to save button on selecting save changes

pull/156/head
M66B 6 years ago
parent 5cb41067cd
commit 12bc1c02eb

@ -1054,6 +1054,12 @@ public class FragmentAccount extends FragmentBase {
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
new Handler().post(new Runnable() {
@Override
public void run() {
scroll.smoothScrollTo(0, btnSave.getBottom());
}
});
onSave(false);
}
})

@ -24,6 +24,7 @@ import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
@ -35,6 +36,7 @@ import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.ScrollView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@ -46,6 +48,8 @@ import java.util.Objects;
public class FragmentFolder extends FragmentBase {
private ViewGroup view;
private ScrollView scroll;
private EditText etName;
private EditText etDisplay;
private CheckBox cbHide;
@ -86,6 +90,7 @@ public class FragmentFolder extends FragmentBase {
setHasOptionsMenu(true);
view = (ViewGroup) inflater.inflate(R.layout.fragment_folder, container, false);
scroll = view.findViewById(R.id.scroll);
// Get controls
etName = view.findViewById(R.id.etName);
@ -317,6 +322,12 @@ public class FragmentFolder extends FragmentBase {
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
new Handler().post(new Runnable() {
@Override
public void run() {
scroll.smoothScrollTo(0, btnSave.getBottom());
}
});
onSave(false);
}
})

@ -760,6 +760,12 @@ public class FragmentIdentity extends FragmentBase {
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
new Handler().post(new Runnable() {
@Override
public void run() {
scroll.smoothScrollTo(0, btnSave.getBottom());
}
});
onSave(false);
}
})

@ -7,6 +7,7 @@
tools:context=".ActivityView">
<ScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"

Loading…
Cancel
Save