In the below example code I have changed particular font size by using ttf file. Here I have added ttf file in assets folder using TypeFace class, I have also included zont zip file. You can see the below example it will clearly describe you How to change particular text font size in class using ttf file in android.
RecylerViewListHolder(View itemView, Context context) {
super(itemView);
cardView = (CardView)itemView.findViewById(R.id.cardView);
titileView=(TextView)itemView.findViewById(R.id.offersTitleTextView);
detailsView = (TextView)itemView.findViewById(R.id.offerDetails);
specialOfferTime=(TextView)itemView.findViewById(R.id.specialOfferTime);
specialOfferTitle=(TextView)itemView.findViewById(R.id.specialOfferTitle);
offersImage=(CircularImage)itemView.findViewById(R.id.offersImageView);
imageView=(ImageView)itemView.findViewById(R.id.favouriteImageView);
camerIcon=(ImageView)itemView.findViewById(R.id.camera_icon);
progressBar=(ProgressBar)itemView.findViewById(R.id.progressbar);
// Here i have used ttf font for changing font size
Typeface typeface = Typeface.createFromAsset(context.getAssets(), "HelveticaNeueBold.ttf");
specialOfferTitle.setTypeface(typeface,Typeface.ITALIC);
specialOfferTitle.setTextColor(Color.RED);
this.context=context;
itemView.setOnClickListener(this);
}
0 Comment(s)