/**
   * 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);
  }
  /**
   * Refresh Widget by phone's bible edition setting
   *
   * @param
   * @return
   */
  private void refreshVerseListWidget() {

    // Set Title Bar Text

    TextView titleBarText = (TextView) findViewById(R.id.title_bar_text);
    titleBarText.setText(databaseManager.getBibleEditionName());

    // Chapter and Verst Widget List Setting

    updateChapterWheel(chapterWheel, books.get(bookWheel.getCurrentItem()).getChapterCount());
    updateVerseWheel(
        verseWheel, bookWheel.getCurrentItem(), Integer.valueOf(chapterWheel.getCurrentItem()));
  }
Beispiel #4
0
  void updateReps(WheelView reps) {
    // Calendar calendar = Calendar.getInstance();
    // calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + year.getCurrentItem());
    // calendar.set(Calendar.MONTH, month.getCurrentItem());

    int maxReps = 50;
    reps.setViewAdapter(new DateNumericAdapter(this, 1, maxReps, 10));
    int curDay = Math.min(maxReps, reps.getCurrentItem() + 1);
    reps.setCurrentItem(curDay - 1, true);
  }
Beispiel #5
0
  void updateWhight(WheelView wheight) {
    // Calendar calendar = Calendar.getInstance();
    // calendar.set(Calendar.YEAR, calendar.get(Calendar.YEAR) + year.getCurrentItem());
    // calendar.set(Calendar.MONTH, month.getCurrentItem());

    int maxDays = 500;
    wheight.setViewAdapter(new DateNumericAdapter(this, 1, maxDays, 100));
    int curDay = Math.min(maxDays, wheight.getCurrentItem() + 1);
    wheight.setCurrentItem(curDay - 1, true);
  }
Beispiel #6
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.sure:
        if (mOnTimeSelectedListener != null) {
          int dayIndex = day.getCurrentItem();
          int hour = hours.getCurrentItem();
          Calendar newCalendar = (Calendar) calendar.clone();
          newCalendar.roll(Calendar.DAY_OF_YEAR, dayIndex);
          newCalendar.set(Calendar.HOUR_OF_DAY, hour);
          //	            Log.d("time","time:"+(new SimpleDateFormat("MMMd EEE
          // hh").format(newCalendar.getTime())));
          mOnTimeSelectedListener.onTimeSelected(newCalendar.getTime());
        }
        break;
      case R.id.empty:
      case R.id.cancel:
        if (mOnTimeSelectedListener != null) {
          mOnTimeSelectedListener.onTimeSelected(null);
        }
        break;
        //		case R.id.feedback_tv:
        //			context.startActivity(new Intent(context,FeedBackActivity.class));
        //			break;
      case R.id.cargo_goods:
        context.startActivity(new Intent(context, CargoGoodsActivity.class));
        break;
      case R.id.cargo_home:
        context.startActivity(new Intent(context, CargoHomeActivity.class));

        break;

      default:
        break;
    }
  }