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


Java Spinner类代码示例

本文整理汇总了Java中android.widget.Spinner的典型用法代码示例。如果您正苦于以下问题:Java Spinner类的具体用法?Java Spinner怎么用?Java Spinner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

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

示例1: onDataChange

import android.widget.Spinner; //导入依赖的package包/类
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
    EditText username = (EditText)findViewById(R.id.usernameText);
    name = username.getText().toString();
    EditText password = (EditText)findViewById(R.id.passwordText);
    pass = password.getText().toString();
    Spinner grabAccountType = findViewById(R.id.accountTypeSpinner);
    String accountType = (String) grabAccountType.getSelectedItem();
    if (!(dataSnapshot.child(email).hasChild(name))) {
        if (accountType.equals("Child")) {
            newUser = new User(name, pass, MenuActivity.getManager().nextSerialNumber(), resID);
            manager.setCurrentUserId(newUser.getUserId());
            manager.addRegUser(newUser);
            fbRef.child(email).child("ChoreManager").setValue(manager);
        } else {
            newAdminUser = new AdminUser(name, pass, MenuActivity.getManager().nextSerialNumber(), resID);
            manager.setCurrentUserId(newAdminUser.getUserId());
            manager.addAdminUser(newAdminUser);
            fbRef.child(email).child("ChoreManager").setValue(manager);
        }
    }
   finish();
}
 
开发者ID:TranAlan,项目名称:Chore-Manager-App,代码行数:24,代码来源:NewUserActivity.java


示例2: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.wx_debug_activity);
    textBack = (TextView) findViewById(R.id.text_back);
    textScan = (ImageView) findViewById(R.id.text_scan);
    editHost = (EditText) findViewById(R.id.edit_host);
    editPort = (EditText) findViewById(R.id.edit_port);
    editOpen = (EditText) findViewById(R.id.edit_open);
    cbLocal = (CheckBox) findViewById(R.id.cb_local);
    cbDebugChrome = (CheckBox) findViewById(R.id.cb_debug_chrome);
    cbSRemote = (CheckBox) findViewById(R.id.cb_sRemoteDebugMode);
    btnSave = (Button) findViewById(R.id.btn_save);
    btnReset = (Button) findViewById(R.id.btn_save_reset);
    btnOpen = (Button) findViewById(R.id.btn_open);
    spinner = (Spinner) findViewById(R.id.spinner_log_level);

    textBack.setOnClickListener(this);
    textScan.setOnClickListener(this);
    btnSave.setOnClickListener(this);
    btnReset.setOnClickListener(this);
    btnOpen.setOnClickListener(this);
    setData();
    hideSoftInput();
}
 
开发者ID:weexext,项目名称:ucar-weex-core,代码行数:26,代码来源:WXDebugActivity.java


示例3: onFinishInflate

import android.widget.Spinner; //导入依赖的package包/类
@Override
public void onFinishInflate() {
    super.onFinishInflate();
    mRadioGroup = (RadioGroup) findViewById(R.id.radio_button_group);
    mColorModeButtons.put(Theme.LIGHT,
            initializeAndGetButton(R.id.light_mode, Theme.LIGHT));
    mColorModeButtons.put(Theme.DARK,
            initializeAndGetButton(R.id.dark_mode, Theme.DARK));
    mColorModeButtons.put(Theme.SEPIA,
            initializeAndGetButton(R.id.sepia_mode, Theme.SEPIA));
    mColorModeButtons.get(mDistilledPagePrefs.getTheme()).setChecked(true);

    mFontScaleSeekBar = (SeekBar) findViewById(R.id.font_size);
    mFontScaleTextView = (TextView) findViewById(R.id.font_size_percentage);

    mFontFamilySpinner = (Spinner) findViewById(R.id.font_family);
    initFontFamilySpinner();

    // Setting initial progress on font scale seekbar.
    onChangeFontScaling(mDistilledPagePrefs.getFontScaling());
    mFontScaleSeekBar.setOnSeekBarChangeListener(this);
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:23,代码来源:DistilledPagePrefsView.java


示例4: onCreateView

import android.widget.Spinner; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    log.i("onCreateView");
    View rootView = inflater.inflate(R.layout.fragment_billing, container, false);
    txt_content = (TextView) rootView.findViewById(R.id.txt_content);
    txt_content.setText(this.getClass().getSimpleName());
    bill_type = (Spinner) rootView.findViewById(R.id.bill_type);
    bill_sku = (Spinner) rootView.findViewById(R.id.bill_sku);
    String[] testSkus = getResources().getStringArray(R.array.bill_skus);
    for (String sku : testSkus) {
        mSkuList.add(sku);
    }
    mSkuAdapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, mSkuList);
    mSkuAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    bill_sku.setAdapter(mSkuAdapter);
    return rootView;
}
 
开发者ID:vipycm,项目名称:mao-android,代码行数:18,代码来源:BillingFragment.java


示例5: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActivityManager.getActivityManager().addActivity("RegisterActivity", this);
    setContentView(R.layout.activity_register);

    etName = (EditText) findViewById(R.id.ETname);
    etEmail = (EditText) findViewById(R.id.ETemail);
    spMajor = (Spinner) findViewById(R.id.spiMajor);
    spProvince = (Spinner) findViewById(R.id.spiProvince);

    etPassword = (EditText) findViewById(R.id.ETpassword);
    etConfirmPassword = (EditText) findViewById(R.id.ETconfirmPassword);
    etCheckCode = (EditText) findViewById(R.id.ETCheckCode);
    radioGroup = (RadioGroup) findViewById(R.id.rgGender);


    findViewById(R.id.butRegister).setOnClickListener(this);
    findViewById(R.id.butMailCode).setOnClickListener(this);

}
 
