Java Code Examples for org.telegram.tgnet.TLRPC#TL_dialogFilterSuggested

The following examples show how to use org.telegram.tgnet.TLRPC#TL_dialogFilterSuggested . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FiltersSetupActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public void setFilter(TLRPC.TL_dialogFilterSuggested filter, boolean divider) {
    needDivider = divider;
    suggestedFilter = filter;
    setWillNotDraw(!needDivider);

    textView.setText(filter.filter.title);
    valueTextView.setText(filter.description);
}
 
Example 2
Source File: FiltersSetupActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private void updateRows(boolean notify) {
    recommendedHeaderRow = -1;
    recommendedStartRow = -1;
    recommendedEndRow = -1;
    recommendedSectionRow = -1;

    ArrayList<TLRPC.TL_dialogFilterSuggested> suggestedFilters = getMessagesController().suggestedFilters;
    rowCount = 0;
    filterHelpRow = rowCount++;
    int count = getMessagesController().dialogFilters.size();
    if (!suggestedFilters.isEmpty() && count < 10) {
        recommendedHeaderRow = rowCount++;
        recommendedStartRow = rowCount;
        rowCount += suggestedFilters.size();
        recommendedEndRow = rowCount;
        recommendedSectionRow = rowCount++;
    }

    if (count != 0) {
        filtersHeaderRow = rowCount++;
        filtersStartRow = rowCount;
        rowCount += count;
        filtersEndRow = rowCount;
    } else {
        filtersHeaderRow = -1;
        filtersStartRow = -1;
        filtersEndRow = -1;
    }
    if (count < 10) {
        createFilterRow = rowCount++;
    } else {
        createFilterRow = -1;
    }

    createSectionRow = rowCount++;
    if (notify && adapter != null) {
        adapter.notifyDataSetChanged();
    }
}
 
Example 3
Source File: FiltersSetupActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public void setFilter(TLRPC.TL_dialogFilterSuggested filter, boolean divider) {
    needDivider = divider;
    suggestedFilter = filter;
    setWillNotDraw(!needDivider);

    textView.setText(filter.filter.title);
    valueTextView.setText(filter.description);
}
 
Example 4
Source File: FiltersSetupActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private void updateRows(boolean notify) {
    recommendedHeaderRow = -1;
    recommendedStartRow = -1;
    recommendedEndRow = -1;
    recommendedSectionRow = -1;

    ArrayList<TLRPC.TL_dialogFilterSuggested> suggestedFilters = getMessagesController().suggestedFilters;
    rowCount = 0;
    filterHelpRow = rowCount++;
    int count = getMessagesController().dialogFilters.size();
    if (!suggestedFilters.isEmpty() && count < 10) {
        recommendedHeaderRow = rowCount++;
        recommendedStartRow = rowCount;
        rowCount += suggestedFilters.size();
        recommendedEndRow = rowCount;
        recommendedSectionRow = rowCount++;
    }

    if (count != 0) {
        filtersHeaderRow = rowCount++;
        filtersStartRow = rowCount;
        rowCount += count;
        filtersEndRow = rowCount;
    } else {
        filtersHeaderRow = -1;
        filtersStartRow = -1;
        filtersEndRow = -1;
    }
    if (count < 10) {
        createFilterRow = rowCount++;
    } else {
        createFilterRow = -1;
    }

    createSectionRow = rowCount++;
    if (notify && adapter != null) {
        adapter.notifyDataSetChanged();
    }
}
 
Example 5
Source File: FiltersSetupActivity.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
public TLRPC.TL_dialogFilterSuggested getSuggestedFilter() {
    return suggestedFilter;
}
 
Example 6
Source File: FiltersSetupActivity.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
public TLRPC.TL_dialogFilterSuggested getSuggestedFilter() {
    return suggestedFilter;
}