Search in sources :

Example 1 with ConversationStickerSuggestionAdapter

use of org.thoughtcrime.securesms.conversation.ConversationStickerSuggestionAdapter in project Signal-Android by WhisperSystems.

the class InputPanel method onFinishInflate.

@Override
public void onFinishInflate() {
    super.onFinishInflate();
    View quoteDismiss = findViewById(R.id.quote_dismiss);
    this.composeContainer = findViewById(R.id.compose_bubble);
    this.stickerSuggestion = findViewById(R.id.input_panel_sticker_suggestion);
    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);
    this.voiceNoteDraftView = findViewById(R.id.voice_note_draft_view);
    this.slideToCancel = new SlideToCancel(findViewById(R.id.slide_to_cancel));
    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 (SignalStore.settings().isPreferSystemEmoji()) {
        mediaKeyboard.setVisibility(View.GONE);
        emojiVisible = false;
    } else {
        mediaKeyboard.setVisibility(View.VISIBLE);
        emojiVisible = true;
    }
    quoteDismiss.setOnClickListener(v -> clearQuote());
    linkPreview.setCloseClickedListener(() -> {
        if (listener != null) {
            listener.onLinkPreviewCanceled();
        }
    });
    stickerSuggestionAdapter = new ConversationStickerSuggestionAdapter(GlideApp.with(this), this);
    stickerSuggestion.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
    stickerSuggestion.setAdapter(stickerSuggestionAdapter);
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) VoiceNoteDraftView(org.thoughtcrime.securesms.conversation.VoiceNoteDraftView) TextView(android.widget.TextView) ConversationStickerSuggestionAdapter(org.thoughtcrime.securesms.conversation.ConversationStickerSuggestionAdapter)

Example 2 with ConversationStickerSuggestionAdapter

use of org.thoughtcrime.securesms.conversation.ConversationStickerSuggestionAdapter in project Signal-Android by signalapp.

the class InputPanel method onFinishInflate.

@Override
public void onFinishInflate() {
    super.onFinishInflate();
    View quoteDismiss = findViewById(R.id.quote_dismiss);
    this.composeContainer = findViewById(R.id.compose_bubble);
    this.stickerSuggestion = findViewById(R.id.input_panel_sticker_suggestion);
    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);
    this.voiceNoteDraftView = findViewById(R.id.voice_note_draft_view);
    this.slideToCancel = new SlideToCancel(findViewById(R.id.slide_to_cancel));
    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 (SignalStore.settings().isPreferSystemEmoji()) {
        mediaKeyboard.setVisibility(View.GONE);
        emojiVisible = false;
    } else {
        mediaKeyboard.setVisibility(View.VISIBLE);
        emojiVisible = true;
    }
    quoteDismiss.setOnClickListener(v -> clearQuote());
    linkPreview.setCloseClickedListener(() -> {
        if (listener != null) {
            listener.onLinkPreviewCanceled();
        }
    });
    stickerSuggestionAdapter = new ConversationStickerSuggestionAdapter(GlideApp.with(this), this);
    stickerSuggestion.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
    stickerSuggestion.setAdapter(stickerSuggestionAdapter);
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) VoiceNoteDraftView(org.thoughtcrime.securesms.conversation.VoiceNoteDraftView) TextView(android.widget.TextView) ConversationStickerSuggestionAdapter(org.thoughtcrime.securesms.conversation.ConversationStickerSuggestionAdapter)

Aggregations

View (android.view.View)2 TextView (android.widget.TextView)2 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)2 RecyclerView (androidx.recyclerview.widget.RecyclerView)2 ConversationStickerSuggestionAdapter (org.thoughtcrime.securesms.conversation.ConversationStickerSuggestionAdapter)2 VoiceNoteDraftView (org.thoughtcrime.securesms.conversation.VoiceNoteDraftView)2