make all Spiners centered

This commit is contained in:
Milos Kozak 2017-05-12 23:04:14 +02:00
parent bcd5cba962
commit 3f4cf57bbc
5 changed files with 6 additions and 12 deletions

View file

@ -233,8 +233,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
profileList = profile.getProfileList();
}
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(),
android.R.layout.simple_spinner_item, profileList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
R.layout.spinner_centered, profileList);
profileSpinner.setAdapter(adapter);
if (profile != null) {
// set selected to actual profile
@ -250,8 +249,7 @@ public class NewNSTreatmentDialog extends DialogFragment implements View.OnClick
reasonList.add(MainApp.sResources.getString(R.string.activity));
reasonList.add(MainApp.sResources.getString(R.string.manual));
ArrayAdapter<CharSequence> adapterReason = new ArrayAdapter<CharSequence>(getContext(),
android.R.layout.simple_spinner_item, reasonList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
R.layout.spinner_centered, reasonList);
reasonSpinner.setAdapter(adapterReason);
// bg

View file

@ -71,8 +71,7 @@ public class EditQuickWizardDialog extends DialogFragment implements View.OnClic
timeList.add(DateUtil.timeString(DateUtil.toDate(24 * 60 * 60 - 60)));
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(),
android.R.layout.simple_spinner_item, timeList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
R.layout.spinner_centered, timeList);
fromSpinner.setAdapter(adapter);
toSpinner.setAdapter(adapter);

View file

@ -169,8 +169,7 @@ public class DanaRHistoryActivity extends Activity {
typeList.add(new TypeList(RecordTypes.RECORD_TYPE_REFILL, getString(R.string.danar_history_refill)));
typeList.add(new TypeList(RecordTypes.RECORD_TYPE_SUSPEND, getString(R.string.danar_history_syspend)));
ArrayAdapter<TypeList> spinnerAdapter = new ArrayAdapter<>(this,
android.R.layout.simple_spinner_item, typeList);
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
R.layout.spinner_centered, typeList);
historyTypeSpinner.setAdapter(spinnerAdapter);
reloadButton.setOnClickListener(new View.OnClickListener() {

View file

@ -168,8 +168,7 @@ public class DanaRHistoryActivity extends Activity {
typeList.add(new TypeList(RecordTypes.RECORD_TYPE_GLUCOSE, getString(R.string.danar_history_glucose)));
ArrayAdapter<TypeList> spinnerAdapter = new ArrayAdapter<>(this,
android.R.layout.simple_spinner_item, typeList);
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
R.layout.spinner_centered, typeList);
historyTypeSpinner.setAdapter(spinnerAdapter);
reloadButton.setOnClickListener(new View.OnClickListener() {

View file

@ -229,8 +229,7 @@ public class TimeListEdit {
}
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(context,
android.R.layout.simple_spinner_item, timeList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
R.layout.spinner_centered, timeList);
spinner.setAdapter(adapter);
spinner.setSelection(posInList, false);
}