當前位置: 首頁>>代碼示例>>Java>>正文


Java RadioGroup.check方法代碼示例

本文整理匯總了Java中android.widget.RadioGroup.check方法的典型用法代碼示例。如果您正苦於以下問題:Java RadioGroup.check方法的具體用法?Java RadioGroup.check怎麽用?Java RadioGroup.check使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.RadioGroup的用法示例。


在下文中一共展示了RadioGroup.check方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import android.widget.RadioGroup; //導入方法依賴的package包/類
private void init(Context context) {
    setOrientation(VERTICAL);

    Resources r = context.getResources();
    int pxPadding = (int)TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, r.getDisplayMetrics());

    setPadding(pxPadding, pxPadding, pxPadding, pxPadding);

    LayoutInflater layoutInflater = LayoutInflater.from(context);
    View view = layoutInflater.inflate(R.layout.menu_dialog, this);
    mStreamEditText = (EditText) view.findViewById(R.id.stream_url);
    mResolutionGroup = (RadioGroup)view.findViewById(R.id.resolution);
    mResolutionGroup.check(R.id.resolution_hight);

    mOrientationGroup = (RadioGroup)view.findViewById(R.id.orientation);
    mOrientationGroup.check(R.id.orientation_landscape);
}
 
開發者ID:JunGeges,項目名稱:AliZhiBoHao,代碼行數:18,代碼來源:MenuDialog.java

示例2: onCreateView

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
public View onCreateView(
        final LayoutInflater inflater,
        final @Nullable ViewGroup container,
        final @Nullable Bundle savedInstanceState) {

    final View picker = inflater.inflate(R.layout.fragment_category_picker, container, false);

    categories = (RadioGroup) picker.findViewById(R.id.categories);
    categoryLabel = (TextView) picker.findViewById(R.id.selected_category);

    categories.setOnCheckedChangeListener(new IconPickerWrapper(categoryLabel));
    categories.check(R.id.other);

    return picker;
}
 
開發者ID:PacktPublishing,項目名稱:Hands-On-Android-UI-Development,代碼行數:17,代碼來源:CategoryPickerFragment.java

示例3: onCreateView

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
public View onCreateView(
        final LayoutInflater inflater,
        final @Nullable ViewGroup container,
        final @Nullable Bundle savedInstanceState) {

    final View picker = inflater.inflate(R.layout.fragment_category_picker, container, false);

    categories = (RadioGroup) picker.findViewById(R.id.categories);
    categoryLabel = (TextSwitcher) picker.findViewById(R.id.selected_category);

    categories.setOnCheckedChangeListener(new IconPickerWrapper(categoryLabel));
    categories.check(R.id.other);

    return picker;
}
 
開發者ID:PacktPublishing,項目名稱:Hands-On-Android-UI-Development,代碼行數:17,代碼來源:CategoryPickerFragment.java

示例4: onCreate

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_capture_claim);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    FloatingActionButton attach = (FloatingActionButton) findViewById(R.id.attach);
    attach.setOnClickListener(this);

    selectedDate = new DatePickerWrapper((TextView) findViewById(R.id.date));

    categories = (RadioGroup) findViewById(R.id.categories);
    categories.setOnCheckedChangeListener(
            new IconPickerWrapper((TextView) findViewById(R.id.selected_category))
    );

    categories.check(R.id.other);
}
 
開發者ID:PacktPublishing,項目名稱:Hands-On-Android-UI-Development,代碼行數:22,代碼來源:CaptureClaimActivity.java

示例5: onCheckedChanged

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
    if(group!=null && checkedId!=-1 && changeGroup==false){
        for(int i=0;i<mRdoBtns.length;i++){
            if(checkedId==mRdoBtns[i]){
                mNewValue=mThemes[i];
                group.check(mRdoBtns[i]);
                persistInt(mNewValue);
                getDialog().cancel();
            }
        }
    }
}
 
開發者ID:ifadai,項目名稱:AndroidThemeChange,代碼行數:14,代碼來源:ThemeChoicePreference.java

