1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 05:16:58 +00:00

Merge branch 'master' into feature/multistack-navigation

This commit is contained in:
Ammar Githam 2021-07-04 18:22:54 +09:00
commit da637bf04e
2 changed files with 15 additions and 31 deletions

View File

@ -243,14 +243,14 @@ dependencies {
githubImplementation 'io.sentry:sentry-android:5.0.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.2'
testImplementation "androidx.test.ext:junit-ktx:1.1.2"
testImplementation "androidx.test:core-ktx:1.3.0"
testImplementation "androidx.test.ext:junit-ktx:1.1.3"
testImplementation "androidx.test:core-ktx:1.4.0"
testImplementation "androidx.arch.core:core-testing:2.1.0"
testImplementation "org.robolectric:robolectric:4.5.1"
testImplementation "org.robolectric:robolectric:4.6"
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.5.0'
androidTestImplementation 'org.junit.jupiter:junit-jupiter:5.7.2'
androidTestImplementation 'androidx.test:core:1.3.0'
androidTestImplementation 'androidx.test:core:1.4.0'
androidTestImplementation 'com.android.support:support-annotations:28.0.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation "androidx.room:room-testing:2.3.0"

View File

@ -114,7 +114,7 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme
private DialogPostViewBinding binding;
private Context context;
private boolean detailsVisible = true;
private boolean video;
// private boolean video;
private VideoPlayerViewHelper videoPlayerViewHelper;
private SliderItemsAdapter sliderItemsAdapter;
private int sliderPosition = -1;
@ -998,30 +998,13 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme
final String text = (position + 1) + "/" + size;
binding.mediaCounter.setText(text);
final Media childMedia = media.getCarouselMedia().get(position);
// final View view = binding.sliderParent.getChildAt(0);
// if (prevPosition != -1) {
// if (view instanceof RecyclerView) {
// final RecyclerView.ViewHolder viewHolder = ((RecyclerView) view).findViewHolderForAdapterPosition(prevPosition);
// if (viewHolder instanceof SliderVideoViewHolder) {
// ((SliderVideoViewHolder) viewHolder).removeCallbacks();
// }
// }
// }
video = false;
if (childMedia.getType() == MediaItemType.MEDIA_TYPE_VIDEO) {
// if (view instanceof RecyclerView) {
// final RecyclerView.ViewHolder viewHolder = ((RecyclerView) view).findViewHolderForAdapterPosition(position);
// if (viewHolder instanceof SliderVideoViewHolder) {
// ((SliderVideoViewHolder) viewHolder).resetPlayerTimeline();
// }
// }
// enablePlayerControls(true);
video = true;
viewModel.setViewCount(childMedia.getViewCount());
return;
}
viewModel.setViewCount(null);
// enablePlayerControls(false);
// video = false;
// if (childMedia.getType() == MediaItemType.MEDIA_TYPE_VIDEO) {
// video = true;
// viewModel.setViewCount(childMedia.getViewCount());
// return;
// }
// viewModel.setViewCount(null);
}
private void pausePlayerAtPosition(final int position, final RecyclerView view) {
@ -1060,7 +1043,7 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme
}
private void setupVideo() {
video = true;
// video = true;
final Media media = viewModel.getMedia();
binding.mediaCounter.setVisibility(View.GONE);
final Context context = getContext();
@ -1398,7 +1381,8 @@ public class PostViewV2Fragment extends Fragment implements EditTextDialogFragme
bottom.like.setVisibility(View.VISIBLE);
bottom.save.setVisibility(View.VISIBLE);
}
if (video) {
// if (video) {
if (media.getType() == MediaItemType.MEDIA_TYPE_VIDEO) {
// binding.playerControlsToggle.setVisibility(View.VISIBLE);
bottom.viewsCount.setVisibility(View.VISIBLE);
}