当前位置: 首页>>代码示例>>Java>>正文


Java TextSettingsCell.setText方法代码示例

本文整理汇总了Java中org.telegram.ui.Cells.TextSettingsCell.setText方法的典型用法代码示例。如果您正苦于以下问题:Java TextSettingsCell.setText方法的具体用法?Java TextSettingsCell.setText怎么用?Java TextSettingsCell.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.ui.Cells.TextSettingsCell的用法示例。


在下文中一共展示了TextSettingsCell.setText方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBindViewHolder

import org.telegram.ui.Cells.TextSettingsCell; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0:
            TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
            if (position == convertRow) {
                textCell.setText(LocaleController.getString("ConvertGroup", R.string.ConvertGroup), false);
            }
            break;
        case 1:
            TextInfoPrivacyCell privacyCell = (TextInfoPrivacyCell) holder.itemView;
            if (position == convertInfoRow) {
                privacyCell.setText(AndroidUtilities.replaceTags(LocaleController.getString("ConvertGroupInfo2", R.string.ConvertGroupInfo2)));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
            } else if (position == convertDetailRow) {
                privacyCell.setText(AndroidUtilities.replaceTags(LocaleController.getString("ConvertGroupInfo3", R.string.ConvertGroupInfo3)));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            }
            break;
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:22,代码来源:ConvertGroupActivity.java

示例2: onBindViewHolder

import org.telegram.ui.Cells.TextSettingsCell; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0:
            TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
            if (position == copyLinkRow) {
                textCell.setText(LocaleController.getString("CopyLink", R.string.CopyLink), true);
            } else if (position == shareLinkRow) {
                textCell.setText(LocaleController.getString("ShareLink", R.string.ShareLink), false);
            } else if (position == revokeLinkRow) {
                textCell.setText(LocaleController.getString("RevokeLink", R.string.RevokeLink), true);
            }
            break;
        case 1:
            TextInfoPrivacyCell privacyCell = (TextInfoPrivacyCell) holder.itemView;
            if (position == shadowRow) {
                privacyCell.setText("");
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            } else if (position == linkInfoRow) {
                TLRPC.Chat chat = MessagesController.getInstance().getChat(chat_id);
                if (ChatObject.isChannel(chat) && !chat.megagroup) {
                    privacyCell.setText(LocaleController.getString("ChannelLinkInfo", R.string.ChannelLinkInfo));
                } else {
                    privacyCell.setText(LocaleController.getString("LinkInfo", R.string.LinkInfo));
                }
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
            }
            break;
        case 2:
            TextBlockCell textBlockCell = (TextBlockCell) holder.itemView;
            textBlockCell.setText(invite != null ? invite.link : "error", false);
            break;
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:35,代码来源:GroupInviteActivity.java

示例3: onBindViewHolder

