Exemplo n.º 1
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    setContentView(R.layout.logging_layout);

    app = (App) getApplication();
    app.Say(getString(R.string.Logging));
  }
Exemplo n.º 2
0
  @Override
  protected void onResume() {
    super.onResume();
    app.ForceLanguage();

    if (app.RadioMode == 1) {
      Mode1.setChecked(true);
    } else {
      Mode2.setChecked(true);
    }

    if (app.Protocol == 200) {
      Protocol20.setChecked(true);
    } else {
      Protocol21.setChecked(true);
    }

    if (app.MagMode == 1) {
      MagMode1.setChecked(true);
    } else {
      MagMode2.setChecked(true);
    }

    CheckBoxTTS.setChecked(app.TextToSpeach);
    CheckBoxConnectOnStart.setChecked(app.ConnectOnStart);
    CheckBoxAltCorrection.setChecked(app.AltCorrection);
    CheckBoxDisableBTonExit.setChecked(app.DisableBTonExit);
    CheckBoxCopyFrskyToMW.setChecked(app.CopyFrskyToMW);
    CheckBoxUseOfflineMap.setChecked(app.UseOfflineMaps);
    CheckBoxReverseRollDirection.setChecked(app.ReverseRoll);
    CheckBoxUseFTDISerial.setChecked(
        app.CommunicationTypeMW == App.COMMUNICATION_TYPE_SERIAL_FTDI
            || app.CommunicationTypeMW == App.COMMUNICATION_TYPE_SERIAL_OTHERCHIPS);
    RadioFTDI.setChecked(
        app.CommunicationTypeMW == App.COMMUNICATION_TYPE_SERIAL_FTDI
            || app.CommunicationTypeMW == App.COMMUNICATION_TYPE_BT);
    RadioOtherChips.setChecked(app.CommunicationTypeMW == App.COMMUNICATION_TYPE_SERIAL_OTHERCHIPS);
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR1) {
      LayoutSerialFTDI.setVisibility(View.GONE);
    }

    MacAddressBTTV.setText("MAC:" + app.MacAddress);
    MacAddressBTFrskyTV.setText("MAC:" + app.MacAddressFrsky);

    RadioNotForce.setChecked(app.ForceLanguage.equals(""));
    RadioForceEnglish.setChecked(app.ForceLanguage.equals("en"));
    RadioForceGerman.setChecked(app.ForceLanguage.equals("de"));
    RadioForceHungarian.setChecked(app.ForceLanguage.equals("hu"));
    RadioForcePolish.setChecked(app.ForceLanguage.equals("pl"));

    EditTextPeriodicSpeaking.setText(String.valueOf(app.PeriodicSpeaking / 1000));

    EditTextVoltageAlarm.setText(String.valueOf(app.VoltageAlarm));
    EditTextRefreshRate.setText(String.valueOf(app.RefreshRate));
    EditTextMapCenterPeriod.setText(String.valueOf(app.MapCenterPeriod));
    EditTextSerialBaudRateMW.setText(app.SerialPortBaudRateMW);

    if (app.MainRequestMethod == 2) {
      CheckBoxNewRequestMethod.setChecked(true);
    } else {
      CheckBoxNewRequestMethod.setChecked(false);
    }

    app.Say(getString(R.string.Config));

    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
  }