mirror of
https://github.com/HackPlan/AndroidArcMenu.git
synced 2026-06-15 23:12:40 +08:00
add menuView in OnClickBtnListener
This commit is contained in:
@@ -19,7 +19,7 @@ import java.util.HashSet;
|
||||
public class ArcMenu {
|
||||
|
||||
public interface OnClickBtnListener{
|
||||
void onClickArcMenu(int viewId);
|
||||
void onClickArcMenu(View menuView, int viewId);
|
||||
}
|
||||
|
||||
private ArcMenuInterceptLayout arcLayout;
|
||||
|
||||
@@ -125,7 +125,8 @@ public class ArcMenuLayout extends ViewGroup implements Animator.AnimatorListene
|
||||
AnimatorUtils.openMenu(this, lastFocusIndex);
|
||||
show = false;
|
||||
if (onClickBtnListener != null) {
|
||||
onClickBtnListener.onClickArcMenu((int)getChildAt(lastFocusIndex).getTag());
|
||||
View clickedView = getChildAt(lastFocusIndex);
|
||||
onClickBtnListener.onClickArcMenu(clickedView, (int)clickedView.getTag());
|
||||
}
|
||||
} else if (hideOnTouchUp) {
|
||||
AnimatorUtils.hideMenu(this, touchPoint);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class MainActivity extends AppCompatActivity implements ArcMenu.OnClickBt
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClickArcMenu(int id) {
|
||||
public void onClickArcMenu(View menuView, int id) {
|
||||
Toast.makeText(this, String.format("Click #%s", id), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user