开发者ID:GrayXu,项目名称:HustEating,代码行数:22,代码来源:RegisterActivity.java


示例6: doLookup

import android.widget.Spinner; //导入依赖的package包/类
public void doLookup() {
    setStatusText("initializing");
    Session thisQuestion = new Session();

    //build the question object
    String qname = gettxtQNAMEContent();
    thisQuestion.qname = qname;
    thisQuestion.qtype = gettxtQTYPEContent();
    thisQuestion.flag_RD = ((CheckBox) findViewById(R.id.cbRD)).isChecked();
    thisQuestion.flag_CD = ((CheckBox) findViewById(R.id.cbCD)).isChecked();
    thisQuestion.flag_DO = ((CheckBox) findViewById(R.id.cbDO)).isChecked();
    thisQuestion.qclass = (((Spinner) findViewById(R.id.spinnerCLASS))).getSelectedItem().toString();
    thisQuestion.server = gettxtResolverContent().trim();
    thisQuestion.TCP = ((CheckBox) findViewById(R.id.cbTCP)).isChecked();
    doLookup(thisQuestion);
}
 
开发者ID:gryphius,项目名称:androdns,代码行数:17,代码来源:DNSFormActivity.java


示例7: onFinishInflate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    tvAmountA = (TextView) findViewById(R.id.tvAmountA);
    tvAmountB = (TextView) findViewById(R.id.tvAmountB);
    sCurrencyA = (Spinner) findViewById(R.id.sCurrencyA);
    sCurrencyB = (Spinner) findViewById(R.id.sCurrencyB);

    ArrayAdapter<String> btcAdapter = new ArrayAdapter<String>(getContext(),
            android.R.layout.simple_spinner_item,
            new String[]{"BTC"});
    sCurrencyA.setAdapter(btcAdapter);
    sCurrencyA.setEnabled(false);
    ArrayAdapter<String> xmrAdapter = new ArrayAdapter<String>(getContext(),
            android.R.layout.simple_spinner_item,
            new String[]{"XMR"});
    sCurrencyB.setAdapter(xmrAdapter);
    sCurrencyB.setEnabled(false);
}
 
开发者ID:m2049r,项目名称:xmrwallet,代码行数:20,代码来源:ExchangeBtcTextView.java


示例8: loadCommandSpinner

import android.widget.Spinner; //导入依赖的package包/类
private void loadCommandSpinner(Spinner spinner, Command command) {
	AlertTypeItemSelectedListener listener = new AlertTypeItemSelectedListener(command);
	spinner.setOnItemSelectedListener(listener);
	List<String> list = new ArrayList<String>();
	int defaultPos = 0;
	int pos = 0;
	for (String callableCommand : callableCommandNames) {
		int resourceId = getResources().getIdentifier(callableCommand, "string", getPackageName());
		if (resourceId != 0) {
			list.add(getString(resourceId));
		}
		else {
			list.add(callableCommand);
		}
		if (callableCommand.equals(command.getMethod())) {
			defaultPos = pos;
		}
		pos++;
	}
	ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);
	dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
	spinner.setAdapter(dataAdapter);
	spinner.setSelection(defaultPos);
}
 
开发者ID:masterjc,项目名称:bluewatcher,代码行数:25,代码来源:ControlModeEditorActivity.java


示例9: onInputViewChanged

import android.widget.Spinner; //导入依赖的package包/类
/**
 */
@Override
protected void onInputViewChanged(@NonNull View inputView) {
	super.onInputViewChanged(inputView);
	if (!(inputView instanceof Spinner)) {
		throw new IllegalArgumentException("Only Spinner is allowed as input view for SpinnerLayout. Found(" + inputView + ") instead.");
	}
	this.mSpinner = (Spinner) inputView;
	if (mPrompt != null) {
		mSpinner.setPrompt(mPrompt);
	}
	if (mAdapter != null) {
		mSpinner.setAdapter(mAdapter);
		mSpinner.setSelection(mSelection, false);
		mSpinner.setOnItemSelectedListener(ITEM_SELECTED_LISTENER);
		this.updatePrivateFlags(PFLAG_ITEM_SELECTED_LISTENER_ATTACHED, true);
	}
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:20,代码来源:SpinnerLayout.java


示例10: setupViews

import android.widget.Spinner; //导入依赖的package包/类
private void setupViews() {
    textInput_Code_user     = (TextInputLayout) findViewById(R.id.textInput_Code_user);
    textInput_FullName      = (TextInputLayout) findViewById(R.id.textInput_FullName);
    textInput_TelUsr        = (TextInputLayout) findViewById(R.id.textInput_TelUsr);
    textInput_AdrUsr        = (TextInputLayout) findViewById(R.id.textInput_AdrUsr);
    textView_Password1      = (TextInputLayout) findViewById(R.id.textView_Password1);
    textView_Password2      = (TextInputLayout) findViewById(R.id.textView_Password2);
    spinner_branch          = (Spinner) findViewById(R.id.spinner_branch);

    Button button_register = (Button) findViewById(R.id.button_ajouter);

    button_register.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if(!checkFields())
                Toast.makeText(RegisterActivity.this, "Erreur", Toast.LENGTH_SHORT).show();
            else
                Register();
        }
    });
}
 
