Example usage for android.view.animation Animation setFillAfter

List of usage examples for android.view.animation Animation setFillAfter

Introduction

In this page you can find the example usage for android.view.animation Animation setFillAfter.

Prototype

public void setFillAfter(boolean fillAfter) 

Source Link

Document

If fillAfter is true, the transformation that this animation performed will persist when it is finished.

Usage

From source file:org.dalol.orthodoxmezmurmedia.utilities.widgets.AmharicKeyboardView.java

/**
 * This method is used to animate the keyboard up and down
 *
 * @param from the initialDelta/*w w  w .  j  av a  2s.co m*/
 * @param to   the destinationDelta
 */
private void animateKeyboard(float from, float to) {
    Animation animation = new TranslateAnimation(0, 0, from, to);
    animation.setDuration(250L);
    animation.setFillAfter(false);
    startAnimation(animation);
}

From source file:de.grobox.transportr.trips.search.DirectionsFragment.java

private void swapLocations() {
    float toToY = fromCard.getY() - toCard.getY();
    Animation slideUp = new TranslateAnimation(RELATIVE_TO_SELF, 0.0f, RELATIVE_TO_SELF, 0.0f, RELATIVE_TO_SELF,
            0.0f, Animation.ABSOLUTE, toToY);
    slideUp.setDuration(400);/* w  w  w . j  a  v  a  2 s. c o  m*/
    slideUp.setFillAfter(true);
    slideUp.setFillEnabled(true);

    float fromToY = toCard.getY() - fromCard.getY();
    Animation slideDown = new TranslateAnimation(RELATIVE_TO_SELF, 0.0f, RELATIVE_TO_SELF, 0.0f,
            RELATIVE_TO_SELF, 0.0f, Animation.ABSOLUTE, fromToY);
    slideDown.setDuration(400);
    slideDown.setFillAfter(true);
    slideDown.setFillEnabled(true);

    fromCard.startAnimation(slideDown);
    toCard.startAnimation(slideUp);

    slideUp.setAnimationListener(new Animation.AnimationListener() {
        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            // swap location objects
            WrapLocation tmp = to.getLocation();
            if (from.isSearching()) {
                viewModel.findGpsLocation.setValue(null);
                // TODO: GPS currently only supports from location, so don't swap it for now
                viewModel.setToLocation(null);
            } else {
                viewModel.setToLocation(from.getLocation());
            }
            viewModel.setFromLocation(tmp);

            fromCard.clearAnimation();
            toCard.clearAnimation();

            viewModel.search();
        }
    });
}

From source file:com.example.android.tryanimationt.TryAnimationFragment.java

void slideView(View view, boolean up) {
    int animResourceId = up ? R.anim.slide_up : R.anim.slide_down;
    Animation slide = AnimationUtils.loadAnimation(getActivity(), animResourceId);
    slide.setFillAfter(true);
    view.startAnimation(slide);/*from  w  w  w. ja va 2  s  .  c  o m*/
}

From source file:com.spoiledmilk.ibikecph.controls.SortableListView.java

void translate(View v, float deltaY, final boolean finalAnim) {
    float newY = posY + deltaY;
    if (animation != null && animation.isInitialized())
        animation.cancel();/*from ww w. j  a v  a2s . c  om*/
    animation = new TranslateAnimation(0, 0, posY, newY);
    animation.setDuration(finalAnim ? 0 : 100);
    animation.setAnimationListener(new AnimationListener() {
        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            if (!finalAnim) {
                animation.setFillEnabled(true);
                animation.setFillAfter(true);
            } else {
                view.clearAnimation();
                posY = 0;
            }
        }
    });

    posY = newY;

    v.startAnimation(animation);
}

From source file:net.bither.fragment.hot.AddAddressHotHDMFragment.java

