mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 12:09:45 +01:00
- set bottom margin for grid for voicecall
- temporarily comment out setOnTouchListener for grid (disables toggle of controls for now) - set android:scrollbars="vertical" for gridview - add callControlsHeight for item height calculation - add fake height to item that scrolling is testable Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
7874aa713f
commit
64d98aefb4
@ -33,18 +33,21 @@ public class ParticipantsAdapter extends BaseAdapter {
|
|||||||
private final ArrayList<ParticipantDisplayItem> participantDisplayItems;
|
private final ArrayList<ParticipantDisplayItem> participantDisplayItems;
|
||||||
private final RelativeLayout gridViewWrapper;
|
private final RelativeLayout gridViewWrapper;
|
||||||
private final LinearLayout callInfosLinearLayout;
|
private final LinearLayout callInfosLinearLayout;
|
||||||
|
private final LinearLayout callControlsLinearLayout;
|
||||||
private final int columns;
|
private final int columns;
|
||||||
private final boolean isVoiceOnlyCall;
|
private final boolean isVoiceOnlyCall;
|
||||||
|
|
||||||
public ParticipantsAdapter(Context mContext,
|
public ParticipantsAdapter(Context mContext,
|
||||||
Map<String, ParticipantDisplayItem> participantDisplayItems,
|
Map<String, ParticipantDisplayItem> participantDisplayItems,
|
||||||
RelativeLayout gridViewWrapper,
|
RelativeLayout gridViewWrapper,
|
||||||
LinearLayout linearLayout,
|
LinearLayout callInfosLinearLayout,
|
||||||
|
LinearLayout callControlsLinearLayout,
|
||||||
int columns,
|
int columns,
|
||||||
boolean isVoiceOnlyCall) {
|
boolean isVoiceOnlyCall) {
|
||||||
this.mContext = mContext;
|
this.mContext = mContext;
|
||||||
this.gridViewWrapper = gridViewWrapper;
|
this.gridViewWrapper = gridViewWrapper;
|
||||||
this.callInfosLinearLayout = linearLayout;
|
this.callInfosLinearLayout = callInfosLinearLayout;
|
||||||
|
this.callControlsLinearLayout = callControlsLinearLayout;
|
||||||
this.columns = columns;
|
this.columns = columns;
|
||||||
this.isVoiceOnlyCall = isVoiceOnlyCall;
|
this.isVoiceOnlyCall = isVoiceOnlyCall;
|
||||||
|
|
||||||
@ -136,11 +139,18 @@ public class ParticipantsAdapter extends BaseAdapter {
|
|||||||
|
|
||||||
private int scaleGridViewItemHeight() {
|
private int scaleGridViewItemHeight() {
|
||||||
int headerHeight = 0;
|
int headerHeight = 0;
|
||||||
|
int callControlsHeight = 0;
|
||||||
if (callInfosLinearLayout.getVisibility() == View.VISIBLE && isVoiceOnlyCall) {
|
if (callInfosLinearLayout.getVisibility() == View.VISIBLE && isVoiceOnlyCall) {
|
||||||
headerHeight = callInfosLinearLayout.getHeight();
|
headerHeight = callInfosLinearLayout.getHeight();
|
||||||
}
|
}
|
||||||
int itemHeight = (gridViewWrapper.getHeight() - headerHeight) / getRowsCount(getCount());
|
if (callControlsLinearLayout.getVisibility() == View.VISIBLE && isVoiceOnlyCall) {
|
||||||
return itemHeight;
|
callControlsHeight = callControlsLinearLayout.getHeight();
|
||||||
|
}
|
||||||
|
int itemHeight = (gridViewWrapper.getHeight() - headerHeight - callControlsHeight) / getRowsCount(getCount());
|
||||||
|
// if (itemHeight < 9000) {
|
||||||
|
// itemHeight = 9000;
|
||||||
|
// }
|
||||||
|
return itemHeight + 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getRowsCount(int items) {
|
private int getRowsCount(int items) {
|
||||||
|
@ -49,10 +49,6 @@ import android.widget.ProgressBar;
|
|||||||
import android.widget.RelativeLayout;
|
import android.widget.RelativeLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
|
||||||
|
|
||||||
import com.bluelinelabs.logansquare.LoganSquare;
|
import com.bluelinelabs.logansquare.LoganSquare;
|
||||||
import com.facebook.drawee.view.SimpleDraweeView;
|
import com.facebook.drawee.view.SimpleDraweeView;
|
||||||
import com.nextcloud.talk.R;
|
import com.nextcloud.talk.R;
|
||||||
@ -143,6 +139,9 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
@ -484,8 +483,10 @@ public class CallController extends BaseController {
|
|||||||
cameraControlButton.setVisibility(View.GONE);
|
cameraControlButton.setVisibility(View.GONE);
|
||||||
pipVideoView.setVisibility(View.GONE);
|
pipVideoView.setVisibility(View.GONE);
|
||||||
|
|
||||||
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||||
|
ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||||
params.addRule(RelativeLayout.BELOW, R.id.callInfosLinearLayout);
|
params.addRule(RelativeLayout.BELOW, R.id.callInfosLinearLayout);
|
||||||
|
params.setMargins(0,0,0,400);
|
||||||
gridView.setLayoutParams(params);
|
gridView.setLayoutParams(params);
|
||||||
} else {
|
} else {
|
||||||
callControlEnableSpeaker.setVisibility(View.GONE);
|
callControlEnableSpeaker.setVisibility(View.GONE);
|
||||||
@ -502,15 +503,15 @@ public class CallController extends BaseController {
|
|||||||
pipVideoView.setOnTouchListener(new SelfVideoTouchListener());
|
pipVideoView.setOnTouchListener(new SelfVideoTouchListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
gridView.setOnTouchListener(new View.OnTouchListener() {
|
// gridView.setOnTouchListener(new View.OnTouchListener() {
|
||||||
public boolean onTouch(View v, MotionEvent me) {
|
// public boolean onTouch(View v, MotionEvent me) {
|
||||||
int action = me.getActionMasked();
|
// int action = me.getActionMasked();
|
||||||
if (action == MotionEvent.ACTION_DOWN) {
|
// if (action == MotionEvent.ACTION_DOWN) {
|
||||||
showCallControls();
|
// showCallControls();
|
||||||
}
|
// }
|
||||||
return true;
|
// return true;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
|
|
||||||
initGridAdapter();
|
initGridAdapter();
|
||||||
}
|
}
|
||||||
@ -561,11 +562,20 @@ public class CallController extends BaseController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
LinearLayout callControlsLinearLayout = controllerCallLayout.findViewById(R.id.callControlsLinearLayout);
|
||||||
|
callControlsLinearLayout.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||||
|
@Override
|
||||||
|
public void onGlobalLayout() {
|
||||||
|
callControlsLinearLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
participantsAdapter = new ParticipantsAdapter(
|
participantsAdapter = new ParticipantsAdapter(
|
||||||
this.getActivity(),
|
this.getActivity(),
|
||||||
participantDisplayItems,
|
participantDisplayItems,
|
||||||
gridViewWrapper,
|
gridViewWrapper,
|
||||||
callInfosLinearLayout,
|
callInfosLinearLayout,
|
||||||
|
callControlsLinearLayout,
|
||||||
columns,
|
columns,
|
||||||
isVoiceOnlyCall);
|
isVoiceOnlyCall);
|
||||||
gridView.setAdapter(participantsAdapter);
|
gridView.setAdapter(participantsAdapter);
|
||||||
|
@ -52,6 +52,8 @@
|
|||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:stretchMode="columnWidth"
|
android:stretchMode="columnWidth"
|
||||||
android:numColumns="2"
|
android:numColumns="2"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
android:background="#fff000"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
|
Loading…
Reference in New Issue
Block a user