<commit_before>package cgeo.geocaching.filters.gui;

import cgeo.geocaching.R;
import cgeo.geocaching.databinding.ButtontogglegroupLabeledItemBinding;
import cgeo.geocaching.filters.core.StatusGeocacheFilter;
import cgeo.geocaching.ui.ButtonToggleGroup;
import cgeo.geocaching.ui.ChipChoiceGroup;
import cgeo.geocaching.ui.TextParam;
import cgeo.geocaching.ui.dialog.SimpleDialog;
import static cgeo.geocaching.ui.ViewUtils.dpToPixel;

import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import java.util.Arrays;
import java.util.Set;

public class StatusFilterViewHolder extends BaseFilterViewHolder<StatusGeocacheFilter> {

    private ChipChoiceGroup activeDisabledArchivedGroup = null;

    private ButtonToggleGroup statusOwn = null;
    private ButtonToggleGroup statusFound = null;
    private ButtonToggleGroup statusStored = null;
    private ButtonToggleGroup statusFavorite = null;
    private ButtonToggleGroup statusWatchlist = null;
    private ButtonToggleGroup statusPremium = null;
    private ButtonToggleGroup statusHasTrackable = null;
    private ButtonToggleGroup statusHasOwnVote = null;
    private ButtonToggleGroup statusHasOfflineLog = null;
    private ButtonToggleGroup statusSolvedMystery = null;

