Exemple #1
0
  @Override
  public void colorChanged(int pos, int color) {
    ImageButton btn = (ImageButton) findViewById(R.id.buttonColor);

    int btnColor = 0;
    if (pos >= mApp.getDisplay().getColorCount()) btnColor = mViewBanner.getSelColor();

    Bitmap bm =
        ColorPickerAdapter.getColorBitmap(
            pos, 80, btnColor, color, mApp.getDisplay().getColorCount(), false);
    btn.setImageBitmap(Bitmap.createScaledBitmap(bm, 64, 64, true));

    Log.d(TAG, "color " + pos);
    if (mViewBanner != null) mViewBanner.setSelColor(pos, color);
  }
Exemple #2
0
  @Override
  public synchronized void onResume() {
    super.onResume();

    OnButtonDone(null);
    String str = mApp.getDisplay().getText();
    EditText editBanner = (EditText) findViewById(R.id.editTextBanner);
    if (editBanner != null && str != null) {
      editBanner.setText(str.toCharArray(), 0, str.length());
    }

    if (mSpinnerFont != null) {
      mSpinnerFont.setSelection(mFontSelIdx);
    }

    updateLedSignInfo(false);

    CheckBox checkVScrollLock = (CheckBox) findViewById(R.id.checkBoxVScroll);
    if (checkVScrollLock != null) {
      boolean check = mViewBanner.getVScroll();
      checkVScrollLock.setChecked(check);
    }

    int nColor = mApp.getDisplay().getDefaultColor();
    mViewBanner.setSelColor(mApp.getDisplay().getColorCount() - 1, nColor);

    int pos = mApp.getDisplay().getColorCount() - 1;
    ImageButton btn = (ImageButton) findViewById(R.id.buttonColor);
    if (btn != null) {
      Bitmap bm =
          ColorPickerAdapter.getColorBitmap(
              pos, 80, 0, nColor, mApp.getDisplay().getColorCount(), false);
      btn.setImageBitmap(Bitmap.createScaledBitmap(bm, 64, 64, true));
    }

    SeekBar speedBar = (SeekBar) findViewById(R.id.seekBarSpeed);
    if (speedBar != null) {
      speedBar.setProgress(mIntPlaySpeed);
    }

    changeSyncButtonState(mBTConnected);

    mViewBanner.invalidate();

    if (mApp.getDisplay() == null || mApp.getDisplay().getBTState() != SerialPort.STATE_CONNECTED)
      mApp.connectDev(new CNKHandler(this));
  }