コード例 #1
0
  public SeekBarPreferenceView(final Context context, final AttributeSet attrs) {
    super(context, attrs);
    maximum = attrs.getAttributeIntValue(psndns, "max", 100);
    minimum = attrs.getAttributeIntValue(psndns, "min", 0);
    interval = attrs.getAttributeIntValue(psndns, "interval", 1);
    description = attrs.getAttributeValue(psndns, "summary");
    description = Utils.getStringResource(context, description);
    subtext = attrs.getAttributeValue(androidns, "text");
    mDefault = attrs.getAttributeIntValue(psndns, "defaultValue", 0);
    yEnabled = attrs.getAttributeBooleanValue(psndns, "yenabled", false);
    title = attrs.getAttributeValue(psndns, "title");
    title = Utils.getStringResource(context, title);
    key = attrs.getAttributeValue(psndns, "key");
    key = Utils.getStringResource(context, key);
    midiAsText = attrs.getAttributeBooleanValue(psndns, "midiAsText", false);

    View v = onCreateView(this);
    // Log.d("SeekBar", "Added view : "+v);

  }
コード例 #2
0
 private void setMonitorBox(int progress) {
   if (midiAsText) this.monitorBox.setText(Utils.midiNoteToName(progress));
   else this.monitorBox.setText(progress + "");
 }