开发者ID:ayounes3333,项目名称:GSB-2017-Android,代码行数:22,代码来源:RegisterActivity.java


示例11: getTeamObjects

import android.widget.Spinner; //导入依赖的package包/类
private void getTeamObjects(){
    mTeamManager = new TeamManager();
    mTeamManager.getTeams(new IGetTeamsListener() {
        @Override
        public void onGetTeams(List<Team> retrievedTeams) {
            teamNames = new ArrayList<>();
            teamIDS = new ArrayList<>();
            team_spinner = (Spinner) findViewById(R.id.team_spinner);
            theTeams = retrievedTeams;
            createTeamSpinner();
        }

        @Override
        public void onFailedTeams() {
            Toast.makeText(context, "Unable to retrieve teams.",Toast.LENGTH_LONG).show();
        }
    });
}
 
开发者ID:panzerama,项目名称:Dispatch,代码行数:19,代码来源:ShiftStartActivity.java


示例12: setNumberType

import android.widget.Spinner; //导入依赖的package包/类
private void setNumberType(View row, int type) {
    int position = 0;
    switch (type) {
        case ContactNumber.TYPE_CONTAINS:
            position = 1;
            break;
        case ContactNumber.TYPE_STARTS:
            position = 2;
            break;
        case ContactNumber.TYPE_ENDS:
            position = 3;
            break;
    }
    Spinner numberTypeSpinner = (Spinner) row.findViewById(R.id.spinner_number_type);
    numberTypeSpinner.setSelection(position);
}
 
开发者ID:kaliturin,项目名称:BlackList,代码行数:17,代码来源:AddOrEditContactFragment.java


示例13: buildPaymentRequest

import android.widget.Spinner; //导入依赖的package包/类
@NonNull
private PaymentSetupRequest buildPaymentRequest(final View view) throws ParseException {
    Log.v(TAG, "buildPaymentRequest()");
    PaymentSetupRequest paymentSetupRequest = new PaymentSetupRequest();
    paymentSetupRequest.setMerchantAccount(((EditText) view.findViewById(R.id.merchantAccountEntry)).getText()
            .toString());
    final String amountValueString = ((EditText) view.findViewById(R.id.orderAmountEntry)).getText().toString();
    final String amountCurrencyString = ((EditText) view.findViewById(R.id.orderCurrencyEntry))
            .getText().toString();

    paymentSetupRequest.setAmount(new Amount(AmountUtil.parseMajorAmount(amountCurrencyString, amountValueString),
            amountCurrencyString));
    paymentSetupRequest.setCountryCode(((EditText) view.findViewById(R.id.countryEntry)).getText().toString());
    paymentSetupRequest.setShopperLocale(((EditText) view.findViewById(R.id.shopperLocaleEntry)).getText().toString());
    paymentSetupRequest.setShopperReference(((EditText) view.findViewById(R.id.shopperReferenceEntry)).getText()
            .toString());
    paymentSetupRequest.setReference(((EditText) view.findViewById(R.id.referenceEntry)).getText()
            .toString());
    String maxNumberOfInstallments = ((String) ((Spinner) view.findViewById(R.id.installmentsEntry)).getSelectedItem());
    paymentSetupRequest.setMaxNumberOfInstallments(maxNumberOfInstallments);

    return paymentSetupRequest;
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:24,代码来源:PaymentDataEntryFragment.java


示例14: editIssue

import android.widget.Spinner; //导入依赖的package包/类
private void editIssue(View v) {
    int categoryId = ((Spinner) findViewById(R.id.nameCategorySpinner))
            .getSelectedItemPosition();
    final View vi = v;
    mCategory = Category.values()[categoryId];

    mIssueAdapter.editIssue(mIssue.getIssueAuthToken(), getUpdatedFields(),
            new IssueSimpleCallback() {
                @Override
                public void onSuccess(Issue issue) {

                    Intent intent = new Intent();
                    Bundle data = new Bundle();
                    data.putSerializable(TAG_ISSUE, issue);
                    intent.putExtra(TAG_ISSUE, data);
                    setResult(RESULT_OK, intent);
                    finish();
                }

                @Override
                public void onFailure() {
                    Snackbar.make(vi, R.string.couldnt_edit_issue, Snackbar.LENGTH_SHORT)
                            .show();
                }
            });
}
 
开发者ID:ArnauBlanch,项目名称:civify-app,代码行数:27,代码来源:EditIssueActivity.java


示例15: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_play_movie);

    mTextureView = (TextureView) findViewById(R.id.movie_texture_view);
    mTextureView.setSurfaceTextureListener(this);

    // Populate file-selection spinner.
    Spinner spinner = (Spinner) findViewById(R.id.playMovieFile_spinner);
    // Need to create one of these fancy ArrayAdapter thingies, and specify the generic layout
    // for the widget itself.
    mMovieFiles = MiscUtils.getFiles(getFilesDir(), "*.mp4");
    ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
            android.R.layout.simple_spinner_item, mMovieFiles);
    adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    // Apply the adapter to the spinner.
    spinner.setAdapter(adapter);
    spinner.setOnItemSelectedListener(this);

    updateControls();
}
 
