Implemented new camera capture flow.

A new, fullscreen camera capture flow that easily allows you to capture
and edit a photo before sending it. Replaces the current half-screen
camera button.
This commit is contained in:
Greyson Parrelli
2018-09-20 13:27:18 -07:00
parent e9a38bab1e
commit 08ace15f95
102 changed files with 1798 additions and 350 deletions

View File

@@ -77,7 +77,7 @@ public class InputAwareLayout extends KeyboardAwareLinearLayout implements OnKey
});
}
private void hideSoftkey(final EditText inputTarget, @Nullable Runnable runAfterClose) {
protected void hideSoftkey(final EditText inputTarget, @Nullable Runnable runAfterClose) {
if (runAfterClose != null) postOnKeyboardClose(runAfterClose);
ServiceUtil.getInputMethodManager(inputTarget.getContext())

View File

@@ -56,6 +56,7 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat {
private boolean keyboardOpen = false;
private int rotation = -1;
private boolean isFullscreen = false;
public KeyboardAwareLinearLayout(Context context) {
this(context, null);
@@ -98,10 +99,11 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat {
}
if (viewInset == 0 && Build.VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) viewInset = getViewInset();
final int availableHeight = this.getRootView().getHeight() - statusBarHeight - viewInset;
getWindowVisibleDisplayFrame(rect);
final int keyboardHeight = availableHeight - (rect.bottom - rect.top);
final int availableHeight = this.getRootView().getHeight() - viewInset - (!isFullscreen ? statusBarHeight : 0);
final int keyboardHeight = availableHeight - (rect.bottom - rect.top);
if (keyboardHeight > minKeyboardSize) {
if (getKeyboardHeight() != keyboardHeight) setKeyboardPortraitHeight(keyboardHeight);
@@ -217,6 +219,10 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat {
shownListeners.remove(listener);
}
public void setFullscreen(boolean isFullscreen) {
this.isFullscreen = isFullscreen;
}
private void notifyHiddenListeners() {
final Set<OnKeyboardHiddenListener> listeners = new HashSet<>(hiddenListeners);
for (OnKeyboardHiddenListener listener : listeners) {

View File

@@ -1,6 +1,7 @@
package org.thoughtcrime.securesms.components;
import android.content.Context;
import android.support.annotation.NonNull;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageButton;
@@ -83,6 +84,10 @@ public class SendButton extends ImageButton
transportOptions.setDefaultTransport(type);
}
public void setTransport(@NonNull TransportOption option) {
transportOptions.setSelectedTransport(option);
}
public void setDefaultSubscriptionId(Optional<Integer> subscriptionId) {
transportOptions.setDefaultSubscriptionId(subscriptionId);
}