Search in sources :

Example 31 with TextView

use of android.widget.TextView in project AndroidTreeView by bmelnychuk.

the class SocialViewHolder method createNodeView.

@Override
public View createNodeView(TreeNode node, SocialItem value) {
    final LayoutInflater inflater = LayoutInflater.from(context);
    final View view = inflater.inflate(R.layout.layout_social_node, null, false);
    final PrintView iconView = (PrintView) view.findViewById(R.id.icon);
    iconView.setIconText(context.getResources().getString(value.icon));
    TextView connectionsLabel = (TextView) view.findViewById(R.id.connections);
    Random r = new Random();
    connectionsLabel.setText(r.nextInt(150) + " connections");
    TextView userNameLabel = (TextView) view.findViewById(R.id.username);
    userNameLabel.setText(NAMES[r.nextInt(4)]);
    TextView sizeText = (TextView) view.findViewById(R.id.size);
    sizeText.setText(r.nextInt(10) + " items");
    return view;
}
Also used : Random(java.util.Random) PrintView(com.github.johnkil.print.PrintView) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) TextView(android.widget.TextView) PrintView(com.github.johnkil.print.PrintView) View(android.view.View)

Example 32 with TextView

use of android.widget.TextView in project StepView by baoyachi.

the class HorizontalStepView method ondrawIndicator.

@Override
public void ondrawIndicator() {
    if (mTextContainer != null) {
        mTextContainer.removeAllViews();
        List<Float> complectedXPosition = mStepsViewIndicator.getCircleCenterPointPositionList();
        if (mStepBeanList != null && complectedXPosition != null && complectedXPosition.size() > 0) {
            for (int i = 0; i < mStepBeanList.size(); i++) {
                mTextView = new TextView(getContext());
                mTextView.setTextSize(TypedValue.COMPLEX_UNIT_SP, mTextSize);
                mTextView.setText(mStepBeanList.get(i).getName());
                int spec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
                mTextView.measure(spec, spec);
                // getMeasuredWidth
                int measuredWidth = mTextView.getMeasuredWidth();
                mTextView.setX(complectedXPosition.get(i) - measuredWidth / 2);
                mTextView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
                if (i <= mComplectingPosition) {
                    mTextView.setTypeface(null, Typeface.BOLD);
                    mTextView.setTextColor(mComplectedTextColor);
                } else {
                    mTextView.setTextColor(mUnComplectedTextColor);
                }
                mTextContainer.addView(mTextView);
            }
        }
    }
}
Also used : ViewGroup(android.view.ViewGroup) TextView(android.widget.TextView)

Example 33 with TextView

use of android.widget.TextView in project Navigation-drawer-page-sliding-tab-strip by balaji-k13.

the class SuperAwesomeCardFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
    FrameLayout fl = new FrameLayout(getActivity());
    fl.setLayoutParams(params);
    final int margin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 8, getResources().getDisplayMetrics());
    TextView v = new TextView(getActivity());
    params.setMargins(margin, margin, margin, margin);
    v.setLayoutParams(params);
    v.setLayoutParams(params);
    v.setGravity(Gravity.CENTER);
    v.setBackgroundResource(R.drawable.background_card);
    v.setText("CARD " + (position + 1));
    fl.addView(v);
    return fl;
}
Also used : LayoutParams(android.widget.FrameLayout.LayoutParams) FrameLayout(android.widget.FrameLayout) TextView(android.widget.TextView)

Example 34 with TextView

use of android.widget.TextView in project ButterRemote-Android by se-bastiaan.

the class DonationAdapter method getView.

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    final Donation donation = getItem(position);
    final Holder holder;
    final View view;
    if (convertView == null) {
        holder = new Holder();
        view = mInflater.inflate(R.layout.donation_iab_item, parent, false);
        assert view != null;
        holder.title = (TextView) view.findViewById(android.R.id.title);
        holder.summary = (TextView) view.findViewById(android.R.id.summary);
        view.setTag(holder);
    } else {
        view = convertView;
        holder = (Holder) view.getTag();
    }
    boolean bought = mInventorySet.contains(donation.sku);
    String amount = Integer.toString(donation.amount);
    holder.title.setText(String.format(mDonationAmountLabel, amount));
    holder.title.setTextColor(bought ? mColorNormal : mColorPurchased);
    holder.summary.setText(donation.text);
    holder.summary.setPaintFlags(bought ? holder.summary.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG : holder.summary.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG));
    return view;
}
Also used : TextView(android.widget.TextView) View(android.view.View)

Example 35 with TextView

use of android.widget.TextView in project MinimalForm by sd6352051.

the class MinimalFormLayout method init.

private void init(Context context, AttributeSet attrs) {
    mTextViewSuccess = new TextView(context);
    RelativeLayout.LayoutParams successParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
    successParams.addRule(RelativeLayout.CENTER_IN_PARENT, RelativeLayout.TRUE);
    mTextViewSuccess.setId(LABLE_SUCCESS_ID);
    addView(mTextViewSuccess, successParams);
}
Also used : RelativeLayout(android.widget.RelativeLayout) 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