List of usage examples for android.text InputType TYPE_NULL
int TYPE_NULL
To view the source code for android.text InputType TYPE_NULL.
Click Source Link
From source file:Main.java
/** Suppress virtual keyboard until user's first tap */ public static void suppressVirtualKeyboard(final TextView editor) { final int inputType = editor.getInputType(); editor.setInputType(InputType.TYPE_NULL); editor.setOnTouchListener((v, event) -> { editor.setInputType(inputType);//from w w w.j a v a 2 s . c om editor.setOnTouchListener(null); return false; }); }
From source file:com.mario22gmail.license.nfc_project.FragmentPinDialog.java
public void disableSoftInputFromAppearing(EditText editText) { if (Build.VERSION.SDK_INT >= 11) { editText.setRawInputType(InputType.TYPE_CLASS_TEXT); editText.setTextIsSelectable(true); } else {/*from w ww .jav a 2s .com*/ editText.setRawInputType(InputType.TYPE_NULL); editText.setFocusable(true); } }
From source file:com.mobicage.rogerthat.plugins.messaging.widgets.TextLineWidget.java
public int getDefaultInputTypes() { return InputType.TYPE_NULL; }
From source file:com.example.android.rowanparkingpass.Activities.PassActivity.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_pass); i = 0;/* ww w . j av a 2s. c om*/ Intent pastIntent = getIntent(); currentMode = pastIntent.getStringExtra(MODE); db = new DatabaseHandlerPasses(getApplicationContext()); Pass pass = (Pass) pastIntent.getSerializableExtra("Pass"); if (pass == null) { driver = (Driver) pastIntent.getSerializableExtra("Driver"); vehicle = (Vehicle) pastIntent.getSerializableExtra("Vehicle"); } else { driver = pass.getDriver(); vehicle = pass.getVehicle(); } setDriverView(); setVehicleView(); dateFormatter = new SimpleDateFormat("MM/dd/yyyy"); startDate = (EditText) findViewById(R.id.createstartdatefield); startDate.setInputType(InputType.TYPE_NULL); startDate.setOnClickListener(this); endDate = (EditText) findViewById(R.id.createenddatefield); endDate.setInputType(InputType.TYPE_NULL); endDate.setOnClickListener(this); Calendar calendar = Calendar.getInstance(); int year = calendar.get(Calendar.YEAR); int month = calendar.get(Calendar.MONTH); int day = calendar.get(Calendar.DAY_OF_MONTH); calendar.set(year, month, day); startDate.setText(dateFormatter.format(calendar.getTime())); calendar.add(Calendar.DAY_OF_MONTH, 1); endDate.setText(dateFormatter.format(calendar.getTime())); startDatePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { Calendar newDate = Calendar.getInstance(); newDate.set(year, monthOfYear, dayOfMonth); startDate.setText(dateFormatter.format(newDate.getTime())); try { Date d = newDate.getTime(); Date d2 = dateFormatter.parse(endDate.getText().toString()); if (d.after(d2)) { newDate.add(Calendar.DAY_OF_MONTH, 1); endDate.setText(dateFormatter.format(newDate.getTime())); } } catch (ParseException pe) { pe.printStackTrace(); } } }, year, month, day); endDatePickerDialog = new DatePickerDialog(this, new DatePickerDialog.OnDateSetListener() { @Override public void onDateSet(DatePicker datePicker, int year, int monthOfYear, int dayOfMonth) { Calendar newDate = Calendar.getInstance(); newDate.set(year, monthOfYear, dayOfMonth); endDate.setText(dateFormatter.format(newDate.getTime())); try { Date d = newDate.getTime(); Date d2 = dateFormatter.parse(startDate.getText().toString()); if (d.before(d2)) { newDate.add(Calendar.DAY_OF_MONTH, -1); startDate.setText(dateFormatter.format(newDate.getTime())); } } catch (ParseException pe) { pe.printStackTrace(); } } }, year, month, day); createPass = (Button) findViewById(R.id.createPassButton); mainMenu = (Button) findViewById(R.id.goMainMenuButton); createPass.setOnClickListener(this); mainMenu.setOnClickListener(this); }
From source file:alexander.martinz.libs.materialpreferences.MaterialEditTextPreference.java
@Override public boolean init(Context context, AttributeSet attrs) { if (mInit) {// w ww . j a v a 2 s .c o m return false; } mInit = true; if (!super.init(context, attrs)) { return false; } if (mEditTextValue == null) { mEditTextValue = new EditText(context); mEditTextValue.setText(mDefaultValue); if (mPrefTextColor != -1) { if (isInEditMode()) { mEditTextValue.setTextColor(Color.parseColor("#009688")); } else { mEditTextValue.setTextColor(ContextCompat.getColor(context, mPrefTextColor)); } } if (mPrefTextSize != -1) { mEditTextValue.setTextSize(TypedValue.COMPLEX_UNIT_SP, mPrefTextSize); } mEditTextValue.setInputType(InputType.TYPE_NULL); mEditTextValue.setEllipsize(TextUtils.TruncateAt.END); mEditTextValue.setOnClickListener(this); addToWidgetFrame(mEditTextValue); } setOnClickListener(this); return true; }
From source file:de.dmxcontrol.fragment.PanelSelectorFragment.java
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (savedInstanceState != null) { mActiveInputType = savedInstanceState.getInt(EXTRA_ACTIVE_INPUT_TYPE, ACTIVE_INPUT_TYPE_DEVICE); } else {//from www.java2s. co m mActiveInputType = ACTIVE_INPUT_TYPE_DEVICE; } LinearLayout layout = (LinearLayout) inflater.inflate(R.layout.group_device_selector_fragment, container, false); mEntitySelection = EntityManager.get().getEntitySelection(EntityManager.CENTRAL_ENTITY_SELECTION); mEntitySelection.addListener(this); mEditDevice = (EditText) layout.findViewById(R.id.device_input); mEditDevice.setInputType(InputType.TYPE_NULL); mEditDevice.setText(mEntitySelection.getRangesString(Type.DEVICE)); mEditGroup = (EditText) layout.findViewById(R.id.group_input); mEditGroup.setInputType(InputType.TYPE_NULL); mEditGroup.setText(mEntitySelection.getRangesString(Type.GROUP)); mBDevice = (Button) layout.findViewById(R.id.button_dev); mBDevice.setOnClickListener(this); updateActiveInputType(); Button bSpan = (Button) layout.findViewById(R.id.button_span); bSpan.setOnClickListener(this); Button bAggregate = (Button) layout.findViewById(R.id.button_aggregate); bAggregate.setOnClickListener(this); Button bStar = (Button) layout.findViewById(R.id.button_star); bStar.setOnClickListener(this); Button bErase = (Button) layout.findViewById(R.id.button_clear); bErase.setOnClickListener(this); bErase.setOnLongClickListener(this); Button bOne = (Button) layout.findViewById(R.id.button_one); bOne.setOnClickListener(this); Button bTwo = (Button) layout.findViewById(R.id.button_two); bTwo.setOnClickListener(this); Button bThree = (Button) layout.findViewById(R.id.button_three); bThree.setOnClickListener(this); Button bFour = (Button) layout.findViewById(R.id.button_four); bFour.setOnClickListener(this); Button bFive = (Button) layout.findViewById(R.id.button_five); bFive.setOnClickListener(this); Button bSix = (Button) layout.findViewById(R.id.button_six); bSix.setOnClickListener(this); Button bSeven = (Button) layout.findViewById(R.id.button_seven); bSeven.setOnClickListener(this); Button bEight = (Button) layout.findViewById(R.id.button_eight); bEight.setOnClickListener(this); Button bNine = (Button) layout.findViewById(R.id.button_nine); bNine.setOnClickListener(this); Button bZero = (Button) layout.findViewById(R.id.button_zero); bZero.setOnClickListener(this); return layout; }
From source file:eisene.riskspeedtools.TimerSetupFrag.java
public void timerStartPresentation() { EditText secondET = (EditText) findViewById(R.id.et_timer_second); Button startButton = (Button) findViewById(R.id.btn_timer_play_pause); secondET.setEnabled(false); // prevent edit while running secondET.setInputType(InputType.TYPE_NULL); startButton.setText(R.string.timer_pause); }
From source file:com.scigames.slidegame.Registration5EmailActivity.java
/** Called with the activity is first created. */ @Override//www . j av a2 s . c o m public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d(TAG, "super.OnCreate"); 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.registration5_email); Log.d(TAG, "...setContentView"); email = (EditText) findViewById(R.id.email); /* to hide the keyboard on launch, then open when tap in firstname field */ email.setInputType(InputType.TYPE_NULL); email.setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { email.setInputType(InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS); email.onTouchEvent(event); // call native handler return true; // consume touch even } }); Log.d(TAG, "...instantiateEditTexts"); //display name in greeting sentence Resources res = getResources(); TextView greets = (TextView) findViewById(R.id.greeting); greets.setText(String.format(res.getString(R.string.greeting), firstNameIn, lastNameIn)); Log.d(TAG, greets.toString()); Log.d(TAG, "...Greetings"); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener); ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); Log.d(TAG, "...instantiateButtons"); //set listener task.setOnResultsListener(this); }
From source file:com.devgmail.mitroshin.totutu.controllers.StartFragment.java
@Nullable @Override//from www . j a v a 2 s . c o m public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { // View view = inflater.inflate(R.layout.fragment_start, container, false); mSimpleDateFormat = new SimpleDateFormat("dd-MM-yyyy", Locale.US); // ? ?? ? findAllViewById(view); datePickerButton.setInputType(InputType.TYPE_NULL); setDateField(); // ? ?? ? setAllClickListener(); // ? ? ? ? ??. if (savedInstanceState != null) { if (savedInstanceState.getParcelable(SAVE_STATION_FROM) != null) { mCurrentStationFrom = savedInstanceState.getParcelable(SAVE_STATION_FROM); updateStationUI(mCurrentStationFrom, "From"); } if (savedInstanceState.getParcelable(SAVE_STATION_TO) != null) { mCurrentStationTo = savedInstanceState.getParcelable(SAVE_STATION_TO); updateStationUI(mCurrentStationTo, "To"); } } return view; }
From source file:com.scigames.slidegame.Registration3MassActivity.java
/** Called with the activity is first created. */ @Override// ww w . j a v a 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.registration3_mass); Log.d(TAG, "...setContentView"); // Find the text editor view inside the layout, because we // want to do various programmatic things with it. thisMass = (EditText) findViewById(R.id.mass); /* to hide the keyboard on launch, then open when tap in firstname field */ thisMass.setInputType(InputType.TYPE_NULL); thisMass.setOnTouchListener(new View.OnTouchListener() { //@Override public boolean onTouch(View v, MotionEvent event) { thisMass.setInputType(InputType.TYPE_CLASS_TEXT); thisMass.onTouchEvent(event); // call native handler return true; // consume touch even } }); Log.d(TAG, "...instantiateEditTexts"); //display name in greeting sentence Resources res = getResources(); TextView greets = (TextView) findViewById(R.id.greeting); greets.setText(String.format(res.getString(R.string.greeting), firstNameIn, lastNameIn)); Log.d(TAG, greets.toString()); Log.d(TAG, "...Greetings"); //set info to what we know already //firstName.setText(firstNameIn); //lastName.setText(lastNameIn); // Hook up button presses to the appropriate event handler. ((Button) findViewById(R.id.back)).setOnClickListener(mBackListener); ((Button) findViewById(R.id.continue_button)).setOnClickListener(mContinueButtonListener); ((Button) findViewById(R.id.scan)).setOnClickListener(mScanButtonListener); Log.d(TAG, "...instantiateButtons"); //set listener task.setOnResultsListener(this); }