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);
}
Aggregations