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();
}
}
});
}
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;
}
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;
}
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;
}
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();
}
Aggregations