• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ITypeface类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.mikepenz.iconics.typeface.ITypeface的典型用法代码示例。如果您正苦于以下问题:Java ITypeface类的具体用法?Java ITypeface怎么用?Java ITypeface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ITypeface类属于com.mikepenz.iconics.typeface包,在下文中一共展示了ITypeface类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initView

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public void initView(View view) {
    // Init and Setup RecyclerView
    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.list);
    recyclerView.setLayoutManager(new GridLayoutManager(context, 2));
    //animator not yet working
    recyclerView.setItemAnimator(new DefaultItemAnimator());
    mAdapter = new IconAdapter(randomize, new ArrayList<String>(), R.layout.row_icon);
    recyclerView.setAdapter(mAdapter);

    for (ITypeface iTypeface : Iconics.getRegisteredFonts(context)) {
        if (iTypeface.getFontName().equalsIgnoreCase("Octicons")) {
            if (iTypeface.getIcons() != null) {
                for (String icon : iTypeface.getIcons()) {
                    icons.add(icon);
                }
                mAdapter.setIcons(randomize, icons);
                break;
            }
        }
    }
    //filter if a search param was provided
    onSearch(search);
}
 
开发者ID:frodoking,项目名称:GithubAndroidClient,代码行数:24,代码来源:StaticOcticonsFragment.java


示例2: IconicsDrawableOld

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
/**
 * Create an IconDrawable.
 * Just give it the icon-identifier
 *
 * @param context Your activity or application context.
 * @param icon    The icon identifier without icon- (font must be registered)
 */