开发者ID:AndyZhu1991,项目名称:grafika,代码行数:23,代码来源:PlayMovieActivity.java


示例16: initUI

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void initUI() {
    mContext = this;
    mBtnGetReport = (Button) findViewById(R.id.btn_get_reports);
    chartContainer = (LinearLayout) findViewById(R.id.report_chart_view_container);
    reportContainer = (LinearLayout) findViewById(R.id.report_container);
    deviceMessage = (TextView) findViewById(R.id.device_message);
    mTvToDate = (TextView) findViewById(R.id.btn_to);
    //deviceNameText = (TextView) findViewById(R.id.deviceName);
    mDeviceSpin = (Spinner) findViewById(R.id.device_spin);
    mDataSpin = (Spinner) findViewById(R.id.data_spin);
    mllGetReport = (LinearLayout) findViewById(R.id.btn_get_reports_ll);
    mTvToDate.setOnClickListener(this);
    mllGetReport.setOnClickListener(this);
    mBtnGetReport.setOnClickListener(this);
    mDeviceSpin.setOnItemSelectedListener(this);
    mDataSpin.setOnItemSelectedListener(this);
}
 
开发者ID:Welloculus,项目名称:MobileAppForPatient,代码行数:19,代码来源:ReportsActivity.java


示例17: onBindDialogView

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onBindDialogView(View view) {
    super.onBindDialogView(view);

    mEnabledCheckbox = (CheckBox) view.findViewById(R.id.increasing_ring);
    mEnabledCheckbox.setOnCheckedChangeListener(this);

    mMinVolumeTitle = (TextView) view.findViewById(R.id.increasing_ring_min_volume_title);

    mMinVolumeSeekBar = (SeekBar) view.findViewById(R.id.seekbar);
    AudioManager am = (AudioManager) getContext().getSystemService(Context.AUDIO_SERVICE);
    mMinVolumeSeekBar.setSecondaryProgress(am.getStreamVolume(AudioManager.STREAM_RING));

    mRingVolumeNotice = (TextView) view.findViewById(R.id.increasing_ring_volume_notice);

    mIntervalTitle = (TextView) view.findViewById(R.id.increasing_ring_ramp_up_duration_title);
    mInterval = (Spinner) view.findViewById(R.id.increasing_ring_ramp_up_duration);
    mIntervalValues = getContext().getResources().getIntArray(R.array.increasing_ring_ramp_up_duration_values);

    getConfig();
    updateVolumeNoticeVisibility(mMinVolumeSeekBar.getProgress());
    updateEnabledStates();
}
 
开发者ID:WrBug,项目名称:GravityBox,代码行数:24,代码来源:IncreasingRingPreference.java


示例18: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_add_habit_event);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
//        IOManager.initManager(this.getApplicationContext());
//        ActivityCompat.requestPermissions(this,
//                new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION},
//                REQUEST_LOCATION);


        spinner = (Spinner) findViewById(R.id.habitTypeSpinner);
        eventTitle = (EditText) findViewById(R.id.eventTitle);
        eventComment = (EditText) findViewById(R.id.eventComment);
        photoImageButton = (ImageButton) findViewById(R.id.imageButtonPhoto);
        initListeners();
    }
 
开发者ID:CMPUT301F17T23,项目名称:routineKeen,代码行数:18,代码来源:AddHabitEvent.java


示例19: inject

import android.widget.Spinner; //导入依赖的package包/类
public void inject(Finder finder, T target, Object source) {
    target.lineChart = (LineChartView) finder.castView((View) finder.findRequiredView(source,
            R.id.linechart, "field 'lineChart'"), R.id.linechart, "field 'lineChart'");
    target.rg_weight = (RadioGroup) finder.castView((View) finder.findRequiredView(source, R
            .id.rg_weight, "field 'rg_weight'"), R.id.rg_weight, "field 'rg_weight'");
    target.spinner = (Spinner) finder.castView((View) finder.findRequiredView(source, R.id
            .spinner, "field 'spinner'"), R.id.spinner, "field 'spinner'");
    target.ll_content = (LinearLayout) finder.castView((View) finder.findRequiredView(source,
            R.id.ll_content, "field 'll_content'"), R.id.ll_content, "field 'll_content'");
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:MeasureCurveActivity$$ViewInjector.java


示例20: setSpinnerPosition

import android.widget.Spinner; //导入依赖的package包/类
private static void setSpinnerPosition(final Spinner spinner, final Object itemToSelect) {
    final SpinnerAdapter adapter = spinner.getAdapter();
    final int count = adapter.getCount();
    for (int i = 0; i < count; i++) {
        final Object item = spinner.getItemAtPosition(i);
        if (item.equals(itemToSelect)) {
            spinner.setSelection(i);
            return;
        }
    }
}
 
开发者ID:sergeychilingaryan,项目名称:AOSP-Kayboard-7.1.2,代码行数:12,代码来源:CustomInputStylePreference.java


示例21: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_banner_style);
    banner = (Banner) findViewById(R.id.banner);
    spinnerStyle = (Spinner) findViewById(R.id.spinnerStyle);
    spinnerStyle.setOnItemSelectedListener(this);

    //默认是CIRCLE_INDICATOR
    banner.setImages(App.images)
            .setBannerTitles(App.titles)
            .setBannerStyle(BannerConfig.NOT_INDICATOR)
            .setImageLoader(new GlideImageLoader())
            .start();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:BannerStyleActivity.java