private void finalAnimation() {
    final int fadeDuration = 400;
    final int zoomDuration = 500;

    AlphaAnimation fadeOut = new AlphaAnimation(1, 0);
    fadeOut.setDuration(fadeDuration);//  ww  w . ja  v a2  s .c  om
    fadeOut.setFillAfter(true);
    vBg.startAnimation(fadeOut);
    tvHot.startAnimation(fadeOut);
    tvCold.startAnimation(fadeOut);
    tvServer.startAnimation(fadeOut);
    if (llSingularRunning.getVisibility() == View.VISIBLE) {
        llSingularRunning.startAnimation(fadeOut);
    }
    flContainer.postDelayed(new Runnable() {
        @Override
        public void run() {
            vBg.setVisibility(View.GONE);
            tvHot.setVisibility(View.INVISIBLE);
            tvCold.setVisibility(View.INVISIBLE);
            tvServer.setVisibility(View.INVISIBLE);

            int[] size = getCompactContainerSize();
            WrapLayoutParamsForAnimator animWrapper = new WrapLayoutParamsForAnimator(flContainer);
            ObjectAnimator animatorWidth = ObjectAnimator.ofInt(animWrapper, "width", size[0])
                    .setDuration(zoomDuration);
            ObjectAnimator animatorHeight = ObjectAnimator.ofInt(animWrapper, "height", size[1])
                    .setDuration(zoomDuration);
            AnimatorSet animatorSet = new AnimatorSet();
            animatorSet.playTogether(animatorWidth, animatorHeight);
            animatorSet.start();

            flContainer.postDelayed(new Runnable() {
                @Override
                public void run() {
                    Animation anim = AnimationUtils.loadAnimation(getActivity(), R.anim.hdm_keychain_add_spin);
                    anim.setFillAfter(true);
                    flContainer.startAnimation(anim);

                    ArrayList<String> addresses = getAddresses();
                    Intent intent = new Intent();
                    intent.putExtra(BitherSetting.INTENT_REF.ADDRESS_POSITION_PASS_VALUE_TAG, addresses);
                    getActivity().setResult(Activity.RESULT_OK, intent);

                    flContainer.postDelayed(new Runnable() {
                        @Override
                        public void run() {
                            if (getActivity() != null) {
                                ((AddPrivateKeyActivity) getActivity()).save();
                            }
                        }
                    }, anim.getDuration());
                }
            }, zoomDuration);
        }
    }, fadeDuration);
}

From source file:com.rashwan.reactive_popular_movies.common.utilities.ExpandableTextView.java

@Override
public void onClick(View view) {
    if (mButton.getVisibility() != View.VISIBLE) {
        return;/*from  w ww .  j  a va2 s.  com*/
    }

    mCollapsed = !mCollapsed;
    mButton.setImageDrawable(mCollapsed ? mExpandDrawable : mCollapseDrawable);

    // mark that the animation is in progress
    mAnimating = true;

    Animation animation;
    if (mCollapsed) {
        animation = new ExpandCollapseAnimation(this, getHeight(), mCollapsedHeight);
    } else {
        animation = new ExpandCollapseAnimation(this, getHeight(),
                getHeight() + mTextHeightWithMaxLines - mTv.getHeight());
    }

    animation.setFillAfter(true);
    animation.setAnimationListener(new Animation.AnimationListener() {
        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            // clear animation here to avoid repeated applyTransformation() calls
            clearAnimation();
            // clear the animation flag
            mAnimating = false;

            // notify the listener
            if (mListener != null) {
                mListener.onExpandStateChanged(mTv, !mCollapsed);
            }
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });

    clearAnimation();
    startAnimation(animation);
}

From source file:com.findme.views.ExpandableTextView.java

@Override
public void onClick(View view) {
    if (mButton.getVisibility() != View.VISIBLE) {
        return;//from   ww  w . j ava  2s. c  o  m
    }

    mCollapsed = !mCollapsed;
    mButton.setImageDrawable(mCollapsed ? mExpandDrawable : mCollapseDrawable);

    if (mCollapsedStatus != null) {
        mCollapsedStatus.put(mPosition, mCollapsed);
    }

    // mark that the animation is in progress
    mAnimating = true;

    Animation animation;
    if (mCollapsed) {
        animation = new ExpandCollapseAnimation(this, getHeight(), mCollapsedHeight);
    } else {
        animation = new ExpandCollapseAnimation(this, getHeight(),
                getHeight() + mTextHeightWithMaxLines - mTv.getHeight());
    }

    animation.setFillAfter(true);
    animation.setAnimationListener(new Animation.AnimationListener() {
        @Override
        public void onAnimationStart(Animation animation) {
            applyAlphaAnimation(mTv, mAnimAlphaStart);
        }

        @Override
        public void onAnimationEnd(Animation animation) {
            // clear animation here to avoid repeated applyTransformation()
            // calls
            clearAnimation();
            // clear the animation flag
            mAnimating = false;
        }

        @Override
        public void onAnimationRepeat(Animation animation) {
        }
    });

    clearAnimation();
    startAnimation(animation);
}

From source file:bmcx.aiton.com.passenger.view.activity.SmsLoginActivity.java

