changed comments fragment loading animation

pull/1650/head
Ritvik Saraf 2018-09-23 15:22:45 +05:30
rodzic 7047b62442
commit 66c753f3a3
2 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -70,7 +70,7 @@ import static org.schabi.newpipe.util.AnimationUtils.animateView;
public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> { public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
private CompositeDisposable disposables = new CompositeDisposable(); private CompositeDisposable disposables = new CompositeDisposable();
private boolean initialLoad = true;
/*////////////////////////////////////////////////////////////////////////// /*//////////////////////////////////////////////////////////////////////////
// Views // Views
//////////////////////////////////////////////////////////////////////////*/ //////////////////////////////////////////////////////////////////////////*/
@ -152,6 +152,10 @@ public class CommentsFragment extends BaseListInfoFragment<CommentsInfo> {
@Override @Override
public void handleResult(@NonNull CommentsInfo result) { public void handleResult(@NonNull CommentsInfo result) {
super.handleResult(result); super.handleResult(result);
if(initialLoad){
itemsList.smoothScrollToPosition(infoListAdapter.getItemCount());
initialLoad = false;
}
if (!result.getErrors().isEmpty()) { if (!result.getErrors().isEmpty()) {
showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0); showSnackBarError(result.getErrors(), UserAction.REQUESTED_COMMENTS, NewPipe.getNameOfService(result.getServiceId()), result.getUrl(), 0);

Wyświetl plik

@ -338,7 +338,7 @@ public class NavigationHelper {
String url, String url,
String name) { String name) {
if (name == null) name = ""; if (name == null) name = "";
defaultTransaction(fragmentManager) fragmentManager.beginTransaction().setCustomAnimations(R.anim.switch_service_in, R.anim.switch_service_out)
.replace(R.id.fragment_holder, CommentsFragment.getInstance(serviceId, url, name)) .replace(R.id.fragment_holder, CommentsFragment.getInstance(serviceId, url, name))
.addToBackStack(null) .addToBackStack(null)
.commit(); .commit();