Browse Source

Disable scrolling when profile has no posts

Fix #1093
renovate/org.robolectric-robolectric-4.x
Rania Pilioura 4 years ago
parent
commit
8210347e66
  1. 8
      app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java

8
app/src/main/java/awais/instagrabber/fragments/main/ProfileFragment.java

@ -40,6 +40,7 @@ import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.google.android.material.appbar.AppBarLayout;
import com.google.android.material.snackbar.BaseTransientBottomBar; import com.google.android.material.snackbar.BaseTransientBottomBar;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@ -686,6 +687,13 @@ public class ProfileFragment extends Fragment implements SwipeRefreshLayout.OnRe
} else { } else {
binding.postsRecyclerView.refresh(); binding.postsRecyclerView.refresh();
} }
//Disable scrolling when profile has no posts
if (profileModel.getMediaCount() == 0){
AppBarLayout.LayoutParams toolbarLayoutParams = (AppBarLayout.LayoutParams) fragmentActivity.getCollapsingToolbarView().getLayoutParams();
toolbarLayoutParams.setScrollFlags(0);
}
profileDetailsBinding.isVerified.setVisibility(profileModel.isVerified() ? View.VISIBLE : View.GONE); profileDetailsBinding.isVerified.setVisibility(profileModel.isVerified() ? View.VISIBLE : View.GONE);
profileDetailsBinding.isPrivate.setVisibility(profileModel.isPrivate() ? View.VISIBLE : View.GONE); profileDetailsBinding.isPrivate.setVisibility(profileModel.isPrivate() ? View.VISIBLE : View.GONE);
final long profileId = profileModel.getPk(); final long profileId = profileModel.getPk();

Loading…
Cancel
Save