コード例 #1
0
 @Override
 public void onClick(View v) {
   if (requirement) {
     Market p = database.getDefaultRequiredMarket();
     database.setDefaultRequiredMarket(p.withOrder(Market.Order.SELL));
   } else {
     Market p = database.getDefaultProducedMarket();
     database.setDefaultProducedMarket(p.withOrder(Market.Order.SELL));
   }
 }
コード例 #2
0
 @Override
 public void valueChanged(int tag, BigDecimal new_value) {
   if (requirement) {
     Market p = database.getDefaultRequiredMarket();
     database.setDefaultRequiredMarket(p.withTransactionTax(new_value));
   } else {
     Market p = database.getDefaultProducedMarket();
     database.setDefaultProducedMarket(p.withTransactionTax(new_value));
   }
 }
コード例 #3
0
 @Override
 public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
   int sys = system_ids.get(pos);
   if (sys == -1) {
     SettingsSolarSystemDialogFragment dialog = new SettingsSolarSystemDialogFragment();
     Bundle args = new Bundle();
     args.putBoolean("required", requirement);
     dialog.setArguments(args);
     dialog.show(getActivity().getSupportFragmentManager(), "SettingsSolarSystemDialogFragment");
   } else {
     if (requirement) {
       Market p = database.getDefaultRequiredMarket();
       database.setDefaultRequiredMarket(p.withSolarSystem(sys));
     } else {
       Market p = database.getDefaultProducedMarket();
       database.setDefaultProducedMarket(p.withSolarSystem(sys));
     }
   }
 }