示例22: startClick

import android.widget.Spinner; //导入依赖的package包/类
public void startClick(View v) {
    TestParams params = new TestParams();
    Spinner spinnerThread = (Spinner) findViewById(R.id.spinnerThread);
    String threadModeStr = spinnerThread.getSelectedItem().toString();
    ThreadMode threadMode = ThreadMode.valueOf(threadModeStr);
    params.setThreadMode(threadMode);

    params.setEventInheritance(((CheckBox) findViewById(R.id.checkBoxEventBusEventHierarchy)).isChecked());
    params.setIgnoreGeneratedIndex(((CheckBox) findViewById(R.id.checkBoxEventBusIgnoreGeneratedIndex)).isChecked());

    EditText editTextEvent = (EditText) findViewById(R.id.editTextEvent);
    params.setEventCount(Integer.parseInt(editTextEvent.getText().toString()));

    EditText editTextSubscriber = (EditText) findViewById(R.id.editTextSubscribe);
    params.setSubscriberCount(Integer.parseInt(editTextSubscriber.getText().toString()));

    Spinner spinnerTestToRun = (Spinner) findViewById(R.id.spinnerTestToRun);
    int testPos = spinnerTestToRun.getSelectedItemPosition();
    params.setTestNumber(testPos + 1);
    ArrayList<Class<? extends Test>> testClasses = initTestClasses(testPos);
    params.setTestClasses(testClasses);

    Intent intent = new Intent();
    intent.setClass(this, TestRunnerActivity.class);
    intent.putExtra("params", params);
    startActivity(intent);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:28,代码来源:TestSetupActivity.java


示例23: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    mLoader = (ButtonProgressBar) findViewById(R.id.cl_main);
    mLoaderTypeSp = (Spinner) findViewById(R.id.sp_select_type);
    init();
}
 
开发者ID:ishaan1995,项目名称:ButtonProgressBar,代码行数:9,代码来源:MainActivity.java


示例24: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_loadmore);
    toolbar = (Toolbar) findViewById(R.id.tool_bar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayShowTitleEnabled(false);
    ultimateRecyclerView = (UltimateRecyclerView) findViewById(R.id.ultimate_recycler_view);
    doURV(ultimateRecyclerView);
    bButtons();
    ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1);
    setupSpinnerSelection((Spinner) findViewById(R.id.spinner), spinnerAdapter);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:BasicFunctions.java


示例25: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	setContentView(R.layout.act_colors);

	mColorScheme = HostDatabase.DEFAULT_COLOR_SCHEME;

	mHostDb = HostDatabase.get(this);

	mColorList = mHostDb.getColorsForScheme(mColorScheme);
	mDefaultColors = mHostDb.getDefaultColorsForScheme(mColorScheme);

	mColorGrid = (GridView) findViewById(R.id.color_grid);
	mColorGrid.setAdapter(new ColorsAdapter(true));
	mColorGrid.setOnItemClickListener(this);
	mColorGrid.setSelection(0);

	mFgSpinner = (Spinner) findViewById(R.id.fg);
	mFgSpinner.setAdapter(new ColorsAdapter(false, R.string.colors_fg_label));
	mFgSpinner.setSelection(mDefaultColors[0]);
	mFgSpinner.setOnItemSelectedListener(this);

	mBgSpinner = (Spinner) findViewById(R.id.bg);
	mBgSpinner.setAdapter(new ColorsAdapter(false, R.string.color_bg_label));
	mBgSpinner.setSelection(mDefaultColors[1]);
	mBgSpinner.setOnItemSelectedListener(this);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:29,代码来源:ColorsActivity.java


示例26: TemplateListAdapter

import android.widget.Spinner; //导入依赖的package包/类
public TemplateListAdapter(Context context, View view, int resource) {
	mView = view;
	mSpinner = (Spinner) view.findViewById(R.id.spTemplate);

	// Get restriction categories
	TreeMap<String, String> tmRestriction = PrivacyManager.getRestrictions(context);
	listRestrictionName = new ArrayList<String>(tmRestriction.values());
	listLocalizedTitle = new ArrayList<String>(tmRestriction.navigableKeySet());

	int userId = Util.getUserId(Process.myUid());
	ondemand = PrivacyManager.getSettingBool(userId, PrivacyManager.cSettingOnDemand, true);
	version = new Version(Util.getSelfVersionName(context));
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:14,代码来源:ActivityMain.java


示例27: onViewCreated

import android.widget.Spinner; //导入依赖的package包/类
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {

  // Get the animation container
  final ImageView imageView = (ImageView) view.findViewById(R.id.animation_container);

  mFrameInformationContainer = (LinearLayout) view.findViewById(R.id.frame_information);

  mAnimatedDrawable = new AnimatedDrawable2();
  mAnimatedDrawable.setDrawListener(new AnimatedDrawable2DebugDrawListener());

  view.findViewById(R.id.invalidate_button).setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      imageView.invalidate();
    }
  });

  mAnimationControlsManager = new AnimationControlsManager(
      mAnimatedDrawable,
      (SeekBar) getView().findViewById(R.id.seekbar),
      (ToggleButton) getView().findViewById(R.id.playpause),
      getView().findViewById(R.id.reset));

  new BitmapAnimationCacheSelectorConfigurator(
      (Spinner) view.findViewById(R.id.spinner),
      mBitmapFrameCacheChangedListener,
      mFrameCacheListener);

  imageView.setImageDrawable(mAnimatedDrawable);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:32,代码来源:BitmapAnimationDebugFragment.java


