Search in sources :

Example 81 with ExpandableListView

use of android.widget.ExpandableListView in project android by cSploit.

the class PasswordSniffer method onCreate.

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    SharedPreferences themePrefs = getSharedPreferences("THEME", 0);
    Boolean isDark = themePrefs.getBoolean("isDark", false);
    if (isDark)
        setTheme(R.style.DarkTheme);
    else
        setTheme(R.style.AppTheme);
    setTitle(System.getCurrentTarget() + " > MITM > Password Sniffer");
    setContentView(R.layout.plugin_mitm_password_sniffer);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    mFileOutput = (new File(System.getStoragePath(), System.getSettings().getString("PREF_PASSWORD_FILENAME", "csploit-password-sniff.log"))).getAbsolutePath();
    mSniffToggleButton = (ToggleButton) findViewById(R.id.sniffToggleButton);
    mSniffProgress = (ProgressBar) findViewById(R.id.sniffActivity);
    mListView = (ExpandableListView) findViewById(R.id.listView);
    mAdapter = new ListViewAdapter(this);
    mSpoofSession = new SpoofSession(false, false, null, null);
    mListView.setAdapter(mAdapter);
    mSniffToggleButton.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            if (mRunning) {
                setStoppedState();
            } else {
                setStartedState();
            }
        }
    });
}
Also used : SharedPreferences(android.content.SharedPreferences) OnClickListener(android.view.View.OnClickListener) File(java.io.File) View(android.view.View) TextView(android.widget.TextView) ExpandableListView(android.widget.ExpandableListView)

Example 82 with ExpandableListView

use of android.widget.ExpandableListView in project TaEmCasa by Dionen.

the class MinhasVagasActivity method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.search_my_list, container, false);
    // Incializa lista de moradias do usuário
    listaMoradias = new ArrayList<Republica>();
    // DEVE-SE OBTER AS MORADIAS E VAGAS DO USUARIO
    listaVagas = new HashMap<Republica, List<Vaga>>();
    ExpandableListView minhasMoradias = (ExpandableListView) rootView.findViewById(R.id.expandable_list);
    Button adicionarVaga = (Button) rootView.findViewById(R.id.adicionarVaga);
    /* Liga os valores ao layout */
    adapter = new ExpandableListAdapter(getActivity(), listaMoradias, listaVagas);
    minhasMoradias.setAdapter(adapter);
    /* Botão de iniciar cadastro de moradia */
    adicionarVaga.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(getContext(), AdicionarMoradia.class);
            intent.putExtra("user_id", getActivity().getIntent().getExtras().getString("user_id"));
            intent.putExtra("nome", getActivity().getIntent().getExtras().getString("nome"));
            intent.putExtra("sobrenome", getActivity().getIntent().getExtras().getString("sobrenome"));
            intent.putExtra("email", getActivity().getIntent().getExtras().getString("email"));
            startActivity(intent);
        }
    });
    return rootView;
}
Also used : Button(android.widget.Button) ArrayList(java.util.ArrayList) List(java.util.List) BaseExpandableListAdapter(android.widget.BaseExpandableListAdapter) Intent(android.content.Intent) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView) ExpandableListView(android.widget.ExpandableListView) ExpandableListView(android.widget.ExpandableListView) Republica(com.usp.icmc.taemcasa.Structures.Republica)

Example 83 with ExpandableListView

use of android.widget.ExpandableListView in project SmartAndroidSource by jaychou2012.

the class Common method shouldDelay.

public static boolean shouldDelay(int groupPosition, int childPosition, View convertView, ViewGroup parent, String url) {
    if (url == null || BitmapAjaxCallback.isMemoryCached(url)) {
        return false;
    }
    AbsListView lv = (AbsListView) parent;
    OnScrollListener sl = (OnScrollListener) parent.getTag(AQuery.TAG_SCROLL_LISTENER);
    if (sl == null) {
        sl = new Common();
        lv.setOnScrollListener(sl);
        parent.setTag(AQuery.TAG_SCROLL_LISTENER, sl);
    }
    Integer scrollState = (Integer) lv.getTag(AQuery.TAG_NUM);
    if (scrollState == null || scrollState == OnScrollListener.SCROLL_STATE_IDLE || scrollState == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
        return false;
    }
    long packed = childPosition;
    if (parent instanceof ExpandableListView) {
        packed = ExpandableListView.getPackedPositionForChild(groupPosition, childPosition);
    }
    convertView.setTag(AQuery.TAG_NUM, packed);
    return true;
}
Also used : OnScrollListener(android.widget.AbsListView.OnScrollListener) AbsListView(android.widget.AbsListView) ExpandableListView(android.widget.ExpandableListView)

Example 84 with ExpandableListView

use of android.widget.ExpandableListView in project SmartAndroidSource by jaychou2012.

the class PullToRefreshExpandableListView method createRefreshableView.

@Override
protected ExpandableListView createRefreshableView(Context context, AttributeSet attrs) {
    final ExpandableListView lv;
    if (VERSION.SDK_INT >= VERSION_CODES.GINGERBREAD) {
        lv = new InternalExpandableListViewSDK9(context, attrs);
    } else {
        lv = new InternalExpandableListView(context, attrs);
    }
    // Set it to this so it can be used in ListActivity/ListFragment
    lv.setId(android.R.id.list);
    return lv;
}
Also used : ExpandableListView(android.widget.ExpandableListView)

Example 85 with ExpandableListView

use of android.widget.ExpandableListView in project XPrivacy by M66B.