@Override
public void onClick(View v) {
    Intent intent = new Intent();
    switch (v.getId()) {
    case R.id.textView_frogetPassword:
        intent.setClass(SmsLoginActivity.this, UpdatePasswordActivity.class);
        startActivity(intent);/*  w w w .  j  av  a2 s  .  c o m*/
        break;
    case R.id.textView_register:
        intent.setClass(SmsLoginActivity.this, RegisterActivity.class);
        startActivity(intent);
        break;
    case R.id.textView_quickLogin:
        isQuickLogin = true;
        mTextView_quickLogin.setTextColor(basicColor);
        mTextView_accountLogin.setTextColor(mSystem_gray);
        Animation animation = new TranslateAnimation(offset, 0, 0, 0);
        animation.setFillAfter(true);// True:???
        animation.setDuration(300);
        mImageView_tiao01.startAnimation(animation);
        mLogin.setVisibility(View.GONE);
        mLinear_quickLogin.setVisibility(View.VISIBLE);
        mLinear_accountLogin.setVisibility(View.INVISIBLE);
        break;
    case R.id.textView_accountLogin:
        isQuickLogin = false;
        mTextView_accountLogin.setTextColor(basicColor);
        mTextView_quickLogin.setTextColor(mSystem_gray);
        Animation animation02 = new TranslateAnimation(0, offset, 0, 0);
        animation02.setFillAfter(true);// True:???
        animation02.setDuration(300);
        mImageView_tiao01.startAnimation(animation02);
        mLogin.setVisibility(View.VISIBLE);
        mLinear_quickLogin.setVisibility(View.INVISIBLE);
        mLinear_accountLogin.setVisibility(View.VISIBLE);
        break;
    case R.id.login:
        if (isQuickLogin) {
            if (mSuijiMath.equals(mSms.getText().toString().trim())) {
                //?
                final String DeviceId = Installation.id(SmsLoginActivity.this);
                //??????????----start----//
                Map<String, String> params = new HashMap<>();
                params.put("phone", mPhoneNum);
                params.put("login_id", DeviceId);
                ApiClient.smsLogingSuccess(SmsLoginActivity.this, params, new VolleyListener() {
                    public void onErrorResponse(VolleyError volleyError) {
                    }

                    public void onResponse(String s) {
                        Log.e("SmsLoginActivity", "onResponse: --??????->>" + s);

                        mUser = GsonUtils.parseJSON(s, User.class);
                        if (mUser.isSuccess()) {
                            Log.e("SmsLoginActivity",
                                    "onResponse: --????->>"
                                            + mLoginState.isLogin());
                            toast("??");
                            //????????
                            mLoginState.login(SmsLoginActivity.this);
                            Log.e("SmsLoginActivity",
                                    "onResponse: --?????->>"
                                            + mLoginState.isLogin());
                            //???id??
                            UserLoginInfo userLoginInfo = new UserLoginInfo(mPhoneNum,
                                    "" + mUser.getContains().getId(), DeviceId, mUser.getContains().getImage(),
                                    mUser.getContains().getIdCardImage(),
                                    mUser.getContains().getIdCardImage_back(),
                                    mUser.getContains().getDrivingLicenseImage(),
                                    mUser.getContains().getDrivingLicenseImage_back());
                            mLoginState.setLoginInfo(userLoginInfo);
                            Log.e("SmsLoginActivity",
                                    "onResponse: --?->>" + mLoginState.getLoginInfo().toString());
                            //?
                            MobclickAgent.onProfileSignIn(mPhoneNum);
                            finish();
                        } else {
                            toast(mUser.getMessage());
                        }
                    }
                });
                //??????????----end----//
            } else {
                toast("?");
            }
        } else {
            mPhoneNum = mEditText_phoneNum.getText().toString().trim();
            String password = mEditText_password.getText().toString().trim();
            //?
            final String DeviceId = Installation.id(SmsLoginActivity.this);
            Map<String, String> map = new HashMap<>();
            map.put("phone", mPhoneNum);
            map.put("login_id", DeviceId);
            map.put("password", password);
            ApiClient.passWordLoginSuccess(SmsLoginActivity.this, map, new VolleyListener() {
                @Override
                public void onErrorResponse(VolleyError volleyError) {

                }

                @Override
                public void onResponse(String s) {
                    mUser = GsonUtils.parseJSON(s, User.class);
                    if (mUser.isSuccess()) {
                        Log.e("SmsLoginActivity", "onResponse: --????->>"
                                + mLoginState.isLogin());
                        //????????
                        mLoginState.login(SmsLoginActivity.this);
                        Log.e("SmsLoginActivity",
                                "onResponse: --?????->>"
                                        + mLoginState.isLogin());
                        //???id??
                        UserLoginInfo userLoginInfo = new UserLoginInfo(mPhoneNum,
                                "" + mUser.getContains().getId(), DeviceId, mUser.getContains().getImage(),
                                mUser.getContains().getIdCardImage(), mUser.getContains().getIdCardImage_back(),
                                mUser.getContains().getDrivingLicenseImage(),
                                mUser.getContains().getDrivingLicenseImage_back());
                        mLoginState.setLoginInfo(userLoginInfo);
                        toast("?");
                        //?
                        MobclickAgent.onProfileSignIn(mPhoneNum);
                        finish();
                        //                                Intent intent = new Intent();
                        //                                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                        //                                intent.setClass(SmsLoginActivity.this, MainActivity.class);
                        //                                startActivity(intent);
                    } else {
                        toast("???");
                    }

                }
            });
        }
        break;
    case R.id.iv_org_detailback:
        finish();
        AnimFromRightToLeft();
        break;
    case R.id.phone_num_cancle:
        mPhone_num.setText("");
        break;
    case R.id.sms_cancle:
        mSms.setText("");
        break;
    case R.id.sendSms:
        if (ContextCompat.checkSelfPermission(SmsLoginActivity.this,
                Manifest.permission.READ_SMS) != PackageManager.PERMISSION_GRANTED) {
            //WRITE_EXTERNAL_STORAGE??
            ActivityCompat.requestPermissions(SmsLoginActivity.this,
                    new String[] { Manifest.permission.READ_SMS },
                    Constant.PermissionRequestAndResultCode.PERMISSION_READ_SMS);
        } else {
            sendSMS();
        }

        break;
    }
}

