本文整理汇总了Java中com.melnykov.fab.FloatingActionButton.setColorRippleResId方法的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionButton.setColorRippleResId方法的具体用法?Java FloatingActionButton.setColorRippleResId怎么用?Java FloatingActionButton.setColorRippleResId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.melnykov.fab.FloatingActionButton
的用法示例。
在下文中一共展示了FloatingActionButton.setColorRippleResId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_tumblr);
createFabFrameAnim();
createFabReverseFrameAnim();
findViewById(R.id.text_view).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(TumblrStyleActivity.this, "Click", Toast.LENGTH_SHORT).show();
}
});
final FloatingActionButton fab = new FloatingActionButton(this);
fab.setType(FloatingActionButton.TYPE_NORMAL);
fab.setImageDrawable(frameAnim);
// fab.setImageResource(android.R.drawable.ic_dialog_email);
fab.setColorPressedResId(R.color.colorPrimary);
fab.setColorNormalResId(R.color.fab);
fab.setColorRippleResId(R.color.text_color);
fab.setShadow(true);
springFloatingActionMenu = new SpringFloatingActionMenu.Builder(this)
.fab(fab)
.addMenuItem(R.color.photo, R.mipmap.ic_messaging_posttype_photo, "Photo", R.color.text_color,this)
.addMenuItem(R.color.chat, R.mipmap.ic_messaging_posttype_chat, "Chat", R.color.text_color,this)
.addMenuItem(R.color.quote, R.mipmap.ic_messaging_posttype_quote, "Quote", R.color.text_color,this)
.addMenuItem(R.color.link, R.mipmap.ic_messaging_posttype_link, "Link", R.color.text_color,this)
.addMenuItem(R.color.audio, R.mipmap.ic_messaging_posttype_audio, "Audio", R.color.text_color,this)
.addMenuItem(R.color.text, R.mipmap.ic_messaging_posttype_text, "Text", R.color.text_color,this)
.addMenuItem(R.color.video, R.mipmap.ic_messaging_posttype_video, "Video", R.color.text_color,this)
.animationType(SpringFloatingActionMenu.ANIMATION_TYPE_TUMBLR)
.revealColor(R.color.colorPrimary)
.gravity(Gravity.RIGHT | Gravity.BOTTOM)
.onMenuActionListner(new OnMenuActionListener() {
@Override
public void onMenuOpen() {
fab.setImageDrawable(frameAnim);
frameReverseAnim.stop();
frameAnim.start();
}
@Override
public void onMenuClose() {
fab.setImageDrawable(frameReverseAnim);
frameAnim.stop();
frameReverseAnim.start();
}
})
.build();
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
setTitle("SpringFloatingActionMenu");
}
示例2: onCreate
import com.melnykov.fab.FloatingActionButton; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bloom);
createFabFrameAnim();
createFabReverseFrameAnim();
final FloatingActionButton fab = new FloatingActionButton(this);
fab.setType(FloatingActionButton.TYPE_NORMAL);
fab.setImageDrawable(frameAnim);
// fab.setImageResource(android.R.drawable.ic_dialog_email);
fab.setColorPressedResId(R.color.colorPrimary);
fab.setColorNormalResId(R.color.fab);
fab.setColorRippleResId(R.color.text_color);
fab.setShadow(true);
springFloatingActionMenu = new SpringFloatingActionMenu.Builder(this)
.fab(fab)
.addMenuItem(R.color.photo, R.mipmap.ic_messaging_posttype_photo, "Photo", R.color.text_color,this)
.addMenuItem(R.color.chat, R.mipmap.ic_messaging_posttype_chat, "Chat", R.color.text_color,this)
.addMenuItem(R.color.quote, R.mipmap.ic_messaging_posttype_quote, "Quote", R.color.text_color,this)
.addMenuItem(R.color.link, R.mipmap.ic_messaging_posttype_link, "Link", R.color.text_color,this)
.addMenuItem(R.color.audio, R.mipmap.ic_messaging_posttype_audio, "Audio", R.color.text_color,this)
.addMenuItem(R.color.text, R.mipmap.ic_messaging_posttype_text, "Text", R.color.text_color,this)
.addMenuItem(R.color.video, R.mipmap.ic_messaging_posttype_video, "Video", R.color.text_color,this)
.animationType(SpringFloatingActionMenu.ANIMATION_TYPE_BLOOM)
.revealColor(R.color.colorPrimary)
.gravity(Gravity.RIGHT | Gravity.BOTTOM)
.onMenuActionListner(new OnMenuActionListener() {
@Override
public void onMenuOpen() {
fab.setImageDrawable(frameAnim);
frameReverseAnim.stop();
frameAnim.start();
}
@Override
public void onMenuClose() {
fab.setImageDrawable(frameReverseAnim);
frameAnim.stop();
frameReverseAnim.start();
}
})
.build();
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
setTitle("SpringFloatingActionMenu");
}