Workaround AndroidX bug

"Range start point not set"
pull/147/head
M66B 6 years ago
parent bc40a4ed57
commit 6dad7d2875

@ -0,0 +1,34 @@
package eu.faircode.email;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
public class FixedRecyclerView extends RecyclerView {
public FixedRecyclerView(@NonNull Context context) {
super(context);
}
public FixedRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public FixedRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent e) {
try {
return super.onInterceptTouchEvent(e);
} catch (IllegalStateException ex) {
// Range start point not set
Log.w(ex);
return false;
}
}
}

@ -89,7 +89,7 @@ public class FragmentMessages extends FragmentEx {
private ImageButton ibHintSelect;
private ImageButton ibHintCompact;
private TextView tvNoEmail;
private RecyclerView rvMessage;
private FixedRecyclerView rvMessage;
private BottomNavigationView bottom_navigation;
private ContentLoadingProgressBar pbWait;
private Group grpSupport;
@ -193,7 +193,7 @@ public class FragmentMessages extends FragmentEx {
ibHintSelect = view.findViewById(R.id.ibHintSelect);
ibHintCompact = view.findViewById(R.id.ibHintCompact);
tvNoEmail = view.findViewById(R.id.tvNoEmail);
rvMessage = view.findViewById(R.id.rvFolder);
rvMessage = view.findViewById(R.id.rvMessage);
bottom_navigation = view.findViewById(R.id.bottom_navigation);
pbWait = view.findViewById(R.id.pbWait);
grpSupport = view.findViewById(R.id.grpSupport);

@ -178,8 +178,8 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vSeparatorHintCompact" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvFolder"
<eu.faircode.email.FixedRecyclerView
android:id="@+id/rvMessage"
android:layout_width="0dp"
android:layout_height="0dp"
android:scrollbarStyle="outsideOverlay"
@ -247,7 +247,7 @@
android:id="@+id/grpReady"
android:layout_width="0dp"
android:layout_height="0dp"
app:constraint_referenced_ids="rvFolder" />
app:constraint_referenced_ids="rvMessage" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

Loading…
Cancel
Save