mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-11 18:10:44 +00:00
parent
45847abf4f
commit
45916be8c9
@ -203,6 +203,8 @@ public class CallActivity extends AppCompatActivity {
|
||||
|
||||
private String baseUrl;
|
||||
|
||||
private boolean initialPermissionsCheck = true;
|
||||
|
||||
private static int getSystemUiVisibility() {
|
||||
int flags = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN;
|
||||
flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
|
||||
@ -412,7 +414,7 @@ public class CallActivity extends AppCompatActivity {
|
||||
R.string.nc_permissions_settings, this);
|
||||
} else {
|
||||
EffortlessPermissions.requestPermissions(this, R.string.nc_permissions_audio,
|
||||
100, PERMISSIONS_MICROPHONE);
|
||||
R.string.nc_proceed, R.string.nc_empty, 100, PERMISSIONS_MICROPHONE);
|
||||
}
|
||||
}
|
||||
|
||||
@ -448,7 +450,7 @@ public class CallActivity extends AppCompatActivity {
|
||||
R.string.nc_permissions_settings, this);
|
||||
} else {
|
||||
EffortlessPermissions.requestPermissions(this, R.string.nc_permissions_video,
|
||||
100, PERMISSIONS_CAMERA);
|
||||
R.string.nc_proceed, R.string.nc_empty, 100, PERMISSIONS_CAMERA);
|
||||
}
|
||||
|
||||
}
|
||||
@ -525,13 +527,14 @@ public class CallActivity extends AppCompatActivity {
|
||||
|
||||
private void checkPermissions() {
|
||||
EffortlessPermissions.requestPermissions(this, R.string.nc_permissions,
|
||||
100, PERMISSIONS_CALL);
|
||||
R.string.nc_proceed, R.string.nc_empty, 100, PERMISSIONS_CALL);
|
||||
|
||||
}
|
||||
|
||||
@AfterPermissionGranted(100)
|
||||
private void onPermissionsGranted() {
|
||||
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CALL)) {
|
||||
if (!videoOn) {
|
||||
if (!videoOn && !initialPermissionsCheck) {
|
||||
onCameraClick();
|
||||
}
|
||||
|
||||
@ -544,7 +547,11 @@ public class CallActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
if (cameraSwitchButton != null && cameraEnumerator.getDeviceNames().length > 1) {
|
||||
if (!initialPermissionsCheck) {
|
||||
cameraSwitchButton.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
cameraSwitchButton.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (!inCall) {
|
||||
@ -554,6 +561,8 @@ public class CallActivity extends AppCompatActivity {
|
||||
PERMISSIONS_CALL)) {
|
||||
checkIfSomeAreApproved();
|
||||
}
|
||||
|
||||
initialPermissionsCheck = false;
|
||||
}
|
||||
|
||||
private void checkIfSomeAreApproved() {
|
||||
@ -565,12 +574,13 @@ public class CallActivity extends AppCompatActivity {
|
||||
cameraSwitchButton.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA)) {
|
||||
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA) && !initialPermissionsCheck) {
|
||||
if (!videoOn) {
|
||||
onCameraClick();
|
||||
}
|
||||
} else {
|
||||
cameraControlButton.getFrontImageView().setImageResource(R.drawable.ic_videocam_off_white_24px);
|
||||
cameraControlButton.setAlpha(0.7f);
|
||||
if (cameraSwitchButton != null) {
|
||||
cameraSwitchButton.setVisibility(View.GONE);
|
||||
}
|
||||
@ -591,6 +601,7 @@ public class CallActivity extends AppCompatActivity {
|
||||
|
||||
@AfterPermissionDenied(100)
|
||||
private void onPermissionsDenied() {
|
||||
initialPermissionsCheck = false;
|
||||
if (cameraEnumerator.getDeviceNames().length == 0) {
|
||||
cameraControlButton.setVisibility(View.GONE);
|
||||
} else if (cameraEnumerator.getDeviceNames().length == 1) {
|
||||
@ -600,6 +611,8 @@ public class CallActivity extends AppCompatActivity {
|
||||
if (EffortlessPermissions.hasPermissions(this, PERMISSIONS_CAMERA) ||
|
||||
EffortlessPermissions.hasPermissions(this, PERMISSIONS_MICROPHONE)) {
|
||||
checkIfSomeAreApproved();
|
||||
} else if (!inCall) {
|
||||
startCall();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,15 +75,8 @@ public class CallMenuController extends BaseController implements FlexibleAdapte
|
||||
private Room room;
|
||||
private List<AbstractFlexibleItem> menuItems;
|
||||
private FlexibleAdapter<AbstractFlexibleItem> adapter;
|
||||
|
||||
@Parcel
|
||||
public enum MenuType {
|
||||
REGULAR, SHARE, NEW_CONVERSATION
|
||||
}
|
||||
|
||||
private MenuType menuType;
|
||||
private Intent shareIntent;
|
||||
|
||||
public CallMenuController(Bundle args) {
|
||||
super(args);
|
||||
this.room = Parcels.unwrap(args.getParcelable(BundleKeys.KEY_ROOM));
|
||||
@ -262,4 +255,9 @@ public class CallMenuController extends BaseController implements FlexibleAdapte
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Parcel
|
||||
public enum MenuType {
|
||||
REGULAR, SHARE, NEW_CONVERSATION
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,7 @@
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:alpha="0.7"
|
||||
android:alpha="0.7"
|
||||
app:checked="false"
|
||||
app:enableInitialAnimation="false"
|
||||
app:frontBackgroundColor="@color/colorPrimary"
|
||||
@ -74,7 +74,8 @@
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:alpha="0.7"
|
||||
android:alpha="0.7"
|
||||
android:visibility="gone"
|
||||
app:checked="false"
|
||||
app:enableInitialAnimation="false"
|
||||
app:frontBackgroundColor="@color/colorPrimary"
|
||||
@ -86,7 +87,7 @@
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:alpha="0.7"
|
||||
android:alpha="0.7"
|
||||
app:checked="false"
|
||||
app:enableInitialAnimation="false"
|
||||
app:frontBackgroundColor="@color/colorPrimary"
|
||||
|
@ -131,4 +131,7 @@
|
||||
<string name="nc_talk_soon">\n\nTalk soon,\n %1$s</string>
|
||||
<string name="nc_share_subject">Call invitation</string>
|
||||
<string name="nc_share_text_pass">\n\nPassword for the call is: %1$s</string>
|
||||
|
||||
<!-- Magical stuff -->
|
||||
<string name="nc_empty"></string>
|
||||
</resources>
|
||||
|
Loading…
Reference in New Issue
Block a user