mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-10-06 05:49:49 +02:00
Display a splash screen when the app starts.
This commit is contained in:
@@ -157,6 +157,8 @@ public class MainActivity extends AppCompatActivity implements SortTypeBottomShe
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
setTheme(R.style.AppTheme_NoActionBarWithTransparentStatusBar);
|
||||
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_main);
|
||||
|
||||
|
@@ -78,7 +78,7 @@ class PostDataSourceFactory extends DataSource.Factory {
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public DataSource create() {
|
||||
public DataSource<String, Post> create() {
|
||||
if(postType == PostDataSource.TYPE_FRONT_PAGE) {
|
||||
postDataSource = new PostDataSource(retrofit, accessToken, locale, postType, sortType,
|
||||
filter, nsfw);
|
||||
|
@@ -450,10 +450,10 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
|
||||
stopLazyMode();
|
||||
}
|
||||
|
||||
mAdapter.setNetworkState(null);
|
||||
mFetchPostInfoLinearLayout.setVisibility(View.GONE);
|
||||
hasPost = false;
|
||||
mPostViewModel.refresh();
|
||||
mAdapter.setNetworkState(null);
|
||||
}
|
||||
|
||||
private void showErrorView(int stringResId) {
|
||||
|
@@ -23,7 +23,7 @@ public class PostViewModel extends ViewModel {
|
||||
private LiveData<PagedList<Post>> posts;
|
||||
private MutableLiveData<Boolean> nsfwLiveData;
|
||||
private MutableLiveData<String> sortTypeLiveData;
|
||||
private PostViewModel.NSFWAndSortTypeLiveData NSFWAndSortTypeLiveData;
|
||||
private NSFWAndSortTypeLiveData nsfwAndSortTypeLiveData;
|
||||
|
||||
public PostViewModel(Retrofit retrofit, String accessToken, Locale locale, int postType, String sortType,
|
||||
int filter, boolean nsfw) {
|
||||
@@ -42,7 +42,7 @@ public class PostViewModel extends ViewModel {
|
||||
sortTypeLiveData = new MutableLiveData<>();
|
||||
sortTypeLiveData.postValue(sortType);
|
||||
|
||||
NSFWAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
nsfwAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
|
||||
PagedList.Config pagedListConfig =
|
||||
(new PagedList.Config.Builder())
|
||||
@@ -50,7 +50,7 @@ public class PostViewModel extends ViewModel {
|
||||
.setPageSize(25)
|
||||
.build();
|
||||
|
||||
posts = Transformations.switchMap(NSFWAndSortTypeLiveData, nsfwAndSort -> {
|
||||
posts = Transformations.switchMap(nsfwAndSortTypeLiveData, nsfwAndSort -> {
|
||||
postDataSourceFactory.changeNSFWAndSortType(nsfwLiveData.getValue(), sortTypeLiveData.getValue());
|
||||
return (new LivePagedListBuilder(postDataSourceFactory, pagedListConfig)).build();
|
||||
});
|
||||
@@ -73,7 +73,7 @@ public class PostViewModel extends ViewModel {
|
||||
sortTypeLiveData = new MutableLiveData<>();
|
||||
sortTypeLiveData.postValue(sortType);
|
||||
|
||||
NSFWAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
nsfwAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
|
||||
PagedList.Config pagedListConfig =
|
||||
(new PagedList.Config.Builder())
|
||||
@@ -81,7 +81,7 @@ public class PostViewModel extends ViewModel {
|
||||
.setPageSize(25)
|
||||
.build();
|
||||
|
||||
posts = Transformations.switchMap(NSFWAndSortTypeLiveData, nsfwAndSort -> {
|
||||
posts = Transformations.switchMap(nsfwAndSortTypeLiveData, nsfwAndSort -> {
|
||||
postDataSourceFactory.changeNSFWAndSortType(nsfwLiveData.getValue(), sortTypeLiveData.getValue());
|
||||
return (new LivePagedListBuilder(postDataSourceFactory, pagedListConfig)).build();
|
||||
});
|
||||
@@ -104,7 +104,7 @@ public class PostViewModel extends ViewModel {
|
||||
sortTypeLiveData = new MutableLiveData<>();
|
||||
sortTypeLiveData.postValue(sortType);
|
||||
|
||||
NSFWAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
nsfwAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
|
||||
PagedList.Config pagedListConfig =
|
||||
(new PagedList.Config.Builder())
|
||||
@@ -112,7 +112,7 @@ public class PostViewModel extends ViewModel {
|
||||
.setPageSize(25)
|
||||
.build();
|
||||
|
||||
posts = Transformations.switchMap(NSFWAndSortTypeLiveData, nsfwAndSort -> {
|
||||
posts = Transformations.switchMap(nsfwAndSortTypeLiveData, nsfwAndSort -> {
|
||||
postDataSourceFactory.changeNSFWAndSortType(nsfwLiveData.getValue(), sortTypeLiveData.getValue());
|
||||
return (new LivePagedListBuilder(postDataSourceFactory, pagedListConfig)).build();
|
||||
});
|
||||
@@ -135,7 +135,7 @@ public class PostViewModel extends ViewModel {
|
||||
sortTypeLiveData = new MutableLiveData<>();
|
||||
sortTypeLiveData.postValue(sortType);
|
||||
|
||||
NSFWAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
nsfwAndSortTypeLiveData = new NSFWAndSortTypeLiveData(nsfwLiveData, sortTypeLiveData);
|
||||
|
||||
PagedList.Config pagedListConfig =
|
||||
(new PagedList.Config.Builder())
|
||||
@@ -143,7 +143,7 @@ public class PostViewModel extends ViewModel {
|
||||
.setPageSize(25)
|
||||
.build();
|
||||
|
||||
posts = Transformations.switchMap(NSFWAndSortTypeLiveData, nsfwAndSort -> {
|
||||
posts = Transformations.switchMap(nsfwAndSortTypeLiveData, nsfwAndSort -> {
|
||||
postDataSourceFactory.changeNSFWAndSortType(nsfwLiveData.getValue(), sortTypeLiveData.getValue());
|
||||
return (new LivePagedListBuilder(postDataSourceFactory, pagedListConfig)).build();
|
||||
});
|
||||
|
Reference in New Issue
Block a user