diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 0f66c665..c22b1a7e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -29,6 +29,7 @@ import androidx.appcompat.app.AppCompatActivity; import androidx.constraintlayout.widget.Barrier; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintSet; +import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; import androidx.paging.PagedListAdapter; import androidx.recyclerview.widget.DiffUtil; @@ -757,10 +758,12 @@ public class PostRecyclerViewAdapter extends PagedListAdapter { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_24dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; mFragment.videoAutoplayChangeMutingOption(true); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_24dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; mFragment.videoAutoplayChangeMutingOption(false); @@ -2884,9 +2892,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter { if (helper != null) { if (helper.getVolume() != 0) { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_mute_white_rounded_24dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_mute_white_rounded_24dp)); helper.setVolume(0f); volume = 0f; mFragment.videoAutoplayChangeMutingOption(true); } else { - muteButton.setImageDrawable(mActivity.getDrawable(R.drawable.ic_unmute_white_rounded_24dp)); + muteButton.setImageDrawable(ContextCompat.getDrawable(mActivity, R.drawable.ic_unmute_white_rounded_24dp)); helper.setVolume(1f); volume = 1f; mFragment.videoAutoplayChangeMutingOption(false); @@ -4103,9 +4111,9 @@ public class PostRecyclerViewAdapter extends PagedListAdapter