public IconicsDrawableOld(Context context, String icon) {
    this.context = context;

    ITypeface font = Iconics.findFont(icon.substring(0, 3));
    icon = icon.replace("-", "_");
    this.icon = font.getIcon(icon);

    paint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
    paint.setTypeface(font.getTypeface(context));
    paint.setStyle(Paint.Style.STROKE);
    paint.setTextAlign(Paint.Align.CENTER);
    paint.setUnderlineText(false);
    paint.setColor(Color.BLACK);
    paint.setAntiAlias(true);
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:23,代码来源:IconicsDrawableOld.java


示例3: IconicsBuilderString

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public IconicsBuilderString(Context ctx, List<ITypeface> fonts, StringBuilder text, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) {
    this.ctx = ctx;
    this.fonts = fonts;
    this.text = text;
    this.withStyles = styles;
    this.withStylesFor = stylesFor;
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:8,代码来源:Iconics.java


示例4: build

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public SpannableString build() {
    HashMap<String, ITypeface> mappedFonts = new HashMap<String, ITypeface>();
    for (ITypeface font : fonts) {
        mappedFonts.put(font.getMappingPrefix(), font);
    }
    return Iconics.style(ctx, mappedFonts, text, withStyles, withStylesFor);
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:8,代码来源:Iconics.java


示例5: IconicsBuilderView

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public IconicsBuilderView(Context ctx, List<ITypeface> fonts, TextView view, List<CharacterStyle> styles, HashMap<String, List<CharacterStyle>> stylesFor) {
    this.ctx = ctx;
    this.fonts = fonts;
    this.view = view;
    this.withStyles = styles;
    this.withStylesFor = stylesFor;
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:8,代码来源:Iconics.java


示例6: IconicsDrawable

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public IconicsDrawable(Context context, String icon) {
    mContext = context.getApplicationContext();
    prepare();

    ITypeface font = Iconics.findFont(icon.substring(0, 3));
    icon = icon.replace("-", "_");
    icon(font.getIcon(icon));
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:9,代码来源:IconicsDrawable.java


示例7: onCreate

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sample);

    // Handle Toolbar
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(R.string.sample_generic_item);

    //style our ui
    new MaterializeBuilder().withActivity(this).build();


    //create our FastAdapter which will manage everything
    fastAdapter = new FastAdapter();
    fastAdapter.withSelectable(true);

    //get our recyclerView and do basic setup
    RecyclerView rv = (RecyclerView) findViewById(R.id.rv);

    //init our gridLayoutManager and configure RV
    GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);

    GenericItemAdapter<IconModel, GenericIconItem> itemAdapter = new GenericItemAdapter<>(new Function<IconModel, GenericIconItem>() {
        @Override
        public GenericIconItem apply(IconModel iconModel) {
            return new GenericIconItem(iconModel);
        }
    });

    final FastScrollIndicatorAdapter<GenericIconItem> fastScrollIndicatorAdapter = new FastScrollIndicatorAdapter<>();
    rv.setAdapter(fastScrollIndicatorAdapter.wrap(itemAdapter.wrap(fastAdapter)));

    DragScrollBar materialScrollBar = new DragScrollBar(this, rv, true);
    materialScrollBar.setHandleColour(ContextCompat.getColor(this, R.color.colorAccent));
    materialScrollBar.setHandleOffColour(ContextCompat.getColor(this, R.color.colorAccent));
    materialScrollBar.addIndicator(new CustomIndicator(this), true);

    rv.setLayoutManager(gridLayoutManager);
    rv.setItemAnimator(new SlideDownAlphaAnimator());

    //order fonts by their name
    List<ITypeface> mFonts = new ArrayList<>(Iconics.getRegisteredFonts(this));
    Collections.sort(mFonts, new Comparator<ITypeface>() {
        @Override
        public int compare(final ITypeface object1, final ITypeface object2) {
            return object1.getFontName().compareTo(object2.getFontName());
        }
    });

    //add all icons of all registered Fonts to the list
    ArrayList<IconModel> models = new ArrayList<>();
    for (ITypeface font : mFonts) {
        for (String icon : font.getIcons()) {
            models.add(new IconModel(font.getIcon(icon)));
        }
    }

    //fill with some sample data
    itemAdapter.addModel(models);

    //restore selections (this has to be done after the items were added
    fastAdapter.withSavedInstanceState(savedInstanceState);

    //set the back arrow in the toolbar
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(false);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:71,代码来源:GenericItemActivity.java


示例8: onCreate

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    findViewById(android.R.id.content).setSystemUiVisibility(findViewById(android.R.id.content).getSystemUiVisibility() | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_sample);

    // Handle Toolbar
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    getSupportActionBar().setTitle(R.string.sample_multi_generic_item);

    //style our ui
    new MaterializeBuilder().withActivity(this).build();


    //create our FastAdapter which will manage everything
    fastAdapter = new FastAdapter();
    fastAdapter.withSelectable(true);

    //get our recyclerView and do basic setup
    RecyclerView rv = (RecyclerView) findViewById(R.id.rv);

    //init our gridLayoutManager and configure RV
    GridLayoutManager gridLayoutManager = new GridLayoutManager(this, 3);

    //if you need multiple items for different models you can also do this be defining a Function which get's the model object and returns the item (extends IItem)
    GenericItemAdapter<IconModel, GenericIconItem> itemAdapter = new GenericItemAdapter<>(new Function<IconModel, GenericIconItem>() {
        @Override
        public GenericIconItem apply(IconModel o) {
            if (o instanceof RightIconModel) {
                return new RightGenericIconItem(o);
            } else {
                return new GenericIconItem(o);
            }
        }
    });

    rv.setLayoutManager(gridLayoutManager);
    rv.setItemAnimator(new SlideDownAlphaAnimator());
    rv.setAdapter(itemAdapter.wrap(fastAdapter));

    //order fonts by their name
    List<ITypeface> mFonts = new ArrayList<>(Iconics.getRegisteredFonts(this));
    Collections.sort(mFonts, new Comparator<ITypeface>() {
        @Override
        public int compare(final ITypeface object1, final ITypeface object2) {
            return object1.getFontName().compareTo(object2.getFontName());
        }
    });

    //add all icons of all registered Fonts to the list
    ArrayList<IconModel> models = new ArrayList<>();
    int i = 0;
    for (ITypeface font : mFonts) {
        for (String icon : font.getIcons()) {
            if (i % 3 == 0) {
                models.add(new IconModel(font.getIcon(icon)));
            } else {
                models.add(new RightIconModel(font.getIcon(icon)));
            }
            i++;
        }
    }

    //fill with some sample data
    itemAdapter.addModel(models);

    //restore selections (this has to be done after the items were added
    fastAdapter.withSavedInstanceState(savedInstanceState);

    //set the back arrow in the toolbar
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeButtonEnabled(false);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:75,代码来源:MultiTypeGenericItemActivity.java


示例9: getTypeface

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public ITypeface getTypeface() {
    if (typeface == null) {
        typeface = new MaterialDrawerFont();
    }
    return typeface;
}
 
开发者ID:LeMinhAn,项目名称:MaterialDrawer,代码行数:7,代码来源:MaterialDrawerFont.java


示例10: getTypeface

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public ITypeface getTypeface() {
    if (typeface == null) {
        typeface = new GoogleMaterial();
    }
    return typeface;
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:7,代码来源:GoogleMaterial.java


示例11: registerFont

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public static void registerFont(ITypeface font) {
    FONTS.put(font.getMappingPrefix(), font);
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:4,代码来源:Iconics.java


示例12: getRegisteredFonts

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public static Collection<ITypeface> getRegisteredFonts() {
    return FONTS.values();
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:4,代码来源:Iconics.java


示例13: findFont

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public static ITypeface findFont(String key) {
    return FONTS.get(key);
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:4,代码来源:Iconics.java


示例14: StyleContainer

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
private StyleContainer(int startIndex, int endIndex, String icon, ITypeface font) {
    this.startIndex = startIndex;
    this.endIndex = endIndex;
    this.icon = icon;
    this.font = font;
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:7,代码来源:Iconics.java


示例15: getFont

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public ITypeface getFont() {
    return font;
}
 
开发者ID:douzifly,项目名称:clear-todolist,代码行数:4,代码来源:Iconics.java


示例16: getTypeface

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public ITypeface getTypeface() {
    if (typeface == null) {
        typeface = new MMXIconFont();
    }
    return typeface;
}
 
开发者ID:moneymanagerex,项目名称:android-money-manager-ex,代码行数:7,代码来源:MMXIconFont.java


示例17: getTypeface

import com.mikepenz.iconics.typeface.ITypeface; //导入依赖的package包/类
public ITypeface getTypeface() {
    if (typeface == null) {
        typeface = new PresentationsTypeface();
    }
    return typeface;
}
 
开发者ID:citiususc,项目名称:calendula,代码行数:7,代码来源:PresentationsTypeface.java



注:本文中的com.mikepenz.iconics.typeface.ITypeface类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GetCallback类代码示例发布时间:2022-05-23
下一篇:
Java GetNodesToLabelsRequest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap