@Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); Debug.c(); if (eanEditText != null) { outState.putString(EAN_CONTENT, eanEditText.getText().toString()); } }
@OnClick(R.id.delete_button) void deleteButtonClicked(View view) { Debug.c(); Intent bookIntent = new Intent(getActivity(), BookService.class); bookIntent.putExtra(BookService.EAN, eanEditText.getText().toString()); bookIntent.setAction(BookService.DELETE_BOOK); getActivity().startService(bookIntent); eanEditText.setText(""); }
private void loadBookFromISBN(String barcode) { // Once we have an ISBN, start a book intent Intent bookIntent = new Intent(getActivity(), BookService.class); bookIntent.putExtra(BookService.EAN, barcode); bookIntent.setAction(BookService.FETCH_BOOK); Debug.showToastShort("Fetching info for Barcode : " + barcode, getActivity(), true); getActivity().startService(bookIntent); AddBook.this.restartLoader(); }
@OnClick(R.id.scan_button) void scanButtonClicked(View view) { Debug.i("scan to perform", false); // Update : // Using google vision APIs, so no need to use 3rd party app for barcode scanning Intent intent = new Intent(getActivity(), BarcodeCaptureActivity.class); intent.putExtra(BarcodeCaptureActivity.AutoFocus, true); getActivity().startActivityForResult(intent, REQUEST_SCAN_BARCODE); }
private void clearFields() { Debug.c(); bookTitleTextView.setText(""); bookSubTitleTextView.setText(""); authorsTextView.setText(""); categoriesTextView.setText(""); bookCoverImageView.setVisibility(View.INVISIBLE); saveButton.setVisibility(View.INVISIBLE); deleteButton.setVisibility(View.INVISIBLE); authorsTitleTextView.setVisibility(View.INVISIBLE); categoriesTitleTextView.setVisibility(View.INVISIBLE); mLinearLayoutFooter.setVisibility(View.INVISIBLE); }
@OnClick(R.id.save_button) void saveButtonClicked(View view) { Debug.c(); eanEditText.setText(""); }