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