siyamed / android-satellite-menu Goto Github PK
View Code? Open in Web Editor NEWAndroid Satellite Menu
Android Satellite Menu
It seems like it should be easy, but adding a click listener to the menu only works when you click around it (the amount of space it takes up when opened)... Is there a way to do something, eg a Toast, only when the user clicks the menu button itself? 现在看来似乎应该很容易,但增加点击监听器菜单只能当你周围单击(空间量它打开时占用)...有没有办法做一些事情,用户点击,只有当菜单按钮本身?
I want to redraw the items so it can display which item is selected
I changed the addItems function from the library to reset the menuitems every time, so it won't be adding more and more items .
This is my code
initarc(menu_x,"x");
menu_x.setOnItemClickedListener(new SateliteClickedListener() {
public void eventOccured(int argx) {
initarc(menu_x,"x");
}
});
initarc is the function to add items and determine which item is selected so it will display a different icon
the problem is when i click an item, the main satellite is unclickable anymore
(no action when clicked)
but then if I press home and resume the app, then the items are displayed.
something is wrong when adding items from the itemclicklistener, because if i call initarc twice without the listener everything works fine.
Really need some help here!
Thanks.
I am trying to adding programmatically but no view generating?
I want to add touch and drag to child menu to add action instead of click. Please suggest me how to achieve it
your code is that when ClickAnimation starts ,the clickEvent is triggered. I change it into AnimationEnd(),but the UE is still uncomfortable.
I think probably the most comfortable way is : ItemClickAnimation---ItemInAnimation---ItemClickEvent
Hi,
There is no proper guideline for setting up and using this wonderful library in Gradle build system. Please provide proper guidelines for it.
I tried the forked version https://github.com/yongjhih/android-satellite-menu. But in xml layout it throws
Unexpected namespace "sat" found for tag android.view.ext.SatelliteMenu....
When I open the SatelitteMenu the second icon from the right bottom corner flickers and causes a weird effect, this does not happens if I close and open the menu several times after, but will happen again if I leave my activity and recreate the SatelitteMenu.
Is there any known fix?
i want to shift menu on right side but when i put it on right side menu open as regular.
how to invert the view, i want to create opposite side view.
Hello thank you for sharing. I want to click on the icon button to open an Activity, how to modify or rewrite the method?
Can you plz tell me how do i add this library to my project in Android Studio and how do i use it further.
Hi Siyamed,
Nice code implemented. Could you please tell me how to align the menu at the right bottom corner of the screen?
I tried changing the android:layout_gravity="bottom|right" but that didn't help. Also how to move the images on a fling?
Hello
i've been using your widget, but when i'm trying to open a new view from the icon pressed the app crashes, i was wandering if anyone already open a new view???
When we use setCloseItemsOnClick(false), onItemClickListener of the satellite menu does not work.
Now i need achieve this , could you provide the relevant methods?thanks so much
First of all, your satellite menu is really really eye-catching. When I show this to my friends, all of them always ask me how to create a beauty control like this ^^. Thank you for your hard-working.
This morning, while reading news on Google Reader, I find another style of satellite menu
http://gigaom2.files.wordpress.com/2012/02/kooabascreenshot.jpg?w=200&h=300
Can you make it?
Cheers.
Hi,
First of all thank you for creating this amazing library and share it with us.
I'm using this menu in my main screen. Depends of what server is sending me i need to dynamically add some items or remove some others. However, I couldn't successful. Is there a way to do this? If you prepare a sample code i'll be so thankful.
public void addItems(List items) {
menuItems.addAll(items);
this.removeView(imgMain);
TextView tmpView = new TextView(getContext());
tmpView.setLayoutParams(new FrameLayout.LayoutParams(0, 0));
// float[] degrees = getDegrees(menuItems.size());
float[] degrees = getDegrees(menuItems.size()+1); // <----- Bug
int index = 0;
for (SatelliteMenuItem menuItem : menuItems) {
int finalX = SatelliteAnimationCreator.getTranslateX(
// degrees[index], satelliteDistance);
degrees[index], satelliteDistance/2); // 円形の場合は、アイテムをメニュー幅の半分にする
int finalY = SatelliteAnimationCreator.getTranslateY(
// degrees[index], satelliteDistance);
degrees[index], satelliteDistance/2); // 円形の場合は、アイテムをメニュー幅の半分にする
ImageView itemView = (ImageView) LayoutInflater.from(getContext())
.inflate(R.layout.sat_item_cr, this, false);
ImageView cloneView = (ImageView) LayoutInflater.from(getContext())
.inflate(R.layout.sat_item_cr, this, false);
cloneView.setTag(menuItem.getId());
itemView.setTag(menuItem.getId());
cloneView.setVisibility(View.GONE);
itemView.setVisibility(View.GONE);
cloneView.setOnClickListener(internalItemClickListener);
// cloneView.setTag(Integer.valueOf(menuItem.getId()));
FrameLayout.LayoutParams layoutParams = getLayoutParams(cloneView);
// layoutParams.bottomMargin = Math.abs(finalY); // 絶対値
// layoutParams.leftMargin = Math.abs(finalX); // 絶対値
layoutParams.bottomMargin = -(finalY);
layoutParams.leftMargin = finalX;
cloneView.setLayoutParams(layoutParams);
if (menuItem.getImgResourceId() > 0) {
itemView.setImageResource(menuItem.getImgResourceId());
cloneView.setImageResource(menuItem.getImgResourceId());
} else if (menuItem.getImgDrawable() != null) {
itemView.setImageDrawable(menuItem.getImgDrawable());
cloneView.setImageDrawable(menuItem.getImgDrawable());
}
Animation itemOut = SatelliteAnimationCreator.createItemOutAnimation(getContext(), index, expandDuration, finalX, finalY);
Animation itemIn = SatelliteAnimationCreator.createItemInAnimation(getContext(), index, expandDuration, finalX, finalY);
Animation itemClick = SatelliteAnimationCreator.createItemClickAnimation(getContext());
menuItem.setView(itemView);
menuItem.setCloneView(cloneView);
menuItem.setInAnimation(itemIn);
menuItem.setOutAnimation(itemOut);
menuItem.setClickAnimation(itemClick);
menuItem.setFinalX(finalX);
menuItem.setFinalY(finalY);
itemIn.setAnimationListener(new SatelliteAnimationListener(itemView, true, viewToItemMap));
itemOut.setAnimationListener(new SatelliteAnimationListener(itemView, false, viewToItemMap));
itemClick.setAnimationListener(new SatelliteItemClickAnimationListener(this, menuItem.getId()));
this.addView(itemView);
this.addView(cloneView);
viewToItemMap.put(itemView, menuItem);
viewToItemMap.put(cloneView, menuItem);
index++;
}
this.addView(imgMain);
}
thanks very much for sharing this library, but I can not set up in my project, the issue is like :Multiple annotations found at this line:
- error: No resource identifier found for attribute 'satelliteDistance' in package
'android.view.ext'
- error: No resource identifier found for attribute 'mainImage' in package 'android.view.ext'
- error: No resource identifier found for attribute 'closeOnClick' in package
'android.view.ext'
- error: No resource identifier found for attribute 'expandDuration' in package
'android.view.ext'
- error: No resource identifier found for attribute 'totalSpacingDegree' in package
'android.view.ext'
XML attributes such as sat:satelliteDistance, sat:mainImage etc. do not work even in the sample project provided here. Even though there are no error shown.
Hi!
You can leave this menu always visible?
I'm using in a layout that contains a ExpandableListView that is populated dynamically via code.
Depending on the number of items that have ExpandableListView, the menu disappears.
I'm using fullscreen layout without ActionBar.
Help?
Hi!
In the demo App itself, if you expand the menu, then rotate, the menu is all the sudden closed. This in itself could be an OK behavior, the real issue comes when pressing to expand the menu again the icons do a funny dance and close themselves.
I imagine, what is going on is that the menu is keeping the expanded state internally while the reality of the views correlates to a new fresh activity, and don't reflect the internal views. I have been looking around for a way of maybe resetting the controller during onPause and recreating it during onResume, but it doesn't make a difference.
Other than that good job, the menu does look really good... and thank you for sharing!
Hi.
Applying:
android:layout_gravity="bottom|center_horizontal"
sat:totalSpacingDegree="180"
Doesn't center the menu, so how to center it?
I tried with:
android:layout_gravity="bottom|center_horizontal"
in satellite-menu/res/layout/sat_main.xml but this centers the ImageView, but not the menu
when use other app so long time.Click Home to restart my app,
it cause:
android.os.BadParcelableException: ClassNotFoundException when unmarshalling
android.view
is for official Android code. AFAIK, your menu is not part of official Android. I would therefore suggest that you move your View
to a package name that is yours, not somebody else's.
How can we add menu item with text ?
How To Compile This in android studio in build.gradle
Hi!, i was trying your library but when i use a different image for sat_main, when the user taps the image rotates as we expect but its moving some pixels left and down
Hello,
I am using your animation for an application, and it works perfectly.
The only bug I have is on Sony Xperia S (with Android 4.0.4), at the end of the animation.
Indeed, buttons don't stay in the place where they should stay : they are all located in a same vertical line (http://file.rspreprod.fr/Screenshot_XperiaS.png)
Do you have an idea on how to fix it ?
Thanks by advance,
Gabriel
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.