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


Java CheckedTextView.isChecked方法代码示例

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


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

示例1: deleteSelected

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public void deleteSelected() {
    List<CheckedTextView> selected = new ArrayList<>();
    for (int i = 0; i < flexboxLayout.getChildCount(); i++) {
        CheckedTextView view = (CheckedTextView) flexboxLayout.getChildAt(i);
        if (view.isChecked()) {
            selected.add(view);
            mainActivity.removeSelection(view);
        }
    }
    for (TextView textView : selected) {
        flexboxLayout.removeView(textView);
    }
}
 
开发者ID:StylingAndroid,项目名称:FlexboxLayout,代码行数:14,代码来源:FlexboxLayoutFragment.java

示例2: onClick

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (mainActivity != null && mainActivity.isSelectingItems() && v instanceof CheckedTextView) {
        CheckedTextView textView = (CheckedTextView) v;
        textView.setChecked(!textView.isChecked());
        if (textView.isChecked()) {
            mainActivity.addSelection(textView);
        } else {
            mainActivity.removeSelection(textView);
            if (noItemsSelected()) {
                mainActivity.endItemSelectionMode();
            }
        }
    }
}
 
开发者ID:StylingAndroid,项目名称:FlexboxLayout,代码行数:16,代码来源:FlexboxLayoutFragment.java

示例3: noItemsSelected

import android.widget.CheckedTextView; //导入方法依赖的package包/类
private boolean noItemsSelected() {
    for (int i = 0; i < flexboxLayout.getChildCount(); i++) {
        CheckedTextView child = (CheckedTextView) flexboxLayout.getChildAt(i);
        if (child.isChecked()) {
            return false;
        }
    }
    return true;
}
 
开发者ID:StylingAndroid,项目名称:FlexboxLayout,代码行数:10,代码来源:FlexboxLayoutFragment.java

示例4: isCheckedTextChecked

import android.widget.CheckedTextView; //导入方法依赖的package包/类
/**
 * Checks if a {@link CheckedTextView} with a given text is checked.
 *
 * @param checkedTextView the {@code CheckedTextView} object
 * @param text the text that is expected to be checked
 * @return {@code true} if {@code CheckedTextView} is checked and {@code false} if it is not checked
 */

public boolean isCheckedTextChecked(String text)
{
	CheckedTextView checkedTextView = waiter.waitForText(CheckedTextView.class, text, 0, Timeout.getSmallTimeout(), true);

	if(checkedTextView != null && checkedTextView.isChecked()) {
		return true;
	}
	return false;
}
 
开发者ID:IfengAutomation,项目名称:test_agent_android,代码行数:18,代码来源:Checker.java

示例5: onDrawerClosed

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public void onDrawerClosed(View drawerView) {
    TabType tab = TabType.all;
    for (CheckedTextView navItem : navMainItemList) {
        if (navItem.isChecked()) {
            switch (navItem.getId()) {
                case cn.tomoya.android.md.R.id.btn_nav_all:
                    tab = TabType.all;
                    break;
                case cn.tomoya.android.md.R.id.btn_nav_good:
                    tab = TabType.good;
                    break;
                case cn.tomoya.android.md.R.id.btn_nav_share:
                    tab = TabType.share;
                    break;
                case cn.tomoya.android.md.R.id.btn_nav_ask:
                    tab = TabType.ask;
                    break;
                case cn.tomoya.android.md.R.id.btn_nav_pybbs:
                    tab = TabType.pybbs;
                    break;
                default:
                    throw new AssertionError("Unknow tab.");
            }
            break;
        }
    }
    mainPresenter.switchTab(tab);
}
 
开发者ID:tomoya92,项目名称:pybbsMD,代码行数:30,代码来源:MainActivity.java

示例6: onClick

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    if (!isAdded()) {
        return;
    }

    CheckedTextView ctv = (CheckedTextView) v;
    if (ctv.isChecked()) {
        // already checked. Do nothing
        return;
    }

    int numberOfButtons = mTopPagerContainer.getChildCount();
    int checkedId = -1;
    for (int i = 0; i < numberOfButtons; i++) {
        CheckedTextView currentCheckedTextView = (CheckedTextView)mTopPagerContainer.getChildAt(i);
        if (ctv == currentCheckedTextView) {
            checkedId = i;
            currentCheckedTextView.setChecked(true);
        } else {
            currentCheckedTextView.setChecked(false);
        }
    }

    if (checkedId == -1)
        return;

    mTopPagerSelectedButtonIndex = checkedId;

    TextView entryLabel = (TextView) getView().findViewById(R.id.stats_list_entry_label);
    entryLabel.setText(getEntryLabelResId());
    updateUI();
}
 
开发者ID:ldsddn,项目名称:wordpress_app_android,代码行数:34,代码来源:StatsAbstractListFragment.java

示例7: getUiSelectedSource

import android.widget.CheckedTextView; //导入方法依赖的package包/类
private List<String> getUiSelectedSource() {
	ArrayList<String> results = new ArrayList<String>();
	int n = mSourceContainer.getChildCount();
	for (int i=0;i<n;i++) {
		CheckedTextView tv = (CheckedTextView)mSourceContainer.getChildAt(i);
		if (tv.isChecked()) {
			results.add((String) tv.getText());
		}
	}
	return results;
}
 
开发者ID:R3CONN3R,项目名称:MuzeiWallpaper,代码行数:12,代码来源:SettingsActivity.java

示例8: onListItemClick

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    super.onListItemClick(l, v, position, id);
    CheckedTextView checkedTextView = (CheckedTextView) v.findViewById(R.id.check);
    boolean isChecked = !checkedTextView.isChecked();
    if (isChecked)
        checkedItems.add(position);
    else
        checkedItems.remove((Integer) position);
    checkedTextView.setChecked(isChecked);
}
 