示例28: fillFret

import android.widget.Spinner; //导入依赖的package包/类
public void fillFret(View view, TGNote note) {
	int selection = 0;
	if( note != null ) {
		selection = (note.getEffect().isGrace() ? note.getEffect().getGrace().getFret() : note.getValue());
	}
	
	ArrayAdapter<TGSelectableItem> adapter = new ArrayAdapter<TGSelectableItem>(getActivity(), android.R.layout.simple_spinner_item, createFretValues());
	
	Spinner spinner = (Spinner) view.findViewById(R.id.grace_dlg_fret_value);
	spinner.setAdapter(adapter);
	spinner.setSelection(adapter.getPosition(new TGSelectableItem(Integer.valueOf(selection), null)));
}
 
开发者ID:axlecho,项目名称:tuxguitar,代码行数:13,代码来源:TGGraceDialog.java


示例29: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    TextView versionInfoTextView = (TextView) findViewById(R.id.VersionInfoTextView);
    String info = "版本号:" + getVersionDescription() + ",编译时间:" + getBuildTimeDescription();
    versionInfoTextView.setText(info);

    mPreviewSizeRatioSpinner = (Spinner) findViewById(R.id.PreviewSizeRatioSpinner);
    mPreviewSizeLevelSpinner = (Spinner) findViewById(R.id.PreviewSizeLevelSpinner);
    mEncodingModeLevelSpinner = (Spinner) findViewById(R.id.EncodingModeLevelSpinner);
    mEncodingSizeLevelSpinner = (Spinner) findViewById(R.id.EncodingSizeLevelSpinner);
    mEncodingBitrateLevelSpinner = (Spinner) findViewById(R.id.EncodingBitrateLevelSpinner);

    ArrayAdapter<String> adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.PREVIEW_SIZE_RATIO_TIPS_ARRAY);
    mPreviewSizeRatioSpinner.setAdapter(adapter);

    adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.PREVIEW_SIZE_LEVEL_TIPS_ARRAY);
    mPreviewSizeLevelSpinner.setAdapter(adapter);
    mPreviewSizeLevelSpinner.setSelection(3);

    adapter= new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_MODE_LEVEL_TIPS_ARRAY);
    mEncodingModeLevelSpinner.setAdapter(adapter);
    mEncodingModeLevelSpinner.setSelection(0);

    adapter= new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_SIZE_LEVEL_TIPS_ARRAY);
    mEncodingSizeLevelSpinner.setAdapter(adapter);
    mEncodingSizeLevelSpinner.setSelection(7);

    adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, RecordSettings.ENCODING_BITRATE_LEVEL_TIPS_ARRAY);
    mEncodingBitrateLevelSpinner.setAdapter(adapter);
    mEncodingBitrateLevelSpinner.setSelection(2);
}
 
开发者ID:pili-engineering,项目名称:PLDroidShortVideo,代码行数:35,代码来源:MainActivity.java


示例30: log

import android.widget.Spinner; //导入依赖的package包/类
private void log(int number, Spinner typeSpinner) {
    String type = typeSpinner.getSelectedItem().toString();
    String logType = (String)type.toLowerCase().subSequence(0, 1);
    switch(logType){
        case "Error": logType = "e";
        case "Debug": logType = "d";
        case "Info": logType = "i";
        case "Verbose": logType = "v";
        case "Warning": logType = "w";
        default: logType = "d";
    }
    try {
        Method method = Log.class.getMethod(logType, String.class, String.class);

        long startTime = System.currentTimeMillis();
        for(int i = 1; i < number; i++) {
            method.invoke(Log.class, "TestApp", "This is a log message: " + i);
        }
        long endTime = System.currentTimeMillis();

        String message = "Logging " + number + " messages took " + (endTime - startTime) + " Milliseconds";

        Log.i("TestApp", message);
        Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
    } catch(Exception e) {
        Log.e("TestApp", "Exception:", e);
    }
}
 
开发者ID:ISNIT0,项目名称:AndroidCrashDummy,代码行数:29,代码来源:MainActivity.java


示例31: getEditorTextField

import android.widget.Spinner; //导入依赖的package包/类
/** @return The validatable item for the given view. */
private EditorFieldView getEditorTextField(View v) {
    if (v instanceof TextView && v.getParent() != null
            && v.getParent() instanceof EditorFieldView) {
        return (EditorFieldView) v.getParent();
    } else if (v instanceof Spinner && v.getTag() != null) {
        return (EditorFieldView) v.getTag();
    } else {
        return null;
    }
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:12,代码来源:EditorView.java


示例32: onItemSelected

import android.widget.Spinner; //导入依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
    Spinner spinner = (Spinner) parent;
    final int filterNum = spinner.getSelectedItemPosition();

    Log.d(TAG, "onItemSelected: " + filterNum);
    mGLView.queueEvent(new Runnable() {
        @Override public void run() {
            // notify the renderer that we want to change the encoder's state
            mRenderer.changeFilterMode(filterNum);
        }
    });
}
 
开发者ID:AndyZhu1991,项目名称:grafika,代码行数:14,代码来源:CameraCaptureActivity.java


示例33: onCreate

