use of android.widget.Spinner in project AdMoney by ErnestoGonAr.
the class RecuperarActivity method evento.
public void evento(View v) {
bandera = false;
Spinner a = (Spinner) findViewById(R.id.spinnerPR);
String as = a.getSelectedItem().toString();
EditText b = (EditText) findViewById(R.id.editTextPR);
String bs = b.getText().toString();
if (a.getSelectedItemPosition() == 0) {
Toast toast = Toast.makeText(this, "Selecciona una pregunta de seguridad", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
if (bs.equals("")) {
Toast toast = Toast.makeText(this, "Escribe tu respuesta", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
bandera = true;
}
use of android.widget.Spinner in project android_frameworks_base by DirtyUnicorns.
the class ScrollingTabContainerView method createSpinner.
private Spinner createSpinner() {
final Spinner spinner = new Spinner(getContext(), null, com.android.internal.R.attr.actionDropDownStyle);
spinner.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.MATCH_PARENT));
spinner.setOnItemClickListenerInt(this);
return spinner;
}
use of android.widget.Spinner in project android_frameworks_base by DirtyUnicorns.
the class ToolbarWidgetWrapper method ensureSpinner.
private void ensureSpinner() {
if (mSpinner == null) {
mSpinner = new Spinner(getContext(), null, R.attr.actionDropDownStyle);
Toolbar.LayoutParams lp = new Toolbar.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT, Gravity.START | Gravity.CENTER_VERTICAL);
mSpinner.setLayoutParams(lp);
}
}
use of android.widget.Spinner in project android_frameworks_base by DirtyUnicorns.
the class BaseActivity method onCreate.
@CallSuper
@Override
public void onCreate(Bundle icicle) {
// Record the time when onCreate is invoked for metric.
mStartTime = new Date().getTime();
super.onCreate(icicle);
final Intent intent = getIntent();
addListenerForLaunchCompletion();
setContentView(mLayoutId);
mDrawer = DrawerController.create(this);
mState = getState(icicle);
Metrics.logActivityLaunch(this, mState, intent);
mRoots = DocumentsApplication.getRootsCache(this);
getContentResolver().registerContentObserver(RootsCache.sNotificationUri, false, mRootsCacheObserver);
mSearchManager = new SearchViewManager(this, icicle);
DocumentsToolbar toolbar = (DocumentsToolbar) findViewById(R.id.toolbar);
setActionBar(toolbar);
mNavigator = new NavigationView(mDrawer, toolbar, (Spinner) findViewById(R.id.stack), mState, this);
// Base classes must update result in their onCreate.
setResult(Activity.RESULT_CANCELED);
}
use of android.widget.Spinner in project easy by MehdiBenmesa.
the class StudentsFragmentAbsence method startDialog.
public void startDialog(final JSONArray response, final JSONArray pseances, List<String> modules) {
/* List<String> modules = new ArrayList<String>();
final JSONArray seances = new JSONArray();
try{
for (int i =0;i<response.length();i++) {
JSONObject seance = response.getJSONObject(i);
JSONObject idmodule = seance.getJSONObject("module");
if(idmodule.getString("_id").equals(module.getString("_id"))){
String type = "";
try{
type = seance.getString("type") + " de : ";
}catch (Exception e){
e.printStackTrace();
type = "heur de : ";
}
String seanceSpinner = type + seance.getString("starts") + " à "+seance.getString("ends");
modules.add(seanceSpinner);
seances.put(seance);
}
}} catch (JSONException e){
e.printStackTrace();
}*/
addDialog = getActivity().getLayoutInflater().inflate(R.layout.absence_dialog, null);
final TextView nom = (TextView) addDialog.findViewById(R.id.nomdialog);
final Spinner etat = (Spinner) addDialog.findViewById(R.id.okdialog);
ArrayAdapter<String> adap = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_item, modules);
adap.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
etat.setAdapter(adap);
nom.setText("");
dialog = new LovelyCustomDialog(getContext(), R.style.EditTextTintTheme).setTopColorRes(R.color.darkRed).setView(addDialog).setTitle(R.string.text_input_title).setIcon(R.drawable.ic_add_alert_black_24dp).setCancelable(false);
dialog.show();
Button ok = (Button) addDialog.findViewById(R.id.ok);
Button annuler = (Button) addDialog.findViewById(R.id.cancel);
ok.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try {
String module = etat.getSelectedItem().toString();
} catch (Exception e) {
System.out.println("NO MODULE ");
}
try {
int position = etat.getSelectedItemPosition();
AbsenceService.getAbsneceBySeance(getContext(), mReceiver, new JSONObject().put("idSeance", pseances.getJSONObject(position).getString("_id")).put("date", newDate));
} catch (JSONException e) {
e.printStackTrace();
}
dialog.dismiss();
}
});
annuler.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
}
Aggregations