Android Open Source - GlassTunes Typophile Text View From Project Back to project page GlassTunes .
License The source code is released under:
Apache License
If you think the Android project GlassTunes listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code package com.glasstunes.view;
/ * f r o m w w w . j a v a 2 s . c o m * /
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.widget.TextView;
import com.glasstunes.R;
public class TypophileTextView extends TextView {
private static final int MASK_CONDENSED = 256;
private static final int MASK_ITALIC = 16;
private static final int MASK_WEIGHT = 15;
public TypophileTextView(Context context) {
this (context, null);
}
public TypophileTextView(Context context, AttributeSet attrs) {
this (context, attrs, 0);
}
public TypophileTextView(Context context, AttributeSet attrs, int style) {
super (context, attrs, style);
boolean condensed = true;
TypedArray attributes = context.obtainStyledAttributes(attrs,
R.styleable.TypophileTextView); // v0
if (!attributes.hasValue(0)) {
attributes.recycle();
return ;
}
int fontWeight = attributes.getInt(0, 0); // v2
int weight = fontWeight & MASK_WEIGHT; // v5
boolean italic; // v3
if ((fontWeight & MASK_ITALIC) == 0) {
italic = true;
} else {
italic = false;
}
if ((fontWeight & MASK_CONDENSED) == 0) {
condensed = false;
}
Typeface typeface = RobotoTypefaces.getTypeface(context, weight,
italic, condensed); // v4
setTypeface(typeface);
}
}
Java Source Code List com.glasstunes.BaseContentCardActivity.java com.glasstunes.BrowseActivity.java com.glasstunes.ConfirmationActivity.java com.glasstunes.ControlsActivity.java com.glasstunes.Debug.java com.glasstunes.DetailActivity.java com.glasstunes.GlassTunesApp.java com.glasstunes.HeaderActivity.java com.glasstunes.LauncherActivity.java com.glasstunes.NowPlayingActivity.java com.glasstunes.cards.ActionCard.java com.glasstunes.cards.BrowseCard.java com.glasstunes.cards.ContentCard.java com.glasstunes.cards.HeaderCard.java com.glasstunes.cards.LauncherCard.java com.glasstunes.cards.NowPlayingCard.java com.glasstunes.cards.PausePlayCard.java com.glasstunes.cards.SkipNextCard.java com.glasstunes.cards.SkipPreviousCard.java com.glasstunes.controller.LocalMusicController.java com.glasstunes.controller.MusicController.java com.glasstunes.screenslide.BasicCardFragment.java com.glasstunes.screenslide.BasicCardPagerAdapter.java com.glasstunes.screenslide.BounceBackViewPager.java com.glasstunes.screenslide.CardFragment.java com.glasstunes.screenslide.ContextWrapperEdgeEffect.java com.glasstunes.screenslide.ScreenSlideActivity.java com.glasstunes.screenslide.ScreenSlidePagerAdapter.java com.glasstunes.view.RobotoTypefaces.java com.glasstunes.view.SliderView.java com.glasstunes.view.TypophileTextView.java com.viewpagerindicator.CirclePageIndicator.java com.viewpagerindicator.IconPageIndicator.java com.viewpagerindicator.IconPagerAdapter.java com.viewpagerindicator.IcsLinearLayout.java com.viewpagerindicator.LinePageIndicator.java com.viewpagerindicator.PageIndicator.java com.viewpagerindicator.TabPageIndicator.java com.viewpagerindicator.TitlePageIndicator.java com.viewpagerindicator.UnderlinePageIndicator.java com.woodblockwithoutco.remotemetadataprovider.internal.MetadataUpdaterCallback.java com.woodblockwithoutco.remotemetadataprovider.internal.RemoteControlDisplay.java com.woodblockwithoutco.remotemetadataprovider.media.RemoteMetadataProvider.java com.woodblockwithoutco.remotemetadataprovider.media.enums.MediaCommand.java com.woodblockwithoutco.remotemetadataprovider.media.enums.PlayState.java com.woodblockwithoutco.remotemetadataprovider.media.enums.RemoteControlFeature.java com.woodblockwithoutco.remotemetadataprovider.media.listeners.OnArtworkChangeListener.java com.woodblockwithoutco.remotemetadataprovider.media.listeners.OnMetadataChangeListener.java com.woodblockwithoutco.remotemetadataprovider.media.listeners.OnPlaybackStateChangeListener.java com.woodblockwithoutco.remotemetadataprovider.media.listeners.OnRemoteControlFeaturesChangeListener.java