| | |
| | | applicationId "com.tejia.lijin" |
| | | minSdkVersion 19 |
| | | targetSdkVersion 26 |
| | | versionCode 65//2.0.2 |
| | | versionName "1.1.1" |
| | | versionCode 67//2.0.2 |
| | | versionName "1.1.3" |
| | | testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' |
| | | } |
| | | |
| | |
| | | <!-- 华为推送自动初始化 --> |
| | | <meta-data |
| | | android:name="push_kit_auto_init_enabled" |
| | | android:value="true" /> |
| | | android:value="false" /> |
| | | <!-- 华为推送服务注册 --> |
| | | <service |
| | | android:name=".service.HWPushService" |
| | |
| | | * 穿山甲广告初始化 |
| | | */ |
| | | private static void initAD(Context context) { |
| | | GDTADManager.getInstance().initWith(context, Constant.GDT_APP_ID); |
| | | try { |
| | | GDTADManager.getInstance().initWith(context, Constant.GDT_APP_ID); |
| | | |
| | | TTAdSdk.init(context, |
| | | new TTAdConfig.Builder() |
| | | .appId(Constant.CSJ_APP_ID) |
| | | .useTextureView(true) //默认使用SurfaceView播放视频广告,当有SurfaceView冲突的场景,可以使用TextureView |
| | | .appName("特价") |
| | | .titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)//落地页主题 |
| | | .allowShowNotify(true) //是否允许sdk展示通知栏提示 |
| | | .debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用 |
| | | .directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI) //允许直接下载的网络状态集合,没有设置的网络下点击下载apk会有二次确认弹窗,弹窗中会披露应用信息 |
| | | .supportMultiProcess(false) //是否支持多进程,true支持 |
| | | .asyncInit(true) //是否异步初始化sdk,设置为true可以减少SDK初始化耗时。3450版本开始废弃~~ |
| | | //.httpStack(new MyOkStack3())//自定义网络库,demo中给出了okhttp3版本的样例,其余请自行开发或者咨询工作人员。 |
| | | .build()); |
| | | TTAdSdk.init(context, |
| | | new TTAdConfig.Builder() |
| | | .appId(Constant.CSJ_APP_ID) |
| | | .useTextureView(true) //默认使用SurfaceView播放视频广告,当有SurfaceView冲突的场景,可以使用TextureView |
| | | .appName("特价") |
| | | .titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK)//落地页主题 |
| | | .allowShowNotify(true) //是否允许sdk展示通知栏提示 |
| | | .debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用 |
| | | .directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI) //允许直接下载的网络状态集合,没有设置的网络下点击下载apk会有二次确认弹窗,弹窗中会披露应用信息 |
| | | .supportMultiProcess(false) //是否支持多进程,true支持 |
| | | .asyncInit(true) //是否异步初始化sdk,设置为true可以减少SDK初始化耗时。3450版本开始废弃~~ |
| | | //.httpStack(new MyOkStack3())//自定义网络库,demo中给出了okhttp3版本的样例,其余请自行开发或者咨询工作人员。 |
| | | .build()); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | public IWXAPI mWxApi; |
| | |
| | | String notifyDesc; |
| | | String notifyUrl; |
| | | int platform; |
| | | int time = 5; |
| | | int time = 3; |
| | | Runnable runnable = null; |
| | | IDialogClose dialogCloseListener; |
| | | |
| | |
| | | PushUtil.inintPush(ShoppingApplication.application, pushApps, new PushUtil.ITokenListener() { |
| | | |
| | | @Override |
| | | public void onToken(PushRomType romType, String regId) { |
| | | ShoppingApi.bindPushToken(getApplicationContext(), UserUtil.getUid(getApplicationContext()), romType, regId, null); |
| | | public void onToken(final PushRomType romType,final String regId) { |
| | | runOnUiThread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | ShoppingApi.bindPushToken(getApplicationContext(), UserUtil.getUid(getApplicationContext()), romType, regId, null); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | } |
| | |
| | | lijinHongBaoRunnable.run(); |
| | | if (lijinSendInfo.getUser() != null) { |
| | | Glide.with(this).load(lijinSendInfo.getUser().getPortrait()).transform(new GlideCircleTransform(getContext())).into(iv_fuli_portrait); |
| | | }else |
| | | } else |
| | | Glide.with(this).load(R.drawable.ic_default_portrait_light).transform(new GlideCircleTransform(getContext())).into(iv_fuli_portrait); |
| | | } |
| | | } |
| | |
| | | new RecommendHbDialog.Builder(getContext()).setHBInfo(lijinSendInfo).setActionListener(new RecommendHbDialog.Builder.ILijinHongBaoAction() { |
| | | @Override |
| | | public void onClose() { |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putString(lijinSendInfo.getMd5(), new Gson().toJson(lijinSendInfo)); |
| | | editor.commit(); |
| | | if (lijinSendInfo != null && !StringUtils.isNullOrEmpty(lijinSendInfo.getMd5())) { |
| | | SharedPreferences.Editor editor = sharedPreferences.edit(); |
| | | editor.putString(lijinSendInfo.getMd5(), new Gson().toJson(lijinSendInfo)); |
| | | editor.commit(); |
| | | } |
| | | |
| | | setFuliData(); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void onClick(View v) { |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("from", "recommendHot"); |
| | | intent.putExtra("goodsId", info.getGoodsId()); |
| | | intent.putExtra("goodsType", info.getGoodsType()); |
| | | intent.putExtra("title", info.getTitle()); |
| | |
| | | case GOODS_TYPE_SUNING: |
| | | return "苏宁"; |
| | | } |
| | | |
| | | |
| | | return ""; |
| | | } |
| | | |
| | |
| | | public static void pourIntoUserInfo(Context context) { |
| | | if (!Constant.TEST) |
| | | return; |
| | | Long uid = 437032L; |
| | | Long uid = 6872490L; |
| | | SharedPreferences sp = context.getSharedPreferences("user", Context.MODE_PRIVATE); |
| | | SharedPreferences.Editor editor = sp.edit(); |
| | | editor.putBoolean("isLogin", true); |
| | |
| | | |
| | | public static void getClipboardContent(final Activity context, final IClipboardContentListener listener) { |
| | | |
| | | if (Build.VERSION.SDK_INT >= 29) {//Q以后版本采用 |
| | | context.getWindow().getDecorView().post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); |
| | | if (clipboardManager != null) |
| | | if (clipboardManager.getPrimaryClip() != null) |
| | | if (clipboardManager.getPrimaryClip().getItemCount() > 0 && clipboardManager.getPrimaryClip().getItemAt(0).getText() != null) |
| | | listener.getContent(clipboardManager.getPrimaryClip().getItemAt(0).getText().toString()); |
| | | } |
| | | }); |
| | | } else { |
| | | ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); |
| | | if (clipboardManager != null) |
| | | if (clipboardManager.getPrimaryClip() != null) |
| | | if (clipboardManager.getPrimaryClip().getItemCount() > 0 && clipboardManager.getPrimaryClip().getItemAt(0).getText() != null) |
| | | listener.getContent(clipboardManager.getPrimaryClip().getItemAt(0).getText().toString()); |
| | | try { |
| | | if (Build.VERSION.SDK_INT >= 29) {//Q以后版本采用 |
| | | context.getWindow().getDecorView().post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); |
| | | if (clipboardManager != null) |
| | | if (clipboardManager.getPrimaryClip() != null) |
| | | if (clipboardManager.getPrimaryClip().getItemCount() > 0 && clipboardManager.getPrimaryClip().getItemAt(0).getText() != null) |
| | | listener.getContent(clipboardManager.getPrimaryClip().getItemAt(0).getText().toString()); |
| | | } |
| | | }); |
| | | } else { |
| | | ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); |
| | | if (clipboardManager != null) |
| | | if (clipboardManager.getPrimaryClip() != null) |
| | | if (clipboardManager.getPrimaryClip().getItemCount() > 0 && clipboardManager.getPrimaryClip().getItemAt(0).getText() != null) |
| | | listener.getContent(clipboardManager.getPrimaryClip().getItemAt(0).getText().toString()); |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import android.app.Application; |
| | | import android.os.Build; |
| | | import android.text.TextUtils; |
| | | import android.util.Log; |
| | | |
| | | import com.heytap.msp.push.HeytapPushManager; |
| | | import com.heytap.msp.push.callback.ICallBackResultService; |
| | | import com.huawei.hms.aaid.HmsInstanceId; |
| | | import com.huawei.hms.common.ApiException; |
| | | import com.meizu.cloud.pushsdk.PushManager; |
| | | import com.vivo.push.IPushActionListener; |
| | | import com.vivo.push.PushClient; |
| | |
| | | case "huawei": |
| | | case "honor": |
| | | //华为是自动初始化 |
| | | //获取token |
| | | new Thread() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | // 从agconnect-service.json文件中读取appId |
| | | String appId = apps.getHw().getAppId(); |
| | | // 输入token标识"HCM" |
| | | String tokenScope = "HCM"; |
| | | String token = HmsInstanceId.getInstance(context).getToken(appId, tokenScope); |
| | | Log.i(TAG, "get token: " + token); |
| | | |
| | | // 判断token是否为空 |
| | | if(!TextUtils.isEmpty(token)) { |
| | | tokenListener.onToken(PushRomType.huawei,token); |
| | | } |
| | | } catch (ApiException e) { |
| | | Log.e(TAG, "hw: get token failed, " + e); |
| | | } |
| | | } |
| | | }.start(); |
| | | |
| | | return; |
| | | case "oppo"://上面官方判断 |
| | | /***OPPO官方判断方法*/ |