From source file:passenger.view.activity.SmsLoginActivity.java

@Override
public void onClick(View v) {
    Intent intent = new Intent();
    switch (v.getId()) {
    case R.id.textView_frogetPassword:
        intent.setClass(SmsLoginActivity.this, UpdatePasswordActivity.class);
        startActivity(intent);/*from   ww  w.  j  av a2s . c  om*/
        break;
    case R.id.textView_register:
        intent.setClass(SmsLoginActivity.this, RegisterActivity.class);
        startActivity(intent);
        break;
    case R.id.textView_quickLogin:
        isQuickLogin = true;
        mTextView_quickLogin.setTextColor(basicColor);
        mTextView_accountLogin.setTextColor(mSystem_gray);
        Animation animation = new TranslateAnimation(offset, 0, 0, 0);
        animation.setFillAfter(true);// True:???
        animation.setDuration(300);
        mImageView_tiao01.startAnimation(animation);
        mLogin.setVisibility(View.GONE);
        mLinear_quickLogin.setVisibility(View.VISIBLE);
        mLinear_accountLogin.setVisibility(View.INVISIBLE);
        break;
    case R.id.textView_accountLogin:
        isQuickLogin = false;
        mTextView_accountLogin.setTextColor(basicColor);
        mTextView_quickLogin.setTextColor(mSystem_gray);
        Animation animation02 = new TranslateAnimation(0, offset, 0, 0);
        animation02.setFillAfter(true);// True:???
        animation02.setDuration(300);
        mImageView_tiao01.startAnimation(animation02);
        mLogin.setVisibility(View.VISIBLE);
        mLinear_quickLogin.setVisibility(View.INVISIBLE);
        mLinear_accountLogin.setVisibility(View.VISIBLE);
        break;
    case R.id.login:
        if (isQuickLogin) {
            if (mSuijiMath.equals(mSms.getText().toString().trim())) {
                //?
                final String DeviceId = Installation.id(SmsLoginActivity.this);
                //??????????----start----//
                Map<String, String> params = new HashMap<String, String>();
                params.put("phone", mPhoneNum);
                params.put("login_id", DeviceId);
                ApiClient.smsLogingSuccess(SmsLoginActivity.this, params, new VolleyListener() {
                    public void onErrorResponse(VolleyError volleyError) {
                    }

                    public void onResponse(String s) {
                        Log.e("SmsLoginActivity", "onResponse: --??????->>" + s);

                        mUser = GsonUtils.parseJSON(s, UserZhuChe.class);
                        if (mUser.isSuccess()) {
                            Log.e("SmsLoginActivity",
                                    "onResponse: --????->>"
                                            + mLoginState.isLogin());
                            toast("??");
                            //????????
                            mLoginState.login(SmsLoginActivity.this);
                            Log.e("SmsLoginActivity",
                                    "onResponse: --?????->>"
                                            + mLoginState.isLogin());
                            //???id??
                            UserLoginInfo userLoginInfo = new UserLoginInfo(mPhoneNum,
                                    "" + mUser.getContains().getId(), DeviceId, mUser.getContains().getImage(),
                                    mUser.getContains().getIdCardImage(),
                                    mUser.getContains().getIdCardImage_back(),
                                    mUser.getContains().getDrivingLicenseImage(),
                                    mUser.getContains().getDrivingLicenseImage_back());
                            mLoginState.setLoginInfo(userLoginInfo);
                            Log.e("SmsLoginActivity",
                                    "onResponse: --?->>" + mLoginState.getLoginInfo().toString());
                            //?
                            MobclickAgent.onProfileSignIn(mPhoneNum);
                            finish();
                        } else {
                            toast(mUser.getMessage());
                        }
                    }
                });
                //??????????----end----//
            } else {
                toast("?");
            }
        } else {
            mPhoneNum = mEditText_phoneNum.getText().toString().trim();
            String password = mEditText_password.getText().toString().trim();
            //?
            final String DeviceId = Installation.id(SmsLoginActivity.this);
            Map<String, String> map = new HashMap<String, String>();
            map.put("phone", mPhoneNum);
            map.put("login_id", DeviceId);
            map.put("password", password);
            ApiClient.passWordLoginSuccess(SmsLoginActivity.this, map, new VolleyListener() {
                @Override
                public void onErrorResponse(VolleyError volleyError) {

                }

                @Override
                public void onResponse(String s) {
                    mUser = GsonUtils.parseJSON(s, UserZhuChe.class);
                    if (mUser.isSuccess()) {
                        Log.e("SmsLoginActivity", "onResponse: --????->>"
                                + mLoginState.isLogin());
                        //????????
                        mLoginState.login(SmsLoginActivity.this);
                        Log.e("SmsLoginActivity",
                                "onResponse: --?????->>"
                                        + mLoginState.isLogin());
                        //???id??
                        UserLoginInfo userLoginInfo = new UserLoginInfo(mPhoneNum,
                                "" + mUser.getContains().getId(), DeviceId, mUser.getContains().getImage(),
                                mUser.getContains().getIdCardImage(), mUser.getContains().getIdCardImage_back(),
                                mUser.getContains().getDrivingLicenseImage(),
                                mUser.getContains().getDrivingLicenseImage_back());
                        mLoginState.setLoginInfo(userLoginInfo);
                        toast("?");
                        //?
                        MobclickAgent.onProfileSignIn(mPhoneNum);
                        finish();
                        //                                Intent intent = new Intent();
                        //                                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                        //                                intent.setClass(SmsLoginActivity.this, MainActivity.class);
                        //                                startActivity(intent);
                    } else {
                        toast("???");
                    }

                }
            });
        }
        break;
    case R.id.iv_org_detailback:
        finish();
        AnimFromRightToLeft();
        break;
    case R.id.phone_num_cancle:
        mPhone_num.setText("");
        break;
    case R.id.sms_cancle:
        mSms.setText("");
        break;
    case R.id.sendSms:
        //                if (ContextCompat.checkSelfPermission(SmsLoginActivity.this, Manifest.permission.READ_SMS)
        //                        != PackageManager.PERMISSION_GRANTED)
        //                {
        //                    //WRITE_EXTERNAL_STORAGE??
        //                    ActivityCompat.requestPermissions(SmsLoginActivity.this, new String[]{Manifest.permission.READ_SMS}, Constant.PermissionRequestAndResultCode.PERMISSION_READ_SMS);
        //                } else
        //                {
        sendSMS();
        //                }

        break;
    }
}