import android.widget.Spinner; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_main);
	findViewById(R.id.slice_upload_json).setOnClickListener(this);
	findViewById(R.id.upload_normal_json).setOnClickListener(this);
	Button mSliceUploadButton = (Button) findViewById(R.id.slice_upload);
	mSliceUploadButton.setOnClickListener(this);
	Button mCancelRequestButton = (Button) findViewById(R.id.cancel_requests);
	mCancelRequestButton.setOnClickListener(this);
	Button mGenerateFilesButton = (Button) findViewById(R.id.generate_files);
	mGenerateFilesButton.setOnClickListener(this);
	Button mUploadNormalButton = (Button) findViewById(R.id.upload_normal);
	mUploadNormalButton.setOnClickListener(this);
	findViewById(R.id.multi_upload_normal).setOnClickListener(this);
	Button clearFileBtn = (Button) findViewById(R.id.clear_files_btn);
	clearFileBtn.setOnClickListener(this);

	mBaseUrlEt = (EditText) findViewById(R.id.baseurl_et);
	mTokenEt = (EditText) findViewById(R.id.token_et);
	mKeyEt = (EditText) findViewById(R.id.keyname_et);
	mFilenameEt = (EditText) findViewById(R.id.filename_et);
	mMimeTypeEt = (EditText) findViewById(R.id.mimetype_et);
	mSliceEt = (EditText) findViewById(R.id.slice_size_et);
	mBlockEt = (EditText) findViewById(R.id.block_size_et);
	mDisplayTv = (TextView) findViewById(R.id.display_tv);

	mDisplaySv = (ScrollView) findViewById(R.id.display_scrollview);

	mFileSizeSp = (Spinner) findViewById(R.id.file_size_sp);
	setSpAdapter();
	init();

}
 
开发者ID:Wangsu-Cloud-Storage,项目名称:wcs-android-sdk,代码行数:35,代码来源:MainActivity.java


示例34: initViewsDialogNew

import android.widget.Spinner; //导入依赖的package包/类
void initViewsDialogNew(View v) {
    ServerDatabaseHandler dbHandler = ServerDatabaseHandler.getInstance(getActivity());

    if (dbHandler.isThereAnyCertificatesInDatabase()){
        certificateSpinner = (Spinner) v.findViewById(R.id.certificateSpinner);
        List<CertificateSpinnerItem> spinnerList = dbHandler.getSpinnerList();
        spinnerList.add(0, new CertificateSpinnerItem(){
            @Override
            public String toString(){
                return getString(R.string.spinner_choose_certificate);
            }
        });
        pairingInfoTextView.setVisibility(View.GONE);
        initiatePairingButton.setText(R.string.dialog_pairing_button_text_or);
        ArrayAdapter<CertificateSpinnerItem> spinnerArrayAdapter = new ArrayAdapter<>(
                getActivity().getApplicationContext(),
                R.layout.dialog_certificate_spinner_textview,
                spinnerList);
        spinnerArrayAdapter.setDropDownViewResource(R.layout.dialog_certificate_spinner_dropdown_textview);
        certificateSpinner.setAdapter(spinnerArrayAdapter);
        certificateSpinner.getBackground().setColorFilter(getResources().getColor(R.color.colorAccent), PorterDuff.Mode.SRC_ATOP);
        certificateSpinner.setOnTouchListener(this);
        certificateSpinner.setOnItemSelectedListener(this);
    } else {
        v.findViewById(R.id.certificateSpinner).setVisibility(View.GONE);
    }

    v.findViewById(R.id.deleteServerBtn).setVisibility(View.INVISIBLE);

    dbHandler.close();
}
 
开发者ID:rootkiwi,项目名称:an2linuxclient,代码行数:32,代码来源:ServerDialog.java


示例35: setupSpinner

import android.widget.Spinner; //导入依赖的package包/类
private void setupSpinner() {
    Spinner spinner = findViewById(R.id.spinner);
    spinner.setOnItemSelectedListener(mMainItemSelected);

    List<String> categories = new ArrayList<>();

    categories.add("All");
    categories.add("Photos");
    categories.add("Videos");


    ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, categories);
    dataAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinner.setAdapter(dataAdapter);

    Spinner spinnerFilter = findViewById(R.id.spinnerFilter);
    spinnerFilter.setOnItemSelectedListener(mFilterItemSelected);

    List<String> filter = new ArrayList<>();

    filter.add("CLUSTER BY ALBUM");
    filter.add("CLUSTER BY TIME");
    filter.add("CLUSTER BY LOCATION");
    filter.add("CLUSTER BY TAG");
    filter.add("CLUSTER BY SIZE");
    filter.add("CLUSTER BY FACE");


    ArrayAdapter<String> dataAdapterFilter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, filter);
    dataAdapterFilter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinnerFilter.setAdapter(dataAdapterFilter);

}
 
开发者ID:mayurkaul,项目名称:medialibrary,代码行数:34,代码来源:AlbumActivity.java


示例36: onViewCreated

