public FiveStepsTableArrayAdapter(Context var1, int var2, List var3) { super(var1, var2, var3); this.light = Typeface.createFromAsset(var1.getAssets(), "nexa_light.otf"); this.bold = Typeface.createFromAsset(var1.getAssets(), "nexa_bold.otf"); this.context = var1; this.mIdMap = var3; }
@Override protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); setContentView(R.layout.activity_splash); mLogo = (ImageView) findViewById(R.id.logo); Glide.with(Splash.this).load(R.drawable.app_icon_512x512).into(mLogo); Typeface typeface1 = Typeface.createFromAsset(getAssets(), "comfortaa_bold.ttf"); Typeface typeface2 = Typeface.createFromAsset(getAssets(), "comfortaa_light.ttf"); TextView textView1 = (TextView) findViewById(R.id.cm); TextView textView2 = (TextView) findViewById(R.id.walking_street); textView1.setTypeface(typeface1); textView2.setTypeface(typeface2); handler = new Handler(); runnable = new Runnable() { @Override public void run() { Intent intent; if (checkLogin()) { intent = new Intent(Splash.this, MainActivity.class); } else { intent = new Intent(Splash.this, LoginActivity.class); } startActivity(intent); finish(); } }; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_login); presenter = new LoginPresenter(this, new LoginService(this)); // register buttonn Login_OnClickButtonListener(); ClearDB_OnClickButtonListener(); RegistrationLink_OnClickListener(); // text handles header = (TextView) findViewById(R.id.textView_header); username = (EditText) findViewById(R.id.editText_username); password = (EditText) findViewById(R.id.editText_password); Typeface type = Typeface.createFromAsset(getAssets(), "fonts/Sansation-LightItalic.ttf"); Typeface glyphicons = Typeface.createFromAsset(getAssets(), "fonts/fontawesome-webfont.ttf"); // initialize values header.setTypeface(type); username.setText(""); username.setTypeface(glyphicons); username.setHint(" \uf007 Username"); password.setText(""); password.setTypeface(glyphicons); password.setHint(" \uf023 Password"); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // supportRequestWindowFeature(Window.FEATURE_NO_TITLE); // this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_about); // custom action bar Toolbar toolbar = (Toolbar) findViewById(R.id.tool_bar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); Typeface hotelFont = Typeface.createFromAsset(getAssets(), "fonts/OptimusPrinceps.ttf"); Typeface iconFont = Typeface.createFromAsset(getAssets(), "fonts/NuevaStd-Bold.otf"); Typeface arialFont = Typeface.createFromAsset(getAssets(), "fonts/arial.ttf"); TextView activityTitle = (TextView) findViewById(R.id.activity_title); activityTitle.setTypeface(iconFont); TextView hotelName = (TextView) findViewById(R.id.hotel_name); hotelName.setTypeface(hotelFont); TextView roomNumber = (TextView) findViewById(R.id.room_number); roomNumber.setTypeface(hotelFont); }
// region Lifecycle Methods @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_quick_return_twitter); ButterKnife.inject(this); mSectionsPagerAdapter = new SectionsPagerAdapter(getFragmentManager()); // Set up the ViewPager with the sections adapter. mViewPager.setAdapter(mSectionsPagerAdapter); mTabs.setAllCaps(false); mTabs.setShouldExpand(true); mTabs.setTextSize(QuickReturnUtils.dp2px(this, 16)); mTabs.setTabBackground(R.drawable.selector_bg_tab); mTabs.setIndicatorColorResource(R.color.steel_blue); mTabs.setIndicatorHeight(QuickReturnUtils.dp2px(this, 5)); mTabs.setOnPageChangeListener(mTabsOnPageChangeListener); mTabs.setViewPager(mViewPager); // Set first tab selected mTabsLinearLayout = ((LinearLayout) mTabs.getChildAt(0)); for (int i = 0; i < mTabsLinearLayout.getChildCount(); i++) { TextView tv = (TextView) mTabsLinearLayout.getChildAt(i); if (i == 0) { tv.setTextColor(getResources().getColor(R.color.steel_blue)); tv.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/Roboto-Medium.ttf")); } else { tv.setTextColor(getResources().getColor(R.color.steel_blue)); tv.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf")); } } }
private void initialize(View fragmentView, Context context) { ButterKnife.bind(this, fragmentView); Typeface robotoBlack = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Black.ttf"); txtGuideLine.setTypeface(robotoBlack); Typeface robotoCondensedLight = Typeface.createFromAsset(context.getAssets(), "fonts/RobotoCondensed-Light.ttf"); edtNidName.setTypeface(robotoCondensedLight); edtNidBirthDate.setTypeface(robotoCondensedLight); edtNidNo.setTypeface(robotoCondensedLight); fab.setOnClickListener(fabOnClickListener); edtNidBirthDate.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { showDialog(); } }); imgDatePicker.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { showDialog(); } }); }
public void onCreate(Bundle savedInstanceState) { if (Utils.isTablet(this)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } super.onCreate(savedInstanceState); setContentView(R.layout.firstrun); context = this; Utils.showWhatNewDialog(context); ActionBar actionBar = getSupportActionBar(); TextView ganjdroid = new TextView(this); Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/font3.ttf"); ganjdroid.setTypeface(typeface); ganjdroid.setText("GrowDroid"); ganjdroid.setTextSize(20); ganjdroid.setGravity(Gravity.CENTER); ganjdroid.setTextColor(getResources().getColor(R.color.white)); actionBar.setCustomView(ganjdroid); actionBar.setDisplayShowCustomEnabled(true); actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayUseLogoEnabled(true); actionBar.setLogo(getResources().getDrawable(R.drawable.ic_launcher)); TextView textView = (TextView) findViewById(R.id.pressTextView); textView.setTypeface( Typeface.createFromAsset(context.getAssets(), "fonts/Roboto/Roboto-Thin.ttf")); RelativeLayout relativeLayout = (RelativeLayout) findViewById(R.id.pressLayout); relativeLayout.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(context, NewCycle.class); startActivity(intent); } }); }
public FlipAdapter(Context paramContext, List<Item> items) { this.items = items; this.context = paramContext; futuraTypeface = Typeface.createFromAsset(paramContext.getAssets(), "font/futura.ttf"); muktiTypeface = Typeface.createFromAsset(paramContext.getAssets(), "font/mukti.ttf"); this.inflater = LayoutInflater.from(paramContext); }
@Override public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = getLayoutInflater(); View list_object = inflater.inflate(R.layout.single_list_object, parent, false); TextView label = (TextView) list_object.findViewById(R.id.row_text); TextView title = (TextView) findViewById(R.id.txtHeader); Typeface font1 = Typeface.createFromAsset(getAssets(), "HelveticaNeueLTStd-Roman.otf"); Typeface font2 = Typeface.createFromAsset(getAssets(), "HelveticaNeueLTStd-Bd.otf"); label.setTypeface(font1); title.setTypeface(font2); String[] title_array = getResources().getStringArray(R.array.cat_00); title.setText(title_array[0]); String[] cat_array = getResources().getStringArray(R.array.cat_01); label.setText(cat_array[position]); ImageView icon = (ImageView) list_object.findViewById(R.id.icon); // open close list array to open (); if (SetItem[position] == "1") { icon.setImageResource(R.drawable.icon_unlock); } else { icon.setImageResource(R.drawable.icon_lock); } return list_object; }
@Override public View getView(int position, View convertView, ViewGroup parent) { MatchHistoryViewHolder holder = null; MatchHistoryListItem matchHistoryItem = getItem(position); LayoutInflater mInflater = (LayoutInflater) context.getSystemService(Activity.LAYOUT_INFLATER_SERVICE); if (convertView == null) { convertView = mInflater.inflate(R.layout.match_history_list_row, null); convertView.setLayoutParams( new ListView.LayoutParams( ListView.LayoutParams.MATCH_PARENT, ListView.LayoutParams.WRAP_CONTENT)); holder = new MatchHistoryViewHolder(); holder.heroName = (TextView) convertView.findViewById(R.id.matchHistoryRow_HeroName); holder.heroPic = (RoundedImageView) convertView.findViewById(R.id.matchHistoryRow_HeroPic); holder.dateTime = (TextView) convertView.findViewById(R.id.matchHistoryRow_DateTime); String fontPath1 = "fonts/segoeui.ttf"; String fontPath2 = "fonts/segoeuil.ttf"; tf = Typeface.createFromAsset(this.context.getAssets(), fontPath1); holder.heroName.setTypeface(tf); tf = Typeface.createFromAsset(this.context.getAssets(), fontPath2); holder.dateTime.setTypeface(tf); convertView.setTag(holder); } else holder = (MatchHistoryViewHolder) convertView.getTag(); holder.heroName.setText(matchHistoryItem.getHeroName()); holder.dateTime.setText(matchHistoryItem.getDateTime()); holder.heroPic.setImageBitmap(matchHistoryItem.getHeroPic()); return convertView; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_cancellation_confirmed); img_Back = (ImageView) findViewById(R.id.img_Back); img_Back.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent i = new Intent(CancellationConfirmedActivity.this, MainActivity.class); startActivity(i); finish(); } }); img_Check_mark = (ImageView) findViewById(R.id.img_Check_mark); txt_hearder = (TextView) findViewById(R.id.txt_hearder); txt_Cancellation_Confirm = (TextView) findViewById(R.id.txt_Cancellation_Confirm); btn_Keep_shopping = (Button) findViewById(R.id.btn_Keep_shopping); btn_View_all_orders = (Button) findViewById(R.id.btn_View_all_orders); Roboto_medium = Typeface.createFromAsset(getAssets(), "Roboto-Medium.ttf"); Roboto_regular = Typeface.createFromAsset(getAssets(), "Roboto-Regular.ttf"); txt_hearder.setTypeface(Roboto_medium); txt_Cancellation_Confirm.setTypeface(Roboto_regular); btn_Keep_shopping.setTypeface(Roboto_regular); btn_View_all_orders.setTypeface(Roboto_regular); }
public void Update(View rootView) { final Typeface custom_font_regular = Typeface.createFromAsset(rootView.getContext().getAssets(), "fonts/Quicksand-Regular.otf"); final Typeface custom_font_bold = Typeface.createFromAsset(rootView.getContext().getAssets(), "fonts/Quicksand-Bold.otf"); final Typeface custom_font_italic = Typeface.createFromAsset(rootView.getContext().getAssets(), "fonts/Quicksand-Italic.otf"); TextView vText = ((TextView) rootView.findViewById(R.id.sprintDetTitle)); ((TextView) rootView.findViewById(R.id.sprintDetTitle)).setText(sprint.id); ((TextView) rootView.findViewById(R.id.sprintDetEstHours)) .setText("Estimated Hours : " + Float.toString(sprint.estHours)); ((TextView) rootView.findViewById(R.id.sprintDetEstWeeks)) .setText("Estimated Weeks : " + Float.toString(sprint.estWeeks)); ((TextView) rootView.findViewById(R.id.sprintDetCompletedHours)) .setText("Completed Hours : " + Float.toString(sprint.completedHours)); ((TextView) rootView.findViewById(R.id.sprintDetCompletedWeeks)) .setText("Completed Weeks : " + Float.toString(sprint.completedWeeks)); ((TextView) rootView.findViewById(R.id.sprintDetTitle)).setTypeface(custom_font_regular); ((TextView) rootView.findViewById(R.id.sprintDetEstHours)).setTypeface(custom_font_regular); ((TextView) rootView.findViewById(R.id.sprintDetEstWeeks)).setTypeface(custom_font_regular); ((TextView) rootView.findViewById(R.id.sprintDetCompletedHours)) .setTypeface(custom_font_regular); ((TextView) rootView.findViewById(R.id.sprintDetCompletedWeeks)) .setTypeface(custom_font_regular); while (mProgressStatus < 100) { mProgressStatus = (int) ((sprint.completedHours / sprint.estHours) * 100f); break; } mProgress.setProgress(mProgressStatus); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.editinterest); save = (Button) findViewById(R.id.submit_edit_interest); delete_button = (Button) findViewById(R.id.delete_interest); save.setOnClickListener(this); delete_button.setOnClickListener(this); editdescription = (EditText) findViewById(R.id.edit_interest); Spinner my_spin = (Spinner) findViewById(R.id.type_spinner); my_spin.setOnItemSelectedListener(this); editdescription.setText(UserProfile.description); ArrayAdapter aa = new ArrayAdapter(this, android.R.layout.simple_spinner_item, items); aa.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); my_spin.setAdapter(aa); my_spin.setSelection(aa.getPosition(UserProfile.type)); Typeface font = Typeface.createFromAsset(getAssets(), "font/deftone_stylus.ttf"); TextView txt = (TextView) findViewById(R.id.eTitle); txt.setTypeface(font); Typeface SEI = Typeface.createFromAsset(getAssets(), "font/deftone_stylus.ttf"); TextView se = (TextView) findViewById(R.id.submit_edit_interest); se.setTypeface(SEI); Typeface DI = Typeface.createFromAsset(getAssets(), "font/deftone_stylus.ttf"); TextView di = (TextView) findViewById(R.id.delete_interest); di.setTypeface(DI); Typeface ET = Typeface.createFromAsset(getAssets(), "font/Impact Label.ttf"); TextView et = (TextView) findViewById(R.id.edittype); et.setTypeface(ET); Typeface ED = Typeface.createFromAsset(getAssets(), "font/Impact Label.ttf"); TextView ed = (TextView) findViewById(R.id.eDesc); ed.setTypeface(ED); }
public FavouriteVendorAdapter(Activity context, ArrayList<FavVendor> objects) { this.mContext = context; this.studentList = objects; prefsManager = new PrefsManager(context); typeHeading = Typeface.createFromAsset(mContext.getAssets(), "fonts/Lato-Heavy.ttf"); typeiconfamily = Typeface.createFromAsset(mContext.getAssets(), "fonts/Lato-Bold.ttf"); typeregular = Typeface.createFromAsset(mContext.getAssets(), "fonts/LATO-REGULAR.TTF"); }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ViewGroup root = (ViewGroup) inflater.inflate(R.layout.edit_profile, null); user = ParseUser.getCurrentUser(); bariol_regular_tf = Typeface.createFromAsset(getActivity().getAssets(), "fonts/Bariol_Regular.otf"); bariol_bold_tf = Typeface.createFromAsset(getActivity().getAssets(), "fonts/Bariol_Bold.otf"); context = getActivity(); name = (EditText) root.findViewById(R.id.name); website = (EditText) root.findViewById(R.id.website); bio = (EditText) root.findViewById(R.id.bio); email = (EditText) root.findViewById(R.id.email); phoneNumber = (EditText) root.findViewById(R.id.phone); genderSpinner = (Spinner) root.findViewById(R.id.gender_spinner); TextView title = (TextView) root.findViewById(R.id.textView); ImageView close = (ImageView) root.findViewById(R.id.close); ImageView approveChanges = (ImageView) root.findViewById(R.id.check); title.setTypeface(bariol_bold_tf); close.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { android.app.FragmentManager manager = getFragmentManager(); manager.popBackStack(); } }); approveChanges.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { saveChanges(user); android.app.FragmentManager manager = getFragmentManager(); manager.popBackStack(); } }); setTypeface(); CustomSpinnerAdapter adapter = new CustomSpinnerAdapter( context, R.layout.spinner_item, Arrays.asList(getResources().getStringArray(R.array.genders))); genderSpinner.setAdapter(adapter); setInformation(user); return root; }
public SettingsDialog(Context context) { super(context, R.style.FullscreenDialogTheme); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.settings_dialog); settings = context.getSharedPreferences("NotifyMeSettings", context.MODE_PRIVATE); prefEditor = settings.edit(); Typeface font = Typeface.createFromAsset(context.getAssets(), "fonts/VarelaRound-Regular.ttf"); Typeface font2 = Typeface.createFromAsset(context.getAssets(), "fonts/DINEngschrift-Regular.ttf"); dialogText = (TextView) findViewById(R.id.settings_header); dialogText.setTypeface(font); deleteAllButton = (Button) findViewById(R.id.delete_all); deleteAllButton.setTypeface(font2); saveButton = (Button) findViewById(R.id.save_button); saveButton.setTypeface(font2); toneBox = (CheckBox) findViewById(R.id.toneCheckBox); vibrateBox = (CheckBox) findViewById(R.id.vibrateCheckBox); toneBox.setTypeface(font); vibrateBox.setTypeface(font); if (settings.contains("tone") == false) { toneBox.setChecked(true); } else { if (settings.getBoolean("tone", true)) { toneBox.setChecked(true); } else { toneBox.setChecked(false); } } if (settings.contains("vibration") == false) { vibrateBox.setChecked(true); } else { if (settings.getBoolean("vibration", true)) { vibrateBox.setChecked(true); } else { vibrateBox.setChecked(false); } } saveButton.setOnClickListener( new View.OnClickListener() { public void onClick(View v) { prefEditor.putBoolean("tone", toneBox.isChecked()); prefEditor.putBoolean("vibration", vibrateBox.isChecked()); prefEditor.commit(); cancel(); } }); }
@Override public void bindView(View view, Context context, Cursor cursor) { // here we are setting our data // that means, take the data from the cursor and put it in views TextView code = (TextView) view.findViewById(R.id.txtCodel); TextView title = (TextView) view.findViewById(R.id.txtTitle); TextView lessontime = (TextView) view.findViewById(R.id.txtTimes); TextView teacher = (TextView) view.findViewById(R.id.txtTeacher); TextView location = (TextView) view.findViewById(R.id.txtLocation); TextView txtPm = (TextView) view.findViewById(R.id.textView1); TextView color = (TextView) view.findViewById(R.id.txtcolor); code.setText(cursor.getString(cursor.getColumnIndex(cursor.getColumnName(3)))); title.setText(cursor.getString(cursor.getColumnIndex(cursor.getColumnName(4)))); teacher.setText(cursor.getString(cursor.getColumnIndex(cursor.getColumnName(8)))); location.setText(cursor.getString(cursor.getColumnIndex(cursor.getColumnName(9)))); color.setText(cursor.getString(cursor.getColumnIndex(cursor.getColumnName(7)))); Typeface font = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Light.ttf"); Typeface font_a = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Medium.ttf"); Typeface font_b = Typeface.createFromAsset(context.getAssets(), "fonts/Roboto-Regular.ttf"); Typeface font_c = Typeface.createFromAsset(context.getAssets(), "fonts/DistProTh.otf"); Typeface font_d = Typeface.createFromAsset(context.getAssets(), "fonts/DroidSans.ttf"); code.setTypeface(font_b); lessontime.setTypeface(font_c); title.setTypeface(font_a); teacher.setTypeface(font_b); location.setTypeface(font_b); txtPm.setTypeface(font_b); String startTime = cursor.getString(cursor.getColumnIndex(cursor.getColumnName(5))); String endTime = cursor.getString(cursor.getColumnIndex(cursor.getColumnName(6))); String pn = "am"; double a = Float.parseFloat(startTime) / 100; double c = Float.parseFloat(endTime) / 100; if (a > 12) { // pn="am"; txtPm.setText(pn); a = a - 12; if (a < 1) a = a + 1; } if (c > 12) { pn = "pm"; txtPm.setText(pn); c = c - 12; if (c < 0.59) c = c + 1; } else { pn = "am"; txtPm.setText(pn); } String m = df.format(a) + "-" + df.format(c); m = m.replaceAll("[.]", ":"); lessontime.setText(m); }
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mActivity = (MainActivity) getActivity(); mRobotoLight = Typeface.createFromAsset(mActivity.getAssets(), "Roboto-Light.ttf"); mRobotoLightItalic = Typeface.createFromAsset(mActivity.getAssets(), "Roboto-LightItalic.ttf"); mRoboto = Typeface.createFromAsset(mActivity.getAssets(), "Roboto-Regular.ttf"); }
public EventPagerAdapter(Context context, List<Event> eventList) { this.context = context; this.eventList = eventList; semiBold = Typeface.createFromAsset( context.getApplicationContext().getAssets(), "fonts/GillSans-SemiBold.ttf"); light = Typeface.createFromAsset( context.getApplicationContext().getAssets(), "fonts/GillSans-Light.ttf"); }
public void whatTypeFace(String type) { if ("kaushanregular.otf".equals(type)) { setTypeface(Typeface.createFromAsset(getAssets(), type)); } if ("robotobold.ttf".equals(type)) { setTypeface(Typeface.createFromAsset(getAssets(), type)); } if ("robotoregular.ttf".equals(type)) { setTypeface(Typeface.createFromAsset(getAssets(), type)); } }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_event_detail); title_view = (TextView) findViewById(R.id.event_detail_title); description_view = (TextView) findViewById(R.id.event_detail_description); photo = (ImageView) findViewById(R.id.photoID); mapButton = (ImageButton) findViewById(R.id.map_image); extras = getIntent().getExtras(); title = extras.getString("title"); description = extras.getString("details"); icon = extras.getString("icon"); eventType = extras.getString("type"); Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/HelveticaNeueLTStd_Bd.otf"); title_view.setTypeface(tf); Typeface tf1 = Typeface.createFromAsset(getAssets(), "fonts/HelveticaNeueLTStd_Lt.otf"); description_view.setTypeface(tf1); title_view.setText(title); description_view.setText(description); if (extras.getString("icon").equals("pet")) { photo.setImageResource(R.drawable.petevent_1); } else if (extras.getString("icon").equals("food")) { photo.setImageResource(R.drawable.foodbank_1); } else if (extras.getString("icon").equals("blood")) { photo.setImageResource(R.drawable.blooddrive_1); } else if (extras.getString("icon").equals("natural")) { photo.setImageResource(R.drawable.flood_1); } else { } final String longitude = "30.269650"; final String latitude = "-97.760140"; final String uri = String.format("geo:0,0?q=" + address); mapButton.setOnClickListener( new View.OnClickListener() { @Override public void onClick(View v) { Intent mapIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(mapIntent); } }); }
public void setFonts() { Typeface fontLogo = Typeface.createFromAsset(getAssets(), "HouseSlant-Regular.otf"); Typeface fontOthers = Typeface.createFromAsset(getAssets(), "Montserrat-Regular.ttf"); Button button = (Button) findViewById(R.id.button_play); TextView appLogoName = (TextView) findViewById(R.id.app_name); TextView headline = (TextView) findViewById(R.id.headline); button.setTypeface(fontOthers); appLogoName.setTypeface(fontLogo); headline.setTypeface(fontOthers); }
public void setTypeface(Typeface tf, int style) { if (style == Typeface.NORMAL) { super.setTypeface( Typeface.createFromAsset(getContext().getAssets(), "fonts/roboto_regular.ttf")); } else if (style == Typeface.ITALIC) { super.setTypeface( Typeface.createFromAsset(getContext().getAssets(), "fonts/roboto_italic.ttf")); } else if (style == Typeface.BOLD) { super.setTypeface( Typeface.createFromAsset(getContext().getAssets(), "fonts/roboto_bold.ttf")); } }
public void setTypeface(Typeface tf, int style) { if (style == Typeface.BOLD) { super.setTypeface( Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Bold.ttf")); } else if (style == Typeface.ITALIC) { super.setTypeface( Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Italic.ttf")); } else { super.setTypeface( Typeface.createFromAsset(getContext().getAssets(), "fonts/Roboto-Regular.ttf")); } }
public Typeface getTypefaceTextView(Context context, String font) { if (font.equals("bold")) { if (typefaceHelveticaBold == null) typefaceHelveticaBold = Typeface.createFromAsset(context.getAssets(), "fonts/HelveticaWorldBold.ttf"); return typefaceHelveticaBold; } else { if (typefaceHelveticaRegular == null) typefaceHelveticaRegular = Typeface.createFromAsset(context.getAssets(), "fonts/HelveticaWorldRegular.ttf"); return typefaceHelveticaRegular; } }
private void loadCustomeFonts(Context context) { // load fonts in fixed order, 0=normal, 1=bold, 2=italic, 3=bolditalic String[] fontList = context.getResources().getStringArray(R.array.fonts); fonts = new Typeface[fontList.length]; qabelFont = Typeface.createFromAsset( context.getAssets(), context.getResources().getString(R.string.asset_qabel_font)); for (int i = 0; i < fontList.length; i++) { fonts[i] = Typeface.createFromAsset(context.getAssets(), fontList[i]); } }
@Override public void onPageSelected(int position) { for (int i = 0; i < mTabsLinearLayout.getChildCount(); i++) { TextView tv = (TextView) mTabsLinearLayout.getChildAt(i); if (i == position) { tv.setTextColor(getResources().getColor(R.color.twitter_primary)); tv.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/Roboto-Medium.ttf")); } else { tv.setTextColor(getResources().getColor(R.color.twitter_primary)); tv.setTypeface(Typeface.createFromAsset(getAssets(), "fonts/Roboto-Light.ttf")); } } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { position = getArguments().getInt(ARG_SECTION_NUMBER); if (position == 0) { initKeyParticleMap(); rootView = inflater.inflate(R.layout.fragment_keyboard_particles, container, false); mp = MediaPlayer.create(getActivity(), R.raw.type_sound); outEditText = (EditText) rootView.findViewById(R.id.edit); Typeface font = Typeface.createFromAsset(getActivity().getAssets(), "Adler.ttf"); outEditText.setTypeface(font); } else if (position == 1) { initStarWarParticleMap(); rootView = inflater.inflate(R.layout.fragment_star_wars, container, false); outEditText = (EditText) rootView.findViewById(R.id.edit); mp = MediaPlayer.create(getActivity(), R.raw.laser); Typeface font = Typeface.createFromAsset(getActivity().getAssets(), "Starjout.ttf"); outEditText.setTypeface(font); } else if (position == 2) { initBubbleParticleMap(); rootView = inflater.inflate(R.layout.fragment_bubble_particles, container, false); mp = MediaPlayer.create(getActivity(), R.raw.type_sound); outEditText = (EditText) rootView.findViewById(R.id.edit); } FABRevealLayout fabRevealLayout = (FABRevealLayout) rootView.findViewById(R.id.fab_reveal_layout); configureFABReveal(fabRevealLayout); setUpLayout(); return rootView; }
private class MountainPassItemForecastAdapter extends ArrayAdapter<ForecastItem> { private Typeface tf = Typeface.createFromAsset(getActivity().getAssets(), "fonts/Roboto-Regular.ttf"); private Typeface tfb = Typeface.createFromAsset(getActivity().getAssets(), "fonts/Roboto-Bold.ttf"); private ArrayList<ForecastItem> items; public MountainPassItemForecastAdapter( Context context, int textViewResourceId, ArrayList<ForecastItem> items) { super(context, textViewResourceId, items); this.items = items; } @SuppressWarnings("unused") public boolean areAllItemsSelectable() { return false; } public boolean isEnabled(int position) { return false; } @Override public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; if (convertView == null) { convertView = getActivity().getLayoutInflater().inflate(R.layout.simple_list_item_with_icon, null); holder = new ViewHolder(); holder.title = (TextView) convertView.findViewById(R.id.title); holder.title.setTypeface(tfb); holder.text = (TextView) convertView.findViewById(R.id.text); holder.text.setTypeface(tf); holder.icon = (ImageView) convertView.findViewById(R.id.icon); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } ForecastItem o = items.get(position); holder.title.setText(o.getDay()); holder.text.setText(o.getForecastText()); holder.icon.setImageResource(o.getWeatherIcon()); return convertView; } }
@Override public View onCreateView( LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View r = inflater.inflate(R.layout.face, container, false); Typeface e1 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[19]); TextView event1 = (TextView) r.findViewById(R.id.event1); event1.setTypeface(e1); Typeface e2 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[11]); TextView event2 = (TextView) r.findViewById(R.id.event2); event2.setTypeface(e2); Typeface e3 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[19]); TextView event3 = (TextView) r.findViewById(R.id.event3); event3.setTypeface(e3); Typeface e4 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[11]); TextView event4 = (TextView) r.findViewById(R.id.event4); event4.setTypeface(e4); Typeface e5 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[19]); TextView event5 = (TextView) r.findViewById(R.id.event5); event5.setTypeface(e5); Typeface e6 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[11]); TextView event6 = (TextView) r.findViewById(R.id.event6); event6.setTypeface(e6); Typeface e7 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[19]); TextView event7 = (TextView) r.findViewById(R.id.event7); event7.setTypeface(e7); Typeface e8 = Typeface.createFromAsset(getActivity().getAssets(), "font/" + style[11]); TextView event8 = (TextView) r.findViewById(R.id.event8); event8.setTypeface(e8); return r; }