mirror of
https://github.com/oxen-io/session-android.git
synced 2023-12-14 02:53:01 +01:00
ca8fecea9c
Did a refactor to better organize the camera flipping code. Also, I wanted to make sure we handle the cases where the user doesn't have two cameras (or no cameras, for that matter). In these cases, we just don't show the appropriate buttons.
32 lines
727 B
Java
32 lines
727 B
Java
package org.thoughtcrime.securesms.webrtc;
|
|
|
|
import android.support.annotation.NonNull;
|
|
|
|
public class CameraState {
|
|
|
|
public static final CameraState UNKNOWN = new CameraState(Direction.NONE, 0);
|
|
|
|
private final Direction activeDirection;
|
|
private final int cameraCount;
|
|
|
|
public CameraState(@NonNull Direction activeDirection, int cameraCount) {
|
|
this.activeDirection = activeDirection;
|
|
this.cameraCount = cameraCount;
|
|
}
|
|
|
|
public int getCameraCount() {
|
|
return cameraCount;
|
|
}
|
|
|
|
public Direction getActiveDirection() {
|
|
return activeDirection;
|
|
}
|
|
|
|
public boolean isEnabled() {
|
|
return this.activeDirection != Direction.NONE;
|
|
}
|
|
|
|
public enum Direction {
|
|
FRONT, BACK, NONE, PENDING
|
|
}
|
|
}
|