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


Java AppCompatAutoCompleteTextView類代碼示例

本文整理匯總了Java中android.support.v7.widget.AppCompatAutoCompleteTextView的典型用法代碼示例。如果您正苦於以下問題:Java AppCompatAutoCompleteTextView類的具體用法?Java AppCompatAutoCompleteTextView怎麽用?Java AppCompatAutoCompleteTextView使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: init

import android.support.v7.widget.AppCompatAutoCompleteTextView; //導入依賴的package包/類
public void init() {

        locationET = (AppCompatAutoCompleteTextView) findViewById(R.id.place_search_dialog_location_ET);
        locationTIL = (TextInputLayout) findViewById(R.id.place_search_dialog_location_TIL);
        cancelTV = (AppCompatTextView) findViewById(R.id.place_search_dialog_cancel_TV);
        okTV = (AppCompatTextView) findViewById(R.id.place_search_dialog_ok_TV);
        headerImageIV = (ImageView) findViewById(R.id.place_search_dialog_header_image_IV);

        okTV.setOnClickListener(this);
        cancelTV.setOnClickListener(this);

        buildDialog();

        locationET.setOnItemClickListener(mAutocompleteClickListener);
        mAdapter = new PlaceAutocompleteAdapter(context, mGoogleApiClient, BOUNDS_WORLD, null);
        locationET.setThreshold(3);
        locationET.setAdapter(mAdapter);
    }
 
開發者ID:codemybrainsout,項目名稱:place-search-dialog,代碼行數:19,代碼來源:PlaceSearchDialog.java

示例2: isValid

import android.support.v7.widget.AppCompatAutoCompleteTextView; //導入依賴的package包/類
@Override
public boolean isValid(AppCompatAutoCompleteTextView view) {
    boolean value;
    try {
        Address address = autoComplete(mAutocompleteLocation.getText().toString()).get(0);
        if (address.getCountryCode().toLowerCase().equals("") && address.getCountryName().equals("")) {
            value = false;
        } else {
            mChosenAddress = address.getCountryName();
            value = true;
        }
    } catch (Exception e) {
        value = false;
    }

    return value;
}
 
開發者ID:securityfirst,項目名稱:Umbrella_android,代碼行數:18,代碼來源:LocationDialog.java

示例3: onCreateView

import android.support.v7.widget.AppCompatAutoCompleteTextView; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    ViewStub viewStub = (ViewStub) findViewById(R.id.toolbar_content);
    viewStub.setLayoutResource(R.layout.toolbar_qms_black_list);
    viewStub.inflate();
    nickField = (AppCompatAutoCompleteTextView) findViewById(R.id.qms_black_list_nick_field);
    return view;
}
 
開發者ID:RadiationX,項目名稱:ForPDA,代碼行數:11,代碼來源:QmsBlackListFragment.java

示例4: ChatThemeCreator

import android.support.v7.widget.AppCompatAutoCompleteTextView; //導入依賴的package包/類
public ChatThemeCreator(QmsChatFragment fragment) {
    this.fragment = fragment;
    viewStub = (ViewStub) this.fragment.findViewById(R.id.toolbar_content);
    viewStub.setLayoutResource(R.layout.toolbar_qms_new_theme);
    viewStub.inflate();
    nickField = (AppCompatAutoCompleteTextView) this.fragment.findViewById(R.id.qms_theme_nick_field);
    titleField = (AppCompatEditText) this.fragment.findViewById(R.id.qms_theme_title_field);
    this.userId = this.fragment.currentChat.getUserId();
    this.userNick = this.fragment.currentChat.getNick();
    this.themeTitle = this.fragment.currentChat.getTitle();
    initCreatorViews();
}
 
開發者ID:RadiationX,項目名稱:ForPDA,代碼行數:13,代碼來源:ChatThemeCreator.java

示例5: getDefaultViewDefStyleAttr

