本文整理汇总了Java中android.widget.TextView.setSelected方法的典型用法代码示例。如果您正苦于以下问题:Java TextView.setSelected方法的具体用法?Java TextView.setSelected怎么用?Java TextView.setSelected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.TextView
的用法示例。
在下文中一共展示了TextView.setSelected方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.TextView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_animation_new);
tvNewNews = (TextView) findViewById(R.id.tv_bar_news_news);
tvNewNews.setSelected(true);
tvNewNews.setOnClickListener(this);
tvhotNews = (TextView) findViewById(R.id.tv_bar_news_hot);
tvhotNews.setOnClickListener(this);
tvtuiNews = (TextView) findViewById(R.id.tv_bar_news_tui);
tvtuiNews.setOnClickListener(this);
vpNews = (ViewPager) findViewById(R.id.vp_news);
newsFragmentLists = new ArrayList<>();
newNewsFragment = NewsFragment.newNewsFragment(NewsFragment.NEWSNEWS);
hotNewsFragment = NewsFragment.newNewsFragment(NewsFragment.NEWSHOT);
tuiNewsFragment = NewsFragment.newNewsFragment(NewsFragment.NEWSTUI);
newsFragmentLists.add(newNewsFragment);
newsFragmentLists.add(hotNewsFragment);
newsFragmentLists.add(tuiNewsFragment);
newsViewPagerAdapter = new NewsViewPagerAdapter(getSupportFragmentManager(),newsFragmentLists);
vpNews.setAdapter(newsViewPagerAdapter);
vpNews.addOnPageChangeListener(this);
vpNews.setOffscreenPageLimit(3);
}
示例2: initView
import android.widget.TextView; //导入方法依赖的package包/类
public void initView() {
mType = (TextView) activity.findViewById(R.id.rmp_type);
mName = (TextView) activity.findViewById(R.id.rmp_info_name);
// 跑马灯
mName.setSelected(true);
mArts = (TextView) activity.findViewById(R.id.rmp_info_arts);
mRemark = (TextView) activity.findViewById(R.id.rmp_info_remark);
mPlayTime = (TextView) activity.findViewById(R.id.rmp_play_time);
mPlayTimeL = (TextView) activity.findViewById(R.id.rmp_l_time);
mPlayTimeR = (TextView) activity.findViewById(R.id.rmp_r_time);
mShowMore = (TextView) activity.findViewById(R.id.rmp_see_more);
mLine = activity.findViewById(R.id.rmp_line);
mInfoLine = activity.findViewById(R.id.rmp_info_line);
mImage = (ImageView) activity.findViewById(R.id.rmp_image);
mInfoContainer = activity.findViewById(R.id.rmp_info_container);
mContainer = activity.findViewById(R.id.rmp_container);
mShowMore.setOnClickListener(this);
mContainer.setOnClickListener(this);
}
示例3: initSelfViews
import android.widget.TextView; //导入方法依赖的package包/类
private void initSelfViews() {
mAlbum = (ImageView) activity.findViewById(R.id.list_album);
mName = (TextView) activity.findViewById(R.id.list_name);
// 跑马灯
mName.setSelected(true);
mArts = (TextView) activity.findViewById(R.id.list_arts);
mPlay = (PlayView) activity.findViewById(R.id.list_play);
mShowList = (ImageButton) activity.findViewById(R.id.list_list);
mContainer = activity.findViewById(R.id.list_bottom_nav_container);
mProgress = activity.findViewById(R.id.list_progress);
mProgressBG = activity.findViewById(R.id.list_progress_bg);
mContainer.setOnClickListener(this);
mShowList.setOnClickListener(this);
mPlay.setOnClickListener(this);
}
示例4: changeFolder
import android.widget.TextView; //导入方法依赖的package包/类
public void changeFolder(long id) {
KRFAM.log("MainActivity.java > changeFolder");
CURRENT_FOLDER = id;
KRFAM.sharedPreferences.edit().putLong("CURRENT_FOLDER", CURRENT_FOLDER).commit();
CURRENT_OFFSET = 0;
TextView currentFolder_textView = (TextView) findViewById(R.id.folder_currentFolder);
TextView currentCount_textView = (TextView) findViewById(R.id.folder_currentCount);
if (CURRENT_FOLDER == -1) {
getSupportActionBar().setDisplayHomeAsUpEnabled(false);
findViewById(R.id.folder_currentWrapper).setVisibility(View.GONE);
} else {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
findViewById(R.id.folder_currentWrapper).setVisibility(View.VISIBLE);
currentFolder_textView.setText(getPathToFolder(CURRENT_FOLDER));
currentFolder_textView.setSelected(true);
currentCount_textView.setText("" + db.countAccounts(CURRENT_FOLDER, "", false));
}
LinearLayout searchBar = (LinearLayout) findViewById(R.id.view_search);
searchBar.setVisibility(View.GONE);
getCurrentPage();
}
示例5: onCreateView
import android.widget.TextView; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_description, container, false);
mTitleView = (TextView) rootView.findViewById(R.id.title);
mSummaryView = (TextView) rootView.findViewById(R.id.summary);
if (Utils.isTv(getActivity())) {
mSummaryView.setFocusable(true);
} else {
mTitleView.setTextIsSelectable(true);
mSummaryView.setTextIsSelectable(true);
}
mSummaryView.setSelected(true);
mSummaryView.setMovementMethod(LinkMovementMethod.getInstance());
mTitle = getArguments().getCharSequence("title");
mSummary = getArguments().getCharSequence("summary");
refresh();
return rootView;
}
示例6: selectTaskImgAmount
import android.widget.TextView; //导入方法依赖的package包/类
/**
* 选择任务图片数量,并设置相应的TextView背景
*/
@Override
public void selectTaskImgAmount(TextView times_10,TextView times_20,TextView times_30,int task_img_amount) {
initTaskButtonBg(times_10,times_20,times_30);
switch (task_img_amount){
case 10:
times_10.setSelected(true);
times_10.setTextColor(mContext.getResources().getColor(R.color.colorWhite));
break;
case 20:
times_20.setSelected(true);
times_20.setTextColor(mContext.getResources().getColor(R.color.colorWhite));
break;
case 30:
times_30.setSelected(true);
times_30.setTextColor(mContext.getResources().getColor(R.color.colorWhite));
break;
}
}
示例7: getView
import android.widget.TextView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = LayoutInflater.from(context).inflate(R.layout.item_column_item, null);
item_text = (TextView) view.findViewById(R.id.text_item);
String className = getItem(position).getClassname();
item_text.setText(className);
if (isSelected) {
if (position == 0) {
item_text.setEnabled(false);
}
}
if (!isVisible && (position == -1 + optionalList.size())) {
item_text.setText("");
item_text.setSelected(true);
item_text.setEnabled(true);
}
if (remove_position == position) {
item_text.setText("");
}
return view;
}
示例8: getView
import android.widget.TextView; //导入方法依赖的package包/类
@Override
public View getView(final int i, View view, ViewGroup parent) {
if (view == null) {
view = LayoutInflater.from(mContext).inflate(R.layout.adapter_media_quality, parent, false);
}
TextView qualityDesc = (TextView) view.findViewById(R.id.tv_media_quality);
qualityDesc.setText(mDatas.get(i).getDesc());
qualityDesc.setSelected(mDatas.get(i).isSelect());
return view;
}
示例9: viewInitialize
import android.widget.TextView; //导入方法依赖的package包/类
private void viewInitialize()
{
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mainView = inflater.inflate(R.layout.view_music_controller, null);
addView(mainView);
songAlbumImageView = (ImageView) mainView.findViewById(R.id.imageView);
songTitleTextView = (TextView) mainView.findViewById(R.id.titleview);
songTitleTextView.setSelected(true);
songInformationTextView = (TextView) mainView.findViewById(R.id.nameView);
}
示例10: getItemView
import android.widget.TextView; //导入方法依赖的package包/类
private View getItemView(int position){
TextView textView = new TextView(mContext);
textView.setTextAppearance(mContext, R.style.switcher_item_text_style);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
DensityUtil.dip2px(mContext,40));
textView.setLayoutParams(layoutParams);
textView.setSelected(position == mDefaultSelection);
textView.setGravity(Gravity.CENTER);
textView.setText(mAllItemArray.get(position));
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12.0f);
textView.setOnClickListener(mItemOnClickListener);
textView.setTag(position);
return textView;
}
示例11: ViewHolder
import android.widget.TextView; //导入方法依赖的package包/类
public ViewHolder(View itemView) {
super(itemView);
imageView = (CircleImageView) itemView.findViewById(R.id.profile_image);
usernameTextView = (TextView) itemView.findViewById(R.id.username);
usernameTextView.setSelected(true);
}
示例12: initTaskButtonBg
import android.widget.TextView; //导入方法依赖的package包/类
/**
* 将所有图片次数TextView初始化为为选中状态
* @param times_10
* @param times_20
* @param times_30
*/
private void initTaskButtonBg(TextView times_10,TextView times_20,TextView times_30) {
times_10.setSelected(false);
times_10.setTextColor(mContext.getResources().getColor(R.color.colorTheme));
times_20.setSelected(false);
times_20.setTextColor(mContext.getResources().getColor(R.color.colorTheme));
times_30.setSelected(false);
times_30.setTextColor(mContext.getResources().getColor(R.color.colorTheme));
}
示例13: getView
import android.widget.TextView; //导入方法依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View view = LayoutInflater.from(context).inflate(R.layout.item_column_item, null);
item_text = (TextView) view.findViewById(R.id.text_item);
String className = getItem(position).getClassname();
item_text.setText(className);
if (isUser) {
if (position == 0) {
item_text.setEnabled(false);
}
}
if (isChanged && (position == holdPosition) && !isItemShow) {
item_text.setText("");
item_text.setSelected(true);
item_text.setEnabled(true);
isChanged = false;
}
if (!isVisible && (position == -1 + selectedList.size())) {
item_text.setText("");
item_text.setSelected(true);
item_text.setEnabled(true);
}
if (remove_position == position) {
item_text.setText("");
}
return view;
}
示例14: getItemView
import android.widget.TextView; //导入方法依赖的package包/类
private View getItemView(int position){
TextView textView = new TextView(mContext);
textView.setTextAppearance(mContext, R.style.switcher_item_text_style);
LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
DensityUtil.dip2px(mContext, 35));
textView.setLayoutParams(layoutParams);
textView.setSelected(position == mDefaultSelection);
textView.setGravity(Gravity.CENTER);
textView.setText(mAllItemArray.get(position));
textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 12.0f);
textView.setOnClickListener(mItemOnClickListener);
textView.setTag(position);
return textView;
}
示例15: onXPreferenceChanged
import android.widget.TextView; //导入方法依赖的package包/类
public void onXPreferenceChanged(XPreference preference, boolean isChecked)
{
TextView checkbox = preference.getIndicator();
if (onXPreferenceSelected(preference, isChecked) && !isChecked)
{
checkbox.setSelected(true);
}
else
{
checkbox.setSelected(false);
}
}