public void addWords() { LayoutInflater inflater = activity.getLayoutInflater(); View mView = inflater.inflate(R.layout.dialog_edit_extra_words, (ViewGroup) activity.findViewById(R.id.dialog_layout_edit_words)); AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(R.string.add); final TextInputEditText word_1 = mView.findViewById(R.id.edittext_edit_word_1); final TextInputEditText word_2 = mView.findViewById(R.id.edittext_edit_word_2); builder.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { String edit_1 = word_1.getText().toString(); String edit_2 = word_2.getText().toString(); if (!edit_1.isEmpty() && !edit_2.isEmpty()) { ExtraWord.add(new String[]{edit_1, edit_2}); hasEdited = true; notifyDataSetChanged(); } else { Toast.makeText(activity, R.string.edit_extra_words_error, Toast.LENGTH_SHORT).show(); } } }); builder.setNegativeButton(android.R.string.no, null); builder.setView(mView); builder.show(); }
private void findViews() { toolbar = (Toolbar) findViewById(R.id.air_toolbar); inputTitle = (TextInputEditText) findViewById(R.id.air_inputTitle); inputDescription = (TextInputEditText) findViewById(R.id.air_inputDescription); textDeviceInfo = (TextView) findViewById(R.id.air_textDeviceInfo); buttonDeviceInfo = (ImageButton) findViewById(R.id.air_buttonDeviceInfo); layoutDeviceInfo = (ExpandableRelativeLayout) findViewById(R.id.air_layoutDeviceInfo); inputUsername = (TextInputEditText) findViewById(R.id.air_inputUsername); inputPassword = (TextInputEditText) findViewById(R.id.air_inputPassword); inputEmail = (TextInputEditText) findViewById(R.id.air_inputEmail); optionUseAccount = (RadioButton) findViewById(R.id.air_optionUseAccount); optionAnonymous = (RadioButton) findViewById(R.id.air_optionAnonymous); layoutLogin = (ExpandableRelativeLayout) findViewById(R.id.air_layoutLogin); layoutAnonymous = (ExpandableRelativeLayout) findViewById(R.id.air_layoutGuest); buttonSend = (FloatingActionButton) findViewById(R.id.air_buttonSend); }
@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { //noinspection ConstantConditions getDialog().getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); View view = inflater.inflate(R.layout.dialog_edit_item, container, false); mTilValue = (TextInputLayout) view.findViewById(R.id.tilValue); mEtValue = (TextInputEditText) view.findViewById(R.id.etValue); view.findViewById(R.id.bPositive).setOnClickListener(this); view.findViewById(R.id.bNegative).setOnClickListener(this); return view; }
public CommonDialog(Context context) { view = LayoutInflater.from(context).inflate(R.layout.dialog_common, null, false); tvMessage = (TextView) view.findViewById(R.id.tv_message); btOk = (Button) view.findViewById(R.id.bt_ok); btCancel = (Button) view.findViewById(R.id.bt_cancel); tvTitle = (TextView) view.findViewById(R.id.tv_title); tvMessageRoot = (LinearLayout) view.findViewById(R.id.tv_message_root); inputArea = (TextInputEditText) view.findViewById(R.id.input_area); inputRoot = (TextInputLayout) view.findViewById(R.id.input_root); inputRoot.setVisibility(View.GONE); tvMessageRoot.setVisibility(View.GONE); tvTitle.setVisibility(View.GONE); tvMessage.setVisibility(View.GONE); btOk.setVisibility(View.GONE); btCancel.setVisibility(View.GONE); builder = new AlertDialog.Builder(context) .setView(view); }
/** * This method is to initialize views */ private void initViews() { nestedScrollView = (NestedScrollView) findViewById(R.id.nestedScrollView); textInputLayoutName = (TextInputLayout) findViewById(R.id.textInputLayoutName); textInputLayoutEmail = (TextInputLayout) findViewById(R.id.textInputLayoutEmail); textInputLayoutPassword = (TextInputLayout) findViewById(R.id.textInputLayoutPassword); textInputLayoutConfirmPassword = (TextInputLayout) findViewById(R.id.textInputLayoutConfirmPassword); textInputEditTextName = (TextInputEditText) findViewById(R.id.textInputEditTextName); textInputEditTextEmail = (TextInputEditText) findViewById(R.id.textInputEditTextEmail); textInputEditTextPassword = (TextInputEditText) findViewById(R.id.textInputEditTextPassword); textInputEditTextConfirmPassword = (TextInputEditText) findViewById(R.id.textInputEditTextConfirmPassword); appCompatButtonRegister = (AppCompatButton) findViewById(R.id.appCompatButtonRegister); appCompatTextViewLoginLink = (AppCompatTextView) findViewById(R.id.appCompatTextViewLoginLink); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); // Set up the login form. mServerView = (TextInputEditText) findViewById(R.id.server); mUsernameView = (TextInputEditText) findViewById(R.id.user); mPasswordView = (TextInputEditText) findViewById(R.id.password); mSignInButton = (Button) findViewById(R.id.user_sign_in_button); mLoginFormView = findViewById(R.id.login_form); mProgressView = findViewById(R.id.login_progress); addListenerOnButton(); mUsernameView.requestFocus(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_lock); final TextInputEditText pass=(TextInputEditText) findViewById(R.id.etPassword); Button submit=(Button) findViewById(R.id.submit_button); submit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String password=pass.getText().toString(); DataBase data=DataBase.getInstance(LockActivity.this); data.insertPass(password); pass.setText(""); Intent i=new Intent(LockActivity.this,Util.class); startActivity(i); } }); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_payment_information, container, false); AppCompatSpinner cardType = (AppCompatSpinner) view.findViewById(R.id.card_type); TextInputEditText cardNumber = (TextInputEditText) view.findViewById(R.id.card_number); TextInputEditText expirationDate = (TextInputEditText) view.findViewById(R.id.expiration_date); TextInputEditText securityCode = (TextInputEditText) view.findViewById(R.id.security_code); TextView cardTypeError = (TextView) view.findViewById(R.id.card_type_error); view.findViewById(R.id.submit).setOnClickListener(this); validator = new PaymentInformationFormValidator(cardType, cardNumber, expirationDate, securityCode, cardTypeError); return view; }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_address, container, false); TextInputEditText address = (TextInputEditText) view.findViewById(R.id.address); TextInputEditText city = (TextInputEditText) view.findViewById(R.id.city); AppCompatSpinner state = (AppCompatSpinner) view.findViewById(R.id.state); TextView stateError = (TextView) view.findViewById(R.id.state_error); TextInputEditText zipCode = (TextInputEditText) view.findViewById(R.id.zip_code); AppCompatSpinner country = (AppCompatSpinner) view.findViewById(R.id.country); TextView countryError = (TextView) view.findViewById(R.id.country_error); view.findViewById(R.id.submit).setOnClickListener(this); validator = new AddressFormValidator(address, city, state, zipCode, country, stateError, countryError); return view; }
private static TextInputLayout createInput(Context context, Field field, Object action) { try { field.setAccessible(true); String name = field.getName(); Object value = field.get(action); String valueStr = value != null ? value.toString() : null; TextInputLayout layout = new TextInputLayout(context); layout.setHint(name); TextInputEditText editText = new TextInputEditText(context); editText.setText(valueStr); layout.setTag(field); layout.addView(editText, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); return layout; } catch (IllegalAccessException e) { throw new RuntimeException(e); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); location = (TextInputEditText) findViewById(R.id.etLocation); location.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View view, MotionEvent motionEvent) { if (motionEvent.getAction() == MotionEvent.ACTION_UP) { showPlacePickerDialog(); } return false; } }); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_marker_manage, container, false); /* The view fields */ mNameEditText = (TextInputEditText) rootView.findViewById(R.id.marker_name_id); mLatEditText = (TextInputEditText) rootView.findViewById(R.id.marker_lat_id); mLonEditText = (TextInputEditText) rootView.findViewById(R.id.marker_lon_id); mProjectionLabel = (TextView) rootView.findViewById(R.id.marker_proj_label_id); mProjectionX = (TextInputEditText) rootView.findViewById(R.id.marker_proj_x_id); mProjectionY = (TextInputEditText) rootView.findViewById(R.id.marker_proj_y_id); mComment = (EditText) rootView.findViewById(R.id.marker_comment_id); mMap = mMapProvider.getCurrentMap(); mMarker = mMarkerProvider.getCurrentMarker(); updateView(); return rootView; }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); activityComponent().inject(this); mPresenter.attachView(this); inputEmail = (TextInputEditText) findViewById(R.id.login_email); inputPassword = (EditText) findViewById(R.id.login_password); Button loginButton = (Button) findViewById(R.id.button_login); loginButton.setOnClickListener(view -> loginClicked()); TextView forgotPassword = (TextView) findViewById(R.id.forgot_password); forgotPassword.setOnClickListener(view -> gotoForgot()); TextView registerButton = (TextView) findViewById(R.id.login_link_register); registerButton.setOnClickListener(view -> gotoRegister()); ImageView loginAccounts = (ImageView) findViewById(R.id.login_account_button); loginAccounts.setOnClickListener(view -> onClickAccountSwitch()); ViewUtil.hideKeyboard(this); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); activityComponent().inject(this); registerPresenter.attachView(this); inputName = (TextInputEditText) findViewById(R.id.register_input_name); inputPassword = (TextInputEditText) findViewById(R.id.register_password); inputEmail = (TextInputEditText) findViewById(R.id.register_input_email); Button register = (Button) findViewById(R.id.button_register); register.setOnClickListener(view -> registerClicked()); TextView loginLink = (TextView) findViewById(R.id.link_login); loginLink.setOnClickListener(view -> gotoLogin()); ViewUtil.hideKeyboard(this); }
@Override public void onAcademicLoaded(Academic loadedAcademic) { hideLoading(); academic = loadedAcademic; ImageView imageView = (ImageView) findViewById(R.id.profile_pic_view); Glide.with(this).load(academic.getImage()).error(R.drawable.profile).into(imageView); TextView nameView = (TextView) findViewById(R.id.name_edit); nameView.setText(academic.getName()); emailView = (TextInputEditText) findViewById(R.id.email_edit); emailView.setText(academic.getPublicEmail()); phoneView = (TextInputEditText) findViewById(R.id.phone_edit); phoneView.setText(academic.getPhone()); bioView = (TextInputEditText) findViewById(R.id.bio_edit); bioView.setText(academic.getBio()); roomView = (TextInputEditText) findViewById(R.id.room_edit); roomView.setText(academic.getRoom()); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_user_list); if (getSupportActionBar() != null) { getSupportActionBar().setTitle("User List"); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } textSearch = (TextInputEditText) findViewById(R.id.text_search); adapter = new SimpleAdapter(this, mapDataList, android.R.layout.simple_list_item_2, from, to); listview = (ListView) findViewById(R.id.listview); listview.setAdapter(adapter); loading = new ProgressDialog(this); loading.setIndeterminate(true); loading.setCancelable(false); loading.setCanceledOnTouchOutside(false); updateAndShowUserList(null); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_data_form); if (getSupportActionBar() != null) { getSupportActionBar().setTitle("Data Beacon Form"); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } textName = (TextInputEditText) findViewById(R.id.text_name); textUUID = (TextInputEditText) findViewById(R.id.text_uuid); textMajor = (TextInputEditText) findViewById(R.id.text_major); textMinor = (TextInputEditText) findViewById(R.id.text_minor); switchIsActive = (Switch) findViewById(R.id.switch_is_active); loading = new ProgressDialog(this); loading.setIndeterminate(true); loading.setCancelable(false); loading.setCanceledOnTouchOutside(false); formMode = getIntent().getIntExtra(INTENT_FORM_MODE, FORM_MODE_ADD); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); if (getSupportActionBar() != null) { getSupportActionBar().setTitle("Mesosfer Registration"); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } // initialize input form view textEmail = (TextInputEditText) findViewById(R.id.text_email); textPassword = (TextInputEditText) findViewById(R.id.text_password); textFirstname = (TextInputEditText) findViewById(R.id.text_firstname); textLastname = (TextInputEditText) findViewById(R.id.text_lastname); textDateOfBirth = (TextInputEditText) findViewById(R.id.text_date_of_birth); textHeight = (TextInputEditText) findViewById(R.id.text_height); textWeight = (TextInputEditText) findViewById(R.id.text_weight); switchIsMarried = (Switch) findViewById(R.id.switch_is_married); loading = new ProgressDialog(this); loading.setIndeterminate(true); loading.setCancelable(false); loading.setCanceledOnTouchOutside(false); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); if (getSupportActionBar() != null) { getSupportActionBar().setTitle("Mesosfer Registration"); } // initialize input form view textEmail = (TextInputEditText) findViewById(R.id.text_email); textPassword = (TextInputEditText) findViewById(R.id.text_password); textFirstname = (TextInputEditText) findViewById(R.id.text_firstname); textLastname = (TextInputEditText) findViewById(R.id.text_lastname); textDateOfBirth = (TextInputEditText) findViewById(R.id.text_date_of_birth); textHeight = (TextInputEditText) findViewById(R.id.text_height); textWeight = (TextInputEditText) findViewById(R.id.text_weight); switchIsMarried = (Switch) findViewById(R.id.switch_is_married); loading = new ProgressDialog(this); loading.setIndeterminate(true); loading.setCancelable(false); loading.setCanceledOnTouchOutside(false); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_key); mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this); mPrefsEditor = mSharedPreferences.edit(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); TextView instructionsTextView = (TextView) findViewById(R.id.key_instructions); instructionsTextView.setMovementMethod(LinkMovementMethod.getInstance()); mAPIKey = (TextInputEditText) findViewById(R.id.input_api_key); ImageButton save = (ImageButton) findViewById(R.id.button_save); ImageButton delete = (ImageButton) findViewById(R.id.button_delete); if (!getApiKeyFromPrefs().isEmpty()) { mAPIKey.setText(getApiKeyFromPrefs()); } save.setOnClickListener(this); delete.setOnClickListener(this); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_router); coordinatorLayout = (CoordinatorLayout) findViewById(R.id.layout_coordinator); snackbarColor = ResourcesCompat.getColor(getResources(), R.color.colorPrimaryDark, null); gatewayEditText = (TextInputEditText) findViewById(R.id.input_gateway); gatewayEditText.addTextChangedListener(this); usernameEditText = (TextInputEditText) findViewById(R.id.input_username); usernameEditText.addTextChangedListener(this); passwordEditText = (TextInputEditText) findViewById(R.id.input_password); passwordEditText.addTextChangedListener(this); routerPresenter = new RouterPresenter(this); routerPresenter.setupFields(); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(this); }
public ProductDialogCache(View rootview) { productName = (AutoCompleteTextView) rootview.findViewById(R.id.product_name); productNameInputLayout = (TextInputLayout) rootview.findViewById(R.id.product_name_input_layout); productPriceInputLayout = (TextInputLayout) rootview.findViewById(R.id.product_price_input_layout); quantity = (TextInputEditText) rootview.findViewById(R.id.quantity); price = (TextInputEditText) rootview.findViewById(R.id.product_price); customStore = (AutoCompleteTextView) rootview.findViewById(R.id.store_input); category = (AutoCompleteTextView) rootview.findViewById(R.id.category_input); productNotes = (TextInputEditText) rootview.findViewById(R.id.product_notes); buttonPlus = (Button) rootview.findViewById(R.id.product_button_plus); buttonMinus = (Button) rootview.findViewById(R.id.product_button_minus); productCheckBox = (CheckBox) rootview.findViewById(R.id.product_checkbox); expandableLayout = (LinearLayout) rootview.findViewById(R.id.expandable_product_view); expandableImageView = (ImageView) rootview.findViewById(R.id.expand_button); cameraIcon = (ImageView) rootview.findViewById(R.id.camera_button); productImage = (ImageView) rootview.findViewById(R.id.image_view); titleTextView = (TextView) rootview.findViewById(R.id.dialog_title); }
public ListDialogCache(View rootview) { prioritySpinner = (Spinner) rootview.findViewById(R.id.priority_spinner); reminderSpinner = (Spinner) rootview.findViewById(R.id.reminder_spinner); listNameText = (TextInputEditText) rootview.findViewById(R.id.list_name); listNameInputLayout = (TextInputLayout) rootview.findViewById(R.id.list_name_input_layout); reminderText = (TextInputEditText) rootview.findViewById(R.id.edittext_reminder); listNotes = (TextInputEditText) rootview.findViewById(R.id.list_notes); checkBox = (CheckBox) rootview.findViewById(R.id.list_dialog_checkbox); deadlineExpansionButton = (ImageView) rootview.findViewById(R.id.expand_button_list); deadlineLayout = (LinearLayout) rootview.findViewById(R.id.deadline_layout); dateLayout = (LinearLayout) rootview.findViewById(R.id.deadline_date); timeLayout = (LinearLayout) rootview.findViewById(R.id.deadline_time); reminderLayout = (LinearLayout) rootview.findViewById(R.id.layout_reminder); dateTextView = (TextView) rootview.findViewById(R.id.date_view); timeTextView = (TextView) rootview.findViewById(R.id.time_view); titleTextView = (TextView) rootview.findViewById(R.id.dialog_title); statisticsSwitch = (SwitchCompat) rootview.findViewById(R.id.switch_statistics); reminderSwitch = (SwitchCompat) rootview.findViewById(R.id.switch_reminder); }
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_main, container, false); mMessageLayout = (TextInputLayout) rootView.findViewById(R.id.messageLayout); mCommandLayout = (TextInputLayout) rootView.findViewById(R.id.commandLayout); mOutputLayoutText = (TextInputLayout) rootView.findViewById(R.id.outputLayout); mMessageText = (TextInputEditText) rootView.findViewById(R.id.messageText); mCommandText = (TextInputEditText) rootView.findViewById(R.id.commandText); mOutputText = (TextInputEditText) rootView.findViewById(R.id.outputText); mBtnSubmit = (Button) rootView.findViewById(R.id.btnSubmit); mBtnSubmit.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { if(mCommandText.getText().toString().isEmpty()){ if(getArduinoConnect()!=null) getArduinoConnect().sendMessage(mMessageText.getText().toString()); }else{ if(getArduinoConnect()!=null) getArduinoConnect().sendCommand(mCommandText.getText().toString(), mMessageText.getText().toString()); } } }); return rootView; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_note); mNoteId = getIntent().getStringExtra("id"); mContext = this; getLoaderManager().initLoader(NOTE_LOADER_ID, null, this); Toolbar toolbar = (Toolbar) findViewById(R.id.app_bar); setSupportActionBar(toolbar); getSupportActionBar().setHomeButtonEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true); etTitle = (TextInputEditText) findViewById(R.id.editTitle); etTag = (TextInputEditText) findViewById(R.id.editTag); etNote = (TextInputEditText) findViewById(R.id.noteContent); }