本文整理汇总了Java中com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu类的典型用法代码示例。如果您正苦于以下问题:Java FloatingActionMenu类的具体用法?Java FloatingActionMenu怎么用?Java FloatingActionMenu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FloatingActionMenu类属于com.oguzdev.circularfloatingactionmenu.library包,在下文中一共展示了FloatingActionMenu类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: restoreSubActionViewAfterAnimation
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
/**
* Restores the specified sub action view to its final state, accoding to the current actionType
* Should be called after an animation finishes.
* @param subActionItem
* @param actionType
*/
protected void restoreSubActionViewAfterAnimation(FloatingActionMenu.Item subActionItem, ActionType actionType) {
FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) subActionItem.view.getLayoutParams();
subActionItem.view.setTranslationX(0);
subActionItem.view.setTranslationY(0);
subActionItem.view.setRotation(0);
subActionItem.view.setScaleX(1);
subActionItem.view.setScaleY(1);
subActionItem.view.setAlpha(1);
if(actionType == ActionType.OPENING) {
params.setMargins(subActionItem.x, subActionItem.y, 0, 0);
subActionItem.view.setLayoutParams(params);
}
else if(actionType == ActionType.CLOSING) {
Point center = menu.getActionViewCenter();
params.setMargins(center.x - subActionItem.width / 2, center.y - subActionItem.height / 2, 0, 0);
subActionItem.view.setLayoutParams(params);
((ViewGroup) menu.getActivityContentView()).removeView(subActionItem.view);
}
}
示例2: onMenuOpened
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
@Override
public void onMenuOpened(FloatingActionMenu menu) {
// Only allow one menu to stay open
for(FloatingActionMenu iMenu : menus) {
iMenu.close(true);
}
// update our current menu reference
currentMenu = menu;
}
示例3: hideandshowfloatingButton
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
public void hideandshowfloatingButton(View actionButton,View button1,View button2,View button3,FloatingActionMenu fabmenu){
this.actionButton = actionButton;
this.button1 = button1;
this.button2 = button2;
this.button3 = button3;
this.fabmenu = fabmenu;
}
示例4: onCreateView
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_menu_with_custom_action_button, container, false);
// Our action button is this time just a regular view!
Button centerActionButton = (Button) rootView.findViewById(R.id.centerActionButton);
// Add some items to the menu. They are regular views as well!
TextView a = new TextView(getActivity()); a.setText("a"); a.setBackgroundResource(android.R.drawable.btn_default_small);
TextView b = new TextView(getActivity()); b.setText("b"); b.setBackgroundResource(android.R.drawable.btn_default_small);
TextView c = new TextView(getActivity()); c.setText("c"); c.setBackgroundResource(android.R.drawable.btn_default_small);
TextView d = new TextView(getActivity()); d.setText("d"); d.setBackgroundResource(android.R.drawable.btn_default_small);
TextView e = new TextView(getActivity()); e.setText("e"); e.setBackgroundResource(android.R.drawable.btn_default_small);
TextView f = new TextView(getActivity()); f.setText("f"); f.setBackgroundResource(android.R.drawable.btn_default_small);
TextView g = new TextView(getActivity()); g.setText("g"); g.setBackgroundResource(android.R.drawable.btn_default_small);
TextView h = new TextView(getActivity()); h.setText("h"); h.setBackgroundResource(android.R.drawable.btn_default_small);
FrameLayout.LayoutParams tvParams = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
a.setLayoutParams(tvParams);
b.setLayoutParams(tvParams);
c.setLayoutParams(tvParams);
d.setLayoutParams(tvParams);
e.setLayoutParams(tvParams);
f.setLayoutParams(tvParams);
g.setLayoutParams(tvParams);
h.setLayoutParams(tvParams);
SubActionButton.Builder subBuilder = new SubActionButton.Builder(getActivity());
FloatingActionMenu circleMenu = new FloatingActionMenu.Builder(getActivity())
.setStartAngle(0) // A whole circle!
.setEndAngle(360)
.setRadius(getResources().getDimensionPixelSize(R.dimen.radius_large))
.addSubActionView(a)
.addSubActionView(b)
.addSubActionView(c)
.addSubActionView(d)
.addSubActionView(e)
.addSubActionView(f)
.addSubActionView(g)
.addSubActionView(h)
.attachTo(centerActionButton)
.build();
return rootView;
}
开发者ID:sathishmscict,项目名称:CircularFloatingActionMenu,代码行数:47,代码来源:MenuWithCustomActionButtonActivity.java
示例5: onCreateView
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_menu_with_custom_animation, container, false);
ImageView fabContent = new ImageView(getActivity());
fabContent.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_settings));
FloatingActionButton darkButton = new FloatingActionButton.Builder(getActivity())
.setTheme(FloatingActionButton.THEME_DARK)
.setContentView(fabContent)
.setPosition(FloatingActionButton.POSITION_BOTTOM_CENTER)
.build();
SubActionButton.Builder rLSubBuilder = new SubActionButton.Builder(getActivity())
.setTheme(SubActionButton.THEME_DARK);
ImageView rlIcon1 = new ImageView(getActivity());
ImageView rlIcon2 = new ImageView(getActivity());
ImageView rlIcon3 = new ImageView(getActivity());
ImageView rlIcon4 = new ImageView(getActivity());
ImageView rlIcon5 = new ImageView(getActivity());
rlIcon1.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_chat));
rlIcon2.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_camera));
rlIcon3.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_video));
rlIcon4.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_place));
rlIcon5.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_headphones));
// Set 4 SubActionButtons
FloatingActionMenu centerBottomMenu = new FloatingActionMenu.Builder(getActivity())
.setStartAngle(0)
.setEndAngle(-180)
.setAnimationHandler(new SlideInAnimationHandler())
.addSubActionView(rLSubBuilder.setContentView(rlIcon1).build())
.addSubActionView(rLSubBuilder.setContentView(rlIcon2).build())
.addSubActionView(rLSubBuilder.setContentView(rlIcon3).build())
.addSubActionView(rLSubBuilder.setContentView(rlIcon4).build())
.addSubActionView(rLSubBuilder.setContentView(rlIcon5).build())
.attachTo(darkButton)
.build();
return rootView;
}
开发者ID:sathishmscict,项目名称:CircularFloatingActionMenu,代码行数:44,代码来源:MenuWithCustomAnimationActivity.java
示例6: onMenuClosed
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
@Override
public void onMenuClosed(FloatingActionMenu menu) {
// remove our current menu reference
currentMenu = null;
}
示例7: SubActionItemAnimationListener
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
public SubActionItemAnimationListener(FloatingActionMenu.Item subActionItem, ActionType actionType) {
this.subActionItem = subActionItem;
this.actionType = actionType;
}
示例8: setMenu
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
public void setMenu(FloatingActionMenu menu) {
this.menu = menu;
}
示例9: FloatingActionWidget
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
public FloatingActionWidget(Activity activity) {
mActivity = activity;
mFloatingActionButtonBuilder = new FloatingActionButton.Builder(activity);
mFloatingActionMenuBuilder = new FloatingActionMenu.Builder(activity);
}
示例10: actionBarButton
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
private void actionBarButton() {
//define the icon for the main floating action button
ImageView iconActionButton = new ImageView(this);
iconActionButton.setImageResource(R.drawable.ic_action_new);
FloatingActionButton actionButton = new FloatingActionButton.Builder(this)
.setContentView(iconActionButton)
.setBackgroundDrawable(R.drawable.selector_button_red)
.build();
//define the icons for the sub action buttons
ImageView TourAndTravel = new ImageView(this);
TourAndTravel.setImageResource(R.drawable.tourtravel);
ImageView MedicinaStore = new ImageView(this);
MedicinaStore.setImageResource(R.drawable.medicina);
ImageView SocialNetwork = new ImageView(this);
SocialNetwork.setImageResource(R.drawable.socialnetwork);
ImageView ShoppingAndUtility = new ImageView(this);
ShoppingAndUtility.setImageResource(R.drawable.shopping);
ImageView Newspaper = new ImageView(this);
Newspaper.setImageResource(R.drawable.newspaper);
//set the background for all the sub buttons
SubActionButton.Builder itemBuilder = new SubActionButton.Builder(this);
itemBuilder.setBackgroundDrawable(getResources().getDrawable(R.drawable.selector_sub_button_gray));
//build the sub buttons
SubActionButton Tour = itemBuilder.setContentView(TourAndTravel).build();
SubActionButton Med = itemBuilder.setContentView(MedicinaStore).build();
SubActionButton Social = itemBuilder.setContentView(SocialNetwork).build();
SubActionButton Shopping = itemBuilder.setContentView(ShoppingAndUtility).build();
SubActionButton News = itemBuilder.setContentView(Newspaper).build();
Tour.setTag(TAG_Tour_Travel);
Med.setTag(TAG_Medicina);
Social.setTag(TAG_Social_Network);
Shopping.setTag(TAG_Shopping_Utility);
News.setTag(TAG_NewsPaper);
Tour.setOnClickListener(this);
Med.setOnClickListener(this);
Social.setOnClickListener(this);
Shopping.setOnClickListener(this);
News.setOnClickListener(this);
//add the sub buttons to the main floating action button
FloatingActionMenu actionMenu = new FloatingActionMenu.Builder(this)
.addSubActionView(Tour)
.addSubActionView(Med)
.addSubActionView(Social)
.addSubActionView(Shopping)
.addSubActionView(News)
.attachTo(actionButton)
.build();
}
示例11: getActionMenu
import com.oguzdev.circularfloatingactionmenu.library.FloatingActionMenu; //导入依赖的package包/类
public FloatingActionMenu getActionMenu() {
return actionMenu;
}