org.telegram.ui.Cells.MaxFileSizeCell Java Examples

The following examples show how to use org.telegram.ui.Cells.MaxFileSizeCell. 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: DataAutoDownloadActivity.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ThemeDescription[] getThemeDescriptions()
{
    return new ThemeDescription[]{
            new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[]{TextCheckBoxCell.class, MaxFileSizeCell.class, HeaderCell.class}, null, null, null, Theme.key_windowBackgroundWhite),
            new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray),

            new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault),
            new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault),
            new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon),
            new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle),
            new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector),

            new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector),

            new ThemeDescription(listView, 0, new Class[]{View.class}, Theme.dividerPaint, null, null, Theme.key_divider),

            new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, Theme.key_windowBackgroundGrayShadow),

            new ThemeDescription(listView, 0, new Class[]{MaxFileSizeCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText),
            new ThemeDescription(listView, 0, new Class[]{MaxFileSizeCell.class}, new String[]{"sizeTextView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText),

            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareUnchecked),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareDisabled),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareBackground),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareCheck),

            new ThemeDescription(listView, 0, new Class[]{HeaderCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader),
    };
}
 
Example #2
Source File: DataAutoDownloadActivity.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public ThemeDescription[] getThemeDescriptions()
{
    return new ThemeDescription[]{
            new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[]{TextCheckBoxCell.class, MaxFileSizeCell.class, HeaderCell.class}, null, null, null, Theme.key_windowBackgroundWhite),
            new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray),

            new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault),
            new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault),
            new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon),
            new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle),
            new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector),

            new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector),

            new ThemeDescription(listView, 0, new Class[]{View.class}, Theme.dividerPaint, null, null, Theme.key_divider),

            new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[]{ShadowSectionCell.class}, null, null, null, Theme.key_windowBackgroundGrayShadow),

            new ThemeDescription(listView, 0, new Class[]{MaxFileSizeCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText),
            new ThemeDescription(listView, 0, new Class[]{MaxFileSizeCell.class}, new String[]{"sizeTextView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText),

            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlackText),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareUnchecked),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareDisabled),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareBackground),
            new ThemeDescription(listView, 0, new Class[]{TextCheckBoxCell.class}, null, null, null, Theme.key_checkboxSquareCheck),

            new ThemeDescription(listView, 0, new Class[]{HeaderCell.class}, new String[]{"textView"}, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader),
    };
}
 
Example #3
Source File: DataAutoDownloadActivity.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position)
{
    switch (holder.getItemViewType())
    {
        case 0:
        {
            if (position == mobileSection2Row || position == wifiSection2Row)
            {
                holder.itemView.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            }
            else
            {
                holder.itemView.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
            }
            break;
        }
        case 1:
        {
            TextCheckBoxCell textCell = (TextCheckBoxCell) holder.itemView;
            if (position == mContactsRow || position == wContactsRow || position == rContactsRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadContacts", R.string.AutodownloadContacts), (getMaskForRow(position) & currentType) != 0, true);
            }
            else if (position == mPrivateRow || position == wPrivateRow || position == rPrivateRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadPrivateChats", R.string.AutodownloadPrivateChats), (getMaskForRow(position) & currentType) != 0, true);
            }
            else if (position == mChannelsRow || position == wChannelsRow || position == rChannelsRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadChannels", R.string.AutodownloadChannels), (getMaskForRow(position) & currentType) != 0, mSizeRow != -1);
            }
            else if (position == mGroupRow || position == wGroupRow || position == rGroupRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadGroupChats", R.string.AutodownloadGroupChats), (getMaskForRow(position) & currentType) != 0, true);
            }
            break;
        }
        case 2:
        {
            HeaderCell headerCell = (HeaderCell) holder.itemView;
            if (position == mobileSectionRow)
            {
                headerCell.setText(LocaleController.getString("WhenUsingMobileData", R.string.WhenUsingMobileData));
            }
            else if (position == wifiSectionRow)
            {
                headerCell.setText(LocaleController.getString("WhenConnectedOnWiFi", R.string.WhenConnectedOnWiFi));
            }
            else if (position == roamingSectionRow)
            {
                headerCell.setText(LocaleController.getString("WhenRoaming", R.string.WhenRoaming));
            }
            break;
        }
        case 3:
        {
            MaxFileSizeCell cell = (MaxFileSizeCell) holder.itemView;
            if (position == mSizeRow)
            {
                cell.setSize(mobileMaxSize, maxSize);
                cell.setTag(0);
            }
            else if (position == wSizeRow)
            {
                cell.setSize(wifiMaxSize, maxSize);
                cell.setTag(1);
            }
            else if (position == rSizeRow)
            {
                cell.setSize(roamingMaxSize, maxSize);
                cell.setTag(2);
            }
            break;
        }
    }
}
 
Example #4
Source File: DataAutoDownloadActivity.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position)
{
    switch (holder.getItemViewType())
    {
        case 0:
        {
            if (position == mobileSection2Row || position == wifiSection2Row)
            {
                holder.itemView.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            }
            else
            {
                holder.itemView.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
            }
            break;
        }
        case 1:
        {
            TextCheckBoxCell textCell = (TextCheckBoxCell) holder.itemView;
            if (position == mContactsRow || position == wContactsRow || position == rContactsRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadContacts", R.string.AutodownloadContacts), (getMaskForRow(position) & currentType) != 0, true);
            }
            else if (position == mPrivateRow || position == wPrivateRow || position == rPrivateRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadPrivateChats", R.string.AutodownloadPrivateChats), (getMaskForRow(position) & currentType) != 0, true);
            }
            else if (position == mChannelsRow || position == wChannelsRow || position == rChannelsRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadChannels", R.string.AutodownloadChannels), (getMaskForRow(position) & currentType) != 0, mSizeRow != -1);
            }
            else if (position == mGroupRow || position == wGroupRow || position == rGroupRow)
            {
                textCell.setTextAndCheck(LocaleController.getString("AutodownloadGroupChats", R.string.AutodownloadGroupChats), (getMaskForRow(position) & currentType) != 0, true);
            }
            break;
        }
        case 2:
        {
            HeaderCell headerCell = (HeaderCell) holder.itemView;
            if (position == mobileSectionRow)
            {
                headerCell.setText(LocaleController.getString("WhenUsingMobileData", R.string.WhenUsingMobileData));
            }
            else if (position == wifiSectionRow)
            {
                headerCell.setText(LocaleController.getString("WhenConnectedOnWiFi", R.string.WhenConnectedOnWiFi));
            }
            else if (position == roamingSectionRow)
            {
                headerCell.setText(LocaleController.getString("WhenRoaming", R.string.WhenRoaming));
            }
            break;
        }
        case 3:
        {
            MaxFileSizeCell cell = (MaxFileSizeCell) holder.itemView;
            if (position == mSizeRow)
            {
                cell.setSize(mobileMaxSize, maxSize);
                cell.setTag(0);
            }
            else if (position == wSizeRow)
            {
                cell.setSize(wifiMaxSize, maxSize);
                cell.setTag(1);
            }
            else if (position == rSizeRow)
            {
                cell.setSize(roamingMaxSize, maxSize);
                cell.setTag(2);
            }
            break;
        }
    }
}