1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +00:00

Added fast scroll to message list

This commit is contained in:
M66B 2019-05-08 11:45:36 +02:00
parent 0c6b3a1f31
commit 00006f67e5
5 changed files with 33 additions and 1 deletions

View file

@ -75,5 +75,4 @@ public class FixedRecyclerView extends RecyclerView {
return false;
}
}
}

View file

@ -446,6 +446,14 @@ public class FragmentMessages extends FragmentBase {
rvMessage.setAdapter(adapter);
rvMessage.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView rv, int dx, int dy) {
int pos = (rv.getChildCount() == 0 ? 0 : rv.getChildAt(0).getTop());
swipeRefresh.setEnabled(pull && pos >= 0);
}
});
seekBar.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="?android:attr/colorAccent" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="?android:attr/colorPrimary" />
</shape>
</item>
</selector>

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?colorSeparator" />
</shape>

View file

@ -150,7 +150,14 @@
android:clipToPadding="false"
android:paddingBottom="90dp"
android:scrollbarStyle="outsideOverlay"
android:scrollbarThumbVertical="@drawable/fast_scroll_thumb"
android:scrollbarTrackVertical="@drawable/fast_scroll_track"
android:scrollbars="vertical"
app:fastScrollEnabled="true"
app:fastScrollHorizontalThumbDrawable="@drawable/fast_scroll_thumb"
app:fastScrollHorizontalTrackDrawable="@drawable/fast_scroll_track"
app:fastScrollVerticalThumbDrawable="@drawable/fast_scroll_thumb"
app:fastScrollVerticalTrackDrawable="@drawable/fast_scroll_track"
app:layout_constraintBottom_toTopOf="@+id/bottom_navigation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"