Search in sources :

Example 16 with Spinner

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;
}
Also used : EditText(android.widget.EditText) Toast(android.widget.Toast) Spinner(android.widget.Spinner)

Example 17 with Spinner

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;
}
Also used : Spinner(android.widget.Spinner) LinearLayout(android.widget.LinearLayout)

Example 18 with 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);
    }
}
Also used : Spinner(android.widget.Spinner) Toolbar(android.widget.Toolbar)

Example 19 with Spinner

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);
}
Also used : Spinner(android.widget.Spinner) Intent(android.content.Intent) Date(java.util.Date) CallSuper(android.support.annotation.CallSuper)

Example 20 with Spinner

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();
        }
    });
}
Also used : Spinner(android.widget.Spinner) JSONException(org.json.JSONException) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView) RecyclerView(android.support.v7.widget.RecyclerView) JSONException(org.json.JSONException) JSONObject(org.json.JSONObject) Button(android.widget.Button) LovelyCustomDialog(com.yarolegovich.lovelydialog.LovelyCustomDialog) TextView(android.widget.TextView) ArrayAdapter(android.widget.ArrayAdapter)

Aggregations

Spinner (android.widget.Spinner)418 View (android.view.View)185 AdapterView (android.widget.AdapterView)146 TextView (android.widget.TextView)134 ArrayAdapter (android.widget.ArrayAdapter)132 EditText (android.widget.EditText)67 ArrayList (java.util.ArrayList)49 LinearLayout (android.widget.LinearLayout)48 Intent (android.content.Intent)45 Button (android.widget.Button)45 ImageView (android.widget.ImageView)43 CheckBox (android.widget.CheckBox)42 DialogInterface (android.content.DialogInterface)41 ViewGroup (android.view.ViewGroup)27 CompoundButton (android.widget.CompoundButton)27 RecyclerView (android.support.v7.widget.RecyclerView)26 LayoutInflater (android.view.LayoutInflater)26 ListView (android.widget.ListView)25 Test (org.junit.Test)23 Context (android.content.Context)19