    @Override
    public View createView() {
        final LinearLayout ll = new LinearLayout(getActivity());
        ll.setOrientation(LinearLayout.VERTICAL);

        activeDisabledArchivedGroup = new ChipChoiceGroup(getActivity());
        activeDisabledArchivedGroup.setChipSpacing(dpToPixel(10));
        activeDisabledArchivedGroup.setWithSelectAllChip(false);

        activeDisabledArchivedGroup.addChips(Arrays.asList(TextParam.id(R.string.cache_filter_status_active),
            TextParam.id(R.string.cache_filter_status_disabled), TextParam.id(R.string.cache_filter_status_archived)));
        activeDisabledArchivedGroup.setCheckedButtonByIndex(true, 0, 1, 2);
        ll.addView(activeDisabledArchivedGroup, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);

        statusFound = createGroup(ll, StatusGeocacheFilter.StatusType.FOUND);
        statusOwn = createGroup(ll, StatusGeocacheFilter.StatusType.OWNED);
        statusStored = createGroup(ll, StatusGeocacheFilter.StatusType.STORED);
        statusFavorite = createGroup(ll, StatusGeocacheFilter.StatusType.FAVORITE);
        statusWatchlist = createGroup(ll, StatusGeocacheFilter.StatusType.WATCHLIST);
        statusPremium = createGroup(ll, StatusGeocacheFilter.StatusType.PREMIUM);
        statusHasTrackable = createGroup(ll, StatusGeocacheFilter.StatusType.HAS_TRACKABLE);
        statusHasOwnVote = createGroup(ll, StatusGeocacheFilter.StatusType.HAS_OWN_VOTE);
        statusHasOfflineLog = createGroup(ll, StatusGeocacheFilter.StatusType.HAS_OFFLINE_LOG);
        statusSolvedMystery = createGroup(ll, StatusGeocacheFilter.StatusType.SOLVED_MYSTERY);
        ButtonToggleGroup.alignWidths(statusOwn, statusFound, statusStored, statusFavorite, statusWatchlist,
            statusPremium, statusHasTrackable, statusHasOwnVote, statusHasOfflineLog, statusSolvedMystery);

        return ll;
    }
    private ButtonToggleGroup createGroup(final LinearLayout ll, final StatusGeocacheFilter.StatusType statusType) {
        final View view = inflateLayout(R.layout.buttontogglegroup_labeled_item);
        final ButtontogglegroupLabeledItemBinding binding = ButtontogglegroupLabeledItemBinding.bind(view);
        binding.itemText.setText(statusType.labelId);
        if (statusType.icon != null) {
            statusType.icon.apply(binding.itemIcon);
        }
        if (statusType.infoTextId != 0) {
            binding.itemInfo.setVisibility(View.VISIBLE);
            binding.itemInfo.setOnClickListener(v -> SimpleDialog.of(getActivity()).setMessage(statusType.infoTextId).show());
        }

        binding.itemTogglebuttongroup.setUseRelativeWidth(true);<commit_msg>fix #11120: fix cut-off of status filter checkbox, remove width adjustments (#11160)<commit_after>package cgeo.geocaching.filters.gui;

import cgeo.geocaching.R;
import cgeo.geocaching.databinding.ButtontogglegroupLabeledItemBinding;
import cgeo.geocaching.filters.core.StatusGeocacheFilter;
import cgeo.geocaching.ui.ButtonToggleGroup;
import cgeo.geocaching.ui.ChipChoiceGroup;
import cgeo.geocaching.ui.TextParam;
import cgeo.geocaching.ui.dialog.SimpleDialog;
import static cgeo.geocaching.ui.ViewUtils.dpToPixel;

import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import java.util.Arrays;
import java.util.Set;

public class StatusFilterViewHolder extends BaseFilterViewHolder<StatusGeocacheFilter> {

    private ChipChoiceGroup activeDisabledArchivedGroup = null;

    private ButtonToggleGroup statusOwn = null;
    private ButtonToggleGroup statusFound = null;
    private ButtonToggleGroup statusStored = null;
    private ButtonToggleGroup statusFavorite = null;
    private ButtonToggleGroup statusWatchlist = null;
    private ButtonToggleGroup statusPremium = null;
    private ButtonToggleGroup statusHasTrackable = null;
    private ButtonToggleGroup statusHasOwnVote = null;
    private ButtonToggleGroup statusHasOfflineLog = null;
    private ButtonToggleGroup statusSolvedMystery = null;

    @Override
    public View createView() {
        final LinearLayout ll = new LinearLayout(getActivity());
        ll.setOrientation(LinearLayout.VERTICAL);

        activeDisabledArchivedGroup = new ChipChoiceGroup(getActivity());
        activeDisabledArchivedGroup.setChipSpacing(dpToPixel(10));
        activeDisabledArchivedGroup.setWithSelectAllChip(false);

        activeDisabledArchivedGroup.addChips(Arrays.asList(TextParam.id(R.string.cache_filter_status_active),
            TextParam.id(R.string.cache_filter_status_disabled), TextParam.id(R.string.cache_filter_status_archived)));
        activeDisabledArchivedGroup.setCheckedButtonByIndex(true, 0, 1, 2);
        ll.addView(activeDisabledArchivedGroup, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);

        statusFound = createGroup(ll, StatusGeocacheFilter.StatusType.FOUND);
        statusOwn = createGroup(ll, StatusGeocacheFilter.StatusType.OWNED);
        statusStored = createGroup(ll, StatusGeocacheFilter.StatusType.STORED);
        statusFavorite = createGroup(ll, StatusGeocacheFilter.StatusType.FAVORITE);
        statusWatchlist = createGroup(ll, StatusGeocacheFilter.StatusType.WATCHLIST);
        statusPremium = createGroup(ll, StatusGeocacheFilter.StatusType.PREMIUM);
        statusHasTrackable = createGroup(ll, StatusGeocacheFilter.StatusType.HAS_TRACKABLE);
        statusHasOwnVote = createGroup(ll, StatusGeocacheFilter.StatusType.HAS_OWN_VOTE);
        statusHasOfflineLog = createGroup(ll, StatusGeocacheFilter.StatusType.HAS_OFFLINE_LOG);
        statusSolvedMystery = createGroup(ll, StatusGeocacheFilter.StatusType.SOLVED_MYSTERY);

        return ll;
    }
    private ButtonToggleGroup createGroup(final LinearLayout ll, final StatusGeocacheFilter.StatusType statusType) {
        final View view = inflateLayout(R.layout.buttontogglegroup_labeled_item);
        final ButtontogglegroupLabeledItemBinding binding = ButtontogglegroupLabeledItemBinding.bind(view);
        binding.itemText.setText(statusType.labelId);
        if (statusType.icon != null) {
            statusType.icon.apply(binding.itemIcon);
        }
        if (statusType.infoTextId != 0) {
            binding.itemInfo.setVisibility(View.VISIBLE);
            binding.itemInfo.setOnClickListener(v -> SimpleDialog.of(getActivity()).setMessage(statusType.infoTextId).show());
        }

{'fraction_non_alphanumeric': 0.07924528301886792, 'fraction_numerical': 0.002862719583604424, 'mean_word_length': 4.871657754010696, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5628387', 'n_tokens_mistral': 2235, 'n_tokens_neox': 2147, 'n_words': 345}