/** * The method which is called When add verse to project button is clicked. Get current wheel * position Get verse information by current wheel position Make Intent includes verse String Add * select project to DB * * @param * @return */ public void addVerseThisVerse() { // Get current wheel position // Get verse from DB by current wheel position int b = bookWheel.getCurrentItem(); int c = chapterWheel.getCurrentItem(); int v = verseWheel.getCurrentItem() + 1; // Add project to DB // Show Toast text by result. // If the verse is already in the project, fail. // Otherwise, success. if (databaseManager.addVerseToProject( projectId, databaseManager.getVerseIdFromWidgetIndex(b, c, v), 0)) Toast.makeText( this, getResources().getString(R.string.verse_chooser_add_verse_toast_success), Toast.LENGTH_LONG) .show(); else Toast.makeText( this, getResources().getString(R.string.verse_chooser_add_verse_toast_fail), Toast.LENGTH_LONG) .show(); }
/** * The method which is called When memorize button is clicked. Get current wheel position Get * verse information by current wheel position Make Intent includes verse String Move to * ActivityChooserAct * * @param * @return */ private void startActivityChooser() { // Get current wheel position // Get verse from DB by current wheel position // Get Reference and verse text from verse object int b = bookWheel.getCurrentItem(); int c = chapterWheel.getCurrentItem(); int v = verseWheel.getCurrentItem() + 1; VerseObject verse = databaseManager.getVerse(databaseManager.getVerseIdFromWidgetIndex(b, c, v)); String refString = databaseManager.getBook(verse.getBook()).getName() + " " + (verse.getChapter() + 1) + ":" + verse.getVerse(); String textString = verse.getContents(); // Set Intent to ActivityChoosetAct Intent intent = new Intent(this, ActivityChooserAct.class); intent.putExtra(GlobalVariable.VERSE_REF, refString); intent.putExtra(GlobalVariable.VERSE_TEXT, textString); startActivity(intent); }