mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-23 17:48:50 +00:00
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:
@@ -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())
|
||||
|
@@ -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) {
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user