Back to project page Calma.
The source code is released under:
Apache License
If you think the Android project Calma listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.espian.showcaseview.targets; // w ww.j av a 2s . c o m import android.app.Activity; import android.graphics.Point; import android.view.ViewParent; import com.espian.showcaseview.actionbar.ActionBarViewWrapper; import com.espian.showcaseview.actionbar.reflection.BaseReflector; public class ActionViewTarget implements Target { private final Activity mActivity; private final Type mType; ActionBarViewWrapper mActionBarWrapper; BaseReflector mReflector; public ActionViewTarget(Activity activity, Type type) { mActivity = activity; mType = type; } protected void setUp() { mReflector = BaseReflector.getReflectorForActivity(mActivity); ViewParent p = mReflector.getActionBarView(); //ActionBarView mActionBarWrapper = new ActionBarViewWrapper(p); } @Override public Point getPoint() { Target internal = null; setUp(); switch (mType) { case SPINNER: internal = new ViewTarget(mActionBarWrapper.getSpinnerView()); break; case HOME: internal = new ViewTarget(mReflector.getHomeButton()); break; case OVERFLOW: internal = new ViewTarget(mActionBarWrapper.getOverflowView()); break; case TITLE: internal = new ViewTarget(mActionBarWrapper.getTitleView()); break; } return internal.getPoint(); } public enum Type { SPINNER, HOME, TITLE, OVERFLOW } }