Search in sources :

Example 46 with TextView

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);
}
Also used : Account(eu.siacs.conversations.entities.Account) Jid(eu.siacs.conversations.xmpp.jid.Jid) Button(android.widget.Button) InvalidJidException(eu.siacs.conversations.xmpp.jid.InvalidJidException) SecureRandom(java.security.SecureRandom) Intent(android.content.Intent) TextView(android.widget.TextView) View(android.view.View)

Example 47 with TextView

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;
}
Also used : TripList(com.example.androidforios.app.data.model.TripList) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 48 with TextView

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;
}
Also used : Prediction(com.example.androidforios.app.data.model.Prediction) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 49 with TextView

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;
}
Also used : Trip(com.example.androidforios.app.data.model.Trip) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 50 with TextView

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

Aggregations

TextView (android.widget.TextView)4994 View (android.view.View)2680 ImageView (android.widget.ImageView)1137 Button (android.widget.Button)442 LinearLayout (android.widget.LinearLayout)439 LayoutInflater (android.view.LayoutInflater)425 Intent (android.content.Intent)397 ListView (android.widget.ListView)389 AdapterView (android.widget.AdapterView)372 ViewGroup (android.view.ViewGroup)322 OnClickListener (android.view.View.OnClickListener)304 RecyclerView (android.support.v7.widget.RecyclerView)197 Test (org.junit.Test)197 ScrollView (android.widget.ScrollView)166 DialogInterface (android.content.DialogInterface)162 Context (android.content.Context)156 Drawable (android.graphics.drawable.Drawable)155 EditText (android.widget.EditText)149 AlertDialog (android.app.AlertDialog)144 Bundle (android.os.Bundle)144