示例6: onCreate

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.fragment_edit_issue);
    mIssuename = (EditText) findViewById(R.id.IssueName);
    mIssueDesc = (EditText) findViewById(R.id.descriptionTex);
    mPosesrisk = (RadioGroup) findViewById(R.id.risk);
    mImageView = (ImageView) findViewById(R.id.eventView);
    mRisk = false;
    mIssueAdapter = AdapterFactory.getInstance().getIssueAdapter(this);
    Spinner categorySpinner = (Spinner) findViewById(R.id.nameCategorySpinner);
    categorySpinner.setAdapter(new CategorySpinnerAdapter(getApplicationContext(),
            R.layout.text_and_icon_spinner_tem));
    categorySpinner.setSelection(categorySpinner.getCount());
    Intent intent = getIntent();
    Bundle data = intent.getBundleExtra(TAG_ISSUE);
    mIssue = (Issue) data.getSerializable(TAG_ISSUE);
    mIssuename.setText(mIssue.getTitle());
    mIssueDesc.setText(mIssue.getDescription());
    String url = mIssue.getPicture().getMedUrl();
    Glide.with(this).load(url).into(mImageView);
    Category[] categories = Category.values();
    for (int i = 0; i < categories.length; ++i) {
        if (mIssue.getCategory().equals(categories[i])) {
            categorySpinner.setSelection(i);
        }
    }
    if (mIssue.isRisk()) {
        mPosesrisk.check(R.id.yes);
        mRisk = true;
    } else mPosesrisk.check(R.id.no);
    Toolbar toolbar = (Toolbar) findViewById(R.id.create_issue_toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setDisplayShowHomeEnabled(true);
    getSupportActionBar().setTitle(getString(R.string.edit_issue));
    mPosesrisk.setOnCheckedChangeListener(mRadioListener);
    mPictureUpdated = false;
    setupCloseKeyboard(findViewById(android.R.id.content));
}
 
開發者ID:ArnauBlanch,項目名稱:civify-app,代碼行數:41,代碼來源:EditIssueActivity.java

示例7: onCreate

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.dialog_remind_fr);
      /*findViewById(R.id.drf_cancel).setOnClickListener(this);
findViewById(R.id.drf_confirm).setOnClickListener(this);*/
      RadioGroup rg = (RadioGroup) findViewById(R.id.remind_fr_buttons);
      rg.check(map[fr]);
      rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {

          @Override
          public void onCheckedChanged(RadioGroup group, int checkedId) {
              for (int i = 0; i < map.length; i++) {
                  if (map[i] == checkedId) {
                      fr = i;
                      if (onResultListener != null) {
                          onResultListener.onResult(fr);
                      }
                      cancel();
                      return;
                  }
              }
          }
      });
      //取消按鈕點擊監聽
      TextView cancle = (TextView) findViewById(R.id.tv_cancel);
      cancle.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View v) {
              RemindFrDialog.this.cancel();
          }
      });
      ((RadioButton) findViewById(R.id.remind_fr9)).setText(AssistUtils.translateRemindFrequency(9, date));
      ((RadioButton) findViewById(R.id.remind_fr10)).setText(AssistUtils.translateRemindFrequency(10, date));
  }
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:36,代碼來源:RemindFrDialog.java

示例8: onCreate

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_remind_fr);
	intent=getIntent();
	if(intent!=null){
		type=intent.getIntExtra(TYPE, 0);
		date.setTimeInMillis(intent.getLongExtra(DATE, System.currentTimeMillis()));
	}
	RadioGroup rg=(RadioGroup) findViewById(R.id.remind_fr_buttons);
	rg.check(map[type]);
	rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
		
		@Override
		public void onCheckedChanged(RadioGroup group, int checkedId) {
			for(int i=0;i<map.length;i++){
				if(map[i]==checkedId){
					type=i;
					return;
				}
			}
		}
	});
	((RadioButton)findViewById(R.id.remind_fr9)).setText(AssistUtils.translateRemindFrequency(9,date));
	((RadioButton)findViewById(R.id.remind_fr10)).setText(AssistUtils.translateRemindFrequency(10,date));
	findViewById(R.id.arf_back).setOnClickListener(new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			if(intent!=null){
				intent.putExtra(TYPE, type);
				setResult(FOR_FR, intent);
			}
			goBack();
		}
	});
	
}
 
開發者ID:LingjuAI,項目名稱:AssistantBySDK,代碼行數:39,代碼來源:RemindFrSettingActivity.java

示例9: initView

import android.widget.RadioGroup; //導入方法依賴的package包/類
private void initView() {
    mHomeBtn = (RadioButton) findViewById(R.id.home_btn);
    mExploreBtn = (RadioButton) findViewById(R.id.explore_btn);
    mMineBtn = (RadioButton) findViewById(R.id.mine_btn);
    mHomeBtn.setOnClickListener(this);
    mExploreBtn.setOnClickListener(this);
    mMineBtn.setOnClickListener(this);
    mRadioGroup = (RadioGroup) findViewById(R.id.radioGroup);

    mRadioGroup.check(R.id.home_btn);
}
 
