use of android.widget.TextView in project Conversations by siacs.
the class MagicCreateActivity method onCreate.
@Override
protected void onCreate(final Bundle savedInstanceState) {
if (getResources().getBoolean(R.bool.portrait_only)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
}
super.onCreate(savedInstanceState);
setContentView(R.layout.magic_create);
mFullJidDisplay = (TextView) findViewById(R.id.full_jid);
mUsername = (EditText) findViewById(R.id.username);
mRandom = new SecureRandom();
Button next = (Button) findViewById(R.id.create_account);
next.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String username = mUsername.getText().toString();
if (username.contains("@") || username.length() < 3) {
mUsername.setError(getString(R.string.invalid_username));
mUsername.requestFocus();
} else {
mUsername.setError(null);
try {
Jid jid = Jid.fromParts(username.toLowerCase(), Config.MAGIC_CREATE_DOMAIN, null);
Account account = xmppConnectionService.findAccountByJid(jid);
if (account == null) {
account = new Account(jid, createPassword());
account.setOption(Account.OPTION_REGISTER, true);
account.setOption(Account.OPTION_DISABLED, true);
account.setOption(Account.OPTION_MAGIC_CREATE, true);
xmppConnectionService.createAccount(account);
}
Intent intent = new Intent(MagicCreateActivity.this, EditAccountActivity.class);
intent.putExtra("jid", account.getJid().toBareJid().toString());
intent.putExtra("init", true);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
Toast.makeText(MagicCreateActivity.this, R.string.secure_password_generated, Toast.LENGTH_SHORT).show();
startActivity(intent);
} catch (InvalidJidException e) {
mUsername.setError(getString(R.string.invalid_username));
mUsername.requestFocus();
}
}
}
});
mUsername.addTextChangedListener(this);
}
use of android.widget.TextView in project AndroidForiOS by smbarne.
the class LineTypeArrayAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TripList.LineType lineType = this.getItem(position);
View inflatedView = convertView;
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflatedView = inflater.inflate(LAYOUT_RESOURCE_ID, null);
}
TextView title = (TextView) inflatedView.findViewById(android.R.id.text1);
title.setText(lineType.getLineName());
title.setTextColor(getContext().getResources().getColor(lineType.getLineColorResourceId()));
return inflatedView;
}
use of android.widget.TextView in project AndroidForiOS by smbarne.
the class PredictionArrayAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Prediction prediction = this.getItem(position);
View inflatedView = convertView;
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflatedView = inflater.inflate(LAYOUT_RESOURCE_ID, parent, false);
}
TextView stopNameTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_left_text_view);
TextView middleTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_middle_text_view);
TextView stopSecondsTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_right_text_view);
stopNameTextView.setText(prediction.stopName);
middleTextView.setVisibility(View.GONE);
stopSecondsTextView.setText(prediction.stopSeconds.toString());
return inflatedView;
}
use of android.widget.TextView in project AndroidForiOS by smbarne.
the class TripArrayAdapter method getView.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
Trip trip = this.getItem(position);
View inflatedView = convertView;
if (convertView == null) {
LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflatedView = inflater.inflate(LAYOUT_RESOURCE_ID, parent, false);
}
TextView destinationTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_left_text_view);
TextView timeStampTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_middle_text_view);
TextView trainNameTextView = (TextView) inflatedView.findViewById(R.id.view_three_item_list_view_right_text_view);
destinationTextView.setText(trip.destination);
if (trip.positionTimeStamp != null) {
timeStampTextView.setText(DateFormat.getDateTimeInstance().format(trip.positionTimeStamp));
timeStampTextView.setVisibility(View.VISIBLE);
} else {
timeStampTextView.setVisibility(View.GONE);
}
trainNameTextView.setText(trip.trainName);
return inflatedView;
}
use of android.widget.TextView in project mosby by sockeqwe.
the class TextSizeTransition method createAnimator.
@Override
public Animator createAnimator(ViewGroup sceneRoot, TransitionValues startValues, TransitionValues endValues) {
if (startValues == null || endValues == null) {
return null;
}
Float startSize = (Float) startValues.values.get(PROPNAME_TEXT_SIZE);
Float endSize = (Float) endValues.values.get(PROPNAME_TEXT_SIZE);
if (startSize == null || endSize == null || startSize.floatValue() == endSize.floatValue()) {
return null;
}
TextView view = (TextView) endValues.view;
view.setTextSize(TypedValue.COMPLEX_UNIT_PX, startSize);
return ObjectAnimator.ofFloat(view, TEXT_SIZE_PROPERTY, startSize, endSize);
}
Aggregations