Search in sources :

Example 1 with PrefsViewImpl

use of com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl in project xDrip-plus by jamorham.

the class DisplayQRCode method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mInstance = this;
    final ActivityDisplayQrcodeBinding binding = ActivityDisplayQrcodeBinding.inflate(getLayoutInflater());
    binding.setPrefs(new PrefsViewImpl());
    setContentView(binding.getRoot());
    JoH.fixActionBar(this);
    processIntent(getIntent());
}
Also used : PrefsViewImpl(com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl) ActivityDisplayQrcodeBinding(com.eveningoutpost.dexdrip.databinding.ActivityDisplayQrcodeBinding)

Example 2 with PrefsViewImpl

use of com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl in project xDrip-plus by jamorham.

the class DoubleCalibrationActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    xdrip.checkForcedEnglish(this);
    super.onCreate(savedInstanceState);
    if (CollectionServiceStarter.isBTShare(getApplicationContext())) {
        Intent intent = new Intent(this, Home.class);
        startActivity(intent);
        finish();
    }
    ActivityDoubleCalibrationBinding binding = ActivityDoubleCalibrationBinding.inflate(getLayoutInflater());
    binding.setPrefs(new PrefsViewImpl());
    setContentView(binding.getRoot());
    addListenerOnButton();
}
Also used : PrefsViewImpl(com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl) ActivityDoubleCalibrationBinding(com.eveningoutpost.dexdrip.databinding.ActivityDoubleCalibrationBinding) Intent(android.content.Intent)

Example 3 with PrefsViewImpl

use of com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl in project xDrip by NightscoutFoundation.

the class Home method showInitialStatusHelper.

private synchronized void showInitialStatusHelper() {
    if (checkBatteryOptimization()) {
        // update
        initialDataQuality = ProcessInitialDataQuality.getInitialDataQuality();
        if ((helper_dialog != null) && (helper_dialog.isShowing()))
            helper_dialog.dismiss();
        if ((status_helper_dialog != null) && (status_helper_dialog.isShowing())) {
            if (initial_status_binding != null)
                // update data
                initial_status_binding.setIdq(initialDataQuality);
            return;
        }
        final AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.collecting_initial_readings);
        initial_status_binding = PopupInitialStatusHelperBinding.inflate(getLayoutInflater());
        initial_status_binding.setIdq(initialDataQuality);
        if (microStatus == null)
            microStatus = new MicroStatusImpl();
        initial_status_binding.setMs(microStatus);
        initial_status_binding.setPrefs(new PrefsViewImpl());
        builder.setView(initial_status_binding.getRoot());
        status_helper_dialog = builder.create();
        status_helper_dialog.setCanceledOnTouchOutside(true);
        try {
            status_helper_dialog.show();
        } catch (Exception e) {
            UserError.Log.e(TAG, "Could not display calibration prompt helper: " + e);
        }
        keepScreenOn();
    }
}
Also used : AlertDialog(android.app.AlertDialog) PrefsViewImpl(com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl) GsonBuilder(com.google.gson.GsonBuilder) BgGraphBuilder(com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder) MicroStatusImpl(com.eveningoutpost.dexdrip.ui.MicroStatusImpl) IOException(java.io.IOException) ParseException(java.text.ParseException) ActivityNotFoundException(android.content.ActivityNotFoundException)

Example 4 with PrefsViewImpl

use of com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl in project xDrip by NightscoutFoundation.

the class DisplayQRCode method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mInstance = this;
    final ActivityDisplayQrcodeBinding binding = ActivityDisplayQrcodeBinding.inflate(getLayoutInflater());
    binding.setPrefs(new PrefsViewImpl());
    setContentView(binding.getRoot());
    JoH.fixActionBar(this);
    processIntent(getIntent());
}
Also used : PrefsViewImpl(com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl) ActivityDisplayQrcodeBinding(com.eveningoutpost.dexdrip.databinding.ActivityDisplayQrcodeBinding)

Example 5 with PrefsViewImpl

use of com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl in project xDrip-plus by jamorham.

the class Home method showInitialStatusHelper.

private synchronized void showInitialStatusHelper() {
    if (checkBatteryOptimization()) {
        // update
        initialDataQuality = ProcessInitialDataQuality.getInitialDataQuality();
        if ((helper_dialog != null) && (helper_dialog.isShowing()))
            helper_dialog.dismiss();
        if ((status_helper_dialog != null) && (status_helper_dialog.isShowing())) {
            if (initial_status_binding != null)
                // update data
                initial_status_binding.setIdq(initialDataQuality);
            return;
        }
        final AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle(R.string.collecting_initial_readings);
        initial_status_binding = PopupInitialStatusHelperBinding.inflate(getLayoutInflater());
        initial_status_binding.setIdq(initialDataQuality);
        if (microStatus == null)
            microStatus = new MicroStatusImpl();
        initial_status_binding.setMs(microStatus);
        initial_status_binding.setPrefs(new PrefsViewImpl());
        builder.setView(initial_status_binding.getRoot());
        status_helper_dialog = builder.create();
        status_helper_dialog.setCanceledOnTouchOutside(true);
        try {
            status_helper_dialog.show();
        } catch (Exception e) {
            UserError.Log.e(TAG, "Could not display calibration prompt helper: " + e);
        }
        keepScreenOn();
    }
}
Also used : AlertDialog(android.app.AlertDialog) PrefsViewImpl(com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl) GsonBuilder(com.google.gson.GsonBuilder) BgGraphBuilder(com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder) MicroStatusImpl(com.eveningoutpost.dexdrip.ui.MicroStatusImpl) IOException(java.io.IOException) ParseException(java.text.ParseException) ActivityNotFoundException(android.content.ActivityNotFoundException)

Aggregations

PrefsViewImpl (com.eveningoutpost.dexdrip.UtilityModels.PrefsViewImpl)8 AlertDialog (android.app.AlertDialog)2 ActivityNotFoundException (android.content.ActivityNotFoundException)2 Intent (android.content.Intent)2 BgGraphBuilder (com.eveningoutpost.dexdrip.UtilityModels.BgGraphBuilder)2 ActivityDisplayQrcodeBinding (com.eveningoutpost.dexdrip.databinding.ActivityDisplayQrcodeBinding)2 ActivityDoubleCalibrationBinding (com.eveningoutpost.dexdrip.databinding.ActivityDoubleCalibrationBinding)2 MicroStatusImpl (com.eveningoutpost.dexdrip.ui.MicroStatusImpl)2 GsonBuilder (com.google.gson.GsonBuilder)2 IOException (java.io.IOException)2 ParseException (java.text.ParseException)2