Implement input bar redesign

This commit is contained in:
Niels Andriesse
2020-01-10 16:35:32 +11:00
parent 4f9b5f06f0
commit c05c1eecd8
30 changed files with 201 additions and 98 deletions

View File

@@ -24,7 +24,6 @@ import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.components.emoji.EmojiKeyboardProvider;
import org.thoughtcrime.securesms.components.emoji.EmojiToggle;
import org.thoughtcrime.securesms.components.emoji.MediaKeyboard;
@@ -48,6 +47,8 @@ import org.whispersystems.libsignal.util.guava.Optional;
import java.util.List;
import java.util.concurrent.TimeUnit;
import network.loki.messenger.R;
public class InputPanel extends LinearLayout
implements MicrophoneRecorderView.Listener,
KeyboardAwareLinearLayout.OnKeyboardShownListener,
@@ -108,7 +109,8 @@ public class InputPanel extends LinearLayout
this.buttonToggle = findViewById(R.id.button_toggle);
this.recordingContainer = findViewById(R.id.recording_container);
this.recordLockCancel = findViewById(R.id.record_cancel);
this.slideToCancel = new SlideToCancel(findViewById(R.id.slide_to_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),

View File

@@ -20,10 +20,11 @@ import android.view.animation.TranslateAnimation;
import android.widget.FrameLayout;
import android.widget.ImageView;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.permissions.Permissions;
import org.thoughtcrime.securesms.util.ViewUtil;
import network.loki.messenger.R;
public final class MicrophoneRecorderView extends FrameLayout implements View.OnTouchListener {
enum State {
@@ -156,7 +157,7 @@ public final class MicrophoneRecorderView extends FrameLayout implements View.On
FloatingRecordButton(Context context, ImageView recordButtonFab) {
this.recordButtonFab = recordButtonFab;
this.recordButtonFab.getBackground().setColorFilter(context.getResources()
.getColor(R.color.red_500),
.getColor(R.color.destructive),
PorterDuff.Mode.SRC_IN);
}

View File

@@ -1,16 +1,18 @@
package org.thoughtcrime.securesms.components.emoji;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.v7.widget.AppCompatImageButton;
import android.util.AttributeSet;
import network.loki.messenger.R;
import org.thoughtcrime.securesms.stickers.StickerKeyboardProvider;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import network.loki.messenger.R;
public class EmojiToggle extends AppCompatImageButton implements MediaKeyboard.MediaKeyboardListener {
private Drawable emojiToggle;
@@ -54,6 +56,8 @@ public class EmojiToggle extends AppCompatImageButton implements MediaKeyboard.M
this.imeToggle = drawables.getDrawable(2);
this.mediaToggle = emojiToggle;
setImageTintList(ColorStateList.valueOf(getResources().getColor(R.color.text)));
drawables.recycle();
setToMedia();
}