From 2959abb6caf89ceb0260dbf574c678fb0b7ed915 Mon Sep 17 00:00:00 2001 From: Ergyun Syuleyman Date: Fri, 8 May 2020 11:09:08 +0300 Subject: [PATCH] NY-10234: [AN]: Issue with swiping in video conferences --- .../data/conference/ConferenceVideoModule.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/nynja/mobile/communicator/data/conference/ConferenceVideoModule.java b/app/src/main/java/com/nynja/mobile/communicator/data/conference/ConferenceVideoModule.java index bf856e2b93..95e50ef935 100644 --- a/app/src/main/java/com/nynja/mobile/communicator/data/conference/ConferenceVideoModule.java +++ b/app/src/main/java/com/nynja/mobile/communicator/data/conference/ConferenceVideoModule.java @@ -134,8 +134,11 @@ public class ConferenceVideoModule { } public int getWidthDividerLength(int position) { - if (mActiveVideoParticipantsCount/MAX_VIDEO_FEEDS_COLUIMN_SIZE <= MAX_VIDEO_FEEDS_ROW_SIZE) { - return mActiveVideoParticipantsCount / MAX_VIDEO_FEEDS_COLUIMN_SIZE + 1; //MAX_VIDEO_FEEDS_ROW_SIZE + 1; + if (mActiveVideoParticipantsCount <= MAX_VIDEO_FEEDS_COUNT_PER_PAGE) { + if (mActiveVideoParticipantsCount/MAX_VIDEO_FEEDS_COLUIMN_SIZE <= MAX_VIDEO_FEEDS_ROW_SIZE) { + if (mActiveVideoParticipantsCount <= MAX_VIDEO_FEEDS_COLUIMN_SIZE) return 0; + return MAX_VIDEO_FEEDS_ROW_SIZE + 1; + } } int lastPageBeginer = ((mActiveVideoParticipantsCount / MAX_VIDEO_FEEDS_COUNT_PER_PAGE) * MAX_VIDEO_FEEDS_COUNT_PER_PAGE); if (mActiveVideoParticipantsCount == lastPageBeginer) { @@ -143,15 +146,16 @@ public class ConferenceVideoModule { } if (position < lastPageBeginer) { - return MAX_VIDEO_FEEDS_COUNT_PER_PAGE / MAX_VIDEO_FEEDS_COLUIMN_SIZE - 1; + return MAX_VIDEO_FEEDS_COUNT_PER_PAGE / MAX_VIDEO_FEEDS_COLUIMN_SIZE; } int row = (mActiveVideoParticipantsCount - lastPageBeginer)/MAX_VIDEO_FEEDS_COLUIMN_SIZE; if (row <= MAX_VIDEO_FEEDS_ROW_SIZE) { int rest = (mActiveVideoParticipantsCount - lastPageBeginer)%MAX_VIDEO_FEEDS_COLUIMN_SIZE; if (rest == 0) { + if (row == MAX_VIDEO_FEEDS_ROW_SIZE) return MAX_VIDEO_FEEDS_ROW_SIZE; + if (row == 1) return row; if (row < MAX_VIDEO_FEEDS_ROW_SIZE) return row; - if (position/lastPageBeginer == 1) return row + 1; return row - 1; } return row + 1; @@ -194,7 +198,7 @@ public class ConferenceVideoModule { } private int lastPageWidthDivider2(int lastPageCount) { - if (lastPageCount < MAX_VIDEO_FEEDS_COLUIMN_SIZE) return 1; + //if (lastPageCount < MAX_VIDEO_FEEDS_COLUIMN_SIZE) return 1; return MAX_VIDEO_FEEDS_ROW_SIZE; } -- GitLab