Search in sources :

Example 1 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 2 with TextDrawable

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

the class HeadItemFiveExtraMenuActivity method getHeadItem3.

private MaterialHeadItem getHeadItem3() {
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 3)", new FragmentDummy(), "Section 1 (Head 3)"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    // create Head Item
    TextDrawable headPhoto = TextDrawable.builder().buildRound("C", Color.GRAY);
    MaterialHeadItem headItem = new MaterialHeadItem(this, "C HeadItem", "C 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 3 with TextDrawable

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

the class HeadItemFiveExtraMenuActivity method getHeadItem4.

private MaterialHeadItem getHeadItem4() {
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 4)", new FragmentDummy(), "Section 1 (Head 4)"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    // create Head Item
    TextDrawable headPhoto = TextDrawable.builder().buildRound("D", Color.GRAY);
    MaterialHeadItem headItem = new MaterialHeadItem(this, "D HeadItem", "D 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 4 with TextDrawable

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

the class HeadItemFiveExtraMenuActivity method getHeadItem5.

private MaterialHeadItem getHeadItem5() {
    // create menu
    MaterialMenu menu = new MaterialMenu();
    menu.add(new MaterialItemSectionFragment(this, "Section 1 (Head 5)", new FragmentDummy(), "Section 1 (Head 5)"));
    menu.add(new MaterialItemSectionFragment(this, "Section 2", new FragmentDummy(), "Section 2"));
    // create Head Item
    TextDrawable headPhoto = TextDrawable.builder().buildRound("E", Color.GRAY);
    MaterialHeadItem headItem = new MaterialHeadItem(this, "E HeadItem", "E 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 5 with TextDrawable

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

the class HeadItemFiveExtraMenuActivity 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)

Aggregations

TextDrawable (com.amulyakhare.textdrawable.TextDrawable)25 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