Search in sources :

Example 26 with TextDrawable

use of com.amulyakhare.textdrawable.TextDrawable in project MyJapanese by 54wall.

the class MemoryFragment method initFabMenu.

private void initFabMenu() {
    TextDrawable textQing = TextDrawable.builder().beginConfig().fontSize((int) getContext().getResources().getDimension(R.dimen.memory_item_fab_text_size)).endConfig().buildRound("清", getContext().getResources().getColor(R.color.transparent));
    FloatingActionButton fab_qingyin = new FloatingActionButton(getContext());
    fab_qingyin.setIconDrawable(textQing);
    fab_qingyin.setColorNormal(getContext().getResources().getColor(R.color.green));
    fab_qingyin.setColorPressed(getContext().getResources().getColor(R.color.window));
    fab_qingyin.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            presenter.setDate(Constants.CATEGORY_QINGYIN);
            category = Constants.CATEGORY_QINGYIN;
            hideFabMenu();
        }
    });
    TextDrawable textZhuo = TextDrawable.builder().beginConfig().fontSize((int) getContext().getResources().getDimension(R.dimen.memory_item_fab_text_size)).endConfig().buildRound("浊", getContext().getResources().getColor(R.color.transparent));
    FloatingActionButton fab_zhuoyin = new FloatingActionButton(getContext());
    fab_zhuoyin.setIconDrawable(textZhuo);
    fab_zhuoyin.setColorNormal(getContext().getResources().getColor(R.color.orange));
    fab_zhuoyin.setColorPressed(getContext().getResources().getColor(R.color.window));
    fab_zhuoyin.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            presenter.setDate(Constants.CATEGORY_ZHUOYIN);
            category = Constants.CATEGORY_ZHUOYIN;
            hideFabMenu();
        }
    });
    TextDrawable textAo = TextDrawable.builder().beginConfig().fontSize((int) getContext().getResources().getDimension(R.dimen.memory_item_fab_text_size)).endConfig().buildRound("拗", getContext().getResources().getColor(R.color.transparent));
    FloatingActionButton fab_aoyin = new FloatingActionButton(getContext());
    fab_aoyin.setIconDrawable(textAo);
    fab_aoyin.setColorNormal(getContext().getResources().getColor(R.color.blue));
    fab_aoyin.setColorPressed(getContext().getResources().getColor(R.color.window));
    fab_aoyin.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            presenter.setDate(Constants.CATEGORY_AOYIN);
            category = Constants.CATEGORY_AOYIN;
            hideFabMenu();
        }
    });
    mFabMenu.addButton(fab_qingyin);
    mFabMenu.addButton(fab_zhuoyin);
    mFabMenu.addButton(fab_aoyin);
}
Also used : TextDrawable(com.amulyakhare.textdrawable.TextDrawable) FloatingActionButton(com.getbase.floatingactionbutton.FloatingActionButton) SwipeFlingAdapterView(pri.weiqiang.myjapanese.widget.swipecardview.SwipeFlingAdapterView) BindView(butterknife.BindView) View(android.view.View) BaseView(pri.weiqiang.myjapanese.mvp.view.BaseView)

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