Search in sources :

Example 1 with ConfirmDialogFragment

use of com.rideread.rideread.common.dialog.ConfirmDialogFragment in project ride-read-android by Ride-Read.

the class UserMomentsActivity method followUser.

private void followUser() {
    if (isFollow) {
        ConfirmDialogFragment unFollowDialog = ConfirmDialogFragment.newInstance(R.string.sure2unfollow);
        unFollowDialog.show(getSupportFragmentManager(), "dialog");
    } else {
        ApiUtils.follow(mSelectedUid, new BaseCallback<BaseModel<DefJsonResult>>() {

            @Override
            protected void onSuccess(BaseModel<DefJsonResult> model) throws Exception {
                isFollow = true;
                refreshFollowAction(isFollow);
                UserInfo myInfo = UserUtils.getCurUser();
                int curFollowing = myInfo.getFollowing() + 1;
                myInfo.setFollowing(curFollowing);
                UserUtils.saveUserInfo(myInfo);
            }
        });
    }
}
Also used : DefJsonResult(com.rideread.rideread.data.result.DefJsonResult) BaseModel(com.rideread.rideread.function.net.retrofit.BaseModel) UserInfo(com.rideread.rideread.data.result.UserInfo) DetailUserInfo(com.rideread.rideread.data.result.DetailUserInfo) ConfirmDialogFragment(com.rideread.rideread.common.dialog.ConfirmDialogFragment)

Aggregations

ConfirmDialogFragment (com.rideread.rideread.common.dialog.ConfirmDialogFragment)1 DefJsonResult (com.rideread.rideread.data.result.DefJsonResult)1 DetailUserInfo (com.rideread.rideread.data.result.DetailUserInfo)1 UserInfo (com.rideread.rideread.data.result.UserInfo)1 BaseModel (com.rideread.rideread.function.net.retrofit.BaseModel)1