Search in sources :

Example 61 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project xabber-android by redsolution.

the class BottomMenu method onCreateView.

@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.view_bottom_navigation, container, false);
    view.findViewById(R.id.btnRecent).setOnClickListener(this);
    view.findViewById(R.id.btnMenu).setOnClickListener(this);
    btnSearch = (ImageView) view.findViewById(R.id.btnSearch);
    btnSearch.setOnClickListener(this);
    searchLayout = (RelativeLayout) view.findViewById(R.id.searchLayout);
    searchLayout.setOnClickListener(this);
    controlView = (LinearLayout) view.findViewById(R.id.controlView);
    expandSearchLayout = (RelativeLayout) view.findViewById(R.id.expandSearchLayout);
    accountList = (RecyclerView) view.findViewById(R.id.accountList);
    RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);
    accountList.setLayoutManager(layoutManager);
    adapter = new AccountShortcutAdapter(items, getActivity(), this);
    accountList.setAdapter(adapter);
    searchView = (SearchView) view.findViewById(R.id.searchView);
    searchView.setQueryHint(getString(R.string.contact_search_hint));
    searchView.setOnQueryTextListener(new android.widget.SearchView.OnQueryTextListener() {

        @Override
        public boolean onQueryTextSubmit(String query) {
            return false;
        }

        @Override
        public boolean onQueryTextChange(String newText) {
            listener.onSearch(newText);
            return true;
        }
    });
    searchView.setOnCloseListener(new SearchView.OnCloseListener() {

        @Override
        public boolean onClose() {
            closeSearch();
            return true;
        }
    });
    tvUnreadCount = (TextView) view.findViewById(R.id.tvUnreadCount);
    return view;
}
Also used : SearchView(android.widget.SearchView) RecyclerView(androidx.recyclerview.widget.RecyclerView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) SearchView(android.widget.SearchView) ImageView(android.widget.ImageView) TextView(android.widget.TextView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) Nullable(androidx.annotation.Nullable)

Example 62 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager 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 63 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class StickerManagementActivity method initView.

private void initView() {
    this.list = findViewById(R.id.sticker_management_list);
    this.adapter = new StickerManagementAdapter(GlideApp.with(this), this, DeviceProperties.shouldAllowApngStickerAnimation(this));
    list.setLayoutManager(new LinearLayoutManager(this));
    list.setAdapter(adapter);
    new ItemTouchHelper(new StickerManagementItemTouchHelper(new ItemTouchCallback())).attachToRecyclerView(list);
}
Also used : ItemTouchHelper(androidx.recyclerview.widget.ItemTouchHelper) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Example 64 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class ContactSelectionListFragment method onCreateView.

@Override
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.contact_selection_list_fragment, container, false);
    emptyText = view.findViewById(android.R.id.empty);
    recyclerView = view.findViewById(R.id.recycler_view);
    swipeRefresh = view.findViewById(R.id.swipe_refresh);
    fastScroller = view.findViewById(R.id.fast_scroller);
    showContactsLayout = view.findViewById(R.id.show_contacts_container);
    showContactsButton = view.findViewById(R.id.show_contacts_button);
    showContactsDescription = view.findViewById(R.id.show_contacts_description);
    showContactsProgress = view.findViewById(R.id.progress);
    chipGroup = view.findViewById(R.id.chipGroup);
    chipGroupScrollContainer = view.findViewById(R.id.chipGroupScrollContainer);
    constraintLayout = view.findViewById(R.id.container);
    shadowView = view.findViewById(R.id.toolbar_shadow);
    toolbarShadowAnimationHelper = new ToolbarShadowAnimationHelper(shadowView);
    recyclerView.addOnScrollListener(toolbarShadowAnimationHelper);
    recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
    recyclerView.setItemAnimator(new DefaultItemAnimator() {

        @Override
        public boolean canReuseUpdatedViewHolder(@NonNull RecyclerView.ViewHolder viewHolder) {
            return true;
        }
    });
    Intent intent = requireActivity().getIntent();
    Bundle arguments = safeArguments();
    int recyclerViewPadBottom = arguments.getInt(RV_PADDING_BOTTOM, intent.getIntExtra(RV_PADDING_BOTTOM, -1));
    boolean recyclerViewClipping = arguments.getBoolean(RV_CLIP, intent.getBooleanExtra(RV_CLIP, true));
    if (recyclerViewPadBottom != -1) {
        ViewUtil.setPaddingBottom(recyclerView, recyclerViewPadBottom);
    }
    recyclerView.setClipToPadding(recyclerViewClipping);
    boolean isRefreshable = arguments.getBoolean(REFRESHABLE, intent.getBooleanExtra(REFRESHABLE, true));
    swipeRefresh.setNestedScrollingEnabled(isRefreshable);
    swipeRefresh.setEnabled(isRefreshable);
    hideCount = arguments.getBoolean(HIDE_COUNT, intent.getBooleanExtra(HIDE_COUNT, false));
    selectionLimit = arguments.getParcelable(SELECTION_LIMITS);
    if (selectionLimit == null) {
        selectionLimit = intent.getParcelableExtra(SELECTION_LIMITS);
    }
    isMulti = selectionLimit != null;
    canSelectSelf = arguments.getBoolean(CAN_SELECT_SELF, intent.getBooleanExtra(CAN_SELECT_SELF, !isMulti));
    if (!isMulti) {
        selectionLimit = SelectionLimits.NO_LIMITS;
    }
    currentSelection = getCurrentSelection();
    return view;
}
Also used : ToolbarShadowAnimationHelper(org.thoughtcrime.securesms.components.recyclerview.ToolbarShadowAnimationHelper) Bundle(android.os.Bundle) RecyclerView(androidx.recyclerview.widget.RecyclerView) Intent(android.content.Intent) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) HorizontalScrollView(android.widget.HorizontalScrollView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) DefaultItemAnimator(androidx.recyclerview.widget.DefaultItemAnimator) SuppressLint(android.annotation.SuppressLint)

Example 65 with LinearLayoutManager

use of androidx.recyclerview.widget.LinearLayoutManager in project Signal-Android by WhisperSystems.

the class CallParticipantsListDialog method initializeList.

private void initializeList() {
    adapter = new CallParticipantsListAdapter();
    participantList.setLayoutManager(new LinearLayoutManager(requireContext()));
    participantList.setAdapter(adapter);
}
Also used : LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Aggregations

LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)470 RecyclerView (androidx.recyclerview.widget.RecyclerView)281 View (android.view.View)183 TextView (android.widget.TextView)65 ArrayList (java.util.ArrayList)37 Nullable (androidx.annotation.Nullable)33 Bundle (android.os.Bundle)32 Toolbar (androidx.appcompat.widget.Toolbar)32 Intent (android.content.Intent)30 ImageView (android.widget.ImageView)27 List (java.util.List)24 Test (org.junit.Test)24 Context (android.content.Context)23 NonNull (androidx.annotation.NonNull)23 ViewGroup (android.view.ViewGroup)22 AlertDialog (androidx.appcompat.app.AlertDialog)21 ContextualCard (com.android.settings.homepage.contextualcards.ContextualCard)20 LayoutInflater (android.view.LayoutInflater)18 AppCompatActivity (androidx.appcompat.app.AppCompatActivity)16 SwipeRefreshLayout (androidx.swiperefreshlayout.widget.SwipeRefreshLayout)16