mirror of
https://github.com/nuclearfog/Shitter.git
synced 2025-02-07 06:23:48 +01:00
bug fix, dependency update
This commit is contained in:
parent
b728208f03
commit
fd0a01dd2e
@ -23,7 +23,7 @@ android {
|
||||
shrinkResources true
|
||||
debuggable false
|
||||
multiDexEnabled false
|
||||
proguardFile 'proguard-rules.pro'
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
debug {
|
||||
applicationIdSuffix '.debug'
|
||||
@ -66,8 +66,8 @@ dependencies {
|
||||
implementation 'com.github.nuclearfog:LinkAndScrollMovement:1.4.1'
|
||||
implementation 'com.github.kyleduo:SwitchButton:2.0.3-SNAPSHOT'
|
||||
implementation 'com.github.UnifiedPush:android-connector:2.1.1'
|
||||
implementation 'com.google.android.material:material:1.9.0'
|
||||
implementation 'com.google.android.material:material:1.10.0'
|
||||
implementation 'jp.wasabeef:picasso-transformations:2.4.0'
|
||||
implementation 'net.danlew:android.joda:2.12.5'
|
||||
implementation 'org.jsoup:jsoup:1.16.1'
|
||||
}
|
||||
}
|
||||
|
@ -50,6 +50,8 @@ public abstract class ListFragment extends Fragment implements OnRefreshListener
|
||||
|
||||
private RecyclerView list;
|
||||
private SwipeRefreshLayout reload;
|
||||
|
||||
private ItemViewModel viewModel;
|
||||
protected GlobalSettings settings;
|
||||
|
||||
private boolean enableSwipe = true;
|
||||
@ -66,7 +68,7 @@ public abstract class ListFragment extends Fragment implements OnRefreshListener
|
||||
list.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
AppStyles.setSwipeRefreshColor(reload, settings);
|
||||
|
||||
ItemViewModel viewModel = new ViewModelProvider(requireActivity()).get(ItemViewModel.class);
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(ItemViewModel.class);
|
||||
viewModel.getSelectedItem().observe(getViewLifecycleOwner(), this);
|
||||
|
||||
reload.setOnRefreshListener(this);
|
||||
@ -74,6 +76,13 @@ public abstract class ListFragment extends Fragment implements OnRefreshListener
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
viewModel.getSelectedItem().removeObserver(this);
|
||||
super.onDestroyView();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final void onRefresh() {
|
||||
onReload();
|
||||
|
@ -40,8 +40,8 @@ public class LockableConstraintLayout extends ConstraintLayout {
|
||||
case MotionEvent.ACTION_SCROLL:
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
float deltaY = ev.getAxisValue(MotionEvent.AXIS_Y) - yPos;
|
||||
// detect scroll down, then aquire scroll lock
|
||||
if (!yLock && deltaY < 0.0f && callback != null) {
|
||||
// detect swipe up, then aquire scroll lock
|
||||
if (deltaY < 0.0f && callback != null) {
|
||||
yLock = callback.aquireVerticalScrollLock();
|
||||
}
|
||||
// fall through
|
||||
|
Loading…
x
Reference in New Issue
Block a user