Remove unused resources
@ -28,166 +28,166 @@ import org.session.libsession.utilities.TextSecurePreferences;
|
||||
|
||||
public class ComposeText extends EmojiEditText {
|
||||
|
||||
private CharSequence hint;
|
||||
private SpannableString subHint;
|
||||
private CharSequence hint;
|
||||
private SpannableString subHint;
|
||||
|
||||
@Nullable private InputPanel.MediaListener mediaListener;
|
||||
@Nullable private CursorPositionChangedListener cursorPositionChangedListener;
|
||||
@Nullable private InputPanel.MediaListener mediaListener;
|
||||
@Nullable private CursorPositionChangedListener cursorPositionChangedListener;
|
||||
|
||||
public ComposeText(Context context) {
|
||||
super(context);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public ComposeText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public ComposeText(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initialize();
|
||||
}
|
||||
|
||||
public String getTextTrimmed(){
|
||||
return getText().toString().trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
|
||||
if (!TextUtils.isEmpty(hint)) {
|
||||
if (!TextUtils.isEmpty(subHint)) {
|
||||
setHint(new SpannableStringBuilder().append(ellipsizeToWidth(hint))
|
||||
.append("\n")
|
||||
.append(ellipsizeToWidth(subHint)));
|
||||
} else {
|
||||
setHint(ellipsizeToWidth(hint));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onSelectionChanged(int selStart, int selEnd) {
|
||||
super.onSelectionChanged(selStart, selEnd);
|
||||
|
||||
if (cursorPositionChangedListener != null) {
|
||||
cursorPositionChangedListener.onCursorPositionChanged(selStart, selEnd);
|
||||
}
|
||||
}
|
||||
|
||||
private CharSequence ellipsizeToWidth(CharSequence text) {
|
||||
return TextUtils.ellipsize(text,
|
||||
getPaint(),
|
||||
getWidth() - getPaddingLeft() - getPaddingRight(),
|
||||
TruncateAt.END);
|
||||
}
|
||||
|
||||
public void setHint(@NonNull String hint, @Nullable CharSequence subHint) {
|
||||
this.hint = hint;
|
||||
|
||||
if (subHint != null) {
|
||||
this.subHint = new SpannableString(subHint);
|
||||
this.subHint.setSpan(new RelativeSizeSpan(0.5f), 0, subHint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
} else {
|
||||
this.subHint = null;
|
||||
public ComposeText(Context context) {
|
||||
super(context);
|
||||
initialize();
|
||||
}
|
||||
|
||||
if (this.subHint != null) {
|
||||
super.setHint(new SpannableStringBuilder().append(ellipsizeToWidth(this.hint))
|
||||
.append("\n")
|
||||
.append(ellipsizeToWidth(this.subHint)));
|
||||
} else {
|
||||
super.setHint(ellipsizeToWidth(this.hint));
|
||||
}
|
||||
}
|
||||
|
||||
public void setCursorPositionChangedListener(@Nullable CursorPositionChangedListener listener) {
|
||||
this.cursorPositionChangedListener = listener;
|
||||
}
|
||||
|
||||
public void setTransport() {
|
||||
final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());
|
||||
final boolean isIncognito = TextSecurePreferences.isIncognitoKeyboardEnabled(getContext());
|
||||
|
||||
int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
|
||||
int inputType = getInputType();
|
||||
|
||||
setImeActionLabel(null, 0);
|
||||
|
||||
if (useSystemEmoji) {
|
||||
inputType = (inputType & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
|
||||
public ComposeText(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initialize();
|
||||
}
|
||||
|
||||
setInputType(inputType);
|
||||
if (isIncognito) {
|
||||
setImeOptions(imeOptions | 16777216);
|
||||
} else {
|
||||
setImeOptions(imeOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||
InputConnection inputConnection = super.onCreateInputConnection(editorInfo);
|
||||
|
||||
if(TextSecurePreferences.isEnterSendsEnabled(getContext())) {
|
||||
editorInfo.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION;
|
||||
public ComposeText(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initialize();
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT < 21) return inputConnection;
|
||||
if (mediaListener == null) return inputConnection;
|
||||
if (inputConnection == null) return null;
|
||||
|
||||
EditorInfoCompat.setContentMimeTypes(editorInfo, new String[] {"image/jpeg", "image/png", "image/gif"});
|
||||
return InputConnectionCompat.createWrapper(inputConnection, editorInfo, new CommitContentListener(mediaListener));
|
||||
}
|
||||
|
||||
public void setMediaListener(@Nullable InputPanel.MediaListener mediaListener) {
|
||||
this.mediaListener = mediaListener;
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
if (TextSecurePreferences.isIncognitoKeyboardEnabled(getContext())) {
|
||||
setImeOptions(getImeOptions() | 16777216);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB_MR2)
|
||||
private static class CommitContentListener implements InputConnectionCompat.OnCommitContentListener {
|
||||
|
||||
private static final String TAG = CommitContentListener.class.getSimpleName();
|
||||
|
||||
private final InputPanel.MediaListener mediaListener;
|
||||
|
||||
private CommitContentListener(@NonNull InputPanel.MediaListener mediaListener) {
|
||||
this.mediaListener = mediaListener;
|
||||
public String getTextTrimmed(){
|
||||
return getText().toString().trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
|
||||
if (BuildCompat.isAtLeastNMR1() && (flags & InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION) != 0) {
|
||||
try {
|
||||
inputContentInfo.requestPermission();
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, e);
|
||||
return false;
|
||||
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
|
||||
super.onLayout(changed, left, top, right, bottom);
|
||||
|
||||
if (!TextUtils.isEmpty(hint)) {
|
||||
if (!TextUtils.isEmpty(subHint)) {
|
||||
setHint(new SpannableStringBuilder().append(ellipsizeToWidth(hint))
|
||||
.append("\n")
|
||||
.append(ellipsizeToWidth(subHint)));
|
||||
} else {
|
||||
setHint(ellipsizeToWidth(hint));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (inputContentInfo.getDescription().getMimeTypeCount() > 0) {
|
||||
mediaListener.onMediaSelected(inputContentInfo.getContentUri(),
|
||||
inputContentInfo.getDescription().getMimeType(0));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public interface CursorPositionChangedListener {
|
||||
void onCursorPositionChanged(int start, int end);
|
||||
}
|
||||
@Override
|
||||
protected void onSelectionChanged(int selStart, int selEnd) {
|
||||
super.onSelectionChanged(selStart, selEnd);
|
||||
|
||||
if (cursorPositionChangedListener != null) {
|
||||
cursorPositionChangedListener.onCursorPositionChanged(selStart, selEnd);
|
||||
}
|
||||
}
|
||||
|
||||
private CharSequence ellipsizeToWidth(CharSequence text) {
|
||||
return TextUtils.ellipsize(text,
|
||||
getPaint(),
|
||||
getWidth() - getPaddingLeft() - getPaddingRight(),
|
||||
TruncateAt.END);
|
||||
}
|
||||
|
||||
public void setHint(@NonNull String hint, @Nullable CharSequence subHint) {
|
||||
this.hint = hint;
|
||||
|
||||
if (subHint != null) {
|
||||
this.subHint = new SpannableString(subHint);
|
||||
this.subHint.setSpan(new RelativeSizeSpan(0.5f), 0, subHint.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
|
||||
} else {
|
||||
this.subHint = null;
|
||||
}
|
||||
|
||||
if (this.subHint != null) {
|
||||
super.setHint(new SpannableStringBuilder().append(ellipsizeToWidth(this.hint))
|
||||
.append("\n")
|
||||
.append(ellipsizeToWidth(this.subHint)));
|
||||
} else {
|
||||
super.setHint(ellipsizeToWidth(this.hint));
|
||||
}
|
||||
}
|
||||
|
||||
public void setCursorPositionChangedListener(@Nullable CursorPositionChangedListener listener) {
|
||||
this.cursorPositionChangedListener = listener;
|
||||
}
|
||||
|
||||
public void setTransport() {
|
||||
final boolean useSystemEmoji = TextSecurePreferences.isSystemEmojiPreferred(getContext());
|
||||
final boolean isIncognito = TextSecurePreferences.isIncognitoKeyboardEnabled(getContext());
|
||||
|
||||
int imeOptions = (getImeOptions() & ~EditorInfo.IME_MASK_ACTION) | EditorInfo.IME_ACTION_SEND;
|
||||
int inputType = getInputType();
|
||||
|
||||
setImeActionLabel(null, 0);
|
||||
|
||||
if (useSystemEmoji) {
|
||||
inputType = (inputType & ~InputType.TYPE_MASK_VARIATION) | InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
|
||||
}
|
||||
|
||||
setInputType(inputType);
|
||||
if (isIncognito) {
|
||||
setImeOptions(imeOptions | 16777216);
|
||||
} else {
|
||||
setImeOptions(imeOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputConnection onCreateInputConnection(EditorInfo editorInfo) {
|
||||
InputConnection inputConnection = super.onCreateInputConnection(editorInfo);
|
||||
|
||||
if(TextSecurePreferences.isEnterSendsEnabled(getContext())) {
|
||||
editorInfo.imeOptions &= ~EditorInfo.IME_FLAG_NO_ENTER_ACTION;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT < 21) return inputConnection;
|
||||
if (mediaListener == null) return inputConnection;
|
||||
if (inputConnection == null) return null;
|
||||
|
||||
EditorInfoCompat.setContentMimeTypes(editorInfo, new String[] {"image/jpeg", "image/png", "image/gif"});
|
||||
return InputConnectionCompat.createWrapper(inputConnection, editorInfo, new CommitContentListener(mediaListener));
|
||||
}
|
||||
|
||||
public void setMediaListener(@Nullable InputPanel.MediaListener mediaListener) {
|
||||
this.mediaListener = mediaListener;
|
||||
}
|
||||
|
||||
private void initialize() {
|
||||
if (TextSecurePreferences.isIncognitoKeyboardEnabled(getContext())) {
|
||||
setImeOptions(getImeOptions() | 16777216);
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.HONEYCOMB_MR2)
|
||||
private static class CommitContentListener implements InputConnectionCompat.OnCommitContentListener {
|
||||
|
||||
private static final String TAG = CommitContentListener.class.getSimpleName();
|
||||
|
||||
private final InputPanel.MediaListener mediaListener;
|
||||
|
||||
private CommitContentListener(@NonNull InputPanel.MediaListener mediaListener) {
|
||||
this.mediaListener = mediaListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommitContent(InputContentInfoCompat inputContentInfo, int flags, Bundle opts) {
|
||||
if (BuildCompat.isAtLeastNMR1() && (flags & InputConnectionCompat.INPUT_CONTENT_GRANT_READ_URI_PERMISSION) != 0) {
|
||||
try {
|
||||
inputContentInfo.requestPermission();
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (inputContentInfo.getDescription().getMimeTypeCount() > 0) {
|
||||
mediaListener.onMediaSelected(inputContentInfo.getContentUri(),
|
||||
inputContentInfo.getDescription().getMimeType(0));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public interface CursorPositionChangedListener {
|
||||
void onCursorPositionChanged(int start, int end);
|
||||
}
|
||||
}
|
||||
|
@ -1,88 +0,0 @@
|
||||
package org.thoughtcrime.securesms.components;
|
||||
|
||||
import android.content.Context;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import network.loki.messenger.R;
|
||||
|
||||
/**
|
||||
* Bottom navigation bar shown in the ConversationActivity
|
||||
* when the user is searching within a conversation. Shows details about the results and allows the
|
||||
* user to move between them.
|
||||
*/
|
||||
public class ConversationSearchBottomBar extends ConstraintLayout {
|
||||
|
||||
private View searchDown;
|
||||
private View searchUp;
|
||||
private TextView searchPositionText;
|
||||
private View progressWheel;
|
||||
|
||||
private EventListener eventListener;
|
||||
|
||||
|
||||
public ConversationSearchBottomBar(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public ConversationSearchBottomBar(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
this.searchUp = findViewById(R.id.conversation_search_up);
|
||||
this.searchDown = findViewById(R.id.conversation_search_down);
|
||||
this.searchPositionText = findViewById(R.id.conversation_search_position);
|
||||
this.progressWheel = findViewById(R.id.conversation_search_progress_wheel);
|
||||
}
|
||||
|
||||
public void setData(int position, int count) {
|
||||
progressWheel.setVisibility(GONE);
|
||||
|
||||
searchUp.setOnClickListener(v -> {
|
||||
if (eventListener != null) {
|
||||
eventListener.onSearchMoveUpPressed();
|
||||
}
|
||||
});
|
||||
|
||||
searchDown.setOnClickListener(v -> {
|
||||
if (eventListener != null) {
|
||||
eventListener.onSearchMoveDownPressed();
|
||||
}
|
||||
});
|
||||
|
||||
if (count > 0) {
|
||||
searchPositionText.setText(getResources().getString(R.string.ConversationActivity_search_position, position + 1, count));
|
||||
} else {
|
||||
searchPositionText.setText(R.string.ConversationActivity_no_results);
|
||||
}
|
||||
|
||||
setViewEnabled(searchUp, position < (count - 1));
|
||||
setViewEnabled(searchDown, position > 0);
|
||||
}
|
||||
|
||||
public void showLoading() {
|
||||
progressWheel.setVisibility(VISIBLE);
|
||||
}
|
||||
|
||||
private void setViewEnabled(@NonNull View view, boolean enabled) {
|
||||
view.setEnabled(enabled);
|
||||
view.setAlpha(enabled ? 1f : 0.25f);
|
||||
}
|
||||
|
||||
public void setEventListener(@Nullable EventListener eventListener) {
|
||||
this.eventListener = eventListener;
|
||||
}
|
||||
|
||||
public interface EventListener {
|
||||
void onSearchMoveUpPressed();
|
||||
void onSearchMoveDownPressed();
|
||||
}
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
package org.thoughtcrime.securesms.components;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.PorterDuff;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import org.thoughtcrime.securesms.conversation.v2.components.TypingIndicatorView;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.session.libsession.utilities.recipients.Recipient;
|
||||
import org.session.libsession.utilities.ThemeUtil;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import network.loki.messenger.R;
|
||||
|
||||
public class ConversationTypingView extends LinearLayout {
|
||||
|
||||
private AvatarImageView avatar;
|
||||
private View bubble;
|
||||
private TypingIndicatorView indicator;
|
||||
|
||||
public ConversationTypingView(Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
avatar = findViewById(R.id.typing_avatar);
|
||||
bubble = findViewById(R.id.typing_bubble);
|
||||
indicator = findViewById(R.id.typing_indicator);
|
||||
}
|
||||
|
||||
public void setTypists(@NonNull GlideRequests glideRequests, @NonNull List<Recipient> typists, boolean isGroupThread) {
|
||||
if (typists.isEmpty()) {
|
||||
indicator.stopAnimation();
|
||||
return;
|
||||
}
|
||||
|
||||
Recipient typist = typists.get(0);
|
||||
|
||||
bubble.getBackground().setColorFilter(
|
||||
ThemeUtil.getThemedColor(getContext(), R.attr.message_received_background_color),
|
||||
PorterDuff.Mode.MULTIPLY);
|
||||
|
||||
if (isGroupThread) {
|
||||
avatar.setAvatar(glideRequests, typist, false);
|
||||
avatar.setVisibility(VISIBLE);
|
||||
} else {
|
||||
avatar.setVisibility(GONE);
|
||||
}
|
||||
|
||||
indicator.startAnimation();
|
||||
}
|
||||
}
|
@ -4,443 +4,26 @@ import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.DimenRes;
|
||||
import androidx.annotation.MainThread;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import android.text.format.DateUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.AlphaAnimation;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationSet;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiKeyboardProvider;
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiToggle;
|
||||
import org.thoughtcrime.securesms.components.emoji.MediaKeyboard;
|
||||
import org.session.libsignal.utilities.Log;
|
||||
import org.thoughtcrime.securesms.loki.utilities.MentionUtilities;
|
||||
import org.thoughtcrime.securesms.mms.GlideRequests;
|
||||
import org.thoughtcrime.securesms.mms.SlideDeck;
|
||||
public class InputPanel extends LinearLayout {
|
||||
|
||||
import org.session.libsession.messaging.sending_receiving.link_preview.LinkPreview;
|
||||
import org.session.libsession.messaging.sending_receiving.quotes.QuoteModel;
|
||||
import org.session.libsession.utilities.recipients.Recipient;
|
||||
import org.session.libsession.utilities.TextSecurePreferences;
|
||||
import org.session.libsession.utilities.Util;
|
||||
import org.session.libsession.utilities.ViewUtil;
|
||||
import org.session.libsession.utilities.concurrent.AssertedSuccessListener;
|
||||
import org.session.libsignal.utilities.ListenableFuture;
|
||||
import org.session.libsignal.utilities.SettableFuture;
|
||||
import org.session.libsignal.utilities.guava.Optional;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import network.loki.messenger.R;
|
||||
|
||||
public class InputPanel extends LinearLayout
|
||||
implements MicrophoneRecorderView.Listener,
|
||||
KeyboardAwareLinearLayout.OnKeyboardShownListener,
|
||||
EmojiKeyboardProvider.EmojiEventListener
|
||||
{
|
||||
|
||||
private static final String TAG = InputPanel.class.getSimpleName();
|
||||
|
||||
private static final int FADE_TIME = 150;
|
||||
|
||||
private QuoteView quoteView;
|
||||
private LinkPreviewView linkPreview;
|
||||
private EmojiToggle mediaKeyboard;
|
||||
public ComposeText composeText;
|
||||
private View quickCameraToggle;
|
||||
private View quickAudioToggle;
|
||||
private View buttonToggle;
|
||||
private View recordingContainer;
|
||||
private View recordLockCancel;
|
||||
|
||||
private MicrophoneRecorderView microphoneRecorderView;
|
||||
private SlideToCancel slideToCancel;
|
||||
private RecordTime recordTime;
|
||||
|
||||
private @Nullable Listener listener;
|
||||
private boolean emojiVisible;
|
||||
|
||||
public InputPanel(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public InputPanel(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public InputPanel(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
View quoteDismiss = findViewById(R.id.quote_dismiss);
|
||||
|
||||
this.quoteView = findViewById(R.id.quote_view);
|
||||
this.linkPreview = findViewById(R.id.link_preview);
|
||||
this.mediaKeyboard = findViewById(R.id.emoji_toggle);
|
||||
this.composeText = findViewById(R.id.embedded_text_editor);
|
||||
this.quickCameraToggle = findViewById(R.id.quick_camera_toggle);
|
||||
this.quickAudioToggle = findViewById(R.id.quick_audio_toggle);
|
||||
this.buttonToggle = findViewById(R.id.button_toggle);
|
||||
this.recordingContainer = findViewById(R.id.recording_container);
|
||||
this.recordLockCancel = findViewById(R.id.record_cancel);
|
||||
View slideToCancelView = findViewById(R.id.slide_to_cancel);
|
||||
this.slideToCancel = new SlideToCancel(slideToCancelView);
|
||||
this.microphoneRecorderView = findViewById(R.id.recorder_view);
|
||||
this.microphoneRecorderView.setListener(this);
|
||||
this.recordTime = new RecordTime(findViewById(R.id.record_time),
|
||||
findViewById(R.id.microphone),
|
||||
TimeUnit.HOURS.toSeconds(1),
|
||||
() -> microphoneRecorderView.cancelAction());
|
||||
|
||||
this.recordLockCancel.setOnClickListener(v -> microphoneRecorderView.cancelAction());
|
||||
|
||||
if (TextSecurePreferences.isSystemEmojiPreferred(getContext())) {
|
||||
mediaKeyboard.setVisibility(View.GONE);
|
||||
emojiVisible = false;
|
||||
} else {
|
||||
mediaKeyboard.setVisibility(View.VISIBLE);
|
||||
emojiVisible = true;
|
||||
public InputPanel(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
quoteDismiss.setOnClickListener(v -> clearQuote());
|
||||
|
||||
linkPreview.setCloseClickedListener(() -> {
|
||||
if (listener != null) {
|
||||
listener.onLinkPreviewCanceled();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setListener(final @NonNull Listener listener) {
|
||||
this.listener = listener;
|
||||
|
||||
mediaKeyboard.setOnClickListener(v -> listener.onEmojiToggle());
|
||||
}
|
||||
|
||||
public void setMediaListener(@NonNull MediaListener listener) {
|
||||
composeText.setMediaListener(listener);
|
||||
}
|
||||
|
||||
public void setQuote(@NonNull GlideRequests glideRequests, long id, @NonNull Recipient author, @NonNull String body, @NonNull SlideDeck attachments, @NonNull Recipient conversationRecipient, long threadID) {
|
||||
this.quoteView.setQuote(glideRequests, id, author, MentionUtilities.highlightMentions(body, threadID, getContext()), false, attachments, conversationRecipient);
|
||||
this.quoteView.setVisibility(View.VISIBLE);
|
||||
|
||||
if (this.linkPreview.getVisibility() == View.VISIBLE) {
|
||||
int cornerRadius = readDimen(R.dimen.message_corner_collapse_radius);
|
||||
this.linkPreview.setCorners(cornerRadius, cornerRadius);
|
||||
}
|
||||
}
|
||||
|
||||
public void clearQuote() {
|
||||
this.quoteView.dismiss();
|
||||
|
||||
if (this.linkPreview.getVisibility() == View.VISIBLE) {
|
||||
int cornerRadius = readDimen(R.dimen.message_corner_radius);
|
||||
this.linkPreview.setCorners(cornerRadius, cornerRadius);
|
||||
}
|
||||
}
|
||||
|
||||
public Optional<QuoteModel> getQuote() {
|
||||
if (quoteView.getQuoteId() > 0 && quoteView.getVisibility() == View.VISIBLE) {
|
||||
return Optional.of(new QuoteModel(quoteView.getQuoteId(), quoteView.getAuthor().getAddress(), quoteView.getBody(), false, quoteView.getAttachments()));
|
||||
} else {
|
||||
return Optional.absent();
|
||||
}
|
||||
}
|
||||
|
||||
public void setLinkPreviewLoading() {
|
||||
this.linkPreview.setVisibility(View.VISIBLE);
|
||||
this.linkPreview.setLoading();
|
||||
}
|
||||
|
||||
public void setLinkPreview(@NonNull GlideRequests glideRequests, @NonNull Optional<LinkPreview> preview) {
|
||||
if (preview.isPresent()) {
|
||||
this.linkPreview.setVisibility(View.VISIBLE);
|
||||
this.linkPreview.setLinkPreview(glideRequests, preview.get(), true);
|
||||
} else {
|
||||
this.linkPreview.setVisibility(View.GONE);
|
||||
public InputPanel(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
int largeCornerRadius = (int)(16 * getResources().getDisplayMetrics().density);
|
||||
int cornerRadius = quoteView.getVisibility() == VISIBLE ? readDimen(R.dimen.message_corner_collapse_radius) : largeCornerRadius;
|
||||
|
||||
this.linkPreview.setCorners(cornerRadius, cornerRadius);
|
||||
}
|
||||
|
||||
public void setMediaKeyboard(@NonNull MediaKeyboard mediaKeyboard) {
|
||||
this.mediaKeyboard.attach(mediaKeyboard);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordPermissionRequired() {
|
||||
if (listener != null) listener.onRecorderPermissionRequired();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordPressed() {
|
||||
if (listener != null) listener.onRecorderStarted();
|
||||
recordTime.display();
|
||||
slideToCancel.display();
|
||||
|
||||
if (emojiVisible) ViewUtil.fadeOut(mediaKeyboard, FADE_TIME, View.INVISIBLE);
|
||||
ViewUtil.fadeOut(composeText, FADE_TIME, View.INVISIBLE);
|
||||
ViewUtil.fadeOut(quickCameraToggle, FADE_TIME, View.INVISIBLE);
|
||||
ViewUtil.fadeOut(quickAudioToggle, FADE_TIME, View.INVISIBLE);
|
||||
buttonToggle.animate().alpha(0).setDuration(FADE_TIME).start();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordReleased() {
|
||||
long elapsedTime = onRecordHideEvent();
|
||||
|
||||
if (listener != null) {
|
||||
Log.d(TAG, "Elapsed time: " + elapsedTime);
|
||||
if (elapsedTime > 1000) {
|
||||
listener.onRecorderFinished();
|
||||
} else {
|
||||
Toast.makeText(getContext(), R.string.InputPanel_tap_and_hold_to_record_a_voice_message_release_to_send, Toast.LENGTH_LONG).show();
|
||||
listener.onRecorderCanceled();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordMoved(float offsetX, float absoluteX) {
|
||||
slideToCancel.moveTo(offsetX);
|
||||
|
||||
int direction = ViewCompat.getLayoutDirection(this);
|
||||
float position = absoluteX / recordingContainer.getWidth();
|
||||
|
||||
if (direction == ViewCompat.LAYOUT_DIRECTION_LTR && position <= 0.5 ||
|
||||
direction == ViewCompat.LAYOUT_DIRECTION_RTL && position >= 0.6)
|
||||
{
|
||||
this.microphoneRecorderView.cancelAction();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordCanceled() {
|
||||
onRecordHideEvent();
|
||||
if (listener != null) listener.onRecorderCanceled();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRecordLocked() {
|
||||
slideToCancel.hide();
|
||||
recordLockCancel.setVisibility(View.VISIBLE);
|
||||
buttonToggle.animate().alpha(1).setDuration(FADE_TIME).start();
|
||||
if (listener != null) listener.onRecorderLocked();
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
this.microphoneRecorderView.cancelAction();
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
composeText.setEnabled(enabled);
|
||||
mediaKeyboard.setEnabled(enabled);
|
||||
quickAudioToggle.setEnabled(enabled);
|
||||
quickCameraToggle.setEnabled(enabled);
|
||||
}
|
||||
|
||||
public void setHint(@NonNull String hint) {
|
||||
composeText.setHint(hint, null);
|
||||
}
|
||||
|
||||
private long onRecordHideEvent() {
|
||||
recordLockCancel.setVisibility(View.GONE);
|
||||
|
||||
ListenableFuture<Void> future = slideToCancel.hide();
|
||||
long elapsedTime = recordTime.hide();
|
||||
|
||||
future.addListener(new AssertedSuccessListener<Void>() {
|
||||
@Override
|
||||
public void onSuccess(Void result) {
|
||||
if (emojiVisible) ViewUtil.fadeIn(mediaKeyboard, FADE_TIME);
|
||||
ViewUtil.fadeIn(composeText, FADE_TIME);
|
||||
ViewUtil.fadeIn(quickCameraToggle, FADE_TIME);
|
||||
ViewUtil.fadeIn(quickAudioToggle, FADE_TIME);
|
||||
buttonToggle.animate().alpha(1).setDuration(FADE_TIME).start();
|
||||
}
|
||||
});
|
||||
|
||||
return elapsedTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyboardShown() {
|
||||
mediaKeyboard.setToMedia();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyEvent(KeyEvent keyEvent) {
|
||||
composeText.dispatchKeyEvent(keyEvent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEmojiSelected(String emoji) {
|
||||
composeText.insertEmoji(emoji);
|
||||
}
|
||||
|
||||
private int readDimen(@DimenRes int dimenRes) {
|
||||
return getResources().getDimensionPixelSize(dimenRes);
|
||||
}
|
||||
|
||||
public boolean isRecordingInLockedMode() {
|
||||
return microphoneRecorderView.isRecordingLocked();
|
||||
}
|
||||
|
||||
public void releaseRecordingLock() {
|
||||
microphoneRecorderView.unlockAction();
|
||||
}
|
||||
|
||||
public interface Listener {
|
||||
void onRecorderStarted();
|
||||
void onRecorderLocked();
|
||||
void onRecorderFinished();
|
||||
void onRecorderCanceled();
|
||||
void onRecorderPermissionRequired();
|
||||
void onEmojiToggle();
|
||||
void onLinkPreviewCanceled();
|
||||
}
|
||||
|
||||
private static class SlideToCancel {
|
||||
|
||||
private final View slideToCancelView;
|
||||
|
||||
SlideToCancel(View slideToCancelView) {
|
||||
this.slideToCancelView = slideToCancelView;
|
||||
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
|
||||
public InputPanel(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public void display() {
|
||||
ViewUtil.fadeIn(this.slideToCancelView, FADE_TIME);
|
||||
public interface MediaListener {
|
||||
void onMediaSelected(@NonNull Uri uri, String contentType);
|
||||
}
|
||||
|
||||
public ListenableFuture<Void> hide() {
|
||||
final SettableFuture<Void> future = new SettableFuture<>();
|
||||
|
||||
AnimationSet animation = new AnimationSet(true);
|
||||
animation.addAnimation(new TranslateAnimation(Animation.ABSOLUTE, slideToCancelView.getTranslationX(),
|
||||
Animation.ABSOLUTE, 0,
|
||||
Animation.RELATIVE_TO_SELF, 0,
|
||||
Animation.RELATIVE_TO_SELF, 0));
|
||||
animation.addAnimation(new AlphaAnimation(1, 0));
|
||||
|
||||
animation.setDuration(MicrophoneRecorderView.ANIMATION_DURATION);
|
||||
animation.setFillBefore(true);
|
||||
animation.setFillAfter(false);
|
||||
|
||||
slideToCancelView.postDelayed(() -> future.set(null), MicrophoneRecorderView.ANIMATION_DURATION);
|
||||
slideToCancelView.setVisibility(View.GONE);
|
||||
slideToCancelView.startAnimation(animation);
|
||||
|
||||
return future;
|
||||
}
|
||||
|
||||
void moveTo(float offset) {
|
||||
Animation animation = new TranslateAnimation(Animation.ABSOLUTE, offset,
|
||||
Animation.ABSOLUTE, offset,
|
||||
Animation.RELATIVE_TO_SELF, 0,
|
||||
Animation.RELATIVE_TO_SELF, 0);
|
||||
|
||||
animation.setDuration(0);
|
||||
animation.setFillAfter(true);
|
||||
animation.setFillBefore(true);
|
||||
|
||||
slideToCancelView.startAnimation(animation);
|
||||
}
|
||||
}
|
||||
|
||||
private static class RecordTime implements Runnable {
|
||||
|
||||
private final @NonNull TextView recordTimeView;
|
||||
private final @NonNull View microphone;
|
||||
private final @NonNull Runnable onLimitHit;
|
||||
private final long limitSeconds;
|
||||
private long startTime;
|
||||
|
||||
private RecordTime(@NonNull TextView recordTimeView, @NonNull View microphone, long limitSeconds, @NonNull Runnable onLimitHit) {
|
||||
this.recordTimeView = recordTimeView;
|
||||
this.microphone = microphone;
|
||||
this.limitSeconds = limitSeconds;
|
||||
this.onLimitHit = onLimitHit;
|
||||
}
|
||||
|
||||
@MainThread
|
||||
public void display() {
|
||||
this.startTime = System.currentTimeMillis();
|
||||
this.recordTimeView.setText(DateUtils.formatElapsedTime(0));
|
||||
ViewUtil.fadeIn(this.recordTimeView, FADE_TIME);
|
||||
Util.runOnMainDelayed(this, TimeUnit.SECONDS.toMillis(1));
|
||||
microphone.setVisibility(View.VISIBLE);
|
||||
microphone.startAnimation(pulseAnimation());
|
||||
}
|
||||
|
||||
@MainThread
|
||||
public long hide() {
|
||||
long elapsedTime = System.currentTimeMillis() - startTime;
|
||||
this.startTime = 0;
|
||||
ViewUtil.fadeOut(this.recordTimeView, FADE_TIME, View.INVISIBLE);
|
||||
microphone.clearAnimation();
|
||||
ViewUtil.fadeOut(this.microphone, FADE_TIME, View.INVISIBLE);
|
||||
return elapsedTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
@MainThread
|
||||
public void run() {
|
||||
long localStartTime = startTime;
|
||||
if (localStartTime > 0) {
|
||||
long elapsedTime = System.currentTimeMillis() - localStartTime;
|
||||
long elapsedSeconds = TimeUnit.MILLISECONDS.toSeconds(elapsedTime);
|
||||
if (elapsedSeconds >= limitSeconds) {
|
||||
onLimitHit.run();
|
||||
} else {
|
||||
recordTimeView.setText(DateUtils.formatElapsedTime(elapsedSeconds));
|
||||
Util.runOnMainDelayed(this, TimeUnit.SECONDS.toMillis(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Animation pulseAnimation() {
|
||||
AlphaAnimation animation = new AlphaAnimation(0, 1);
|
||||
|
||||
animation.setInterpolator(pulseInterpolator());
|
||||
animation.setRepeatCount(Animation.INFINITE);
|
||||
animation.setDuration(1000);
|
||||
|
||||
return animation;
|
||||
}
|
||||
|
||||
private static Interpolator pulseInterpolator() {
|
||||
return input -> {
|
||||
input *= 5;
|
||||
if (input > 1) {
|
||||
input = 4 - input;
|
||||
}
|
||||
return Math.max(0, Math.min(1, input));
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public interface MediaListener {
|
||||
void onMediaSelected(@NonNull Uri uri, String contentType);
|
||||
}
|
||||
}
|
||||
|
@ -1,272 +0,0 @@
|
||||
package org.thoughtcrime.securesms.components;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.graphics.PorterDuff;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationSet;
|
||||
import android.view.animation.AnticipateOvershootInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.animation.OvershootInterpolator;
|
||||
import android.view.animation.ScaleAnimation;
|
||||
import android.view.animation.TranslateAnimation;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import org.thoughtcrime.securesms.permissions.Permissions;
|
||||
|
||||
import org.session.libsession.utilities.ViewUtil;
|
||||
|
||||
import network.loki.messenger.R;
|
||||
|
||||
public final class MicrophoneRecorderView extends FrameLayout implements View.OnTouchListener {
|
||||
|
||||
enum State {
|
||||
NOT_RUNNING,
|
||||
RUNNING_HELD,
|
||||
RUNNING_LOCKED
|
||||
}
|
||||
|
||||
public static final int ANIMATION_DURATION = 200;
|
||||
|
||||
private FloatingRecordButton floatingRecordButton;
|
||||
private LockDropTarget lockDropTarget;
|
||||
private @Nullable Listener listener;
|
||||
private @NonNull State state = State.NOT_RUNNING;
|
||||
|
||||
public MicrophoneRecorderView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public MicrophoneRecorderView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
floatingRecordButton = new FloatingRecordButton(getContext(), findViewById(R.id.quick_audio_fab));
|
||||
lockDropTarget = new LockDropTarget (getContext(), findViewById(R.id.lock_drop_target));
|
||||
|
||||
View recordButton = ViewUtil.findById(this, R.id.quick_audio_toggle);
|
||||
recordButton.setOnTouchListener(this);
|
||||
}
|
||||
|
||||
public void cancelAction() {
|
||||
if (state != State.NOT_RUNNING) {
|
||||
state = State.NOT_RUNNING;
|
||||
hideUi();
|
||||
|
||||
if (listener != null) listener.onRecordCanceled();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isRecordingLocked() {
|
||||
return state == State.RUNNING_LOCKED;
|
||||
}
|
||||
|
||||
private void lockAction() {
|
||||
if (state == State.RUNNING_HELD) {
|
||||
state = State.RUNNING_LOCKED;
|
||||
hideUi();
|
||||
|
||||
if (listener != null) listener.onRecordLocked();
|
||||
}
|
||||
}
|
||||
|
||||
public void unlockAction() {
|
||||
if (state == State.RUNNING_LOCKED) {
|
||||
state = State.NOT_RUNNING;
|
||||
hideUi();
|
||||
|
||||
if (listener != null) listener.onRecordReleased();
|
||||
}
|
||||
}
|
||||
|
||||
private void hideUi() {
|
||||
floatingRecordButton.hide();
|
||||
lockDropTarget.hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onTouch(View v, final MotionEvent event) {
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
if (!Permissions.hasAll(getContext(), Manifest.permission.RECORD_AUDIO)) {
|
||||
if (listener != null) listener.onRecordPermissionRequired();
|
||||
} else {
|
||||
state = State.RUNNING_HELD;
|
||||
floatingRecordButton.display(event.getX(), event.getY());
|
||||
lockDropTarget.display();
|
||||
if (listener != null) listener.onRecordPressed();
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_CANCEL:
|
||||
case MotionEvent.ACTION_UP:
|
||||
if (this.state == State.RUNNING_HELD) {
|
||||
state = State.NOT_RUNNING;
|
||||
hideUi();
|
||||
if (listener != null) listener.onRecordReleased();
|
||||
}
|
||||
break;
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
if (this.state == State.RUNNING_HELD) {
|
||||
this.floatingRecordButton.moveTo(event.getX(), event.getY());
|
||||
if (listener != null) listener.onRecordMoved(floatingRecordButton.lastOffsetX, event.getRawX());
|
||||
|
||||
int dimensionPixelSize = getResources().getDimensionPixelSize(R.dimen.recording_voice_lock_target);
|
||||
if (floatingRecordButton.lastOffsetY <= dimensionPixelSize) {
|
||||
lockAction();
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setListener(@Nullable Listener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
public interface Listener {
|
||||
void onRecordPressed();
|
||||
void onRecordReleased();
|
||||
void onRecordCanceled();
|
||||
void onRecordLocked();
|
||||
void onRecordMoved(float offsetX, float absoluteX);
|
||||
void onRecordPermissionRequired();
|
||||
}
|
||||
|
||||
private static class FloatingRecordButton {
|
||||
|
||||
private final ImageView recordButtonFab;
|
||||
|
||||
private float startPositionX;
|
||||
private float startPositionY;
|
||||
private float lastOffsetX;
|
||||
private float lastOffsetY;
|
||||
|
||||
FloatingRecordButton(Context context, ImageView recordButtonFab) {
|
||||
this.recordButtonFab = recordButtonFab;
|
||||
this.recordButtonFab.getBackground().setColorFilter(context.getResources()
|
||||
.getColor(R.color.destructive),
|
||||
PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
void display(float x, float y) {
|
||||
this.startPositionX = x;
|
||||
this.startPositionY = y;
|
||||
|
||||
recordButtonFab.setVisibility(View.VISIBLE);
|
||||
|
||||
AnimationSet animation = new AnimationSet(true);
|
||||
animation.addAnimation(new TranslateAnimation(Animation.ABSOLUTE, 0,
|
||||
Animation.ABSOLUTE, 0,
|
||||
Animation.ABSOLUTE, 0,
|
||||
Animation.ABSOLUTE, 0));
|
||||
|
||||
animation.addAnimation(new ScaleAnimation(.5f, 1f, .5f, 1f,
|
||||
Animation.RELATIVE_TO_SELF, .5f,
|
||||
Animation.RELATIVE_TO_SELF, .5f));
|
||||
|
||||
animation.setDuration(ANIMATION_DURATION);
|
||||
animation.setInterpolator(new OvershootInterpolator());
|
||||
|
||||
recordButtonFab.startAnimation(animation);
|
||||
}
|
||||
|
||||
void moveTo(float x, float y) {
|
||||
lastOffsetX = getXOffset(x);
|
||||
lastOffsetY = getYOffset(y);
|
||||
|
||||
if (Math.abs(lastOffsetX) > Math.abs(lastOffsetY)) {
|
||||
lastOffsetY = 0;
|
||||
} else {
|
||||
lastOffsetX = 0;
|
||||
}
|
||||
|
||||
recordButtonFab.setTranslationX(lastOffsetX);
|
||||
recordButtonFab.setTranslationY(lastOffsetY);
|
||||
}
|
||||
|
||||
void hide() {
|
||||
recordButtonFab.setTranslationX(0);
|
||||
recordButtonFab.setTranslationY(0);
|
||||
if (recordButtonFab.getVisibility() != VISIBLE) return;
|
||||
|
||||
AnimationSet animation = new AnimationSet(false);
|
||||
Animation scaleAnimation = new ScaleAnimation(1, 0.5f, 1, 0.5f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f,
|
||||
Animation.RELATIVE_TO_SELF, 0.5f);
|
||||
|
||||
Animation translateAnimation = new TranslateAnimation(Animation.ABSOLUTE, lastOffsetX,
|
||||
Animation.ABSOLUTE, 0,
|
||||
Animation.ABSOLUTE, lastOffsetY,
|
||||
Animation.ABSOLUTE, 0);
|
||||
|
||||
scaleAnimation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
|
||||
translateAnimation.setInterpolator(new DecelerateInterpolator());
|
||||
animation.addAnimation(scaleAnimation);
|
||||
animation.addAnimation(translateAnimation);
|
||||
animation.setDuration(ANIMATION_DURATION);
|
||||
animation.setInterpolator(new AnticipateOvershootInterpolator(1.5f));
|
||||
|
||||
recordButtonFab.setVisibility(View.GONE);
|
||||
recordButtonFab.clearAnimation();
|
||||
recordButtonFab.startAnimation(animation);
|
||||
}
|
||||
|
||||
private float getXOffset(float x) {
|
||||
return ViewCompat.getLayoutDirection(recordButtonFab) == ViewCompat.LAYOUT_DIRECTION_LTR ?
|
||||
-Math.max(0, this.startPositionX - x) : Math.max(0, x - this.startPositionX);
|
||||
}
|
||||
|
||||
private float getYOffset(float y) {
|
||||
return Math.min(0, y - this.startPositionY);
|
||||
}
|
||||
}
|
||||
|
||||
private static class LockDropTarget {
|
||||
|
||||
private final View lockDropTarget;
|
||||
private final int dropTargetPosition;
|
||||
|
||||
LockDropTarget(Context context, View lockDropTarget) {
|
||||
this.lockDropTarget = lockDropTarget;
|
||||
this.dropTargetPosition = context.getResources().getDimensionPixelSize(R.dimen.recording_voice_lock_target);
|
||||
}
|
||||
|
||||
void display() {
|
||||
lockDropTarget.setScaleX(1);
|
||||
lockDropTarget.setScaleY(1);
|
||||
lockDropTarget.setAlpha(0);
|
||||
lockDropTarget.setTranslationY(0);
|
||||
lockDropTarget.setVisibility(VISIBLE);
|
||||
lockDropTarget.animate()
|
||||
.setStartDelay(ANIMATION_DURATION * 2)
|
||||
.setDuration(ANIMATION_DURATION)
|
||||
.setInterpolator(new DecelerateInterpolator())
|
||||
.translationY(dropTargetPosition)
|
||||
.alpha(1)
|
||||
.start();
|
||||
}
|
||||
|
||||
void hide() {
|
||||
lockDropTarget.animate()
|
||||
.setStartDelay(0)
|
||||
.setDuration(ANIMATION_DURATION)
|
||||
.setInterpolator(new LinearInterpolator())
|
||||
.scaleX(0).scaleY(0)
|
||||
.start();
|
||||
}
|
||||
}
|
||||
}
|
@ -14,7 +14,6 @@ import androidx.fragment.app.FragmentPagerAdapter
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import kotlinx.android.synthetic.main.activity_link_device.*
|
||||
import kotlinx.android.synthetic.main.conversation_activity.*
|
||||
import kotlinx.android.synthetic.main.fragment_recovery_phrase.*
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
|
@ -82,7 +82,7 @@ public class MediaSendFragment extends Fragment implements ViewTreeObserver.OnGl
|
||||
private InputAwareLayout hud;
|
||||
private View captionAndRail;
|
||||
private ImageButton sendButton;
|
||||
private ComposeText composeText;
|
||||
private ComposeText composeText;
|
||||
private ViewGroup composeContainer;
|
||||
private EmojiEditText captionText;
|
||||
private EmojiToggle emojiToggle;
|
||||
|
@ -19,7 +19,6 @@ package org.thoughtcrime.securesms.util;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.ActivityManager;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build.VERSION;
|
||||
import android.os.Build.VERSION_CODES;
|
||||
import android.text.TextUtils;
|
||||
|
Before Width: | Height: | Size: 129 B |
Before Width: | Height: | Size: 284 B |
Before Width: | Height: | Size: 311 B |
Before Width: | Height: | Size: 309 B |
Before Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 483 B |
Before Width: | Height: | Size: 297 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 571 B |
Before Width: | Height: | Size: 428 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 457 B |
Before Width: | Height: | Size: 92 B |
Before Width: | Height: | Size: 227 B |
Before Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 230 B |
Before Width: | Height: | Size: 351 B |
Before Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 211 B |
Before Width: | Height: | Size: 777 B |
Before Width: | Height: | Size: 488 B |
Before Width: | Height: | Size: 288 B |
Before Width: | Height: | Size: 746 B |
Before Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 97 B |
Before Width: | Height: | Size: 308 B |
Before Width: | Height: | Size: 359 B |
Before Width: | Height: | Size: 322 B |
Before Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 575 B |
Before Width: | Height: | Size: 364 B |
Before Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 872 B |
Before Width: | Height: | Size: 507 B |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 534 B |
Before Width: | Height: | Size: 97 B |
Before Width: | Height: | Size: 386 B |
Before Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 384 B |
Before Width: | Height: | Size: 990 B |
Before Width: | Height: | Size: 834 B |
Before Width: | Height: | Size: 474 B |
Before Width: | Height: | Size: 875 B |
Before Width: | Height: | Size: 702 B |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 781 B |
Before Width: | Height: | Size: 946 B |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 913 B |
Before Width: | Height: | Size: 3.4 KiB |
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:dither="true"
|
||||
android:endColor="@android:color/transparent"
|
||||
android:startColor="@color/conversation_compose_divider" />
|
||||
</shape>
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/touch_highlight" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item android:drawable="@android:color/transparent" />
|
||||
</selector>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:right="24dp">
|
||||
<shape>
|
||||
<corners
|
||||
android:bottomLeftRadius="46dp"
|
||||
android:topLeftRadius="46dp" />
|
||||
<solid android:color="@android:color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?attr/colorControlHighlight">
|
||||
<!-- Add half of the medium_profile_picture_size padding on the right to better work with the group icons. -->
|
||||
<item
|
||||
android:id="@android:id/mask"
|
||||
android:right="24dp">
|
||||
<shape>
|
||||
<corners
|
||||
android:bottomLeftRadius="@dimen/medium_profile_picture_size"
|
||||
android:topLeftRadius="@dimen/medium_profile_picture_size" />
|
||||
<solid android:color="@android:color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
</ripple>
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@color/accent_alpha50" android:state_selected="true" />
|
||||
<item android:drawable="@color/signal_primary_alpha_focus" android:state_focused="true" />
|
||||
</selector>
|
@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="1000">
|
||||
<item android:drawable="@color/accent_alpha50" android:state_selected="true" />
|
||||
<item android:drawable="@color/signal_primary_alpha_focus" android:state_focused="true" />
|
||||
</selector>
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="#FFD32F2F" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="#FFF44336" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -1,10 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M11.67,3.87L9.9,2.1 0,12l9.9,9.9 1.77,-1.77L3.54,12z"/>
|
||||
</vector>
|
@ -1,10 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M12.65,10C11.83,7.67 9.61,6 7,6c-3.31,0 -6,2.69 -6,6s2.69,6 6,6c2.61,0 4.83,-1.67 5.65,-4H17v4h4v-4h2v-4H12.65zM7,14c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2z"/>
|
||||
</vector>
|
@ -1,10 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
|
||||
</vector>
|
@ -1,21 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?android:colorControlNormal">
|
||||
<path
|
||||
android:pathData="M12,12m-9.4734,0a9.4734,9.4734 0,1 1,18.9468 0a9.4734,9.4734 0,1 1,-18.9468 0"
|
||||
android:strokeWidth="1.5"
|
||||
android:strokeColor="@android:color/white"/>
|
||||
<path
|
||||
android:pathData="m11.9996,8.4641l0,7.0708"
|
||||
android:strokeWidth="1.2991"
|
||||
android:strokeColor="@android:color/white"
|
||||
android:strokeLineCap="round"/>
|
||||
<path
|
||||
android:pathData="m15.535,11.9997l-7.0708,0"
|
||||
android:strokeWidth="1.2991"
|
||||
android:strokeColor="@android:color/white"
|
||||
android:strokeLineCap="round"/>
|
||||
</vector>
|
@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="512dp"
|
||||
android:height="512dp"
|
||||
android:viewportWidth="512"
|
||||
android:viewportHeight="512">
|
||||
<path
|
||||
android:pathData="M466.5,83.7l-192,-80a48.15,48.15 0,0 0,-36.9 0l-192,80C27.7,91.1 16,108.6 16,128c0,198.5 114.5,335.7 221.5,380.3 11.8,4.9 25.1,4.9 36.9,0C360.1,472.6 496,349.3 496,128c0,-19.4 -11.7,-36.9 -29.5,-44.3zM256.1,446.3l-0.1,-381 175.9,73.3c-3.3,151.4 -82.1,261.1 -175.8,307.7z"
|
||||
android:fillColor="#000000"/>
|
||||
</vector>
|
@ -1,16 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape>
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="#ff145c95" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<shape>
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="#ff2090ea" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:top="2px"
|
||||
android:bottom="2px">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/message_corner_radius"/>
|
||||
<solid android:color="@color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/transparent" />
|
||||
|
||||
<corners android:radius="38dp" />
|
||||
</shape>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/transparent" />
|
||||
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/profile_picture_background" />
|
||||
|
||||
<corners android:radius="23dp" />
|
||||
</shape>
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/transparent" />
|
||||
|
||||
<corners android:radius="18dp" />
|
||||
|
||||
<stroke android:width="@dimen/profile_picture_border_thickness" android:color="@color/profile_picture_border" />
|
||||
</shape>
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@color/accent" />
|
||||
|
||||
<corners android:radius="@dimen/dialog_button_corner_radius" />
|
||||
|
||||
<stroke android:width="@dimen/border_thickness" android:color="@color/accent" />
|
||||
</shape>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
|
||||
<solid android:color="@color/compose_view_background" />
|
||||
|
||||
</shape>
|
@ -1,9 +0,0 @@
|
||||
<vector android:height="24dp" android:viewportHeight="448.40668"
|
||||
android:viewportWidth="404.08533" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<group>
|
||||
<clip-path android:pathData="M0,0L404.085,0L404.085,448.407L0,448.407Z M 0,0"/>
|
||||
<path android:fillAlpha="1" android:fillColor="#ffffff"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="m288.607,420.376l-196.335,-0c-33.576,-0 -62.508,-25.748 -64.164,-59.281 -1.771,-35.847 26.883,-65.576 62.353,-65.576l113.072,-0c6.919,-0 12.527,-5.608 12.527,-12.525l0,-92.305L327.307,252.333C356.723,268.633 375.241,299.335 376.027,332.848 377.161,380.975 336.746,420.376 288.607,420.376m-211.829,-224.303c-29.416,-16.3 -47.933,-47.001 -48.721,-80.515 -1.132,-48.127 39.283,-87.528 87.42,-87.528L311.811,28.031c33.576,-0 62.508,25.748 64.165,59.283 1.771,35.845 -26.883,65.575 -62.352,65.575 0,-0 -81.316,0.013 -113.077,0.019 -6.915,0.001 -12.499,5.608 -12.501,12.523l-0.021,92.289zM340.891,227.816 L256.254,180.919l57.371,-0c49.877,-0 90.46,-40.579 90.46,-90.457 0,-49.877 -40.583,-90.461 -90.46,-90.461l-200.299,-0c-62.485,-0 -113.327,50.841 -113.327,113.327 0,44.567 24.216,85.664 63.195,107.265l84.636,46.896l-57.368,-0c-49.88,-0 -90.463,40.58 -90.463,90.457 0,49.877 40.583,90.461 90.463,90.461L290.758,448.407c62.488,-0 113.327,-50.84 113.327,-113.327 0,-44.567 -24.216,-85.664 -63.193,-107.264" android:strokeColor="#00000000"/>
|
||||
</group>
|
||||
</vector>
|
@ -1,125 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<data>
|
||||
<import type="org.thoughtcrime.securesms.loki.activities.BackupRestoreViewModel"/>
|
||||
<import type="org.thoughtcrime.securesms.util.BackupUtil"/>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="viewModel"
|
||||
type="org.thoughtcrime.securesms.loki.activities.BackupRestoreViewModel" />
|
||||
</data>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/very_large_spacing"
|
||||
android:layout_marginRight="@dimen/very_large_spacing"
|
||||
android:text="@string/activity_backup_restore_title"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/large_font_size"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/very_large_spacing"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginRight="@dimen/very_large_spacing"
|
||||
android:text="@string/activity_backup_restore_explanation_1"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/small_font_size" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/buttonSelectFile"
|
||||
style="@style/Button.Primary"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/very_large_spacing"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_marginRight="@dimen/very_large_spacing"
|
||||
android:textColor="@color/black"
|
||||
android:text="@{viewModel.backupFile != null ? BackupRestoreViewModel.uriToFileName(buttonSelectFile, viewModel.backupFile) : @string/activity_backup_restore_select_file}"
|
||||
tools:text="Select a file"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/backupCode"
|
||||
style="@style/SmallSessionEditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/very_large_spacing"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="@dimen/very_large_spacing"
|
||||
android:hint="@string/activity_backup_restore_passphrase"
|
||||
android:inputType="numberDecimal|textNoSuggestions"
|
||||
android:digits="0123456789"
|
||||
android:maxLength="@{BackupUtil.BACKUP_PASSPHRASE_LENGTH}"
|
||||
android:text="@={viewModel.backupPassphrase}"
|
||||
android:visibility="@{viewModel.backupFile != null ? View.VISIBLE : View.INVISIBLE}"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/restoreButton"
|
||||
style="@style/Widget.Session.Button.Common.ProminentFilled"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/medium_button_height"
|
||||
android:layout_marginLeft="@dimen/massive_spacing"
|
||||
android:layout_marginRight="@dimen/massive_spacing"
|
||||
android:text="@string/continue_2"
|
||||
android:visibility="@{BackupRestoreViewModel.validateData(viewModel.backupFile, viewModel.backupPassphrase) ? View.VISIBLE : View.INVISIBLE}"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/termsTextView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/onboarding_button_bottom_offset"
|
||||
android:layout_marginLeft="@dimen/massive_spacing"
|
||||
android:layout_marginRight="@dimen/massive_spacing"
|
||||
android:gravity="center"
|
||||
android:text="By using this service, you agree to our Terms of Service and Privacy Policy"
|
||||
android:textColor="@color/text"
|
||||
android:textColorLink="@color/text"
|
||||
android:textSize="@dimen/very_small_font_size"
|
||||
tools:ignore="HardcodedText" /> <!-- Intentionally not yet translated -->
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/busyIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#A4000000"
|
||||
android:visibility="@{viewModel.processingBackupFile == true ? View.VISIBLE : View.GONE}"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ProgressBar
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:indeterminate="true"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</layout>
|
@ -1,235 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/rootView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:clipChildren="false"
|
||||
app:contentInsetStart="4dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:clipChildren="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/homeButtonContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:background="@drawable/conversation_home_touch_highlight"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:src="@drawable/ic_baseline_arrow_back_compact_24"
|
||||
android:layout_marginRight="-2dp"
|
||||
android:layout_marginLeft="8dp" />
|
||||
|
||||
<org.thoughtcrime.securesms.loki.views.ProfilePictureView
|
||||
android:id="@+id/profilePictureView"
|
||||
android:layout_width="@dimen/medium_profile_picture_size"
|
||||
android:layout_height="@dimen/medium_profile_picture_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/medium_spacing"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/titleTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="Conversation"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/large_font_size"
|
||||
android:fontFamily="sans-serif-medium" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/muteIndicatorImageView"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@drawable/ic_outline_notifications_off_24"
|
||||
android:layout_marginRight="6dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subtitleTextView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="26 members"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/small_font_size" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<org.thoughtcrime.securesms.components.InputAwareLayout
|
||||
android:id="@+id/layout_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/conversation_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:gravity="bottom"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="?attr/actionBarSize">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/messageStatusProgressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/accent_line_thickness"
|
||||
android:paddingLeft="-2dp"
|
||||
android:paddingRight="-2dp"
|
||||
android:progressTint="@color/accent"
|
||||
android:progressBackgroundTint="@color/transparent"
|
||||
android:alpha="0"
|
||||
android:indeterminate="false"
|
||||
android:progress="0" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="?android:dividerHorizontal"
|
||||
android:elevation="1dp" />
|
||||
|
||||
<org.thoughtcrime.securesms.conversation.v2.components.OpenGroupGuidelinesView
|
||||
android:id="@+id/open_group_guidelines_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/fragment_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/attachment_editor_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inflatedId="@+id/attachment_editor"
|
||||
android:layout="@layout/conversation_activity_attachment_editor_stub" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/mentionCandidateSelectionViewContainer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="?android:dividerHorizontal" />
|
||||
|
||||
<include layout="@layout/view_mention_candidate_selection" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1px"
|
||||
android:background="?android:dividerHorizontal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<include layout="@layout/conversation_input_panel" />
|
||||
|
||||
<include layout="@layout/conversation_search_nav" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<Button
|
||||
android:id="@+id/unblock_button"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:text="@string/ConversationActivity_unblock"
|
||||
android:visibility="gone" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/make_default_sms_button"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:text="@string/conversation_activity__enable_signal_for_sms"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/space_left"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:attr/windowBackground"
|
||||
android:paddingStart="5dip"
|
||||
tools:text="160/160 (1)"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ViewStub
|
||||
android:id="@+id/emoji_drawer_stub"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inflatedId="@+id/emoji_drawer"
|
||||
android:layout="@layout/conversation_activity_emojidrawer_stub" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</org.thoughtcrime.securesms.components.InputAwareLayout>
|
||||
|
||||
</FrameLayout>
|
@ -1,56 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/attachment_editor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:visibility="gone">
|
||||
|
||||
<org.thoughtcrime.securesms.components.RemovableEditableMediaView
|
||||
android:id="@+id/removable_media_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center">
|
||||
|
||||
<org.thoughtcrime.securesms.conversation.v2.utilities.ThumbnailView
|
||||
android:id="@+id/attachment_thumbnail"
|
||||
android:layout_width="230dp"
|
||||
android:layout_height="150dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:visibility="gone"
|
||||
android:contentDescription="@string/conversation_activity__attachment_thumbnail"
|
||||
app:minWidth="100dp"
|
||||
app:maxWidth="300dp"
|
||||
app:minHeight="100dp"
|
||||
app:maxHeight="300dp"/>
|
||||
|
||||
<org.thoughtcrime.securesms.loki.views.MessageAudioView
|
||||
android:id="@+id/attachment_audio"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="15dp"
|
||||
android:paddingBottom="15dp"
|
||||
app:widgetBackground="?conversation_item_bubble_background"
|
||||
app:foregroundTintColor="?android:colorControlNormal"
|
||||
app:waveformFillColor="?conversation_item_audio_seek_bar_color_outgoing"
|
||||
app:waveformBackgroundColor="?conversation_item_audio_seek_bar_background_color"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.DocumentView
|
||||
android:id="@+id/attachment_document"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingStart="@dimen/message_bubble_horizontal_padding"
|
||||
android:paddingEnd="@dimen/message_bubble_horizontal_padding"
|
||||
android:background="@drawable/message_bubble_background_sent_alone"
|
||||
app:doc_titleColor="?attr/conversation_item_sent_text_primary_color"
|
||||
app:doc_captionColor="?attr/conversation_item_sent_text_secondary_color"/>
|
||||
|
||||
</org.thoughtcrime.securesms.components.RemovableEditableMediaView>
|
||||
|
||||
</FrameLayout>
|
||||
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.emoji.MediaKeyboard
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/emoji_drawer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="2dp"
|
||||
android:scrollbars="vertical"
|
||||
android:cacheColorHint="?conversation_background"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"/>
|
||||
|
||||
<TextView android:id="@+id/scroll_date_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center_horizontal|top"
|
||||
android:paddingStart="12dp"
|
||||
android:paddingEnd="12dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:textSize="@dimen/small_font_size"
|
||||
android:textColor="?conversation_item_sticky_date_text_color"
|
||||
android:background="?conversation_item_sticky_date_background"
|
||||
android:elevation="10dp"
|
||||
android:visibility="gone"
|
||||
tools:text="March 1, 2015" />
|
||||
|
||||
<View android:id="@+id/compose_divider"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/compose_divider_background"
|
||||
android:alpha="1"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/scroll_to_bottom_button"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/medium_spacing"
|
||||
android:layout_marginBottom="@dimen/medium_spacing"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:background="@drawable/scroll_to_bottom_button_background"
|
||||
android:paddingLeft="@dimen/small_spacing"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingRight="@dimen/small_spacing"
|
||||
android:paddingBottom="6dp"
|
||||
android:elevation="10dp"
|
||||
android:contentDescription="@string/conversation_fragment__scroll_to_the_bottom_content_description"
|
||||
android:src="@drawable/ic_baseline_keyboard_arrow_down_24"/>
|
||||
|
||||
</FrameLayout>
|
@ -1,208 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.InputPanel
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/bottom_panel"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:clickable="true"
|
||||
android:background="@color/compose_view_background"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingTop="6dp"
|
||||
android:paddingBottom="6dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/input_panel_sticker_suggestion"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="90dp"
|
||||
android:background="?emoji_tab_strip_background"
|
||||
android:visibility="gone" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/compose_bubble"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?attr/conversation_input_background"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.thoughtcrime.securesms.components.QuoteView
|
||||
android:id="@+id/quote_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:visibility="gone"
|
||||
app:message_type="preview"
|
||||
app:quote_colorPrimary="?attr/conversation_item_sent_text_primary_color"
|
||||
app:quote_colorSecondary="?attr/conversation_item_sent_text_primary_color"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.LinkPreviewView
|
||||
android:id="@+id/link_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:visibility="gone"
|
||||
app:linkpreview_type="compose" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="10dp"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<org.thoughtcrime.securesms.components.emoji.EmojiToggle
|
||||
android:id="@+id/emoji_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/conversation_compose_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:paddingStart="4dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/conversation_activity__emoji_toggle_description" />
|
||||
|
||||
<Space
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/conversation_compose_height" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.ComposeText
|
||||
style="@style/Widget.Session.EditText.Compose"
|
||||
android:id="@+id/embedded_text_editor"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:nextFocusForward="@+id/send_button"
|
||||
android:nextFocusRight="@+id/send_button"
|
||||
tools:visibility="invisible"
|
||||
tools:hint="Send TextSecure message" >
|
||||
<requestFocus />
|
||||
|
||||
</org.thoughtcrime.securesms.components.ComposeText>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<org.thoughtcrime.securesms.components.HidingLinearLayout
|
||||
android:id="@+id/quick_attachment_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right|end"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/quick_camera_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:src="?quick_camera_icon"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingEnd="6dp"
|
||||
android:background="?selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/conversation_activity__quick_attachment_drawer_toggle_camera_description" />
|
||||
|
||||
<org.thoughtcrime.securesms.components.MicrophoneRecorderView
|
||||
android:id="@+id/recorder_view"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="36dp"
|
||||
android:layout_gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false">
|
||||
|
||||
<include layout="@layout/microphone_recorder_view" />
|
||||
|
||||
</org.thoughtcrime.securesms.components.MicrophoneRecorderView>
|
||||
|
||||
</org.thoughtcrime.securesms.components.HidingLinearLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.HidingLinearLayout
|
||||
android:id="@+id/inline_attachment_container"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right|end">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/inline_attachment_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/conversation_compose_height"
|
||||
android:layout_gravity="bottom"
|
||||
android:padding="8dp"
|
||||
android:src="@drawable/ic_add_white_24dp"
|
||||
android:tint="?attr/conversation_input_inline_attach_icon_tint"
|
||||
android:background="?selectableItemBackgroundBorderless"/>
|
||||
|
||||
</org.thoughtcrime.securesms.components.HidingLinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/recording_layout" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.AnimatingToggle
|
||||
android:id="@+id/button_toggle"
|
||||
android:layout_width="@dimen/conversation_compose_height"
|
||||
android:layout_height="@dimen/conversation_compose_height"
|
||||
android:layout_marginStart="12dp"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/attach_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:background="@drawable/circle_touch_highlight_background"
|
||||
android:src="@drawable/ic_circle_plus"
|
||||
android:scaleType="fitXY"
|
||||
android:padding="4dp"
|
||||
android:contentDescription="@string/ConversationActivity_add_attachment"
|
||||
android:nextFocusLeft="@+id/embedded_text_editor" />
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/send_button"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:contentDescription="@string/conversation_activity__send"
|
||||
android:nextFocusLeft="@+id/embedded_text_editor"
|
||||
android:src="?conversation_transport_sms_indicator"
|
||||
android:background="@drawable/circle_touch_highlight_background"/>
|
||||
|
||||
</org.thoughtcrime.securesms.components.AnimatingToggle>
|
||||
|
||||
</org.thoughtcrime.securesms.components.InputPanel>
|
@ -1,22 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="12dp"
|
||||
android:paddingBottom="13dp"
|
||||
android:paddingStart="28dp"
|
||||
android:paddingEnd="28dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:textColor="?conversation_item_sticky_date_text_color"
|
||||
android:textSize="@dimen/small_font_size"
|
||||
tools:text="March 1, 2015" />
|
||||
|
||||
</LinearLayout>
|
@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp"
|
||||
android:paddingBottom="18dp">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:layout_marginStart="@dimen/large_spacing"
|
||||
android:layout_marginEnd="@dimen/large_spacing"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:background="@color/text" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
style="@style/Signal.Text.Caption"
|
||||
android:textColor="@color/text"
|
||||
android:textSize="@dimen/small_font_size"
|
||||
tools:text="3 unread messages" />
|
||||
|
||||
</LinearLayout>
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.loki.views.MessageAudioView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/audio_view"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:foregroundTintColor="?android:colorControlNormal"
|
||||
app:waveformFillColor="?conversation_item_audio_seek_bar_color_incoming"
|
||||
app:waveformBackgroundColor="?conversation_item_audio_seek_bar_background_color"
|
||||
tools:visibility="visible"/>
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.DocumentView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/document_view"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:doc_titleColor="?conversation_item_received_text_primary_color"
|
||||
app:doc_captionColor="?conversation_item_received_text_secondary_color"
|
||||
app:doc_downloadButtonTint="@color/core_white"
|
||||
tools:visibility="visible"/>
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.LinkPreviewView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/link_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:linkpreview_type="conversation"
|
||||
tools:visibility="visible" />
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.loki.views.OpenGroupInvitationView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/open_group_invitation_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.StickerView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="@dimen/media_bubble_sticker_dimens"
|
||||
android:layout_height="@dimen/media_bubble_sticker_dimens"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description" />
|
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.ConversationItemThumbnail
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="@dimen/media_bubble_default_dimens"
|
||||
android:layout_height="@dimen/media_bubble_default_dimens"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description"
|
||||
android:visibility="gone"
|
||||
android:elevation="8dp"
|
||||
app:conversationThumbnail_minWidth="@dimen/media_bubble_min_width"
|
||||
app:conversationThumbnail_maxWidth="@dimen/media_bubble_max_width"
|
||||
app:conversationThumbnail_minHeight="@dimen/media_bubble_min_height"
|
||||
app:conversationThumbnail_maxHeight="@dimen/media_bubble_max_height"
|
||||
tools:src="@drawable/ic_video_light"
|
||||
tools:visibility="gone" />
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.loki.views.MessageAudioView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/audio_view"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:foregroundTintColor="?android:colorControlNormal"
|
||||
app:waveformFillColor="?conversation_item_audio_seek_bar_color_outgoing"
|
||||
app:waveformBackgroundColor="?conversation_item_audio_seek_bar_background_color"
|
||||
android:visibility="gone"/>
|
@ -1,13 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.DocumentView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/document_view"
|
||||
android:layout_width="210dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:doc_titleColor="?conversation_item_sent_text_primary_color"
|
||||
app:doc_captionColor="?conversation_item_sent_text_secondary_color"
|
||||
app:doc_downloadButtonTint="?android:colorControlNormal"
|
||||
tools:visibility="visible"/>
|
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.LinkPreviewView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/link_preview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:linkpreview_type="conversation"
|
||||
tools:visibility="visible" />
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.loki.views.OpenGroupInvitationView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/open_group_invitation_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.StickerView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="@dimen/media_bubble_sticker_dimens"
|
||||
android:layout_height="@dimen/media_bubble_sticker_dimens"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description" />
|
@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.thoughtcrime.securesms.components.ConversationItemThumbnail
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/image_view"
|
||||
android:layout_width="@dimen/media_bubble_default_dimens"
|
||||
android:layout_height="@dimen/media_bubble_default_dimens"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_gravity="center"
|
||||
android:scaleType="centerCrop"
|
||||
android:adjustViewBounds="true"
|
||||
android:contentDescription="@string/conversation_item__mms_image_description"
|
||||
android:visibility="gone"
|
||||
android:elevation="8dp"
|
||||
app:conversationThumbnail_minWidth="@dimen/media_bubble_min_width"
|
||||
app:conversationThumbnail_maxWidth="@dimen/media_bubble_max_width"
|
||||
app:conversationThumbnail_minHeight="@dimen/media_bubble_min_height"
|
||||
app:conversationThumbnail_maxHeight="@dimen/media_bubble_max_height"
|
||||
tools:src="@drawable/ic_video_light"
|
||||
tools:visibility="visible" />
|