本文整理匯總了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);
}
}
示例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();
}
}
}
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
}
}
示例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;
}
示例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);
}
示例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");
}
示例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);
}
}