forked from mirrors/Fedilab
Release 3.0.8
This commit is contained in:
parent
7589f91e07
commit
2a47056606
3 changed files with 35 additions and 25 deletions
|
@ -9,8 +9,8 @@ android {
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
minSdk 21
|
minSdk 21
|
||||||
targetSdk 31
|
targetSdk 31
|
||||||
versionCode 397
|
versionCode 398
|
||||||
versionName "3.0.7"
|
versionName "3.0.8"
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
flavorDimensions "default"
|
flavorDimensions "default"
|
||||||
|
|
|
@ -174,9 +174,9 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
}
|
}
|
||||||
|
|
||||||
public void scrollToTop() {
|
public void scrollToTop() {
|
||||||
if (binding != null) {
|
binding.swipeContainer.setRefreshing(true);
|
||||||
binding.recyclerView.scrollToPosition(0);
|
flagLoading = false;
|
||||||
}
|
route(DIRECTION.SCROLL_TOP, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public View onCreateView(@NonNull LayoutInflater inflater,
|
public View onCreateView(@NonNull LayoutInflater inflater,
|
||||||
|
@ -423,6 +423,9 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
} else if (direction == DIRECTION.BOTTOM) {
|
} else if (direction == DIRECTION.BOTTOM) {
|
||||||
flagLoading = true;
|
flagLoading = true;
|
||||||
}
|
}
|
||||||
|
if (direction == DIRECTION.SCROLL_TOP) {
|
||||||
|
binding.recyclerView.scrollToPosition(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -459,7 +462,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
statusFetchMore.isFetchMore = true;
|
statusFetchMore.isFetchMore = true;
|
||||||
statusFetchMore.id = Helper.generateString();
|
statusFetchMore.id = Helper.generateString();
|
||||||
int insertAt;
|
int insertAt;
|
||||||
if (direction == DIRECTION.REFRESH || direction == DIRECTION.BOTTOM) {
|
if (direction == DIRECTION.REFRESH || direction == DIRECTION.BOTTOM || direction == DIRECTION.SCROLL_TOP) {
|
||||||
insertAt = lastInsertedPosition;
|
insertAt = lastInsertedPosition;
|
||||||
} else {
|
} else {
|
||||||
insertAt = initialInsertedPosition;
|
insertAt = initialInsertedPosition;
|
||||||
|
@ -617,11 +620,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, true, false, false, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, true, false, false, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, true, false, false, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, true, false, false, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -637,11 +640,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, false, true, false, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, false, true, false, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, false, true, false, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getPublic(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, false, true, false, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -659,11 +662,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.BOTTOM, false));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.BOTTOM, false));
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getNitter(remoteInstance, pinnedTimeline.remoteInstance.host, null)
|
timelinesVM.getNitter(remoteInstance, pinnedTimeline.remoteInstance.host, null)
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -682,11 +685,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.BOTTOM, false));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.BOTTOM, false));
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getMisskey(remoteInstance, null, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getMisskey(remoteInstance, null, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -703,11 +706,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.BOTTOM, false));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.BOTTOM, false));
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
flagLoading = false;
|
flagLoading = false;
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getPeertube(remoteInstance, null, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getPeertube(remoteInstance, null, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -723,11 +726,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
timelinesVM.getPublic(null, remoteInstance, true, false, false, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getPublic(null, remoteInstance, true, false, false, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getPublic(null, remoteInstance, true, false, false, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getPublic(null, remoteInstance, true, false, false, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -744,11 +747,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
timelinesVM.getList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, list_id, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, list_id, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, list_id, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getList(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, list_id, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -768,11 +771,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
} else if (direction == DIRECTION.TOP) {
|
} else if (direction == DIRECTION.TOP) {
|
||||||
timelinesVM.getHashTag(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, tagTimeline.name, false, tagTimeline.isART, tagTimeline.all, tagTimeline.any, tagTimeline.none, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getHashTag(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, tagTimeline.name, false, tagTimeline.isART, tagTimeline.all, tagTimeline.any, tagTimeline.none, null, null, fetchingMissing ? min_id_fetch_more : min_id, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
.observe(getViewLifecycleOwner(), statusesBottom -> dealWithPagination(statusesBottom, DIRECTION.TOP, fetchingMissing));
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getHashTag(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, tagTimeline.name, false, tagTimeline.isART, tagTimeline.all, tagTimeline.any, tagTimeline.none, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
timelinesVM.getHashTag(BaseMainActivity.currentToken, BaseMainActivity.currentInstance, tagTimeline.name, false, tagTimeline.isART, tagTimeline.all, tagTimeline.any, tagTimeline.none, null, null, null, MastodonHelper.statusesPerCall(requireActivity()))
|
||||||
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
.observe(getViewLifecycleOwner(), statusesRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusesRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusesRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusesRefresh);
|
initializeStatusesCommonView(statusesRefresh);
|
||||||
}
|
}
|
||||||
|
@ -954,11 +957,11 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
.observe(getViewLifecycleOwner(), statusesTop -> dealWithPagination(statusesTop, DIRECTION.TOP, true));
|
.observe(getViewLifecycleOwner(), statusesTop -> dealWithPagination(statusesTop, DIRECTION.TOP, true));
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (direction == DIRECTION.REFRESH) {
|
} else if (direction == DIRECTION.REFRESH || direction == DIRECTION.SCROLL_TOP) {
|
||||||
timelinesVM.getHome(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, true, null, null, null, MastodonHelper.statusesPerCall(requireActivity()), false)
|
timelinesVM.getHome(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, true, null, null, null, MastodonHelper.statusesPerCall(requireActivity()), false)
|
||||||
.observe(getViewLifecycleOwner(), statusRefresh -> {
|
.observe(getViewLifecycleOwner(), statusRefresh -> {
|
||||||
if (statusAdapter != null) {
|
if (statusAdapter != null) {
|
||||||
dealWithPagination(statusRefresh, DIRECTION.REFRESH, true);
|
dealWithPagination(statusRefresh, direction, true);
|
||||||
} else {
|
} else {
|
||||||
initializeStatusesCommonView(statusRefresh);
|
initializeStatusesCommonView(statusRefresh);
|
||||||
}
|
}
|
||||||
|
@ -1019,6 +1022,7 @@ public class FragmentMastodonTimeline extends Fragment implements StatusAdapter.
|
||||||
public enum DIRECTION {
|
public enum DIRECTION {
|
||||||
TOP,
|
TOP,
|
||||||
BOTTOM,
|
BOTTOM,
|
||||||
REFRESH
|
REFRESH,
|
||||||
|
SCROLL_TOP
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
- Keep improving the scroll behaviour
|
||||||
|
- Scroll to top (tab reselection) will fetch new messages and then scroll to top
|
||||||
|
- Remove focus point for fit media preview
|
||||||
|
- Fix cannot share with one account
|
||||||
|
- Fix black theme
|
||||||
|
- Fix some button colors
|
Loading…
Reference in a new issue