Search in sources :

Example 6 with FloatingActionButton

use of com.getbase.floatingactionbutton.FloatingActionButton in project LiYuJapanese 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) MemoryFragmentView(pri.weiqiang.liyujapanese.mvp.view.memory.MemoryFragmentView) BindView(butterknife.BindView) View(android.view.View) SwipeFlingAdapterView(pri.weiqaing.common.widget.swipecardview.SwipeFlingAdapterView)

Aggregations

View (android.view.View)6 FloatingActionButton (com.getbase.floatingactionbutton.FloatingActionButton)6 BindView (butterknife.BindView)3 TextDrawable (com.amulyakhare.textdrawable.TextDrawable)3 Drawable (android.graphics.drawable.Drawable)2 FloatingActionsMenu (com.getbase.floatingactionbutton.FloatingActionsMenu)2 SwipeFlingAdapterView (pri.weiqaing.common.widget.swipecardview.SwipeFlingAdapterView)2 MemoryFragmentView (pri.weiqiang.liyujapanese.mvp.view.memory.MemoryFragmentView)2 DialogInterface (android.content.DialogInterface)1 ShapeDrawable (android.graphics.drawable.ShapeDrawable)1 OvalShape (android.graphics.drawable.shapes.OvalShape)1 CardView (android.support.v7.widget.CardView)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 RecyclerView (android.support.v7.widget.RecyclerView)1 OnClickListener (android.view.View.OnClickListener)1 TextView (android.widget.TextView)1 DialogAction (com.afollestad.materialdialogs.DialogAction)1 MaterialDialog (com.afollestad.materialdialogs.MaterialDialog)1 CaseInsensitiveArrayList (me.ccrama.redditslide.CaseInsensitiveArrayList)1 MultiReddit (net.dean.jraw.models.MultiReddit)1