Search in sources :

Example 11 with TextDrawable

use of com.amulyakhare.textdrawable.TextDrawable in project AdvancedMaterialDrawer by madcyph3r.

the class HeadItemThreeActivity method getHeadItem2.

private MaterialHeadItem getHeadItem2() {
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 2)", new FragmentDummy(), "Section 1 (Head 2)"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    // create Head Item
    TextDrawable headPhoto = TextDrawable.builder().buildRound("B", Color.BLUE);
    MaterialHeadItem headItem = new MaterialHeadItem(this, "B HeadItem", "B Subtitle", headPhoto, R.drawable.mat6, menu);
    return headItem;
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) MaterialHeadItem(de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem) FragmentDummy(de.madcyph3r.example.example.FragmentDummy)

Example 12 with TextDrawable

use of com.amulyakhare.textdrawable.TextDrawable in project AdvancedMaterialDrawer by madcyph3r.

the class HeadItemFiveDontCloseOnChangeActivity method getHeadItem2.

private MaterialHeadItem getHeadItem2() {
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 2)", new FragmentDummy(), "Section 1 (Head 2)"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    // create Head Item
    TextDrawable headPhoto = TextDrawable.builder().buildRound("B", Color.BLUE);
    MaterialHeadItem headItem = new MaterialHeadItem(this, "B HeadItem", "B Subtitle", headPhoto, R.drawable.mat6, menu);
    // don't close the drawer, if this head item chosen
    headItem.setCloseDrawerOnChanged(false);
    return headItem;
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) MaterialHeadItem(de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem) FragmentDummy(de.madcyph3r.example.example.FragmentDummy)

Example 13 with TextDrawable

use of com.amulyakhare.textdrawable.TextDrawable in project AdvancedMaterialDrawer by madcyph3r.

the class HeadItemThreeChangeListenerActivity method getHeadItem2.

private MaterialHeadItem getHeadItem2() {
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 2)", new FragmentDummy(), "Section 1 (Head 2)"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    // create Head Item
    TextDrawable headPhoto = TextDrawable.builder().buildRound("B", Color.BLUE);
    MaterialHeadItem headItem = new MaterialHeadItem(this, "B HeadItem", "B Subtitle", headPhoto, R.drawable.mat6, menu);
    return headItem;
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) MaterialItemSectionFragment(de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment) MaterialMenu(de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu) MaterialHeadItem(de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem) FragmentDummy(de.madcyph3r.example.example.FragmentDummy)

Example 14 with TextDrawable

use of com.amulyakhare.textdrawable.TextDrawable in project TextDrawable by amulyakhare.

the class DrawableProvider method getRectWithCustomSize.

public Drawable getRectWithCustomSize() {
    String leftText = "I";
    String rightText = "J";
    TextDrawable.IBuilder builder = TextDrawable.builder().beginConfig().width(toPx(29)).withBorder(toPx(2)).endConfig().rect();
    TextDrawable left = builder.build(leftText, mGenerator.getColor(leftText));
    TextDrawable right = builder.build(rightText, mGenerator.getColor(rightText));
    Drawable[] layerList = { new InsetDrawable(left, 0, 0, toPx(31), 0), new InsetDrawable(right, toPx(31), 0, 0, 0) };
    return new LayerDrawable(layerList);
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) LayerDrawable(android.graphics.drawable.LayerDrawable) TextDrawable(com.amulyakhare.textdrawable.TextDrawable) LayerDrawable(android.graphics.drawable.LayerDrawable) InsetDrawable(android.graphics.drawable.InsetDrawable) AnimationDrawable(android.graphics.drawable.AnimationDrawable) Drawable(android.graphics.drawable.Drawable) InsetDrawable(android.graphics.drawable.InsetDrawable)

Example 15 with TextDrawable

use of com.amulyakhare.textdrawable.TextDrawable in project TextDrawable by amulyakhare.

the class DrawableProvider method getRectWithAnimation.

public Drawable getRectWithAnimation() {
    TextDrawable.IBuilder builder = TextDrawable.builder().rect();
    AnimationDrawable animationDrawable = new AnimationDrawable();
    for (int i = 10; i > 0; i--) {
        TextDrawable frame = builder.build(String.valueOf(i), mGenerator.getRandomColor());
        animationDrawable.addFrame(frame, 1200);
    }
    animationDrawable.setOneShot(false);
    animationDrawable.start();
    return animationDrawable;
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) AnimationDrawable(android.graphics.drawable.AnimationDrawable)

Aggregations

TextDrawable (com.amulyakhare.textdrawable.TextDrawable)26 MaterialHeadItem (de.madcyph3r.materialnavigationdrawer.head.MaterialHeadItem)23 FragmentDummy (de.madcyph3r.example.example.FragmentDummy)22 MaterialMenu (de.madcyph3r.materialnavigationdrawer.menu.MaterialMenu)22 MaterialItemSectionFragment (de.madcyph3r.materialnavigationdrawer.menu.item.section.MaterialItemSectionFragment)22 AnimationDrawable (android.graphics.drawable.AnimationDrawable)2 Drawable (android.graphics.drawable.Drawable)1 InsetDrawable (android.graphics.drawable.InsetDrawable)1 LayerDrawable (android.graphics.drawable.LayerDrawable)1 View (android.view.View)1 BindView (butterknife.BindView)1 FloatingActionButton (com.getbase.floatingactionbutton.FloatingActionButton)1 BaseView (pri.weiqiang.myjapanese.mvp.view.BaseView)1 SwipeFlingAdapterView (pri.weiqiang.myjapanese.widget.swipecardview.SwipeFlingAdapterView)1