開發者ID:AndroidWJC,項目名稱:UnversityFinance,代碼行數:12,代碼來源:MainActivity.java

示例10: onCheckedChanged

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
    if (group != null && checkedId != -1 && changeGroup == false) {
        for (int i = 0; i < mRdoBtns.length; i++) {
            if (checkedId == mRdoBtns[i]) {
                mNewValue = mThemes[i];
                group.check(mRdoBtns[i]);
                persistInt(mNewValue);
                getDialog().cancel();
            }
        }
    }
}
 
開發者ID:paradoxie,項目名稱:DizzyPassword,代碼行數:14,代碼來源:ThemeChoice.java

示例11: onCreateDialog

import android.widget.RadioGroup; //導入方法依賴的package包/類
@NonNull
   @Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
	final LayoutInflater inflater = LayoutInflater.from(getActivity());

	// Read button configuration
	final Bundle args = getArguments();
	final int index = args.getInt(ARG_INDEX);
	final String command = args.getString(ARG_COMMAND);
	final int eol = args.getInt(ARG_EOL);
	final int iconIndex = args.getInt(ARG_ICON_INDEX);
	final boolean active = true; // change to active by default
	mActiveIcon = iconIndex;

	// Create view
	final View view = inflater.inflate(R.layout.feature_uart_dialog_edit, null);
	final EditText field = mField = (EditText) view.findViewById(R.id.field);
	final GridView grid = (GridView) view.findViewById(R.id.grid);
	final CheckBox checkBox = mActiveCheckBox = (CheckBox) view.findViewById(R.id.active);
	checkBox.setOnCheckedChangeListener(new CheckBox.OnCheckedChangeListener() {
		@Override
		public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
			field.setEnabled(isChecked);
			grid.setEnabled(isChecked);
			if (mIconAdapter != null)
				mIconAdapter.notifyDataSetChanged();
		}
	});

	final RadioGroup eolGroup = mEOLGroup = (RadioGroup) view.findViewById(R.id.uart_eol);
	switch (Command.Eol.values()[eol]) {
		case CR_LF:
			eolGroup.check(R.id.uart_eol_cr_lf);
			break;
		case CR:
			eolGroup.check(R.id.uart_eol_cr);
			break;
		case LF:
		default:
			eolGroup.check(R.id.uart_eol_lf);
			break;
	}

	field.setText(command);
	field.setEnabled(active);
	checkBox.setChecked(active);
	grid.setOnItemClickListener(this);
	grid.setEnabled(active);
	grid.setAdapter(mIconAdapter = new IconAdapter());

	// As we want to have some validation we can't user the DialogInterface.OnClickListener as it's always dismissing the dialog.
	final AlertDialog dialog = new AlertDialog.Builder(getActivity()).setCancelable(false).setTitle(R.string.uart_edit_title).setPositiveButton(R.string.ok, null)
			.setNegativeButton(R.string.cancel, null).setView(view).show();
	final Button okButton = dialog.getButton(AlertDialog.BUTTON_POSITIVE);
	okButton.setOnClickListener(this);
	return dialog;
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:58,代碼來源:UARTEditDialog.java

示例12: onCreateView

import android.widget.RadioGroup; //導入方法依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.pay_way,container,false);
    RadioGroup radioGroup = (RadioGroup) view.findViewById(R.id.payway);

    //默認選中支付寶
    radioGroup.check(R.id.paypal);
    savePayway("Paypal");

    radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
            if(checkedId==R.id.paypal){
                savePayway("PayPal");
            }
            else if(checkedId==R.id.alipay){
                savePayway("AliPay");
            }
            else if(checkedId==R.id.wechat){
                savePayway("Wechat Pay");
            }
            else if(checkedId==R.id.credit){
                savePayway("Credit Card");
            }
            else{
                savePayway("Bank Card");
            }
        }
    });
    return view;
}
 
開發者ID:Quick-Tip,項目名稱:Quick-Tip-Consumer,代碼行數:33,代碼來源:PayWay.java

示例13: checkTheme

import android.widget.RadioGroup; //導入方法依賴的package包/類
private void checkTheme(RadioGroup group, int checkedId){
    for(int i=0;i<mRdoBtns.length;i++){
        if(checkedId==mRdoBtns[i]){
            saveTheme(i);
            group.check(mRdoBtns[i]);
            if(getDialog()!=null){
                getDialog().cancel();
            }
            break;
        }
    }
}
 
開發者ID:ifadai,項目名稱:SuperNote,代碼行數:13,代碼來源:ThemeChoicePreference.java


注:本文中的android.widget.RadioGroup.check方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。