import org.telegram.ui.Cells.TextSettingsCell; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0:
            TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
            textCell.setTag(Theme.key_windowBackgroundWhiteBlackText);
            textCell.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
            if (position == changePasswordRow) {
                textCell.setText(LocaleController.getString("ChangePassword", R.string.ChangePassword), true);
            } else if (position == setPasswordRow) {
                textCell.setText(LocaleController.getString("SetAdditionalPassword", R.string.SetAdditionalPassword), true);
            } else if (position == turnPasswordOffRow) {
                textCell.setText(LocaleController.getString("TurnPasswordOff", R.string.TurnPasswordOff), true);
            } else if (position == changeRecoveryEmailRow) {
                textCell.setText(LocaleController.getString("ChangeRecoveryEmail", R.string.ChangeRecoveryEmail), abortPasswordRow != -1);
            } else if (position == setRecoveryEmailRow) {
                textCell.setText(LocaleController.getString("SetRecoveryEmail", R.string.SetRecoveryEmail), false);
            } else if (position == abortPasswordRow) {
                textCell.setTag(Theme.key_windowBackgroundWhiteRedText3);
                textCell.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteRedText3));
                textCell.setText(LocaleController.getString("AbortPassword", R.string.AbortPassword), false);
            }
            break;
        case 1:
            TextInfoPrivacyCell privacyCell = (TextInfoPrivacyCell) holder.itemView;
            if (position == setPasswordDetailRow) {
                privacyCell.setText(LocaleController.getString("SetAdditionalPasswordInfo", R.string.SetAdditionalPasswordInfo));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            } else if (position == shadowRow) {
                privacyCell.setText("");
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            } else if (position == passwordSetupDetailRow) {
                privacyCell.setText(LocaleController.formatString("EmailPasswordConfirmText", R.string.EmailPasswordConfirmText, currentPassword.email_unconfirmed_pattern));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_top, Theme.key_windowBackgroundGrayShadow));
            } else if (position == passwordEnabledDetailRow) {
                privacyCell.setText(LocaleController.getString("EnabledPasswordText", R.string.EnabledPasswordText));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            } else if (position == passwordEmailVerifyDetailRow) {
                privacyCell.setText(LocaleController.formatString("PendingEmailText", R.string.PendingEmailText, currentPassword.email_unconfirmed_pattern));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            }
            break;
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:45,代码来源:TwoStepVerificationActivity.java

示例4: onBindViewHolder

import org.telegram.ui.Cells.TextSettingsCell; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0: {
            if (position == proxySection2Row) {
                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: {
            TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
            textCell.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
            if (position == storageUsageRow) {
                textCell.setText(LocaleController.getString("StorageUsage", R.string.StorageUsage), true);
            } else if (position == useLessDataForCallsRow) {
                SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
                String value = null;
                switch (preferences.getInt("VoipDataSaving", VoIPController.DATA_SAVING_NEVER)) {
                    case VoIPController.DATA_SAVING_NEVER:
                        value = LocaleController.getString("UseLessDataNever", R.string.UseLessDataNever);
                        break;
                    case VoIPController.DATA_SAVING_MOBILE:
                        value = LocaleController.getString("UseLessDataOnMobile", R.string.UseLessDataOnMobile);
                        break;
                    case VoIPController.DATA_SAVING_ALWAYS:
                        value = LocaleController.getString("UseLessDataAlways", R.string.UseLessDataAlways);
                        break;
                }
                textCell.setTextAndValue(LocaleController.getString("VoipUseLessData", R.string.VoipUseLessData), value, false);
            } else if (position == mobileUsageRow) {
                textCell.setText(LocaleController.getString("MobileUsage", R.string.MobileUsage), true);
            } else if (position == roamingUsageRow) {
                textCell.setText(LocaleController.getString("RoamingUsage", R.string.RoamingUsage), false);
            } else if (position == wifiUsageRow) {
                textCell.setText(LocaleController.getString("WiFiUsage", R.string.WiFiUsage), true);
            } else if (position == proxyRow) {
                textCell.setText(LocaleController.getString("ProxySettings", R.string.ProxySettings), true);
            } else if (position == resetDownloadRow) {
                textCell.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteRedText));
                textCell.setText(LocaleController.getString("ResetAutomaticMediaDownload", R.string.ResetAutomaticMediaDownload), false);
            } else if (position == photosRow) {
                textCell.setText(LocaleController.getString("LocalPhotoCache", R.string.LocalPhotoCache), true);
            } else if (position == voiceMessagesRow) {
                textCell.setText(LocaleController.getString("AudioAutodownload", R.string.AudioAutodownload), true);
            } else if (position == videoMessagesRow) {
                textCell.setText(LocaleController.getString("VideoMessagesAutodownload", R.string.VideoMessagesAutodownload), true);
            } else if (position == videosRow) {
                textCell.setText(LocaleController.getString("LocalVideoCache", R.string.LocalVideoCache), true);
            } else if (position == filesRow) {
                textCell.setText(LocaleController.getString("FilesDataUsage", R.string.FilesDataUsage), true);
            } else if (position == musicRow) {
                textCell.setText(LocaleController.getString("AttachMusic", R.string.AttachMusic), true);
            } else if (position == gifsRow) {
                textCell.setText(LocaleController.getString("LocalGifCache", R.string.LocalGifCache), true);
            }
            break;
        }
        case 2: {
            HeaderCell headerCell = (HeaderCell) holder.itemView;
            if (position == mediaDownloadSectionRow) {
                headerCell.setText(LocaleController.getString("AutomaticMediaDownload", R.string.AutomaticMediaDownload));
            } else if (position == usageSectionRow) {
                headerCell.setText(LocaleController.getString("DataUsage", R.string.DataUsage));
            } else if (position == callsSectionRow) {
                headerCell.setText(LocaleController.getString("Calls", R.string.Calls));
            } else if (position == proxySectionRow) {
                headerCell.setText(LocaleController.getString("Proxy", R.string.Proxy));
            }
            break;
        }
        case 3: {
            TextCheckCell checkCell = (TextCheckCell) holder.itemView;
            if (position == autoDownloadMediaRow) {
                checkCell.setTextAndCheck(LocaleController.getString("AutoDownloadMedia", R.string.AutoDownloadMedia), MediaController.getInstance().globalAutodownloadEnabled, true);
            }
            break;
        }
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:82,代码来源:DataSettingsActivity.java

