123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638 |
- package com.edufound.reader.base;
- import android.animation.Animator;
- import android.animation.AnimatorListenerAdapter;
- import android.animation.AnimatorSet;
- import android.animation.ObjectAnimator;
- import android.annotation.SuppressLint;
- import android.app.Activity;
- import android.content.BroadcastReceiver;
- import android.content.Context;
- import android.content.Intent;
- import android.content.IntentFilter;
- import android.os.Build;
- import android.os.Bundle;
- import android.os.Handler;
- import android.os.Message;
- import android.util.DisplayMetrics;
- import android.view.Gravity;
- import android.view.LayoutInflater;
- import android.view.MotionEvent;
- import android.view.View;
- import android.view.ViewGroup;
- import android.view.WindowManager;
- import android.view.animation.LinearInterpolator;
- import android.widget.FrameLayout;
- import android.widget.ImageView;
- import android.widget.Toast;
- import com.alibaba.fastjson.JSONObject;
- import com.baidu.duer.bot.directive.payload.AmountInfo;
- import com.baidu.duer.botsdk.BotIntent;
- import com.baidu.duer.botsdk.IAccountChargeMsgListener;
- import com.edufound.reader.R;
- import com.edufound.reader.annotation.BindView;
- import com.edufound.reader.apiserver.UserApiServerImpl;
- import com.edufound.reader.application.EApplication;
- import com.edufound.reader.bean.BaiDuUserInfo;
- import com.edufound.reader.bean.HttpResultBean;
- import com.edufound.reader.bean.SignBean;
- import com.edufound.reader.bean.UserBean;
- import com.edufound.reader.botsdk.BotRegisterListener;
- import com.edufound.reader.botsdk.IBotIntentCallback;
- import com.edufound.reader.cusview.CusToast;
- import com.edufound.reader.receiver.HomeKeyEventReceiver;
- import com.edufound.reader.receiver.NetworkChangeReceiver;
- import com.edufound.reader.receiver.ShowFollowReceiver;
- import com.edufound.reader.util.Consts;
- import com.edufound.reader.util.DeviceUuidFactory;
- import com.edufound.reader.util.EfunboxUtil;
- import com.edufound.reader.util.LiuHaiScreenUtil;
- import com.edufound.reader.util.MMKVEncodeKey;
- import com.edufound.reader.util.MMKVUtil;
- import com.edufound.reader.util.SizeUtils;
- import com.google.gson.Gson;
- import com.google.gson.reflect.TypeToken;
- import com.jakewharton.rxbinding4.view.RxView;
- import com.okhttplib.HttpInfo;
- import com.okhttplib.callback.Callback;
- import com.orhanobut.logger.Logger;
- import java.io.IOException;
- import java.lang.reflect.Field;
- import java.lang.reflect.InvocationTargetException;
- import java.lang.reflect.Method;
- import java.util.HashMap;
- import java.util.Map;
- import java.util.concurrent.TimeUnit;
- import androidx.annotation.NonNull;
- import androidx.appcompat.app.AppCompatActivity;
- import io.reactivex.rxjava3.annotations.Nullable;
- import io.reactivex.rxjava3.disposables.CompositeDisposable;
- import io.reactivex.rxjava3.disposables.Disposable;
- import io.reactivex.rxjava3.functions.Consumer;
- public abstract class BaseActivity extends AppCompatActivity {
- private static final int SHOW_FOLLOW = 0x5512;
- private static final int SHOW_FIRST_TIP = 0x5513;
- public CompositeDisposable mCompositeDisposable;
- //按home键的receiver
- HomeKeyEventReceiver mHomeReceiver;
- //登录广播action
- //Gson
- Gson mGson;
- View mFirstIntoView;
- @Override
- protected void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // EfunboxUtil.setCustomDensity(this, Consts.getmApplicAtion());
- EApplication.mActivityList.add(this);
- EfunboxUtil.initDesignSize(this);
- setContentView(this.getLayoutId());
- initBase();
- bindViews(this);
- initView();
- }
- void initBase() {
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
- LiuHaiScreenUtil.openFullScreenModel(this);
- }
- mGson = new Gson();
- //获取录音权限
- // PermissionsUtil.verifyAudioPermissions(this);
- if (Consts.getScreenSize() == null) {
- DisplayMetrics outMetrics = new DisplayMetrics();
- getWindowManager().getDefaultDisplay().getMetrics(outMetrics);
- int widthPixels = outMetrics.widthPixels;
- int heightPixels = outMetrics.heightPixels;
- int arr[] = {widthPixels, heightPixels};
- Consts.setScreenSize(arr);
- }
- mCompositeDisposable = new CompositeDisposable();
- mHomeReceiver = new HomeKeyEventReceiver();
- //注册home广播
- registerReceiver(mHomeReceiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
- // 注册网络广播
- NetworkChangeReceiver.registerReceiver(this);
- NetworkChangeReceiver.registerObserver(NetStateChangeObserver);
- //注册百度广播
- BotRegisterListener.registerListener(mBotIntentCallBack, mIAccountChargeMsgListener);
- //注册小红花广播
- ShowFollowReceiver.registerReceiver(this);
- ShowFollowReceiver.registerObserver(showFollow);
- }
- @Override
- protected void onDestroy() {
- super.onDestroy();
- EApplication.mActivityList.remove(this);
- BotRegisterListener.removeListener(mBotIntentCallBack);
- clearDisposable();
- unregisterReceiver(mHomeReceiver);
- NetworkChangeReceiver.unRegisterReceiver(this);
- NetworkChangeReceiver.unRegisterObserver(NetStateChangeObserver);
- ShowFollowReceiver.unRegisterReceiver(this);
- ShowFollowReceiver.unRegisterObserver(showFollow);
- }
- /**
- * 设置布局
- *
- * @return
- */
- public abstract int getLayoutId();
- /**
- * 初始化视图
- */
- public abstract void initView();
- public static void bindViews(Activity activity) {
- Class<? extends Activity> activityClass = activity.getClass();//获取activity的class
- Field[] fields = activityClass.getDeclaredFields();//获取activity的字段
- //遍历所有的字段
- for (Field field : fields) {
- //获取该字段的注解
- BindView bindView = field.getAnnotation(BindView.class);
- //!=null 说明该字段有注解并且是指定的注解
- if (bindView != null) {
- //获取到注解总传入的数值value
- int viewId = bindView.id();
- if (viewId != -1) {
- try {
- //获取到activity中findViewById的方法
- Method findViewByIdMethod = activityClass.getMethod("findViewById", int.class);
- try {
- //执行findViewById方法
- Object resView = findViewByIdMethod.invoke(activity, viewId);
- //允许通过反射访问私有变量
- field.setAccessible(true);
- //把字段的值设置该view的实例
- field.set(activity, resView);
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- } catch (NoSuchMethodException e) {
- e.printStackTrace();
- }
- }
- }
- }
- }
- /**
- * 添加订阅
- */
- public void addDisposable(Disposable mDisposable) {
- if (mCompositeDisposable == null) {
- mCompositeDisposable = new CompositeDisposable();
- }
- mCompositeDisposable.add(mDisposable);
- }
- /**
- * 取消所有订阅
- */
- public void clearDisposable() {
- if (mCompositeDisposable != null) {
- mCompositeDisposable.clear();
- }
- }
- @SuppressLint("AutoDispose")
- public void addUiClickListener(View view, Consumer onNext) {
- addDisposable(RxView.clicks(view).throttleFirst(2, TimeUnit.SECONDS).subscribe(onNext));
- }
- public abstract void onGetDisconnect();
- public abstract void onGetMobileConnect();
- public abstract void onGetWifiConnect();
- NetworkChangeReceiver.NetStateChangeObserver NetStateChangeObserver = new NetworkChangeReceiver.NetStateChangeObserver() {
- @Override
- public void onDisconnect() {
- //断网了
- onGetDisconnect();
- Toast.makeText(Consts.getmApplicAtion(), "网络异常,请检查网络。", Toast.LENGTH_SHORT).show();
- }
- @Override
- public void onMobileConnect() {
- //有网了(移动网络)
- onGetMobileConnect();
- }
- @Override
- public void onWifiConnect() {
- //有网了(wifi)
- onGetWifiConnect();
- }
- };
- protected void onLoginSuccess() {
- }
- BroadcastReceiver loginReceiver = new BroadcastReceiver() {
- @Override
- public void onReceive(Context context, Intent intent) {
- onLoginSuccess();
- }
- };
- public ViewGroup getRootView() {
- return findViewById(android.R.id.content);
- }
- public void showFollowCountAnim(String count) {
- // View mFollowView = LayoutInflater.from(this).inflate(R.layout.anim_getfollow, null);
- // FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
- // ((TextView) mFollowView.findViewById(R.id.anim_getfollow_followcount)).setText("+" + count);
- // params.gravity = Gravity.CENTER;
- // mFollowView.setLayoutParams(params);
- // ObjectAnimator mRotationImgAnim = ObjectAnimator.ofFloat(mFollowView, "translationY", 0, -150);
- // mRotationImgAnim.setDuration(1500);
- // LinearInterpolator interpolator = new LinearInterpolator();
- // mRotationImgAnim.setInterpolator(interpolator); //设置匀速旋转,不卡顿 icon_anim.start();
- // ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(mFollowView, "alpha", 1f, 0f);
- // alphaAnim.setDuration(1500);
- // getRootView().addView(mFollowView);
- // AnimatorSet animatorSet = new AnimatorSet();
- // animatorSet.play(mRotationImgAnim).with(alphaAnim);
- // animatorSet.addListener(new AnimatorListenerAdapter() {
- // @Override
- // public void onAnimationEnd(Animator animation) {
- // super.onAnimationEnd(animation);
- // getRootView().removeView(mFollowView);
- // }
- // });
- // animatorSet.start();
- //
- for (int i = 0; i < Integer.valueOf(count); i++) {
- Message message = new Message();
- message.what = SHOW_FOLLOW;
- message.arg1 = i;
- baseHandler.sendMessageDelayed(message, i * 250);
- }
- }
- Handler baseHandler = new Handler(new Handler.Callback() {
- @Override
- public boolean handleMessage(@NonNull Message message) {
- switch (message.what) {
- case SHOW_FOLLOW:
- ImageView imageView = new ImageView(getBaseContext());
- imageView.setImageResource(R.drawable.testhua);
- FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(SizeUtils.dp2px(Consts.getmApplicAtion().getBaseContext(), 50), SizeUtils.dp2px(Consts.getmApplicAtion().getBaseContext(), 50));
- params.gravity = Gravity.RIGHT | Gravity.CENTER;
- params.topMargin = SizeUtils.dp2px(Consts.getmApplicAtion().getBaseContext(), 80);
- if (Integer.valueOf(message.arg1) % 2 == 0) {
- //双数
- params.rightMargin = SizeUtils.dp2px(Consts.getmApplicAtion().getBaseContext(), 30);
- } else {
- params.rightMargin = SizeUtils.dp2px(Consts.getmApplicAtion().getBaseContext(), 70);
- }
- imageView.setLayoutParams(params);
- getRootView().addView(imageView);
- ObjectAnimator mRotationImgAnim = ObjectAnimator.ofFloat(imageView, "translationY", 0, -200);
- mRotationImgAnim.setDuration(1500);
- ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(imageView, "alpha", 1f, 0f);
- alphaAnim.setDuration(1500);
- AnimatorSet animatorSet = new AnimatorSet();
- animatorSet.play(mRotationImgAnim).with(alphaAnim);
- animatorSet.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- getRootView().removeView(imageView);
- }
- });
- animatorSet.start();
- break;
- case SHOW_FIRST_TIP:
- mFirstIntoView = LayoutInflater.from(getBaseContext()).inflate(R.layout.first_tip, null);
- ImageView touch = mFirstIntoView.findViewById(R.id.first_touch);
- FrameLayout.LayoutParams first_params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
- first_params.gravity = Gravity.RIGHT | Gravity.CENTER;
- first_params.rightMargin = SizeUtils.dp2px(Consts.getmApplicAtion().getBaseContext(), 80);
- mFirstIntoView.setLayoutParams(first_params);
- ObjectAnimator translationYUp = ObjectAnimator.ofFloat(touch, "translationY", 80, -30);
- ObjectAnimator translationYDown = ObjectAnimator.ofFloat(touch, "translationY", -30, 80);
- translationYUp.setDuration(3000);
- translationYDown.setDuration(3000);
- LinearInterpolator interpolator = new LinearInterpolator();
- translationYUp.setInterpolator(interpolator); //设置匀速旋转,不卡顿
- translationYDown.setInterpolator(interpolator); //设置匀速旋转,不卡顿
- getRootView().addView(mFirstIntoView);
- AnimatorSet first_animatorSet = new AnimatorSet();
- first_animatorSet.addListener(new AnimatorListenerAdapter() {
- @Override
- public void onAnimationEnd(Animator animation) {
- super.onAnimationEnd(animation);
- first_animatorSet.start();
- }
- });
- mFirstIntoView.setOnTouchListener(new View.OnTouchListener() {
- @Override
- public boolean onTouch(View view, MotionEvent motionEvent) {
- first_animatorSet.pause();
- removeFirstTipView();
- return true;
- }
- });
- first_animatorSet.playSequentially(translationYUp, translationYDown);
- first_animatorSet.start();
- MMKVUtil.getInstance().encode("first_into", false);
- break;
- }
- return false;
- }
- });
- public void showFirstTouchView() {
- baseHandler.sendEmptyMessage(SHOW_FIRST_TIP);
- }
- public void removeFirstTipView() {
- if (mFirstIntoView != null) {
- getRootView().removeView(mFirstIntoView);
- mFirstIntoView = null;
- }
- }
- public Gson getGson() {
- return mGson;
- }
- public void toNextActivity(Class clazz) {
- Intent intent = new Intent(this, clazz);
- startActivity(intent);
- }
- public void toNextActivity(Class clazz, Bundle bundle) {
- Intent intent = new Intent(this, clazz);
- intent.putExtra("params_bundle", bundle);
- startActivity(intent);
- }
- public void toNextActivityForResult(Class clazz, Bundle bundle, int resultCode) {
- Intent intent = new Intent(this, clazz);
- intent.putExtra("params_bundle", bundle);
- startActivityForResult(intent, resultCode);
- }
- //百度的回调逻辑代码块
- protected void botHandleIntent(BotIntent intent, String customData) {
- }
- protected void botOnClickLink(String url, HashMap<String, String> paramMap) {
- }
- protected void botOnHandleScreenNavigatorEvent(int event) {
- }
- protected void botOnLinkAccountSucceed(String s, String s1) {
- }
- protected void refUserInfo(UserBean bean) {
- }
- /**
- * 支付状态改变的通知
- *
- * @param purchaseResult 支付结果 SUCCESS 支付成功 - ERROR 支付发生错误
- * @param authorizationAmount 应收金额信息
- * @param capturedAmount 实际扣款信息
- * @param creationTimestamp 订单创建时间戳
- * @param baiduOrderReferenceId 此次交易百度生成的订单Id
- * @param sellerOrderId 对应支付的订单ID
- * @param msg 订单信息
- */
- protected void botOnChargeStatusUpdated(String purchaseResult, AmountInfo authorizationAmount,
- AmountInfo capturedAmount, long creationTimestamp,
- String baiduOrderReferenceId, String sellerOrderId, String msg) {
- }
- /**
- * 购买结果更新
- *
- * @param purchaseResult 支付结果,SUCCESS 支付成功 -ERROR 支付发生错误
- * @param productId 商品id
- * @param baiduOrderId 百度侧订单id
- * @param sellerOrderId 卖家订单id
- * @param msg 订单备注信息
- */
- protected void botOnBuyStatusUpdated(@NonNull final String purchaseResult,
- @NonNull final String productId,
- @NonNull final String baiduOrderId,
- @NonNull final String sellerOrderId, @Nullable final String msg, String token) {
- }
- IBotIntentCallback mBotIntentCallBack = new IBotIntentCallback() {
- @Override
- public void handleIntent(BotIntent intent, String customData) {
- Logger.e("fragment---intent.name:" + intent.name);
- if (intent.name.equals("all_login")) {
- //用户主动要求登录
- Consts.setIsNeedLogin(true);
- EfunboxUtil.userLogin(EApplication.mActivityList.get(EApplication.mActivityList.size() - 1));
- return;
- } else if (intent.name.equals("user_info")) {
- //获取是不是百度VIP
- Consts.setmConstsBaiDuUserBean(mGson.fromJson(customData, BaiDuUserInfo.class));
- Logger.e("json----" + mGson.toJson(Consts.getmConstsBaiDuUserBean()));
- if (Consts.getIsNeedLogin()) {
- BotRegisterListener.BaiDuLogin();
- } else {
- Consts.setIsNeedLogin(true);
- }
- botHandleIntent(intent, customData);
- return;
- }
- if (BotRegisterListener.isNoLoginIntent(intent)) {
- //不是获取手机号
- Logger.e("不是获取手机号--不是获取手机号:" + intent.name + "---" + intent.slots.toString());
- botHandleIntent(intent, customData);
- } else {
- Logger.e("是获取手机号--是获取手机号");
- //是获取手机号
- if (intent.slots.get(0).value.equals("SUCCESS")) {
- //获取手机号Token成功
- String token = intent.slots.get(1).value;
- UserApiServerImpl userApiServer = new UserApiServerImpl();
- Activity topActivity = EApplication.mActivityList.get(EApplication.mActivityList.size() - 1);
- userApiServer.getBaiDuUserPhone(topActivity, token, new Callback() {
- @Override
- public void onSuccess(HttpInfo info) throws IOException {
- JSONObject object = JSONObject.parseObject(info.getRetDetail().toString());
- String phone = JSONObject.parseObject(object.getString("data")).getString("phone");
- Logger.e("获取的手机号:" + phone);
- if (EfunboxUtil.isMobileNO(phone)) {
- Map<String, String> map = new HashMap<>();
- map.put("deviceCode", DeviceUuidFactory.getUuid());
- map.put("channel", Consts.getUmengChannel());
- map.put("mobileNo", phone);
- map.put("nickName", EfunboxUtil.setPhoneMiddle(phone));
- Logger.e("Consts.getmConstsBaiDuUserBean().getUserInfo().getUserId():" + Consts.getmConstsBaiDuUserBean().getUserInfo().getUserId());
- map.put("userId", Consts.getmConstsBaiDuUserBean().getUserInfo().getUserId());
- if (MMKVUtil.getInstance().decodeString(MMKVEncodeKey.USER_GRADE).equals("") || MMKVUtil.getInstance().decodeString(MMKVEncodeKey.USER_GRADE) == null) {
- //如果没有,默认给一年级
- map.put("grade", "PRIMARY_FIRST_GRADE");
- } else {
- map.put("grade", MMKVUtil.getInstance().decodeString(MMKVEncodeKey.USER_GRADE));
- }
- String json = mGson.toJson(map);
- Logger.e("json:" + json);
- userApiServer.registerUserId(topActivity, json, new Callback() {
- @Override
- public void onSuccess(HttpInfo info) throws IOException {
- Logger.e("手机号注册成功:" + info.getRetDetail());
- HttpResultBean<UserBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<UserBean>>() {
- }.getType());
- Consts.setUID(bean.getData().getUid());
- //用户是否登录,登录了,创建Consts的userbean
- String nickName = EfunboxUtil.setPhoneMiddle(bean.getData().getMobile());
- bean.getData().setNickName(nickName);
- Consts.setmConstsUserBean(bean.getData());
- Logger.e("看看到底对没有:" + mGson.toJson(Consts.getmConstsUserBean()));
- refUserInfo(Consts.getmConstsUserBean());
- userApiServer.loginSign(topActivity, new Callback() {
- @Override
- public void onSuccess(HttpInfo info) throws IOException {
- Logger.e("info:" + info.getRetDetail());
- HttpResultBean<SignBean> bean = info.getRetDetail(new TypeToken<HttpResultBean<SignBean>>() {
- }.getType());
- if (bean.getData().getIsSign()) {
- CusToast.getInstance(topActivity).show("恭喜签到成功\n奖励" + bean.getData().getCount() + "朵小红花", 2000);
- }
- }
- @Override
- public void onFailure(HttpInfo info) throws IOException {
- }
- });
- }
- @Override
- public void onFailure(HttpInfo info) throws IOException {
- Logger.e("手机号注册失败:" + info.getRetDetail());
- Toast.makeText(topActivity, "注册失败", Toast.LENGTH_SHORT).show();
- }
- });
- } else {
- Toast.makeText(topActivity, "手机号不正确", Toast.LENGTH_SHORT).show();
- }
- }
- @Override
- public void onFailure(HttpInfo info) throws IOException {
- }
- });
- } else if (intent.slots.get(0).value.equals("FAIL")) {
- //获取手机号Token失败
- }
- }
- }
- @Override
- public void onClickLink(String url, HashMap<String, String> paramMap) {
- botOnClickLink(url, paramMap);
- }
- @Override
- public void onHandleScreenNavigatorEvent(int event) {
- botOnHandleScreenNavigatorEvent(event);
- }
- };
- IAccountChargeMsgListener mIAccountChargeMsgListener = new IAccountChargeMsgListener() {
- @Override
- public void onLinkAccountSucceed(String s, String s1) {
- botOnLinkAccountSucceed(s, s1);
- }
- @Override
- public void onChargeStatusUpdated(String purchaseResult, AmountInfo authorizationAmount,
- AmountInfo capturedAmount, long creationTimestamp,
- String baiduOrderReferenceId, String sellerOrderId, String msg) {
- botOnChargeStatusUpdated(purchaseResult, authorizationAmount, capturedAmount, creationTimestamp, baiduOrderReferenceId, sellerOrderId, msg);
- }
- @Override
- public void onBuyStatusUpdated(@NonNull final String purchaseResult,
- @NonNull final String productId,
- @NonNull final String baiduOrderId,
- @NonNull final String sellerOrderId, @Nullable final String msg, String token) {
- Consts.setIsNeedLogin(false);
- //处理支付回调
- Logger.e("purchaseResult:" + purchaseResult);
- Logger.e("productId:" + productId);
- Logger.e("baiduOrderId:" + baiduOrderId);
- Logger.e("sellerOrderId:" + sellerOrderId);
- Logger.e("msg:" + msg);
- Logger.e("token:" + token);
- if (purchaseResult.equals("SUCCESS")) {
- //成功
- } else if (purchaseResult.equals("ERROR")) {
- //支付失败
- }
- botOnBuyStatusUpdated(purchaseResult, productId, baiduOrderId, sellerOrderId, msg, token);
- }
- };
- @Override
- protected void onResume() {
- super.onResume();
- // if (Consts.getUmengChannel().equals(ChannelCodeEnum.BAIDU.getChannelCode())) {
- // if (!Consts.getIsNeedLogin()) {
- // BotRegisterListener.getBaiDuVipInfo();
- // }
- // }
- }
- ShowFollowReceiver.ShowFollow showFollow = new ShowFollowReceiver.ShowFollow() {
- @Override
- public void showFollow(Intent intent) {
- showFollowCountAnim(intent.getStringExtra("follow_count"));
- }
- };
- }
|