public void generateScreen() { List<String> names = presenter.getAccountNames(username, password); LinearLayout layout = (LinearLayout) findViewById(R.id.accountArray); TextView account = new TextView(this); Point size = new Point(); Display display = ((android.view.WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); display.getSize(size); Button temp; if (!(names.size() > 0)) { return; } account.setBackgroundColor(Color.BLACK); account.setHeight(2); account.setWidth(size.x); layout.addView(account); for (String name : names) { temp = new Button(this); temp.setText(name); temp.setGravity(Gravity.CENTER); temp.setOnClickListener(AccountClickListener); layout.addView(temp); account = new TextView(this); account.setWidth(size.x); account.setBackgroundColor(Color.BLACK); account.setHeight(2); layout.addView(account); } }
public void onClickLogout(View v) { presenter.onClickLogout(); }
public void onClickCreate(View v) { presenter.onClickCreate(); }