import android.widget.Spinner; //导入依赖的package包/类
@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
	super.onViewCreated(view, savedInstanceState);
	final Spinner spinnerTimer = (Spinner) view.findViewById(R.id.fragment_components_menus_spinner_timer);
	final Spinner spinnerWhen = (Spinner) view.findViewById(R.id.fragment_components_menus_spinner_when);
	final Spinner spinnerColors = (Spinner) view.findViewById(R.id.fragment_components_menus_spinner_colors);
	final SpinnerLayout spinnerLayoutTimer = (SpinnerLayout) view.findViewById(R.id.fragment_components_menus_spinner_layout_timer);
	final SpinnerLayout sSpinnerLayoutWhen = (SpinnerLayout) view.findViewById(R.id.fragment_components_menus_spinner_layout_when);
	final SpinnerLayout spinnerLayoutColors = (SpinnerLayout) view.findViewById(R.id.fragment_components_menus_spinner_layout_colors);
	final SpinnerLayout spinnerLayoutColorsDisabled = (SpinnerLayout) view.findViewById(R.id.fragment_components_menus_spinner_layout_colors_disabled);

	final Context context = getActivity();
	spinnerTimer.setAdapter(new TimerAdapter(context));
	spinnerTimer.setSelection(2, false);
	spinnerTimer.setOnItemSelectedListener(this);

	spinnerWhen.setAdapter(new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, WHEN));
	spinnerWhen.setSelection(0, false);
	spinnerWhen.setOnItemSelectedListener(this);

	spinnerColors.setAdapter(new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, COLORS));
	spinnerColors.setSelection(0, false);
	spinnerColors.setOnItemSelectedListener(this);

	spinnerLayoutTimer.setAdapter(new TimerAdapter(context));
	spinnerLayoutTimer.setSelection(2, false);
	spinnerLayoutTimer.setOnItemSelectedListener(this);

	sSpinnerLayoutWhen.setAdapter(new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, WHEN));
	sSpinnerLayoutWhen.setOnItemSelectedListener(this);

	spinnerLayoutColors.setAdapter(new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, COLORS));
	spinnerLayoutColors.setOnItemSelectedListener(this);

	spinnerLayoutColorsDisabled.setAdapter(new ArrayAdapter<>(context, android.R.layout.simple_list_item_1, COLORS));
}
 
开发者ID:universum-studios,项目名称:android_ui,代码行数:37,代码来源:MenusFragment.java


示例37: isValid

import android.widget.Spinner; //导入依赖的package包/类
private boolean isValid() {
	boolean ret = true;
	int max = scrollView.getChildCount();
	for (int i = 0; i < max; i++) {
		Spinner spiner = (Spinner) scrollView.getChildAt(i);
		if (spiner.getSelectedItem() == null) {
			ret = false;
		}
	}
	return ret;
}
 
开发者ID:eduyayo,项目名称:gamesboard,代码行数:12,代码来源:NewGameActivity.java


示例38: getTimeSpanAmount

import android.widget.Spinner; //导入依赖的package包/类
public int getTimeSpanAmount()
{
	Spinner timeSpanSpinner = (Spinner) dialog.findViewById(R.id.timeSpanSpinner);

	if (timeSpanSpinner == null)
	{
		return -1;
	}

	Editable text = timeSpanEditText.getText();

	String timeSpanAmountString = null;

	if (text != null)
	{
		timeSpanAmountString = text.toString();
	}

	int timeSpanAmount = 0;

	if (timeSpanAmountString != null && !"".equals(timeSpanAmountString))
	{
		timeSpanAmount = Integer.parseInt(timeSpanAmountString);
	}

	return timeSpanAmount;
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:28,代码来源:TimeSpanPicker.java


示例39: restorePreferences

import android.widget.Spinner; //导入依赖的package包/类
public void restorePreferences(Activity activity, SharedPreferences preferences) {
      Spinner decimals = (Spinner)activity.findViewById(R.id.spinnerDecimals);
      Spinner decimalSeparators = (Spinner)activity.findViewById(R.id.spinnerDecimalSeparators);
      Spinner groupSeparators = (Spinner)activity.findViewById(R.id.spinnerGroupSeparators);
decimals.setSelection(preferences.getInt(prefix(EXPORT_DECIMALS), 0));
decimalSeparators.setSelection(preferences.getInt(prefix(EXPORT_DECIMAL_SEPARATOR), 0));
groupSeparators.setSelection(preferences.getInt(prefix(EXPORT_GROUP_SEPARATOR), 3));
  }
 
开发者ID:tiberiusteng,项目名称:financisto1-holo,代码行数:9,代码来源:CurrencyExportPreferences.java


示例40: populateClientSpinner

import android.widget.Spinner; //导入依赖的package包/类
public static void populateClientSpinner(final Context context, final Spinner spinnerClients , final CompositeDisposable compositeDisposable) {
    ClientsNetworkCalls.getAllClients().subscribe(new Observer<List<Client>>() {
        @Override
        public void onSubscribe(Disposable d) {
            compositeDisposable.add(d);
        }

        @Override
        public void onNext(List<Client> value) {
            ArrayList<String> date = new ArrayList<>();
            for (Client client : value) {
                date.add(String.valueOf(client.getNameClt()));
            }
            ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, date);
            spinnerClients.setAdapter(adapter);
        }

        @Override
        public void onError(Throwable e) {
            Log.e("Get Clients" , "Error getting clients" , e);
            if(e instanceof SocketException || e instanceof IOException) {
                Toast.makeText(context , R.string.no_internet , Toast.LENGTH_SHORT).show();
            } else if (e instanceof Exception) {
                Toast.makeText(context , e.getMessage() , Toast.LENGTH_LONG).show();
            }
        }

        @Override
        public void onComplete() {

        }
    });
}
 
开发者ID:ayounes3333,项目名称:GSB-2017-Android,代码行数:34,代码来源:SpinnersHelper.java



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