From source file:cn.zhangls.android.weibo.ui.weibo.WeiboFrameProvider.java

/**
 * ????/*from   www .j a  va  2  s .co m*/
 *
 * @param holder
 * @param status
 */
private void setupPopupBar(final FrameHolder holder, final Status status) {
    LayoutInflater layoutInflater = LayoutInflater
            .from(holder.binding.fgHomeWeiboPopupBar.getContext().getApplicationContext());
    // 
    final View popupView;
    if (status.isFavorited() && status.getUser().isFollowing()) {// ??
        popupView = layoutInflater.inflate(R.layout.popup_window_weibo_follow_save_post,
                holder.binding.flWeiboContainer, false);
    } else if (!status.isFavorited() && status.getUser().isFollowing()) {// ??
        popupView = layoutInflater.inflate(R.layout.popup_window_weibo_follow_unsave_post,
                holder.binding.flWeiboContainer, false);
    } else if (status.isFavorited() && !status.getUser().isFollowing()) {// ??
        popupView = layoutInflater.inflate(R.layout.popup_window_weibo_unfollow_save_post,
                holder.binding.flWeiboContainer, false);
    } else {// ??
        popupView = layoutInflater.inflate(R.layout.popup_window_weibo_unfollow_unsave_post,
                holder.binding.flWeiboContainer, false);
    }
    //  PopupWindow
    final PopupWindow popupWindow = new PopupWindow(popupView, LinearLayout.LayoutParams.WRAP_CONTENT,
            LinearLayout.LayoutParams.WRAP_CONTENT);
    popupWindow.setTouchable(true);
    popupWindow.setFocusable(true);
    popupWindow.setOutsideTouchable(true);
    // popupWindow 
    popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
        @Override
        public void onDismiss() {
            Animation animation = AnimationUtils.loadAnimation(
                    holder.binding.fgHomeWeiboPopupBar.getContext().getApplicationContext(),
                    R.anim.rotate_180_end);
            animation.setDuration(300);
            animation.setFillAfter(true);
            holder.binding.fgHomeWeiboPopupBar.startAnimation(animation);
        }
    });
    popupWindow.setAnimationStyle(R.style.PopupWindowAnimStyle);
    // popupWindow  Item ?
    if (status.isFavorited()) {// ??????
        popupWindow.getContentView().findViewById(R.id.menu_item_weibo_more_save_post)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        FavoritesAPI favoritesAPI = new FavoritesAPI(
                                mBinding.getRoot().getContext().getApplicationContext(),
                                AccessTokenKeeper.readAccessToken(
                                        mBinding.getRoot().getContext().getApplicationContext()));
                        BaseObserver<Favorite> observer = new BaseObserver<Favorite>(
                                mBinding.getRoot().getContext().getApplicationContext()) {
                            @Override
                            public void onNext(Favorite value) {
                            }

                            @Override
                            public void onError(Throwable e) {
                                super.onError(e);
                            }

                            @Override
                            public void onComplete() {

                            }
                        };

                        favoritesAPI.destroy(observer, status.getId());

                        popupWindow.dismiss();
                    }
                });
    } else {
        popupWindow.getContentView().findViewById(R.id.menu_item_weibo_more_unsave_post)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        FavoritesAPI favoritesAPI = new FavoritesAPI(
                                mBinding.getRoot().getContext().getApplicationContext(),
                                AccessTokenKeeper.readAccessToken(
                                        mBinding.getRoot().getContext().getApplicationContext()));
                        BaseObserver<Favorite> observer = new BaseObserver<Favorite>(
                                mBinding.getRoot().getContext().getApplicationContext()) {
                            @Override
                            public void onNext(Favorite value) {
                            }

                            @Override
                            public void onError(Throwable e) {
                                super.onError(e);
                            }

                            @Override
                            public void onComplete() {

                            }
                        };

                        favoritesAPI.create(observer, status.getId());

                        popupWindow.dismiss();
                    }
                });
    }
    if (status.getUser().isFollowing()) {// ????
        popupWindow.getContentView().findViewById(R.id.menu_item_weibo_more_follow)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        popupWindow.dismiss();
                    }
                });
    } else {
        popupWindow.getContentView().findViewById(R.id.menu_item_weibo_more_unfollow)
                .setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        popupWindow.dismiss();
                    }
                });
    }

    // ???
    holder.binding.fgHomeWeiboPopupBar.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (popupWindow != null && !popupWindow.isShowing()) {
                Animation animation = AnimationUtils.loadAnimation(
                        holder.binding.fgHomeWeiboPopupBar.getContext().getApplicationContext(),
                        R.anim.rotate_180_start);
                animation.setDuration(300);
                animation.setFillAfter(true);
                holder.binding.fgHomeWeiboPopupBar.startAnimation(animation);
                popupWindow.showAsDropDown(holder.binding.fgHomeWeiboPopupBar);
            }
        }
    });
}