mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 06:01:12 +00:00
Scroll to rule action attributes
This commit is contained in:
parent
f824dfb47e
commit
91ccd85c5b
2 changed files with 16 additions and 1 deletions
|
@ -22,6 +22,7 @@ package eu.faircode.email;
|
|||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
|
@ -31,6 +32,7 @@ import android.widget.AdapterView;
|
|||
import android.widget.ArrayAdapter;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.Spinner;
|
||||
|
||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||
|
@ -44,10 +46,13 @@ import java.util.List;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
|
||||
public class FragmentRule extends FragmentBase {
|
||||
private ViewGroup view;
|
||||
private ScrollView scroll;
|
||||
private ConstraintLayout content;
|
||||
private EditText etName;
|
||||
private EditText etOrder;
|
||||
private CheckBox cbEnabled;
|
||||
|
@ -89,6 +94,8 @@ public class FragmentRule extends FragmentBase {
|
|||
view = (ViewGroup) inflater.inflate(R.layout.fragment_rule, container, false);
|
||||
|
||||
// Get controls
|
||||
scroll = view.findViewById(R.id.scroll);
|
||||
content = view.findViewById(R.id.content);
|
||||
etName = view.findViewById(R.id.etName);
|
||||
etOrder = view.findViewById(R.id.etOrder);
|
||||
cbEnabled = view.findViewById(R.id.cbEnabled);
|
||||
|
@ -134,6 +141,13 @@ public class FragmentRule extends FragmentBase {
|
|||
|
||||
private void onActionSelected(int type) {
|
||||
grpMove.setVisibility(type == EntityRule.TYPE_MOVE ? View.VISIBLE : View.GONE);
|
||||
|
||||
new Handler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
scroll.smoothScrollTo(0, content.getBottom());
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -244,7 +258,6 @@ public class FragmentRule extends FragmentBase {
|
|||
spTarget.setSelection(pos);
|
||||
break;
|
||||
}
|
||||
grpMove.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
tools:context=".ActivityView">
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scroll"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_margin="12dp"
|
||||
|
@ -15,6 +16,7 @@
|
|||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
|
Loading…
Reference in a new issue