mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
hide pip button for android < 8
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
6839b9eb2c
commit
1ae5f51a81
@ -95,10 +95,13 @@ class MagicCallActivity : BaseActivity() {
|
|||||||
enterPictureInPictureMode(getPipParams())
|
enterPictureInPictureMode(getPipParams())
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
|
||||||
override fun onUserLeaveHint() {
|
override fun onUserLeaveHint() {
|
||||||
enableKeyguard()
|
enableKeyguard()
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||||
enterPictureInPictureMode(getPipParams())
|
enterPictureInPictureMode(getPipParams())
|
||||||
|
} else {
|
||||||
|
finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(Build.VERSION_CODES.O)
|
@RequiresApi(Build.VERSION_CODES.O)
|
||||||
|
@ -79,6 +79,8 @@ public class ParticipantsAdapter extends BaseAdapter {
|
|||||||
|
|
||||||
surfaceViewRenderer = convertView.findViewById(R.id.surface_view);
|
surfaceViewRenderer = convertView.findViewById(R.id.surface_view);
|
||||||
try {
|
try {
|
||||||
|
Log.d(TAG, "hasSurface: " + participantDisplayItem.getRootEglBase().hasSurface());
|
||||||
|
|
||||||
surfaceViewRenderer.setMirror(false);
|
surfaceViewRenderer.setMirror(false);
|
||||||
surfaceViewRenderer.init(participantDisplayItem.getRootEglBase().getEglBaseContext(), null);
|
surfaceViewRenderer.init(participantDisplayItem.getRootEglBase().getEglBaseContext(), null);
|
||||||
surfaceViewRenderer.setZOrderMediaOverlay(false);
|
surfaceViewRenderer.setZOrderMediaOverlay(false);
|
||||||
@ -127,7 +129,24 @@ public class ParticipantsAdapter extends BaseAdapter {
|
|||||||
} else {
|
} else {
|
||||||
audioOffView.setVisibility(View.INVISIBLE);
|
audioOffView.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
convertView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewAttachedToWindow(View v) {
|
||||||
|
Log.d(TAG,"onViewAttachedToWindow");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewDetachedFromWindow(View v) {
|
||||||
|
Log.d(TAG,"onViewDetachedFromWindow");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
return convertView;
|
return convertView;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean hasVideoStream(ParticipantDisplayItem participantDisplayItem, MediaStream mediaStream) {
|
private boolean hasVideoStream(ParticipantDisplayItem participantDisplayItem, MediaStream mediaStream) {
|
||||||
|
@ -141,7 +141,6 @@ import javax.inject.Inject;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.RequiresApi;
|
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
@ -208,8 +207,8 @@ public class CallController extends BaseController {
|
|||||||
TextView callVoiceOrVideoTextView;
|
TextView callVoiceOrVideoTextView;
|
||||||
@BindView(R.id.callConversationNameTextView)
|
@BindView(R.id.callConversationNameTextView)
|
||||||
TextView callConversationNameTextView;
|
TextView callConversationNameTextView;
|
||||||
|
@BindView(R.id.callControlEnterPip)
|
||||||
|
SimpleDraweeView callControlEnterPip;
|
||||||
|
|
||||||
@BindView(R.id.callStateRelativeLayoutView)
|
@BindView(R.id.callStateRelativeLayoutView)
|
||||||
RelativeLayout callStateView;
|
RelativeLayout callStateView;
|
||||||
@ -484,6 +483,10 @@ public class CallController extends BaseController {
|
|||||||
callInfosLinearLayout.setVisibility(View.VISIBLE);
|
callInfosLinearLayout.setVisibility(View.VISIBLE);
|
||||||
selfVideoViewWrapper.setVisibility(View.VISIBLE);
|
selfVideoViewWrapper.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||||
|
callControlEnterPip.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
if (isVoiceOnlyCall) {
|
if (isVoiceOnlyCall) {
|
||||||
callControlEnableSpeaker.setVisibility(View.VISIBLE);
|
callControlEnableSpeaker.setVisibility(View.VISIBLE);
|
||||||
cameraSwitchButton.setVisibility(View.GONE);
|
cameraSwitchButton.setVisibility(View.GONE);
|
||||||
@ -858,10 +861,14 @@ public class CallController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
|
||||||
@OnClick(R.id.callControlEnterPip)
|
@OnClick(R.id.callControlEnterPip)
|
||||||
void enterPipMode() {
|
void enterPipMode() {
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O){
|
||||||
((MagicCallActivity) getActivity()).enterPipMode();
|
((MagicCallActivity) getActivity()).enterPipMode();
|
||||||
|
} else{
|
||||||
|
Log.w(TAG, "tried to enterPipMode with an android api level below 26 (Android 8). This scenario should " +
|
||||||
|
"have been avoided by hiding the PIP button!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R.id.callControlHangupView)
|
@OnClick(R.id.callControlHangupView)
|
||||||
|
@ -139,13 +139,14 @@
|
|||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
android:layout_marginStart="40dp"
|
||||||
|
android:layout_marginEnd="40dp">
|
||||||
|
|
||||||
<com.facebook.drawee.view.SimpleDraweeView
|
<com.facebook.drawee.view.SimpleDraweeView
|
||||||
android:id="@+id/callControlEnterPip"
|
android:id="@+id/callControlEnterPip"
|
||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="40dp"
|
|
||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:elevation="10dp"
|
android:elevation="10dp"
|
||||||
app:backgroundImage="@color/call_buttons_background"
|
app:backgroundImage="@color/call_buttons_background"
|
||||||
@ -189,7 +190,7 @@
|
|||||||
android:layout_width="60dp"
|
android:layout_width="60dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="10dp"
|
android:layout_marginStart="10dp"
|
||||||
android:layout_marginEnd="40dp"
|
android:layout_marginEnd="10dp"
|
||||||
app:backgroundImage="@color/nc_darkRed"
|
app:backgroundImage="@color/nc_darkRed"
|
||||||
app:placeholderImage="@drawable/ic_call_end_white_24px"
|
app:placeholderImage="@drawable/ic_call_end_white_24px"
|
||||||
app:roundAsCircle="true" />
|
app:roundAsCircle="true" />
|
||||||
|
Loading…
Reference in New Issue
Block a user