Exemplo n.º 1
0
 @Override
 public void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);
   Debug.c();
   if (eanEditText != null) {
     outState.putString(EAN_CONTENT, eanEditText.getText().toString());
   }
 }
Exemplo n.º 2
0
 @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("");
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
  @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);
  }
Exemplo n.º 5
0
 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);
 }
Exemplo n.º 6
0
 @OnClick(R.id.save_button)
 void saveButtonClicked(View view) {
   Debug.c();
   eanEditText.setText("");
 }