Ejemplo n.º 1
0
 public void onServerSettingSaveButtonClicked() {
   SharedPreferences sharedPreferences =
       getActivity().getSharedPreferences(GlobalValues.PREFS_FILE_NAME, 0);
   float compileWeight =
       Float.parseFloat(binder.serverSettingCompileWeight.getEditText().getText().toString());
   binder.setCompileWeight(compileWeight);
   sharedPreferences.edit().putFloat(GlobalValues.PREFS_COMPILE_WEIGHT, compileWeight).apply();
 }
Ejemplo n.º 2
0
  @Override
  public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    new GetEventsTask().execute();

    SharedPreferences sharedPreferences =
        getActivity().getSharedPreferences(GlobalValues.PREFS_FILE_NAME, 0);
    float compileWeight = sharedPreferences.getFloat(GlobalValues.PREFS_COMPILE_WEIGHT, 1.0f);

    binder.hostToggle.setOnCheckedChangeListener(this);
    binder.serverSettingsSave.setOnClickListener(this);
    binder.serverSettingsRestoreDefaults.setOnClickListener(this);
    binder.excel.setOnClickListener(this);
    binder.viewEvent.setOnClickListener(this);
    binder.setCompileWeight(compileWeight);

    EventBus.getDefault().post(new ServerStateRequestEvent());
  }
Ejemplo n.º 3
0
 @Override
 public View onCreateView(
     LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
   binder = DataBindingUtil.inflate(inflater, R.layout.fragment_server, null, false);
   return binder.getRoot();
 }
Ejemplo n.º 4
0
 public void onRestoreButtonClicked() {
   SharedPreferences sharedPreferences =
       getActivity().getSharedPreferences(GlobalValues.PREFS_FILE_NAME, 0);
   sharedPreferences.edit().putFloat(GlobalValues.PREFS_COMPILE_WEIGHT, 1.0f).apply();
   binder.setCompileWeight(1.0f);
 }