示例5: onBindViewHolder

import org.telegram.ui.Cells.TextSettingsCell; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
    switch (holder.getItemViewType()) {
        case 0:
            TextSettingsCell textCell = (TextSettingsCell) holder.itemView;
            if (position == terminateAllSessionsRow) {
                textCell.setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteRedText2));
                textCell.setText(LocaleController.getString("TerminateAllSessions", R.string.TerminateAllSessions), false);
            }
            break;
        case 1:
            TextInfoPrivacyCell privacyCell = (TextInfoPrivacyCell) holder.itemView;
            if (position == terminateAllSessionsDetailRow) {
                privacyCell.setText(LocaleController.getString("ClearOtherSessionsHelp", R.string.ClearOtherSessionsHelp));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow));
            } else if (position == otherSessionsTerminateDetail) {
                privacyCell.setText(LocaleController.getString("TerminateSessionInfo", R.string.TerminateSessionInfo));
                privacyCell.setBackgroundDrawable(Theme.getThemedDrawable(mContext, R.drawable.greydivider_bottom, Theme.key_windowBackgroundGrayShadow));
            }
            break;
        case 2:
            HeaderCell headerCell = (HeaderCell) holder.itemView;
            if (position == currentSessionSectionRow) {
                headerCell.setText(LocaleController.getString("CurrentSession", R.string.CurrentSession));
            } else if (position == otherSessionsSectionRow) {
                headerCell.setText(LocaleController.getString("OtherSessions", R.string.OtherSessions));
            }
            break;
        case 3:
            ViewGroup.LayoutParams layoutParams = emptyLayout.getLayoutParams();
            if (layoutParams != null) {
                layoutParams.height = Math.max(AndroidUtilities.dp(220), AndroidUtilities.displaySize.y - ActionBar.getCurrentActionBarHeight() - AndroidUtilities.dp(128) - (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0));
                emptyLayout.setLayoutParams(layoutParams);
            }
            break;
        default:
            SessionCell sessionCell = (SessionCell) holder.itemView;
            if (position == currentSessionRow) {
                sessionCell.setSession(currentSession, !sessions.isEmpty());
            } else {
                sessionCell.setSession(sessions.get(position - otherSessionsStartRow), position != otherSessionsEndRow - 1);
            }
            break;
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:46,代码来源:SessionsActivity.java


注:本文中的org.telegram.ui.Cells.TextSettingsCell.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。