本文整理匯總了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");
}