import android.support.v7.widget.AppCompatAutoCompleteTextView; //導入依賴的package包/類
@SuppressLint({"PrivateResource", "InlinedApi"})
@Override
protected int getDefaultViewDefStyleAttr(View view) {
    if (view instanceof AppCompatRadioButton) {
        return R.attr.radioButtonStyle;
    } else if (view instanceof AppCompatCheckBox) {
        return R.attr.checkboxStyle;
    } else if (view instanceof AppCompatButton) {
        return R.attr.buttonStyle;
    } else if (view instanceof AppCompatMultiAutoCompleteTextView) {
        return R.attr.autoCompleteTextViewStyle;
    } else if (view instanceof AppCompatAutoCompleteTextView) {
        return R.attr.autoCompleteTextViewStyle;
    } else if (view instanceof AppCompatEditText) {
        return R.attr.editTextStyle;
    } else if (view instanceof AppCompatCheckedTextView) {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 ?
                android.R.attr.checkedTextViewStyle : 0;
    } else if (view instanceof AppCompatTextView) {
        return android.R.attr.textViewStyle;
    } else if (view instanceof AppCompatSpinner) {
        return R.attr.spinnerStyle;
    } else if (view instanceof AppCompatImageButton) {
        return R.attr.imageButtonStyle;
    } else if (view instanceof AppCompatRatingBar) {
        return R.attr.ratingBarStyle;
    } else if (view instanceof AppCompatSeekBar) {
        return R.attr.seekBarStyle;
    } else {
        return super.getDefaultViewDefStyleAttr(view);
    }
}
 
開發者ID:Leao,項目名稱:CodeColors,代碼行數:33,代碼來源:AppCompatDefStyleHandler.java

示例6: onCreateView

import android.support.v7.widget.AppCompatAutoCompleteTextView; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.location_view, container, false);
    mButtonCancel = (TextView) view.findViewById(R.id.place_search_dialog_cancel_TV);
    mButtonOk = (TextView) view.findViewById(R.id.place_search_dialog_ok_TV);
    mAutocompleteLocation = (AppCompatAutoCompleteTextView) view.findViewById(R.id.place_search_dialog_location_ET);
    mValidator = new Validator(this);
    mValidator.setValidationListener(this);
    mValidator.put(mAutocompleteLocation, new AutocompleteLocationRule());
    initOkButtons();
    initAutoCompleteOnItemClick();
    initAutoCompleteOnFocusChange();
    return view;
}
 
開發者ID:securityfirst,項目名稱:Umbrella_android,代碼行數:16,代碼來源:LocationDialog.java

示例7: onCreateView

import android.support.v7.widget.AppCompatAutoCompleteTextView; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_register_service, container, false);
    serviceNameEditText = (EditText) view.findViewById(R.id.service_name);
    regTypeEditText = (AppCompatAutoCompleteTextView) view.findViewById(R.id.reg_type);
    portEditText = (EditText) view.findViewById(R.id.port);

    serviceNameEditText.setOnEditorActionListener(this);
    regTypeEditText.setOnEditorActionListener(this);
    portEditText.setOnEditorActionListener(this);

    adapter = new TxtRecordsAdapter(getContext(), new HashMap<String, String>()){

        @Override
        public void onItemClick(View view, int position) {
            AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
            final String key = getKey(position);
            String value = getValue(position);
            // Inflate and set the layout for the dialog
            // Pass null as the parent view because its going in the dialog layout
            builder.setMessage("Do you really want to delete " + key + "=" + value + " ?")
                    .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int id1) {
                            mRecords.remove(key);
                            adapter.swap(mRecords);
                            adapter.notifyDataSetChanged();
                        }
                    })
                    .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int id1) {

                        }
                    });
            builder.create().show();
        }
    };

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
    recyclerView.setLayoutManager(new LinearLayoutManager(view.getContext(), LinearLayoutManager.VERTICAL, false));
    recyclerView.setAdapter(adapter);

    List<String> regTypes = BonjourApplication.getRegTypeManager(getContext()).getListRegTypes();
    regTypeEditText.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.select_dialog_item, regTypes));

    view.findViewById(R.id.fab).setOnClickListener(this);

    return view;
}
 
開發者ID:andriydruk,項目名稱:BonjourBrowser,代碼行數:52,代碼來源:RegisterServiceActivity.java


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