开发者ID:GermainZ,项目名称:Identiconizer,代码行数:12,代码来源:ContactsListActivity.java

示例9: onLongclickfile

import android.widget.CheckedTextView; //导入方法依赖的package包/类
public void onLongclickfile(int position, int fragnum, View item,
		AdapterView<?> parent) {
	CheckedTextView tv = ((Gridviewholder) item.getTag()).filename;
	Gridviewholder holder = ((Gridviewholder) item.getTag());
	if (!tv.isChecked()) {
		selectedfiles.add(holder.associatedfile);
		tv.setChecked(true);
		selectedcount++;
		if (selectedcount == 2) {
			mMode.getMenu().getItem(Consts.INDEX_RENAME).setVisible(false);
			mMode.getMenu().getItem(Consts.INDEX_INFO).setVisible(false);

		}
		if (mMode == null) {
			mMode = startActionMode(getCutCopyCallback());
		}
	} else {
		selectedfiles.remove(holder.associatedfile);
		tv.setChecked(false);
		selectedcount--;
		if (selectedcount == 1) {
			mMode.getMenu().getItem(Consts.INDEX_RENAME).setVisible(true);
			mMode.getMenu().getItem(Consts.INDEX_INFO).setVisible(true);

		}
		if (selectedcount == 0) {
			mMode.finish();
			mMode = null;
		}
	}
}
 
开发者ID:ashmikuz,项目名称:Open-file-manager,代码行数:32,代码来源:MainActivity.java

示例10: getView

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
// create a new ImageView for each item referenced by the Adapter
public View getView(int position, View convertView, ViewGroup parent) {
	Gridviewholder holder;
    if ( convertView == null )
    {
       LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
       convertView = li.inflate(R.layout.grid_item, null); 
       holder=new Gridviewholder();
       holder.filename=(CheckedTextView)convertView.findViewById(R.id.grid_item_text);
       holder.fileicon=(ImageView)convertView.findViewById(R.id.grid_item_image);
       convertView.setTag(holder);
    }
    else
    {
    	holder=(Gridviewholder) convertView.getTag();
    	holder.fileicon.setImageResource(R.drawable.unknownfile);
    }
    holder.rootview=convertView;
    holder.associatedfile=dirfiles[position];
    holder.position=position;
    CheckedTextView tv = holder.filename;
    File current=holder.associatedfile;
    tv.setText(current.getName());
    tv.setChecked(MainActivity.selectedfiles.contains(current));
    loader.loadIcon(holder, position);   
    if(tv.isChecked())
    {
    	convertView.setBackgroundResource(R.color.cyan);
    }
    else
    {
    	convertView.setBackgroundResource(R.color.white);
    }
    
    return convertView;
}
 
开发者ID:ashmikuz,项目名称:Open-file-manager,代码行数:38,代码来源:GridAdapter.java

示例11: onItemClick

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id) {
    final CheckedTextView checkedTextView = (CheckedTextView) view;
    final String ssid = checkedTextView.getText().toString();
    if (checkedTextView.isChecked()) {
        wifiPreferenceUtil.disableKeyguardForNetwork(ssid);
    } else {
        wifiPreferenceUtil.enableKeyguardForNetork(ssid);
    }

    final Intent intent = new Intent(WifiStateReceiver.ACTION_NETWORK_TOGGLED);
    intent.putExtra(WifiStateReceiver.EXTRA_SSID, ssid);
    sendBroadcast(intent);
}
 
开发者ID:birbeck,项目名称:wifikeyguard,代码行数:15,代码来源:MyActivity.java

示例12: onClick

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
	FiltersChangedFlag = true;

	String Tag = (String) v.getTag();
	CheckedTextView ctv = (CheckedTextView)v;
	boolean currState = ctv.isChecked();

	ctv.setChecked(!currState);
	savePreferences(Tag, !currState, "boolean");
}
 
开发者ID:MKLab-ITI,项目名称:ImproveMyCity-Mobile,代码行数:12,代码来源:Fragment_Filters.java

示例13: onListItemClick

import android.widget.CheckedTextView; //导入方法依赖的package包/类
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
    Log.i(LOG_TAG, "onListItemClick");

    CheckedTextView check = (CheckedTextView)v;

    HttpDataModel dm = data.get(position);
    
    switch (dm.getType()) {
    case 0: // dir
        Log.d(LOG_TAG, "Directory");
        String next = dm.getName();
        if (!next.startsWith("http://")) {
            if (currentUrl.charAt(currentUrl.length() - 1) == '/') {
                next = currentUrl + next;
            } else {
                next = currentUrl + "/" + next;
            }
        }
        try {
            new RetreiveURL().execute(next);
        } catch (Exception e) {
            e.printStackTrace();
            return;
        }
        return;
    case 1: // media
        Log.d(LOG_TAG, "Media clicked" + dm.getName());
        if (check.isChecked()) {
            dm.setSelected(true);
        } else {
            dm.setSelected(false);
        }
        break;
    case -1: // invalid
    default:
        Log.d(LOG_TAG, "Invalid");
        check.setChecked(false);
        return;
    
    }
    
    mediaUrls.clear();
    // enable the castButton or not?
    Iterator<HttpDataModel> it1 = data.iterator();
    while (it1.hasNext()) {
        HttpDataModel dm1 = it1.next();
        if (dm1.isSelected()) {
            mediaUrls.add(dm1.getName());
        }
    }
   
    if (mediaUrls.isEmpty()) {
        castButton.setVisibility(View.GONE);
    } else {
        // enable the cast button
        castButton.setVisibility(View.VISIBLE);
    }
}
 
开发者ID:qiushengxy,项目名称:cast-any,代码行数:60,代码来源:HttpActivity.java


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