the class ActivityMain method optionTemplate.

@SuppressLint("InflateParams")
private void optionTemplate() {
    final int userId = Util.getUserId(Process.myUid());
    // Build view
    LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.template, null);
    final Spinner spTemplate = (Spinner) view.findViewById(R.id.spTemplate);
    Button btnRename = (Button) view.findViewById(R.id.btnRename);
    ExpandableListView elvTemplate = (ExpandableListView) view.findViewById(R.id.elvTemplate);
    // Template selector
    final SpinnerAdapter spAdapter = new SpinnerAdapter(this, android.R.layout.simple_spinner_item);
    spAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    String defaultName = PrivacyManager.getSetting(userId, Meta.cTypeTemplateName, "0", getString(R.string.title_default));
    spAdapter.add(defaultName);
    for (int i = 1; i <= 4; i++) {
        String alternateName = PrivacyManager.getSetting(userId, Meta.cTypeTemplateName, Integer.toString(i), getString(R.string.title_alternate) + " " + i);
        spAdapter.add(alternateName);
    }
    spTemplate.setAdapter(spAdapter);
    // Template definition
    final TemplateListAdapter templateAdapter = new TemplateListAdapter(this, view, R.layout.templateentry);
    elvTemplate.setAdapter(templateAdapter);
    elvTemplate.setGroupIndicator(null);
    spTemplate.setOnItemSelectedListener(new OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
            templateAdapter.notifyDataSetChanged();
        }

        @Override
        public void onNothingSelected(AdapterView<?> arg0) {
            templateAdapter.notifyDataSetChanged();
        }
    });
    btnRename.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            if (Util.hasProLicense(ActivityMain.this) == null) {
                // Redirect to pro page
                Util.viewUri(ActivityMain.this, cProUri);
                return;
            }
            final int templateId = spTemplate.getSelectedItemPosition();
            if (templateId == AdapterView.INVALID_POSITION)
                return;
            AlertDialog.Builder dlgRename = new AlertDialog.Builder(spTemplate.getContext());
            dlgRename.setTitle(R.string.title_rename);
            final String original = (templateId == 0 ? getString(R.string.title_default) : getString(R.string.title_alternate) + " " + templateId);
            dlgRename.setMessage(original);
            final EditText input = new EditText(spTemplate.getContext());
            dlgRename.setView(input);
            dlgRename.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int whichButton) {
                    String name = input.getText().toString();
                    if (TextUtils.isEmpty(name)) {
                        PrivacyManager.setSetting(userId, Meta.cTypeTemplateName, Integer.toString(templateId), null);
                        name = original;
                    } else {
                        PrivacyManager.setSetting(userId, Meta.cTypeTemplateName, Integer.toString(templateId), name);
                    }
                    spAdapter.remove(spAdapter.getItem(templateId));
                    spAdapter.insert(name, templateId);
                    spAdapter.notifyDataSetChanged();
                }
            });
            dlgRename.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {

                public void onClick(DialogInterface dialog, int whichButton) {
                // Do nothing
                }
            });
            dlgRename.create().show();
        }
    });
    // Build dialog
    AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
    alertDialogBuilder.setTitle(R.string.menu_template);
    alertDialogBuilder.setIcon(getThemed(R.attr.icon_launcher));
    alertDialogBuilder.setView(view);
    alertDialogBuilder.setPositiveButton(getString(R.string.msg_done), new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
        // Do nothing
        }
    });
    // Show dialog
    AlertDialog alertDialog = alertDialogBuilder.create();
    alertDialog.show();
}
Also used : AlertDialog(android.app.AlertDialog) EditText(android.widget.EditText) DialogInterface(android.content.DialogInterface) Spinner(android.widget.Spinner) OnClickListener(android.view.View.OnClickListener) ImageView(android.widget.ImageView) View(android.view.View) AdapterView(android.widget.AdapterView) WebView(android.webkit.WebView) TextView(android.widget.TextView) ListView(android.widget.ListView) SearchView(android.widget.SearchView) ScrollView(android.widget.ScrollView) ExpandableListView(android.widget.ExpandableListView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) Button(android.widget.Button) CompoundButton(android.widget.CompoundButton) LayoutInflater(android.view.LayoutInflater) OnItemSelectedListener(android.widget.AdapterView.OnItemSelectedListener) OnClickListener(android.view.View.OnClickListener) ExpandableListView(android.widget.ExpandableListView) SuppressLint(android.annotation.SuppressLint)

Aggregations

ExpandableListView (android.widget.ExpandableListView)86 View (android.view.View)59 TextView (android.widget.TextView)30 AdapterView (android.widget.AdapterView)18 Intent (android.content.Intent)16 ListView (android.widget.ListView)16 ArrayList (java.util.ArrayList)16 AbsListView (android.widget.AbsListView)14 DialogInterface (android.content.DialogInterface)11 ImageView (android.widget.ImageView)11 List (java.util.List)11 Builder (android.app.AlertDialog.Builder)9 ViewGroup (android.view.ViewGroup)9 ExpandableListAdapter (android.widget.ExpandableListAdapter)7 AbsSpinner (android.widget.AbsSpinner)6 QuickContactBadge (android.widget.QuickContactBadge)6 TabHost (android.widget.TabHost)6 AdapterBinding (com.android.ide.common.rendering.api.AdapterBinding)6 ResourceReference (com.android.ide.common.rendering.api.ResourceReference)6 SessionParams (com.android.ide.common.rendering.api.SessionParams)6