Пример #1
0
 /** Create the "Combine to Two Staffs" preference. */
 private void createTwoStaffsPrefs(PreferenceScreen root) {
   twoStaffs = new CheckBoxPreference(this);
   if (options.tracks.length == 1) {
     twoStaffs.setTitle(R.string.split_to_two_staffs);
     twoStaffs.setSummary(R.string.split_to_two_staffs_summary);
   } else {
     twoStaffs.setTitle(R.string.combine_to_two_staffs);
     twoStaffs.setSummary(R.string.combine_to_two_staffs_summary);
   }
   twoStaffs.setChecked(options.twoStaffs);
   root.addPreference(twoStaffs);
 }
Пример #2
0
  /**
   * Create the "Play Measures in a Loop" preference.
   *
   * <p>Note that we display the measure numbers starting at 1, but the actual
   * playMeasuresInLoopStart field starts at 0.
   */
  private void createPlayMeasuresInLoopPrefs(PreferenceScreen root) {
    String[] values = new String[options.lastMeasure + 1];
    for (int measure = 0; measure < values.length; measure++) {
      values[measure] = "" + (measure + 1);
    }

    PreferenceCategory playLoopTitle = new PreferenceCategory(this);
    playLoopTitle.setTitle(R.string.play_measures_in_loop_title);
    root.addPreference(playLoopTitle);

    showMeasures = new CheckBoxPreference(this);
    showMeasures.setTitle(R.string.show_measures);
    showMeasures.setChecked(options.showMeasures);
    root.addPreference(showMeasures);

    playMeasuresInLoop = new CheckBoxPreference(this);
    playMeasuresInLoop.setTitle(R.string.play_measures_in_loop);
    playMeasuresInLoop.setChecked(options.playMeasuresInLoop);
    root.addPreference(playMeasuresInLoop);

    loopStart = new ListPreference(this);
    loopStart.setOnPreferenceChangeListener(this);
    loopStart.setTitle(R.string.play_measures_in_loop_start);
    loopStart.setEntries(values);
    loopStart.setEntryValues(values);
    loopStart.setValueIndex(options.playMeasuresInLoopStart);
    loopStart.setSummary(loopStart.getEntry());
    root.addPreference(loopStart);

    loopEnd = new ListPreference(this);
    loopEnd.setOnPreferenceChangeListener(this);
    loopEnd.setTitle(R.string.play_measures_in_loop_end);
    loopEnd.setEntries(values);
    loopEnd.setEntryValues(values);
    loopEnd.setValueIndex(options.playMeasuresInLoopEnd);
    loopEnd.setSummary(loopEnd.getEntry());
    root.addPreference(loopEnd);
  }
Пример #3
0
 /** Create the "Show Piano" preference */
 private void createShowPianoPrefs(PreferenceScreen root) {
   showPiano = new CheckBoxPreference(this);
   showPiano.setTitle(R.string.show_piano);
   showPiano.setChecked(options.showPiano);
   root.addPreference(showPiano);
 }
Пример #4
0
 /** Create the "Show Lyrics" preference */
 private void createShowLyricsPrefs(PreferenceScreen root) {
   showLyrics = new CheckBoxPreference(this);
   showLyrics.setTitle(R.string.show_lyrics);
   showLyrics.setChecked(options.showLyrics);
   root.addPreference(showLyrics);
 }
Пример #5
0
 /** Create the "Scroll Vertically" preference */
 private void createScrollPrefs(PreferenceScreen root) {
   scrollVertically = new CheckBoxPreference(this);
   scrollVertically.setTitle(R.string.scroll_vertically);
   scrollVertically.setChecked(options.scrollVert);
   root.addPreference(scrollVertically);
 }