List of usage examples for android.text InputType TYPE_TEXT_FLAG_NO_SUGGESTIONS
int TYPE_TEXT_FLAG_NO_SUGGESTIONS
To view the source code for android.text InputType TYPE_TEXT_FLAG_NO_SUGGESTIONS.
Click Source Link
From source file:org.cvasilak.jboss.mobile.app.fragments.DeploymentDetailsDialogFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.deploymentdetail_form, container, false); key = (EditText) view.findViewById(R.id.key); key.setText(BYTES_VALUE);/*w ww .j ava2 s.c om*/ key.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); name = (EditText) view.findViewById(R.id.name); name.setText(NAME); name.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); runtimeName = (EditText) view.findViewById(R.id.runtimeName); runtimeName.setText(NAME); runtimeName.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); Button save = (Button) view.findViewById(R.id.done); save.setOnClickListener(onSave); return view; }
From source file:com.seedform.dfatester.viewer.AlphabetListFragment.java
private void openAddSymbolDialog() { final EditText input = new EditText(getActivity()); input.setHint(R.string.hint_symbol_entry); input.setGravity(Gravity.CENTER);/* w w w .j a v a 2s . c o m*/ input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); new AlertDialog.Builder(getActivity()).setTitle(R.string.title_symbol_entry).setView(input) .setPositiveButton(R.string.action_add_symbol, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String inputText = input.getText().toString(); if (inputText.length() != 0) { for (char c : inputText.toCharArray()) { mDFA.addSymbol(c); } mAdapter.notifyDataSetChanged(); Tool.createToast(getActivity(), R.string.msg_symbols_added, Toast.LENGTH_SHORT); } } }).show(); }
From source file:com.layer8apps.MyTlc.java
/************ * PURPOSE: Primary thread that starts everything * ARGUMENTS: <Bundle> savedInstanceState * RETURNS: void/*w w w . j a v a2 s. c o m*/ * AUTHOR: Casey Stark <starkca90@gmail.com>, Devin Collins <agent14709@gmail.com>, Bobby Ore <bob1987@gmail.com> ************/ @Override public void onCreate(Bundle savedInstanceState) { /************* * The following try statement makes the app think that the user doesn't * have a hard settings button. This allows the options menu to always be * visible ************/ try { // Get the configuration of the device ViewConfiguration config = ViewConfiguration.get(this); // Check if the phone has a hard settings key Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); // If it does... if (menuKeyField != null) { // Make our app think it doesn't! menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Do nothing } // Create a new preferences manager pf = new Preferences(this); // Set the theme of the app applyTheme(); super.onCreate(savedInstanceState); setContentView(R.layout.main); txtUsername = (EditText) findViewById(R.id.txtUsername); txtUsername.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); txtPassword = (EditText) findViewById(R.id.txtPassword); remember = (CheckBox) findViewById(R.id.remember); results = (TextView) findViewById(R.id.results); // Get a reference to our last handler final Object handler = getLastCustomNonConfigurationInstance(); // If the last handler existed if (handler != null) { // Cast the handler to MyHandler so we can use it mHandler = (MyHandler) handler; } else { // Otherwise create a new handler mHandler = new MyHandler(); } // Assign the activity for our handler so it knows the proper reference mHandler.setActivity(this); // Load all of the users saved options checkSavedSettings(); // Show the ads showAds(); }
From source file:luxsyp.corona.com.base.ui.activity.HomeActivity.java
private void initSearchButton() { search_fab.setClickable(true);//w w w . j a v a 2 s .c o m search_fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { search_fab.setClickable(true); search_fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { try { new MaterialDialog.Builder(HomeActivity.this).title(R.string.movie_name_search) .content(R.string.movie_name_search) .inputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS) .input(R.string.movie_name_search, R.string.no_prefill, new MaterialDialog.InputCallback() { @Override public void onInput(MaterialDialog dialog, CharSequence input) { homeFragment.doSearch(input.toString()); InputMethodManager imm = (InputMethodManager) getSystemService( Context.INPUT_METHOD_SERVICE); imm.toggleSoftInput(InputMethodManager.HIDE_IMPLICIT_ONLY, 0); } }) .show(); } catch (Exception e) { e.printStackTrace(); } } }); } }); }
From source file:com.ruesga.rview.fragments.EditDialogFragment.java
@Override public void buildDialog(AlertDialog.Builder builder, Bundle savedInstanceState) { String title = getArguments().getString(EXTRA_TITLE); String action = getArguments().getString(EXTRA_ACTION); if (TextUtils.isEmpty(action)) { action = getString(R.string.action_change); }/* w w w . j ava2 s . c om*/ boolean allowSuggestions = getArguments().getBoolean(EXTRA_ALLOW_SUGGESTIONS, false); int inputType = InputType.TYPE_CLASS_TEXT | (mModel.isMultiLine ? InputType.TYPE_TEXT_FLAG_MULTI_LINE : 0) | (allowSuggestions ? 0 : InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); LayoutInflater inflater = LayoutInflater.from(builder.getContext()); mBinding = DataBindingUtil.inflate(inflater, R.layout.edit_dialog, null, true); mBinding.edit.setInputType(inputType); mBinding.edit.addTextChangedListener(mTextWatcher); mBinding.setModel(mModel); builder.setTitle(title).setView(mBinding.getRoot()).setNegativeButton(R.string.action_cancel, null) .setPositiveButton(action, (dialog, which) -> performEditChanged()); }
From source file:com.scigames.slidegame.Registration1UserNameActivity.java
/** Called with the activity is first created. */ @Override// w w w . ja va 2 s. c o m public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "super.OnCreate"); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); Intent i = getIntent(); Log.d(TAG, "...getIntent"); // firstNameIn = i.getStringExtra("fName"); // lastNameIn = i.getStringExtra("lName"); // studentIdIn = i.getStringExtra("studentId"); // visitIdIn = i.getStringExtra("visitId"); Log.d(TAG, "...getStringExtra"); // Inflate our UI from its XML layout description. setContentView(R.layout.registration1_username); Log.d(TAG, "...setContentView"); // Find the text editor view inside the layout, because we // want to do various programmatic things with it. firstName = (EditText) findViewById(R.id.first_name); /* to hide the keyboard on launch, then open when tap in firstname field */ firstName.setInputType(InputType.TYPE_NULL); firstName.setOnTouchListener(new View.OnTouchListener() { //@Override public boolean onTouch(View v, MotionEvent event) { firstName.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME); firstName .setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); firstName.onTouchEvent(event); // call native handler return true; // consume touch even } }); lastName = (EditText) findViewById(R.id.last_name); password = (EditText) findViewById(R.id.password); Log.d(TAG, "...instantiateEditTexts"); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener); //((Button) findViewById(R.id.clear)).setOnClickListener(mClearListener); ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); Log.d(TAG, "...instantiateButtons"); //set info to what we know already //firstName.setText(firstNameIn); //lastName.setText(lastNameIn); //password.setText(passwordIn); //Log.d(TAG,"...setTexts with incoming name/pw"); //set listener task.setOnResultsListener(this); alertDialog = new AlertDialog.Builder(Registration1UserNameActivity.this).create(); // Setting Dialog Title alertDialog.setTitle("Login Failed"); // Setting Dialog Message alertDialog.setMessage("Welcome to AndroidHive.info"); // Setting Icon to Dialog //alertDialog.setIcon(R.drawable.tick); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed Toast.makeText(getApplicationContext(), "You clicked on OK", Toast.LENGTH_SHORT).show(); } }); }
From source file:com.cttapp.bby.mytlc.layer8apps.MyTlc.java
/************ * PURPOSE: Primary thread that starts everything * ARGUMENTS: <Bundle> savedInstanceState * RETURNS: void//from w w w . j a v a2s .com * AUTHOR: Casey Stark <starkca90@gmail.com>, Devin Collins <agent14709@gmail.com>, Bobby Ore <bob1987@gmail.com> ************/ @Override public void onCreate(Bundle savedInstanceState) { /************* * The following try statement makes the app think that the user doesn't * have a hard settings button. This allows the options menu to always be * visible ************/ currentMyTLCActivity = this; try { // Get the configuration of the device ViewConfiguration config = ViewConfiguration.get(this); // Check if the phone has a hard settings key Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey"); // If it does... if (menuKeyField != null) { // Make our app think it doesn't! menuKeyField.setAccessible(true); menuKeyField.setBoolean(config, false); } } catch (Exception ex) { // Do nothing } // Create a new preferences manager pf = new Preferences(this); // Set the theme of the app int logo = applyTheme(); super.onCreate(savedInstanceState); setContentView(R.layout.main); ImageView imgLogo = (ImageView) findViewById(R.id.logo); imgLogo.setImageDrawable(getResources().getDrawable(logo)); txtUsername = (EditText) findViewById(R.id.txtUsername); txtUsername.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); txtPassword = (EditText) findViewById(R.id.txtPassword); // remember = (CheckBox) findViewById(R.id.remember); results = (TextView) findViewById(R.id.results); // Get a reference to our last handler final Object handler = getLastCustomNonConfigurationInstance(); // If the last handler existed if (handler != null) { // Cast the handler to MyHandler so we can use it mHandler = (MyHandler) handler; } else { // Otherwise create a new handler mHandler = new MyHandler(); } // Assign the activity for our handler so it knows the proper reference mHandler.setActivity(this); // Load all of the users saved options checkSavedSettings(); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); System.out.println("Saved Shifts:\n" + pf.getJSONString()); loginButton = (Button) findViewById(R.id.loginButton); loginButton.setOnClickListener(this); // Show the ads //showAds(); }
From source file:com.seedform.dfatester.viewer.AlphabetListFragment.java
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { final Character oldChar = mDFA.getAlphabet().get(position); final EditText input = new EditText(getActivity()); input.setHint(getResources().getString(R.string.hint_concat_symbol_replacement) + "\"" + oldChar.toString() + "\""); input.setGravity(Gravity.CENTER);/*from w ww . j a v a 2 s . c om*/ input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); input.setFilters(new InputFilter[] { new InputFilter.LengthFilter(1) }); new AlertDialog.Builder(getActivity()).setTitle(R.string.title_symbol_replacement).setView(input) .setPositiveButton(R.string.action_replace_symbol, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String inputText = input.getText().toString(); String message; if (inputText.length() != 0) { if (mDFA.replaceSymbol(oldChar, inputText.charAt(0))) { message = "\"" + oldChar + "\"" + getResources().getString(R.string.msg_concat_symbol_replaced); mAdapter.notifyDataSetChanged(); } else { message = "\"" + inputText + "\"" + getResources().getString(R.string.msg_concat_symbol_exists); } Tool.createToast(getActivity(), message, Toast.LENGTH_SHORT); } } }).show(); }
From source file:com.scigames.registration.Registration1UserNameActivity.java
/** Called with the activity is first created. */ @Override// w ww . j av a 2 s .c om public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "super.OnCreate"); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); Intent i = getIntent(); Log.d(TAG, "...getIntent"); firstNameIn = i.getStringExtra("fName"); lastNameIn = i.getStringExtra("lName"); passwordIn = i.getStringExtra("pword"); Log.d(TAG, "...getStringExtra"); // Inflate our UI from its XML layout description. setContentView(R.layout.registration1_username); Log.d(TAG, "...setContentView"); lastName = (EditText) findViewById(R.id.last_name); password = (EditText) findViewById(R.id.password); password_confirm = (EditText) findViewById(R.id.confirm_password); firstName = (EditText) findViewById(R.id.first_name); /* to hide the keyboard on launch, then open when tap in firstname field */ firstName.setCursorVisible(false); firstName.setInputType(InputType.TYPE_NULL); firstName.setOnTouchListener(new View.OnTouchListener() { //@Override public boolean onTouch(View v, MotionEvent event) { firstName.setInputType(InputType.TYPE_TEXT_VARIATION_PERSON_NAME); firstName .setInputType(InputType.TYPE_TEXT_FLAG_CAP_WORDS | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); firstName.setCursorVisible(true); firstName.onTouchEvent(event); // call native handler return true; // consume touch even } }); Log.d(TAG, "...instantiateEditTexts"); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); Log.d(TAG, "...instantiateButtons"); Typeface ExistenceLightOtf = Typeface.createFromAsset(getAssets(), "fonts/Existence-Light.ttf"); Typeface Museo300Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo300-Regular.otf"); Typeface Museo500Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo500-Regular.otf"); Typeface Museo700Regular = Typeface.createFromAsset(getAssets(), "fonts/Museo700-Regular.otf"); setEditTextFont(Museo500Regular, firstName, lastName, password, password_confirm); //set info to what we know already firstName.setText(firstNameIn); lastName.setText(lastNameIn); //password.setText(passwordIn); Log.d(TAG, "...setTexts with incoming name/pw"); //set listener task.setOnResultsListener(this); alertDialog = new AlertDialog.Builder(Registration1UserNameActivity.this).create(); // Setting Dialog Title alertDialog.setTitle("Login Failed"); // Setting Dialog Message alertDialog.setMessage("Welcome to AndroidHive.info"); // Setting Icon to Dialog //alertDialog.setIcon(R.drawable.tick); alertDialog.setButton(RESULT_OK, "OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { // Write your code here to execute after dialog closed Toast.makeText(getApplicationContext(), "", Toast.LENGTH_SHORT).show(); } }); }