35个文件已添加
2 文件已复制
36个文件已修改
3 文件已重命名
1个文件已删除
| | |
| | | storeFile file('C:/Users/weikou2015/Desktop/mKey/buxin') |
| | | storePassword 'weikou2014' |
| | | } |
| | | |
| | | debug { |
| | | storeFile file('D:\\项目\\返利券\\分身\\签名\\tejia.jks') |
| | | storePassword 'weikou2014' |
| | | keyAlias '特价' |
| | | keyPassword 'weikou2014' |
| | | } |
| | | } |
| | | |
| | | useLibrary 'org.apache.http.legacy' |
| | | compileSdkVersion 28 |
| | | buildToolsVersion '28.0.3' |
| | |
| | | api project(':APPUpdate') |
| | | api files('libs/eventbus-2.4.0.jar') |
| | | api files('libs/universal-image-loader-1.9.5.jar') |
| | | api files('libs/open_ad_sdk.aar') |
| | | implementation 'com.github.bumptech.glide:glide:4.9.0' |
| | | implementation project(path: ':library-gallery') |
| | | annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' |
| | |
| | | implementation 'com.github.hackware1993:MagicIndicator:1.7.0' |
| | | |
| | | //广点通广告 |
| | | implementation(name: 'GDTSDK.unionNormal.4.211.1081', ext: 'aar') |
| | | implementation(name: 'GDTSDK.unionNormal.4.362.1232', ext: 'aar') |
| | | |
| | | implementation 'com.google.android.material:material:1.0.0' |
| | | |
| | | |
| | | compile 'com.github.wendux:DSBridge-Android:3.0-SNAPSHOT' |
| | | //support the x5 browser core of tencent |
| | | compile 'com.github.wendux:DSBridge-Android:x5-3.0-SNAPSHOT' |
| | | |
| | | compile 'com.wang.avi:library:2.1.3' |
| | | } |
| | |
| | | <activity |
| | | android:name=".ui.SplashActivity" |
| | | android:label="@string/app_name" |
| | | android:theme="@style/fullScreen" |
| | | android:screenOrientation="portrait"> |
| | | android:screenOrientation="portrait" |
| | | android:theme="@style/fullScreen"> |
| | | |
| | | <intent-filter> |
| | | <action android:name="android.intent.action.VIEW" /> |
| | |
| | | android:screenOrientation="portrait" /> |
| | | |
| | | |
| | | |
| | | <activity |
| | | android:name=".ui.mine.ContactActivity" |
| | | android:configChanges="keyboardHidden|orientation|screenSize" |
| | |
| | | |
| | | <activity |
| | | android:name=".ui.recommend.GoodsDetailActivity" |
| | | android:screenOrientation="portrait"> |
| | | </activity> |
| | | android:screenOrientation="portrait"></activity> |
| | | |
| | | |
| | | <activity |
| | | android:name=".ui.recommend.GoodsDetailActivityTB" |
| | | android:screenOrientation="portrait"> |
| | | <intent-filter> |
| | | <action android:name=".ui.recommend.GoodsBrowserActivity" /> |
| | | </intent-filter> |
| | | </activity> |
| | | <activity |
| | | android:name=".ui.recommend.GoodsDetailActivityJD" |
| | | android:screenOrientation="portrait"> |
| | | <intent-filter> |
| | | <action android:name=".ui.recommend.GoodsBrowserActivity" /> |
| | | </intent-filter> |
| | | </activity> |
| | | <activity |
| | | android:name=".ui.recommend.GoodsDetailActivityPDD" |
| | | android:screenOrientation="portrait"> |
| | | <intent-filter> |
| | | <action android:name=".ui.recommend.GoodsBrowserActivity" /> |
| | | </intent-filter> |
| | | </activity> |
| | | |
| | | <activity |
| | | android:name=".ui.recommend.GoodsDetailActivityVIP" |
| | | android:screenOrientation="portrait"> |
| | | <intent-filter> |
| | | <action android:name=".ui.recommend.GoodsBrowserActivity" /> |
| | | </intent-filter> |
| | | </activity> |
| | | |
| | | <activity |
| | | android:name=".ui.recommend.GoodsDetailActivitySuning" |
| | | android:screenOrientation="portrait"> |
| | | <intent-filter> |
| | | <action android:name=".ui.recommend.GoodsBrowserActivity" /> |
| | | </intent-filter> |
| | | </activity> |
| | | <activity |
| | | android:name=".ui.recommend.ShareExplosionsGoodsDetailActivity" |
| | | android:screenOrientation="portrait"> |
| | |
| | | <!--vivo推送结束--> |
| | | |
| | | <!-- 广点通开始 --> |
| | | <provider |
| | | android:name="com.qq.e.comm.GDTFileProvider" |
| | | android:authorities="${applicationId}.gdt.fileprovider" |
| | | android:exported="false" |
| | | android:grantUriPermissions="true"> |
| | | <meta-data |
| | | android:name="android.support.FILE_PROVIDER_PATHS" |
| | | android:resource="@xml/filepaths" /> |
| | | </provider> |
| | | |
| | | <uses-library |
| | | android:name="org.apache.http.legacy" |
| | | android:required="false" /> |
| | |
| | | android:exported="false" /> |
| | | <!-- 请开发者注意字母的大小写,ADActivity,而不是AdActivity --> |
| | | <activity |
| | | android:name="com.qq.e.ads.ADActivity" |
| | | android:name="com.qq.e.tg.ADActivity" |
| | | android:configChanges="keyboard|keyboardHidden|orientation|screenSize" /> |
| | | <activity |
| | | android:name="com.qq.e.ads.PortraitADActivity" |
| | | android:name="com.qq.e.tg.PortraitADActivity" |
| | | android:configChanges="keyboard|keyboardHidden|orientation|screenSize" |
| | | android:screenOrientation="portrait" /> |
| | | <activity |
| | | android:name="com.qq.e.ads.LandscapeADActivity" |
| | | android:name="com.qq.e.tg.LandscapeADActivity" |
| | | android:configChanges="keyboard|keyboardHidden|orientation|screenSize" |
| | | android:screenOrientation="landscape" /> |
| | | |
| | | |
| | | <!-- 广点通结束--> |
| | | |
| | | <!-- 穿山甲广告开始 --> |
| | | <provider |
| | | android:name="com.bytedance.sdk.openadsdk.TTFileProvider" |
| | | android:authorities="${applicationId}.TTFileProvider" |
| | | android:exported="false" |
| | | android:grantUriPermissions="true"> |
| | | <meta-data |
| | | android:name="android.support.FILE_PROVIDER_PATHS" |
| | | android:resource="@xml/csj_file_paths" /> |
| | | </provider> |
| | | |
| | | <provider |
| | | android:name="com.bytedance.sdk.openadsdk.multipro.TTMultiProvider" |
| | | android:authorities="${applicationId}.TTMultiProvider" |
| | | android:exported="false" /> |
| | | |
| | | <!-- 穿山甲广告结束 --> |
| | | |
| | | </application> |
| | | |
| | | </manifest> |
| | |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | if (uid != null) params.put("uid", uid + ""); |
| | | params.put("id", goodsId); |
| | | if (from != null) |
| | | params.put("from", from); |
| | | if (!StringUtils.isEmpty(source)) |
| | | params.put("source", source); |
| | |
| | | commonPostWithFailture(context, BuXinConstant.HOST + "/fanli/api/lijin/goods/getGoodsDetail", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 通过淘礼金购买 |
| | | * |
| | | * @param context |
| | | * @param goodsId |
| | | * @param goodsType |
| | | * @param lijinId |
| | | * @param uid |
| | | * @param from |
| | | * @param handler |
| | | */ |
| | | public static void buyWithLijin(Context context, String goodsId, int goodsType, String lijinId, Long uid, String from, |
| | | BasicTextHttpResponseHandler handler) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | params.put("goodsId", goodsId); |
| | | params.put("goodsType", goodsType + ""); |
| | | if (lijinId != null) |
| | | params.put("lijinId", lijinId); |
| | | if (uid != null) params.put("uid", uid + ""); |
| | | if (from != null) |
| | | params.put("from", from); |
| | | commonPostWithFailture(context, BuXinConstant.HOST + "/fanli/api/lijin/goods/buyWithLijin", params, handler); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 淘宝获取商品信息1.3.9 |
| | | * |
| | |
| | | int version = PackageUtils2.getVersionCode(context); |
| | | long time = System.currentTimeMillis(); |
| | | String deviceType = MobileUtil.getSystemModel(); |
| | | params.put("packages", "com.yeshi.ec.rebate"); |
| | | params.put("packages", "com.youhuiquan.android"); |
| | | params.put("Version", version + ""); |
| | | params.put("appkey", BuXinConstant.TAO_BAO_KE_KEY); |
| | | params.put("platform", "android"); |
| | |
| | | int version = PackageUtils2.getVersionCode(context); |
| | | long time = System.currentTimeMillis(); |
| | | String deviceType = MobileUtil.getSystemModel(); |
| | | params.put("packages", "com.yeshi.ec.rebate"); |
| | | params.put("packages", "com.youhuiquan.android"); |
| | | params.put("Version", version + ""); |
| | | params.put("appkey", BuXinConstant.TAO_BAO_KE_KEY); |
| | | params.put("platform", "android"); |
| | |
| | | int version = PackageUtils2.getVersionCode(context); |
| | | long time = System.currentTimeMillis(); |
| | | String deviceType = MobileUtil.getSystemModel(); |
| | | params.put("packages", "com.yeshi.ec.rebate"); |
| | | params.put("packages", "com.youhuiquan.android"); |
| | | params.put("Version", version + ""); |
| | | params.put("appkey", BuXinConstant.TAO_BAO_KE_KEY); |
| | | params.put("platform", "android"); |
| | |
| | | import android.content.Intent; |
| | | import android.os.Build; |
| | | import android.os.Process; |
| | | |
| | | import androidx.multidex.MultiDex; |
| | | |
| | | import android.util.Log; |
| | | |
| | | import com.alibaba.baichuan.android.trade.AlibcTradeSDK; |
| | | import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback; |
| | | import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams; |
| | | import com.bytedance.sdk.openadsdk.TTAdConfig; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.kepler.jd.Listener.AsyncInitListener; |
| | | import com.kepler.jd.login.KeplerApiManager; |
| | | import com.qq.e.comm.managers.GDTADManager; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tencent.mm.opensdk.openapi.IWXAPI; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.umeng.commonsdk.UMConfigure; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 京东联盟 |
| | | * |
| | | * @param application |
| | | */ |
| | | public static void initJd(Application application) { |
| | | //京东联盟 |
| | | final String appKey = "0370d4db71dc8d24581e59cabda231f1"; //"7ba8e06b7d6fde3d6bd5db4b0026ecd7"; |
| | | final String appSecret = "21d22579c7c5487c8d73bff2b82b01cc"; //"fb49bc6ecac5458ba5394fc2969d7c56"; |
| | | final String appKey = Constant.JD_APP_KEY; |
| | | final String appSecret = Constant.JD_APP_SECRET; |
| | | KeplerApiManager.asyncInitSdk(application, appKey, appSecret, new AsyncInitListener() { |
| | | @Override |
| | | public void onSuccess() { |
| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 穿山甲广告初始化 |
| | | */ |
| | | private void initAD(){ |
| | | GDTADManager.getInstance().initWith(this,"1110527324"); |
| | | GDTADManager.getInstance().initWith(this, Constant.GDT_APP_ID); |
| | | |
| | | TTAdSdk.init(getApplicationContext(), |
| | | 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()); |
| | | } |
| | | |
| | | public IWXAPI mWxApi; |
| | |
| | | @Expose |
| | | private String hongBaoMoney; |
| | | |
| | | @Expose |
| | | private String finalMoney; |
| | | |
| | | public String getHongBaoMoney() { |
| | | return hongBaoMoney; |
| | | } |
| | |
| | | public void setRateInfoHelpUrl(String rateInfoHelpUrl) { |
| | | this.rateInfoHelpUrl = rateInfoHelpUrl; |
| | | } |
| | | |
| | | public String getFinalMoney() { |
| | | return finalMoney; |
| | | } |
| | | |
| | | public void setFinalMoney(String finalMoney) { |
| | | this.finalMoney = finalMoney; |
| | | } |
| | | } |
| | |
| | | |
| | | public static class GoodsHongBaoListVO { |
| | | |
| | | private String id; |
| | | // 2-红包 4-返利 |
| | | private int type; |
| | | private String subMoney; |
| | |
| | | private List<GoodsDetailVO.GoodsHongBaoListVO.PriceInfo> priceDetails; |
| | | private GoodsDetailVO.GoodsHongBaoListVO.UserLevelVO userLevel; |
| | | private String desc; |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public int getType() { |
| | | return type; |
| | |
| | | |
| | | public static class UserLevelVO { |
| | | //VIP等级 0-初级 1-青铜 2-白银 3-铂金 |
| | | private int vipRank; |
| | | private String vipRank; |
| | | private String desc; |
| | | private String link; |
| | | |
| | | public int getVipRank() { |
| | | public String getVipRank() { |
| | | return vipRank; |
| | | } |
| | | |
| | | public void setVipRank(int vipRank) { |
| | | public void setVipRank(String vipRank) { |
| | | this.vipRank = vipRank; |
| | | } |
| | | |
| | |
| | | import android.content.res.Resources; |
| | | import android.os.Bundle; |
| | | |
| | | import com.tejia.lijin.app.ui.dialog.ShapeLoadingDialog; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.tejia.lijin.app.util.clipboard.ClipboardUtil; |
| | |
| | | this.showRecommend = recommend; |
| | | } |
| | | |
| | | protected ShapeLoadingDialog loadingDialog = null; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | loadingDialog = new ShapeLoadingDialog.Builder(this).build(); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package com.tejia.lijin.app.ui.dialog; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.graphics.drawable.AnimationDrawable; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.tejia.lijin.app.R; |
| | | import com.tejia.lijin.app.ui.invite.ShareBrowserActivity; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.ad.AdUtil; |
| | | import com.tejia.lijin.app.util.ad.ExpressAdContainer; |
| | | import com.tejia.lijin.app.util.ad.ExpressAdManager; |
| | | import com.wpc.library.util.SystemCommon; |
| | | import com.wpc.library.widget.ResizableImageView; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by weikou2015 on 2017/2/28. |
| | | */ |
| | | |
| | | public class GoodsDetailJumpLoaingDialog extends Dialog { |
| | | public GoodsDetailJumpLoaingDialog(Context context) { |
| | | super(context); |
| | | this.setCancelable(false); |
| | | } |
| | | |
| | | |
| | | public GoodsDetailJumpLoaingDialog(Context context, int theme) { |
| | | super(context, theme); |
| | | this.setCancelable(false); |
| | | } |
| | | |
| | | |
| | | public static class Builder { |
| | | private Activity context; |
| | | boolean hasAd; |
| | | String adPid; |
| | | String notifyDesc; |
| | | String notifyUrl; |
| | | int platform; |
| | | int time = 5; |
| | | Runnable runnable = null; |
| | | IDialogClose dialogCloseListener; |
| | | |
| | | public Builder(Activity context) { |
| | | this.context = context; |
| | | } |
| | | |
| | | public Builder setNotify(String desc, String url) { |
| | | this.notifyDesc = desc; |
| | | this.notifyUrl = url; |
| | | return this; |
| | | } |
| | | |
| | | public Builder setAdPid(String pid) { |
| | | this.adPid = pid; |
| | | return this; |
| | | } |
| | | |
| | | public Builder setHasAd(boolean hasAd) { |
| | | this.hasAd = hasAd; |
| | | return this; |
| | | } |
| | | |
| | | public Builder setPlatform(int platform) { |
| | | this.platform = platform; |
| | | return this; |
| | | } |
| | | |
| | | public Builder setOnCloseListener(IDialogClose dialogCloseListener) { |
| | | this.dialogCloseListener = dialogCloseListener; |
| | | return this; |
| | | } |
| | | |
| | | private void initView(AQuery mAuery) { |
| | | if (!hasAd) { |
| | | mAuery.id(R.id.ll_notify).visibility(View.GONE); |
| | | mAuery.id(R.id.ll_top).background(R.drawable.shape_dialog_goods_detail_jump_loading_top_common); |
| | | mAuery.id(R.id.ll_loading).visibility(View.VISIBLE); |
| | | mAuery.id(R.id.fl_ad).visibility(View.GONE); |
| | | mAuery.id(R.id.tv_time).text("正在跳转至"); |
| | | } else { |
| | | mAuery.id(R.id.ll_notify).visibility(View.VISIBLE); |
| | | mAuery.id(R.id.ll_top).background(R.drawable.shape_dialog_goods_detail_jump_loading_top); |
| | | mAuery.id(R.id.ll_loading).visibility(View.GONE); |
| | | mAuery.id(R.id.fl_ad).visibility(View.VISIBLE); |
| | | mAuery.id(R.id.tv_time).text(""); |
| | | } |
| | | } |
| | | |
| | | public GoodsDetailJumpLoaingDialog create() { |
| | | LayoutInflater inflater = (LayoutInflater) context |
| | | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
| | | final GoodsDetailJumpLoaingDialog dialog = new GoodsDetailJumpLoaingDialog(context, R.style.Dialog); |
| | | View layout = inflater.inflate(R.layout.dialog_goods_detail_jump_loading, null); |
| | | AQuery mAquery = new AQuery(layout); |
| | | initView(mAquery); |
| | | switch (platform) { |
| | | case Constant.GOODS_TYPE_TB: |
| | | mAquery.id(R.id.iv_source_type).image(R.drawable.icon_goods_detail_jump_loading_taobao); |
| | | break; |
| | | case Constant.GOODS_TYPE_JD: |
| | | mAquery.id(R.id.iv_source_type).image(R.drawable.icon_goods_detail_jump_loading_jd); |
| | | break; |
| | | case Constant.GOODS_TYPE_PDD: |
| | | mAquery.id(R.id.iv_source_type).image(R.drawable.icon_goods_detail_jump_loading_pdd); |
| | | break; |
| | | case Constant.GOODS_TYPE_VIP: |
| | | mAquery.id(R.id.iv_source_type).image(R.drawable.icon_goods_detail_jump_loading_vipshop); |
| | | break; |
| | | case Constant.GOODS_TYPE_SUNING: |
| | | mAquery.id(R.id.iv_source_type).image(R.drawable.icon_goods_detail_jump_loading_suning); |
| | | break; |
| | | } |
| | | |
| | | //非VIP |
| | | if (hasAd) { |
| | | final FrameLayout fl_ad = (FrameLayout) mAquery.id(R.id.fl_ad_content).getView(); |
| | | final TextView tv_time = mAquery.id(R.id.tv_time).getTextView(); |
| | | //填充通知信息 |
| | | mAquery.id(R.id.tv_notify).text(notifyDesc); |
| | | mAquery.id(R.id.ll_notify).clicked(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | context.startActivity(new Intent(context, ShareBrowserActivity.class).putExtra("url", notifyUrl)); |
| | | } |
| | | }); |
| | | |
| | | //需要展示广告,然后倒计时 |
| | | mAquery.id(R.id.tv_skip).clicked(new View.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (dialog.isShowing()) |
| | | dialog.dismiss(); |
| | | if (dialogCloseListener != null) { |
| | | dialogCloseListener.onClose(false); |
| | | } |
| | | } |
| | | }); |
| | | //填充广告 |
| | | new ExpressAdManager(AdUtil.AD_TYPE.gdt2, context).loadGoodsJumpLoadingAd("", new ExpressAdManager.IAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<ExpressAdContainer> adList) { |
| | | if (adList != null && adList.size() > 0) { |
| | | //广告 |
| | | ExpressAdManager.renderAndFillAd(context, adList.get(0), fl_ad, new ExpressAdManager.IAdEventListener() { |
| | | |
| | | @Override |
| | | public void closeAd(ExpressAdContainer ad) { |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | runnable = new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (time > 0) { |
| | | time--; |
| | | tv_time.setText(String.format("%s秒后自动跳转", time)); |
| | | tv_time.postDelayed(runnable, 1000); |
| | | } else { |
| | | if (dialog.isShowing()) |
| | | dialog.dismiss(); |
| | | dialogCloseListener.onClose(true); |
| | | } |
| | | } |
| | | }; |
| | | tv_time.setText(String.format("%s秒后自动跳转", time)); |
| | | tv_time.postDelayed(runnable, 1000); |
| | | } |
| | | |
| | | |
| | | dialog.addContentView(layout, new FrameLayout.LayoutParams( |
| | | FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); |
| | | dialog.setContentView(layout); |
| | | |
| | | android.view.WindowManager.LayoutParams params = dialog.getWindow() |
| | | .getAttributes(); |
| | | params.width = (int) ((SystemCommon.getScreenWidth(context) * 4) / 5); |
| | | params.height = android.view.WindowManager.LayoutParams.WRAP_CONTENT; |
| | | dialog.getWindow().setAttributes(params); |
| | | dialog.setCanceledOnTouchOutside(false); |
| | | return dialog; |
| | | } |
| | | |
| | | |
| | | public static interface IDialogClose { |
| | | public void onClose(boolean auto); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.tejia.lijin.app.ui.dialog; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.graphics.Color; |
| | | import android.graphics.drawable.GradientDrawable; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.widget.FrameLayout; |
| | | import android.widget.TextView; |
| | | |
| | | import com.androidquery.AQuery; |
| | | import com.tejia.lijin.app.R; |
| | | import com.tejia.lijin.app.ui.invite.ShareBrowserActivity; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.ad.AdUtil; |
| | | import com.tejia.lijin.app.util.ad.ExpressAdContainer; |
| | | import com.tejia.lijin.app.util.ad.ExpressAdManager; |
| | | import com.wpc.library.util.SystemCommon; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * Created by weikou2015 on 2017/2/28. |
| | | */ |
| | | |
| | | public class GoodsDetailNotifyDialog extends Dialog { |
| | | public GoodsDetailNotifyDialog(Context context) { |
| | | super(context); |
| | | this.setCancelable(false); |
| | | } |
| | | |
| | | |
| | | public GoodsDetailNotifyDialog(Context context, int theme) { |
| | | super(context, theme); |
| | | this.setCancelable(false); |
| | | } |
| | | |
| | | |
| | | public static class Builder { |
| | | private Activity context; |
| | | IDialogButtonClick dialogButtonClickListener; |
| | | |
| | | public Builder(Activity context) { |
| | | this.context = context; |
| | | } |
| | | |
| | | |
| | | public Builder setOnButtonClickListener(IDialogButtonClick dialogCloseListener) { |
| | | this.dialogButtonClickListener = dialogCloseListener; |
| | | return this; |
| | | } |
| | | |
| | | public GoodsDetailNotifyDialog create() { |
| | | LayoutInflater inflater = (LayoutInflater) context |
| | | .getSystemService(Context.LAYOUT_INFLATER_SERVICE); |
| | | final GoodsDetailNotifyDialog dialog = new GoodsDetailNotifyDialog(context, R.style.Dialog); |
| | | View layout = inflater.inflate(R.layout.dialog_goods_detail_notify, null); |
| | | AQuery mAquery = new AQuery(layout); |
| | | final TextView tv_create = mAquery.id(R.id.tv_create).getTextView(); |
| | | final TextView tv_fanli = mAquery.id(R.id.tv_fanli).getTextView(); |
| | | |
| | | GradientDrawable gradientDrawable = new GradientDrawable(); |
| | | gradientDrawable.setStroke(1, Color.parseColor("#F53245")); |
| | | gradientDrawable.setColor(Color.WHITE); |
| | | gradientDrawable.setCornerRadius(DimenUtils.dip2px(context, 50)); |
| | | tv_create.setBackground(gradientDrawable); |
| | | |
| | | gradientDrawable = new GradientDrawable(); |
| | | gradientDrawable.setColor(Color.parseColor("#55BE00")); |
| | | gradientDrawable.setCornerRadius(DimenUtils.dip2px(context, 50)); |
| | | tv_fanli.setBackground(gradientDrawable); |
| | | tv_create.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (dialogButtonClickListener != null) |
| | | dialogButtonClickListener.onLeftClick(); |
| | | } |
| | | }); |
| | | |
| | | tv_fanli.setOnClickListener(new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | if (dialogButtonClickListener != null) |
| | | dialogButtonClickListener.onRightClick(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | dialog.addContentView(layout, new FrameLayout.LayoutParams( |
| | | FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.WRAP_CONTENT)); |
| | | dialog.setContentView(layout); |
| | | |
| | | android.view.WindowManager.LayoutParams params = dialog.getWindow() |
| | | .getAttributes(); |
| | | params.width = (int) ((SystemCommon.getScreenWidth(context) * 4) / 5); |
| | | params.height = android.view.WindowManager.LayoutParams.WRAP_CONTENT; |
| | | dialog.getWindow().setAttributes(params); |
| | | dialog.setCanceledOnTouchOutside(false); |
| | | return dialog; |
| | | } |
| | | |
| | | |
| | | public static interface IDialogButtonClick { |
| | | public void onLeftClick(); |
| | | |
| | | public void onRightClick(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | viewHolder.tv_level_desc.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); |
| | | } else { |
| | | viewHolder.ll_level_info.setVisibility(View.VISIBLE); |
| | | viewHolder.iv_level.setImageResource(R.drawable.icon_rank_2); |
| | | viewHolder.tv_level_desc.setText(hongBaoInfo.getUserLevel().getDesc()); |
| | | viewHolder.iv_level.setImageResource(mContext.getResources().getIdentifier("icon_rank_" + hongBaoInfo.getUserLevel().getVipRank(), "drawable", mContext.getPackageName())); |
| | | viewHolder.tv_level_desc.setText(hongBaoInfo.getUserLevel().getDesc() == null ? "" : hongBaoInfo.getUserLevel().getDesc()); |
| | | if (!StringUtils.isNullOrEmpty(hongBaoInfo.getUserLevel().getLink())) { |
| | | viewHolder.tv_level_desc.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.icon_goods_detail_hongbao_user_level_more, 0); |
| | | } else { |
| | |
| | | action = ACTION_LOGIN; |
| | | return; |
| | | } |
| | | int goodsType = 0; |
| | | switch (goodsType) { |
| | | switch (goodsDetail.getGoods().getGoodsType()) { |
| | | case Constant.GOODS_TYPE_TB: |
| | | //判断是否授权成功 |
| | | if (!taoBaoAuthSuccess) { |
| | |
| | | return; |
| | | |
| | | default: |
| | | pddAuthSuccess(); |
| | | return; |
| | | } |
| | | |
| | | //用户是否 |
| | | } |
| | | |
| | | public void startClick(int type, IPreEventListener preEventListener) { |
| | |
| | | |
| | | private void getTaoBaoH5AuthInfo(final String source, String goodsId, final boolean needJumpAuth, final IAuthResult authResultListener) { |
| | | if (pd == null) |
| | | pd = new ShapeLoadingDialog.Builder(mContext).build(); |
| | | pd = new ShapeLoadingDialog.Builder(mActivity).build(); |
| | | if (!pd.isShowing()) |
| | | pd.show(); |
| | | Log.e("detail", "getTaoBaoH5AuthInfo--" + source); |
| | |
| | | @Override |
| | | public void onFailure(int statusCode, Header[] headers, String jsonObject, Throwable e) { |
| | | super.onFailure(statusCode, headers, jsonObject, e); |
| | | Toast.makeText(mContext, "网络请求出错", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onFailure(int statusCode, Header[] headers, String jsonObject, Throwable e) { |
| | | super.onFailure(statusCode, headers, jsonObject, e); |
| | | Toast.makeText(mContext, "网络请求出错", Toast.LENGTH_SHORT).show(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | import android.Manifest; |
| | | import android.annotation.SuppressLint; |
| | | import android.app.Activity; |
| | | import android.app.AlertDialog; |
| | | import android.content.ClipData; |
| | | import android.content.DialogInterface; |
| | | import android.content.Intent; |
| | | import android.content.pm.ActivityInfo; |
| | | import android.graphics.PixelFormat; |
| | |
| | | import androidx.annotation.NonNull; |
| | | import androidx.annotation.Nullable; |
| | | import androidx.annotation.RequiresApi; |
| | | import wendu.dsbridge.DWebView; |
| | | |
| | | import android.util.Base64; |
| | | import android.util.Log; |
| | | import android.view.KeyEvent; |
| | | import android.view.View; |
| | |
| | | import android.widget.PopupWindow; |
| | | import android.widget.ProgressBar; |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.ali.auth.third.ui.context.CallbackContext; |
| | | import com.alibaba.baichuan.android.trade.model.AlibcShowParams; |
| | | import com.alibaba.baichuan.trade.biz.AlibcConstants; |
| | | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.tejia.lijin.app.util.web.RebateJavaInterfaceBS; |
| | | import com.tejia.lijin.app.util.web.WebViewUtil; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.wpc.library.okhttp.OkHttpUtils; |
| | | import com.wpc.library.util.JDLinkCutUtil; |
| | |
| | | import com.tejia.lijin.app.ui.recommend.NoExtendPDDGoodsActivity; |
| | | import com.tejia.lijin.app.ui.recommend.NoExtendTaoBaoGoodsActivity; |
| | | import com.tejia.lijin.app.util.AndroidBug5497Workaround; |
| | | import com.tejia.lijin.app.util.ApkUtil; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.KeFuUtil; |
| | | import com.tejia.lijin.app.util.PermissionHelper; |
| | | import com.tejia.lijin.app.util.RebateJavaInterface; |
| | | import com.tejia.lijin.app.util.Tools; |
| | | import com.tejia.lijin.app.util.web.RebateJavaInterface; |
| | | import com.tejia.lijin.app.util.TopStatusSettings; |
| | | import com.tejia.lijin.app.util.baichuan.AlibcTradeUtil; |
| | | import com.tejia.lijin.app.util.clipboard.ClipboardUtil; |
| | | import com.tejia.lijin.app.util.goods.GoodsDetailJumpUtil; |
| | | import com.tejia.lijin.app.util.web.CustomNavigationJsObject; |
| | | |
| | | import org.apache.http.Header; |
| | |
| | | private TextView tv_top_bar_left2; |
| | | private ImageView iv_right; |
| | | private Button tv_top_bar_middle; |
| | | private WebView webview; |
| | | private DWebView webview; |
| | | private FrameLayout fl_webview; |
| | | View v_cover_web; |
| | | ProgressBar progressBar; |
| | |
| | | private boolean interceptGoodsDetail; |
| | | |
| | | private String originalUrl = ""; |
| | | //沉浸式网页 |
| | | private boolean immersion = false; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle savedInstanceState) { |
| | | super.onCreate(savedInstanceState); |
| | | |
| | | String immersionStr = getIntent().getStringExtra("immersion"); |
| | | if (!StringUtils.isNullOrEmpty(immersionStr) && Boolean.parseBoolean(immersionStr)) { |
| | | immersion = true; |
| | | } |
| | | setContentView(R.layout.browser_activity); |
| | | AndroidBug5497Workaround.assistActivity(this); |
| | | TopStatusSettings.setStatusViewAndDeepColor(this); |
| | | String url = getIntent().getStringExtra("url"); |
| | | String url = "http://192.168.3.122:8848/tejia-web/dsbridge-test.html";//getIntent().getStringExtra("url"); |
| | | originalUrl = url; |
| | | //是否允许粘贴板推荐 |
| | | String clipboradStr = getIntent().getStringExtra("clipboard"); |
| | |
| | | // tv_top_bar_middle.setText("奥术大师大所大所多奥术大师"); |
| | | pd = new ShapeLoadingDialog.Builder(this).build(); |
| | | |
| | | webview = new WebView(ShareBrowserActivity.this); |
| | | webview = new DWebView(ShareBrowserActivity.this); |
| | | |
| | | fl_webview.addView(webview, new FrameLayout.LayoutParams( |
| | | FrameLayout.LayoutParams.MATCH_PARENT, |
| | |
| | | webview.addJavascriptInterface(javaInterface, "yestv"); |
| | | CustomNavigationJsObject customNavigation = new CustomNavigationJsObject(this); |
| | | webview.addJavascriptInterface(customNavigation, "czb");//第二个参数czb不可更改, |
| | | |
| | | RebateJavaInterfaceBS javaInterface1 = new RebateJavaInterfaceBS(ShareBrowserActivity.this, |
| | | tv_top_bar_middle, tv_top_bar_left2, new TextView(this), iv_right, webview, pd); |
| | | webview.addJavascriptObject(javaInterface1, "yestv"); |
| | | |
| | | /*** |
| | | * Android5.0开始,WebView默认不支持同时加载Https和Http混合模式 |
| | | * WebView在微信网页中首先打开一个https网址,然后它会被重定向到一个http网址 |
| | |
| | | return true; |
| | | } |
| | | } |
| | | if (url != null && url.startsWith("yestv://copy")) { |
| | | String murl = url.split("yestv://")[1]; |
| | | String[] params = murl.split("#"); |
| | | byte raw[] = Base64.decode(params[1], Base64.DEFAULT); |
| | | |
| | | ClipboardUtil.copy(getApplicationContext(), new String(raw)); |
| | | Toast.makeText(ShareBrowserActivity.this, "复制成功", |
| | | Toast.LENGTH_SHORT).show(); |
| | | return true; |
| | | } else if (url != null && url.startsWith("yestv://toast")) { |
| | | String murl = url.split("yestv://")[1]; |
| | | String[] params = murl.split("#"); |
| | | byte raw[] = Base64.decode(params[1], Base64.DEFAULT); |
| | | String content = new String(raw); |
| | | Toast.makeText(ShareBrowserActivity.this, content, Toast.LENGTH_LONG).show(); |
| | | return true; |
| | | } |
| | | if (url != null && !url.startsWith("http")) { |
| | | if (url.startsWith("weixin://wap/pay?")) { |
| | | if (Tools.isWeixinAvilible(ShareBrowserActivity.this) == 2) { |
| | | Toast.makeText(ShareBrowserActivity.this, |
| | | "尚未安装微信", Toast.LENGTH_LONG).show(); |
| | | return true; |
| | | } |
| | | Intent intent = new Intent(); |
| | | intent.setAction(Intent.ACTION_VIEW); |
| | | intent.setData(Uri.parse(url)); |
| | | startActivity(intent); |
| | | } else if (url.startsWith("alipays:") || url.startsWith("alipay")) { |
| | | try { |
| | | startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); |
| | | } catch (Exception e) { |
| | | new AlertDialog.Builder(ShareBrowserActivity.this) |
| | | .setMessage("未检测到支付宝客户端,请安装后重试。") |
| | | .setPositiveButton("立即安装", new DialogInterface.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | Uri alipayUrl = Uri.parse("https://d.alipay.com"); |
| | | startActivity(new Intent("android.intent.action.VIEW", alipayUrl)); |
| | | } |
| | | }).setNegativeButton("取消", null).show(); |
| | | } |
| | | } else if (url.startsWith("pinduoduo://")) {//拦截拼多多页面 |
| | | if (ApkUtil.checkAPP(getApplicationContext(), "com.xunmeng.pinduoduo")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | startActivity(intent); |
| | | return true; |
| | | } else { |
| | | return true; |
| | | } |
| | | } else if (url.startsWith("suning://")) {//苏宁 |
| | | if (ApkUtil.checkAPP(getApplicationContext(), "com.suning.mobile.ebuy")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | startActivity(intent); |
| | | return true; |
| | | } else |
| | | return true; |
| | | } else if (url.startsWith("vipshop://")) {//唯品会 |
| | | if (ApkUtil.checkAPP(getApplicationContext(), "com.achievo.vipshop")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | startActivity(intent); |
| | | return true; |
| | | } else |
| | | return true; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | if (url.endsWith(".apk")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW); |
| | | intent.addCategory(Intent.CATEGORY_BROWSABLE); |
| | | intent.setData(Uri.parse(url)); |
| | | startActivity(intent); |
| | | } |
| | | Boolean intercept = WebViewUtil.interceptUrl(getApplicationContext(), url); |
| | | if (intercept != null) |
| | | return intercept; |
| | | |
| | | return super.shouldOverrideUrlLoading(view, url); |
| | | } |
| | |
| | | registeredOPPOId();//上传OPPO_RegId |
| | | // onPush_OFF_NO();//检测是否打开推送 |
| | | registeredVIVOId();//上传VIVO_RegId |
| | | |
| | | |
| | | tv_msg_num2.postDelayed(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | //测试 |
| | | Bundle bundle = new Bundle(); |
| | | bundle.putString("goodsId", "19711731038"); |
| | | bundle.putString("goodsType", 1+""); |
| | | startActivity(new Intent(getApplicationContext(), GoodsDetailActivity.class).putExtras(bundle)); |
| | | } |
| | | },5000); |
| | | |
| | | |
| | | } |
| | | |
| | | private void choiceTab(Integer tab, Integer subTab) { |
| | |
| | | |
| | | private AliyunSmsOneKeyLoginManager aliyunSmsOneKeyLoginManager; |
| | | |
| | | private boolean showOnkeyLoginToast = true; |
| | | private boolean showOnkeyLoginToast = false; |
| | | |
| | | |
| | | @Override |
| | |
| | | String from = getIntent().getStringExtra("from"); |
| | | UserCustomEvent.userLogin(this, StringUtils.isEmpty(from) ? "其它" : from); |
| | | EventBus.getDefault().register(this); |
| | | aliyunSmsOneKeyLoginManager = new AliyunSmsOneKeyLoginManager(this, null); |
| | | aliyunSmsOneKeyLoginManager = new AliyunSmsOneKeyLoginManager(this, "zTsQ9uC74C7EsD4h1II3+0CsxtXbz8VikP//49QvybqgZLOsv4pCQ4yW5fz1Ogt4QFuTqHdictmxHm7KvMAd+dl8peJL+xpGFZjjAMcqNkqcSLptS358E+EpbITK4yYjDS1gbQQKuPiODw88UUWlhcCMye7gm3eF9AWNuZ7fQKVONWl/0wube5iXegJ6ZOfhJiYQDZqsKzgmxU/MdPKWOlKCS9NtefDmgCYMM9S6GQODkxPZm+wDqJ89dXMtU5ejBhMMv63t7eug9SfEGfmEnG31JXD9MCQ00t7e8VLeCfanFoZTquLD5w=="); |
| | | aliyunSmsOneKeyLoginManager.init(new AliyunSmsOneKeyLoginManager.IOneKeyLoginListener() { |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | showOnkeyLoginToast = false; |
| | | showOnkeyLoginToast = true; |
| | | } |
| | | |
| | | @Override |
| | |
| | | *添加监听 |
| | | */ |
| | | private void addListener() { |
| | | tv_login_gain_sms.setOnClickListener(this); |
| | | tv_user_agreement.setOnClickListener(this); |
| | | tv_other_login.setOnClickListener(this); |
| | | tv_privacy_policies.setOnClickListener(this); |
| | |
| | | |
| | | @Override |
| | | public void afterTextChanged(Editable editable) { |
| | | // fl_login_gain_sms.setEnabled(editable.length() == 13 ? true : false); |
| | | // fl_login_gain_sms.setBackgroundResource(editable.length() == 13 ? |
| | | tv_login_gain_sms.setEnabled(editable.length() == 13 ? true : false); |
| | | // tv_login_gain_sms.setBackgroundResource(editable.length() == 13 ? |
| | | // R.drawable.shape_mobile_login_light : R.drawable.shape_login_gain_sms); |
| | | } |
| | | }); |
| | |
| | | package com.tejia.lijin.app.ui.recommend; |
| | | |
| | | import android.app.Dialog; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.SharedPreferences; |
| | |
| | | import com.tejia.lijin.app.BasicTextHttpResponseHandler; |
| | | import com.tejia.lijin.app.R; |
| | | import com.tejia.lijin.app.ShoppingApi; |
| | | import com.tejia.lijin.app.entity.CouponInfo; |
| | | import com.tejia.lijin.app.entity.CouponUser; |
| | | import com.tejia.lijin.app.entity.GoodsDetail; |
| | | import com.tejia.lijin.app.entity.PushEventData; |
| | |
| | | import com.tejia.lijin.app.entity.goods.GoodsDetailVO; |
| | | import com.tejia.lijin.app.ui.BaseActivity; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailHongBaoAndCouponSelectDialog; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailJumpLoaingDialog; |
| | | import com.tejia.lijin.app.ui.dialog.GoodsDetailNotifyDialog; |
| | | import com.tejia.lijin.app.ui.dialog.JumpTaoBaoDialog; |
| | | import com.tejia.lijin.app.ui.goods.GoodsDetailHongBaoListAdapter; |
| | | import com.tejia.lijin.app.ui.goods.GoodsDetailPreEventManager; |
| | |
| | | import com.tejia.lijin.app.util.FlowLayout; |
| | | import com.tejia.lijin.app.util.GlideCircleTransform; |
| | | import com.tejia.lijin.app.util.GlideRoundTransform; |
| | | import com.tejia.lijin.app.util.GoodsBuyJumpUtil; |
| | | import com.tejia.lijin.app.util.ImageUtil; |
| | | import com.tejia.lijin.app.util.SetLabels; |
| | | import com.tejia.lijin.app.util.Toast_Dialog; |
| | | import com.tejia.lijin.app.util.TopStatusSettings; |
| | | import com.tejia.lijin.app.util.clipboard.ClipboardUtil; |
| | | import com.tejia.lijin.app.util.goods.GoodsBuyUtil; |
| | | import com.tejia.lijin.app.util.ui.GoodsDetailUtil; |
| | | import com.tejia.lijin.app.util.ui.dialog.DialogUtil; |
| | | import com.tejia.lijin.app.util.umengCustomEvent.GoodsCustomEvent; |
| | | import com.tejia.lijin.app.util.user.LoginAndInviteStatusUtil; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | |
| | | private LinearLayout ll_loading; |
| | | private ImageView iv_loading; |
| | | private TextView tv_loading; |
| | | private View view_goods_imgs_tag;//用来标识导航栏选中 |
| | | |
| | | //猜你喜欢 |
| | | private LinearLayout ll_guess_like; |
| | |
| | | tv_loading = findViewById(R.id.tv_loading); |
| | | iv_loading = findViewById(R.id.iv_loading); |
| | | webView = findViewById(R.id.webView); |
| | | view_goods_imgs_tag = findViewById(R.id.view_goods_imgs_tag); |
| | | |
| | | |
| | | vp_goods_detail = findViewById(R.id.vp_goods_img); |
| | |
| | | avLoadingIndicatorView.setVisibility(View.VISIBLE); |
| | | Animation ani = AnimationUtils.loadAnimation(this, R.anim.touming); //申明一个动画 |
| | | avLoadingIndicatorView.setAnimation(ani);//为图片绑定动画 |
| | | ll_content.setVisibility(View.GONE); |
| | | fl_face.setVisibility(View.VISIBLE); |
| | | bannerAdapter = new ImageAdapter(mBanners, this); |
| | | vp_goods_detail.setAdapter(bannerAdapter); |
| | |
| | | if (scrollY < fl_goods_detail.getTop()) {//头部 |
| | | setPosition(1); |
| | | } else if (scrollY >= (fl_goods_detail.getTop() - titleHeight) |
| | | && scrollY < ll_guess_like.getTop()) {//详情图片 |
| | | && scrollY < view_goods_imgs_tag.getTop()) {//详情图片 |
| | | setPosition(2); |
| | | } else if (scrollY >= ll_guess_like.getTop() - titleHeight) {//猜你喜欢 |
| | | setPosition(4); |
| | | } else { |
| | | setPosition(4); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | GoodsDetailNotifyDialog notifyDialog; |
| | | |
| | | @Override |
| | | protected void onCreate(Bundle arg0) { |
| | | super.onCreate(arg0); |
| | |
| | | initView(); |
| | | initData(); |
| | | getAppPageNotification(); |
| | | |
| | | // new GoodsDetailJumpLoaingDialog.Builder(this).setHasAd(true).setAdPid("").setNotify("铂金会员免广告,礼金提高100%", "http://www.baidu.com").setPlatform(Constant.GOODS_TYPE_TB).setOnCloseListener(new GoodsDetailJumpLoaingDialog.Builder.IDialogClose() { |
| | | // @Override |
| | | // public void onClose(boolean auto) { |
| | | // } |
| | | // }).create().show(); |
| | | |
| | | } |
| | | |
| | | public void showNotifyDialog() { |
| | | if (notifyDialog == null) |
| | | notifyDialog = new GoodsDetailNotifyDialog.Builder(this).setOnButtonClickListener(new GoodsDetailNotifyDialog.Builder.IDialogButtonClick() { |
| | | @Override |
| | | public void onLeftClick() { |
| | | DialogUtil.dismiss(notifyDialog); |
| | | } |
| | | |
| | | @Override |
| | | public void onRightClick() { |
| | | DialogUtil.dismiss(notifyDialog); |
| | | goFanli(); |
| | | } |
| | | }).create(); |
| | | DialogUtil.show(notifyDialog); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | tv_name.setText(mInfo.getGoods().getTitle()); |
| | | webView.loadUrl(mInfo.getExtra().getDetailUrl()); |
| | | if (StringUtils.isNullOrEmpty(mInfo.getGoods().getSalesCount())) { |
| | | tv_sales_num.setText(""); |
| | | } else |
| | | tv_sales_num.setText(GoodsDetailUtil.getSalesTypeDesc(mInfo.getGoods().getSalesType()) + " " + mInfo.getGoods().getSalesCount()); |
| | | |
| | | if (mInfo.getGoods().getShopInfo() != null) { |
| | |
| | | tv_shop_name.setText(mInfo.getGoods().getShopInfo().getShopName()); |
| | | |
| | | try { |
| | | GoodsDetailUtil.fillShopType(tv_shop_type, mInfo.getGoods().getShopInfo().getUserType()); |
| | | GoodsDetailUtil.fillShopType(tv_shop_type, mInfo.getGoods().getShopType()); |
| | | |
| | | if (!StringUtils.isNullOrEmpty(mInfo.getGoods().getShopInfo().getScoreGoods())) { |
| | | tv_shop_des.setText("宝贝描述: " + mInfo.getGoods().getShopInfo().getScoreGoods()); |
| | |
| | | initFanliAndBuyBtn(mInfo.getExtra().isBuyValid(), mInfo.getExtra().isFanliValid()); |
| | | requestState(0); |
| | | sv_goods.scrollTo(0, 0); |
| | | // ll_content.setVisibility(View.VISIBLE); |
| | | // fl_face.setVisibility(View.GONE); |
| | | } else if (jsonObject.optString("code").equalsIgnoreCase("2")) { |
| | | ll_content.setVisibility(View.GONE); |
| | | findViewById(R.id.ll_goods_nothing).setVisibility(View.VISIBLE); |
| | | fl_face.setVisibility(View.VISIBLE); |
| | | } |
| | |
| | | * @param state |
| | | */ |
| | | private void requestState(int state) { |
| | | ll_content.setVisibility(state == 0 ? View.VISIBLE : View.GONE); |
| | | // fl_face.setVisibility(state != 0 ? View.VISIBLE : View.GONE); |
| | | ll_no_data.setVisibility(state == 1 ? View.VISIBLE : View.GONE); |
| | | ll_request_failture.setVisibility(state == 2 ? View.VISIBLE : View.GONE); |
| | | ll_no_net.setVisibility(state == 3 ? View.VISIBLE : View.GONE); |
| | | if (mInfo == null) { |
| | | fl_face.setVisibility(View.VISIBLE); |
| | | } else { |
| | | fl_face.setVisibility(View.GONE); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | |
| | | private void goFanli() { |
| | | if (mInfo.getGoods().getCouponInfoList() != null && mInfo.getGoods().getCouponInfoList().size() > 1) { |
| | | new GoodsDetailHongBaoAndCouponSelectDialog.Builder(this).setCouponList(mInfo.getGoods().getCouponInfoList()).setItemClickListener(new GoodsDetailHongBaoAndCouponSelectDialog.OnItemClickListener() { |
| | | @Override |
| | | public void onClick(int p) { |
| | | goodsDetailPreEventManager.startClick(0, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | @Override |
| | | public void onPreSuccess() { |
| | | |
| | | //TODO 返利 |
| | | } |
| | | }); |
| | | goFanli(mInfo.getGoods().getCouponInfoList().get(p)); |
| | | } |
| | | }).create().show(); |
| | | } else { |
| | | goFanli(null); |
| | | } |
| | | //判断是否有多张券情况 |
| | | } |
| | | |
| | | private void goFanli(final CouponInfo couponInfo) { |
| | | goodsDetailPreEventManager.startClick(0, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | @Override |
| | | public void onPreSuccess() { |
| | | fanliRequest(couponInfo); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | private void goBuy() { |
| | | List<GoodsDetailVO.GoodsHongBaoListVO> hongBaoList = new ArrayList<>(); |
| | | final List<GoodsDetailVO.GoodsHongBaoListVO> hongBaoList = new ArrayList<>(); |
| | | hongBaoList.addAll(mInfo.getGoods().getPriceList()); |
| | | for (int i = 0; i < hongBaoList.size(); i++) { |
| | | if (hongBaoList.get(i).getType() != 2) { |
| | | hongBaoList.remove(i--); |
| | | } |
| | | } |
| | | |
| | | |
| | | if (hongBaoList.size() > 1) { |
| | | new GoodsDetailHongBaoAndCouponSelectDialog.Builder(this).setHongBaoList(hongBaoList).setItemClickListener(new GoodsDetailHongBaoAndCouponSelectDialog.OnItemClickListener() { |
| | | @Override |
| | | public void onClick(int p) { |
| | | goBuy(hongBaoList.get(p)); |
| | | } |
| | | }).create().show(); |
| | | } else { |
| | | if (hongBaoList.size() > 0) |
| | | goBuy(hongBaoList.get(0)); |
| | | } |
| | | } |
| | | |
| | | private void goBuy(final GoodsDetailVO.GoodsHongBaoListVO lijinVO) { |
| | | goodsDetailPreEventManager.startClick(1, new GoodsDetailPreEventManager.IPreEventListener() { |
| | | @Override |
| | | public void onPreSuccess() { |
| | | //TODO 购买 |
| | | buyRequest(lijinVO); |
| | | } |
| | | }); |
| | | } |
| | | }).create().show(); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public void onHongBaoClick(int p, GoodsDetailVO.GoodsHongBaoListVO info) { |
| | | |
| | | if (info.getType() == 4) { |
| | | goFanli(null); |
| | | } else { |
| | | goBuy(info); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | private void buyRequest(GoodsDetailVO.GoodsHongBaoListVO goodsHongBaoListVO) { |
| | | |
| | | ShoppingApi.buyWithLijin(getApplicationContext(), mInfo.getGoods().getGoodsId(), mInfo.getGoods().getGoodsType(), goodsHongBaoListVO.getId(), UserUtil.getUid(getApplicationContext()), from, new BasicTextHttpResponseHandler() { |
| | | |
| | | @Override |
| | | public void onStart() { |
| | | super.onStart(); |
| | | if (loadingDialog != null && !loadingDialog.isShowing()) |
| | | loadingDialog.show(); |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccessPerfect(int statusCode, Header[] headers, JSONObject jsonObject) throws Exception { |
| | | super.onSuccessPerfect(statusCode, headers, jsonObject); |
| | | int code = jsonObject.optInt("code"); |
| | | if (code == 0) { |
| | | JSONObject data = jsonObject.optJSONObject("data"); |
| | | JSONObject link = data.optJSONObject("link"); |
| | | if (link != null) { |
| | | GoodsBuyJumpUtil.jumpTB(GoodsDetailActivity.this, null, link.optString("clickUrl"), null, new GoodsBuyUtil.IBuyGoodsResultListener() { |
| | | |
| | | @Override |
| | | public void onConvertLinkStart() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onConvertLinkSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onConvertLinkFail(String msg) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onConvertLinkComplete() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onJumpThirdAppStart() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onJumpThirdAppSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onJumpThirdAppFail() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | } else { |
| | | if (code == 2001) { |
| | | //用户机会已经用完了 |
| | | showNotifyDialog(); |
| | | } else |
| | | Toast.makeText(GoodsDetailActivity.this, jsonObject.optString("msg"), Toast.LENGTH_SHORT).show(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onFailure(int statusCode, Header[] headers, String jsonObject, Throwable e) { |
| | | super.onFailure(statusCode, headers, jsonObject, e); |
| | | } |
| | | |
| | | @Override |
| | | public void onFinish() { |
| | | super.onFinish(); |
| | | if (loadingDialog != null && loadingDialog.isShowing()) |
| | | loadingDialog.dismiss(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | private void fanliRequest(CouponInfo couponInfo) { |
| | | GoodsBuyUtil.GoodsBuyRequestInfo requestInfo = new GoodsBuyUtil.GoodsBuyRequestInfo(); |
| | | requestInfo.setGoodsId(mInfo.getGoods().getGoodsId()); |
| | | requestInfo.setGoodsType(mInfo.getGoods().getGoodsType()); |
| | | if (couponInfo != null) |
| | | requestInfo.setCouponLink(couponInfo.getLink()); |
| | | requestInfo.setUid(UserUtil.getUid(getApplicationContext())); |
| | | requestInfo.setFrom(from); |
| | | |
| | | //返利 |
| | | GoodsBuyUtil.fanli(this, getApplicationContext(), requestInfo, new GoodsBuyUtil.IBuyGoodsResultListener() { |
| | | @Override |
| | | public void onConvertLinkStart() { |
| | | if (loadingDialog != null && !loadingDialog.isShowing()) |
| | | loadingDialog.show(); |
| | | } |
| | | |
| | | @Override |
| | | public void onConvertLinkSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onConvertLinkFail(String msg) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onConvertLinkComplete() { |
| | | if (loadingDialog != null && loadingDialog.isShowing()) |
| | | loadingDialog.dismiss(); |
| | | } |
| | | |
| | | @Override |
| | | public void onJumpThirdAppStart() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onJumpThirdAppSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onJumpThirdAppFail() { |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取购买机会信息 |
| | | */ |
| | | private void getBuyChanceInfoRequest() { |
| | | //TODO 判断是否还有机会(返回当前剩余多少次,还能解锁多少次),如果有机会需要看激励视频广告 |
| | | } |
| | | |
| | | } |
| | |
| | | import com.nostra13.universalimageloader.core.assist.ImageScaleType; |
| | | import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.tejia.lijin.app.util.goods.GoodsDetailListUtil; |
| | | import com.tejia.lijin.app.util.ui.GoodsRightViewHolder; |
| | | import com.viewpagerindicator.CirclePageIndicator; |
| | | import com.wpc.library.util.SystemCommon; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | |
| | | |
| | | |
| | | if (circleContentHolder.rv_content.getItemDecorationCount() == 0) { |
| | | circleContentHolder.rv_content.addItemDecoration(new SpaceItemDecoration(largeImageCount, smallImageCount + invalidImageCount, goodsCount, commentCount, circleContent.getLineNum(), DimenUtils.dip2px(mContext, 2))); |
| | | circleContentHolder.rv_content.addItemDecoration(new SpaceItemDecoration(largeImageCount, smallImageCount + invalidImageCount, goodsCount, commentCount, circleContent.getLineNum(), DimenUtils.dip2px(mContext, 1))); |
| | | } else { |
| | | SpaceItemDecoration spaceItemDecoration = (SpaceItemDecoration) circleContentHolder.rv_content.getItemDecorationAt(0); |
| | | spaceItemDecoration.initData(largeImageCount, smallImageCount + invalidImageCount, goodsCount, commentCount, circleContent.getLineNum(), DimenUtils.dip2px(mContext, 2)); |
| | | spaceItemDecoration.initData(largeImageCount, smallImageCount + invalidImageCount, goodsCount, commentCount, circleContent.getLineNum(), DimenUtils.dip2px(mContext, 1)); |
| | | } |
| | | |
| | | if (maxImgHeight == null) { |
| | |
| | | if (imgInfo.isLarge()) |
| | | width = maxImgWidth; |
| | | else { |
| | | width = (maxImgWidth - DimenUtils.dip2px(mContext, 2) * 8) / 3; |
| | | width = (maxImgWidth - DimenUtils.dip2px(mContext, 2) * 3) / 3; |
| | | } |
| | | height = (int) (width * ratio); |
| | | params.width = width; |
| | |
| | | }); |
| | | |
| | | } else if (holder1 instanceof GoodsViewHolder) { |
| | | |
| | | |
| | | GoodsViewHolder goodsViewHolder = (GoodsViewHolder) holder1; |
| | | |
| | | final TaoBaoGoodsBrief info = goods; |
| | | String disCount; |
| | | if (info.isHasCoupon()) { |
| | | goodsViewHolder.ll_coupon_bg.setVisibility(View.VISIBLE); |
| | | disCount = "¥ " + info.getCouponPrice(); |
| | | goodsViewHolder.tv_coupon_price.setText("¥ " + info.getCouponInfo().getAmount()); |
| | | } else { |
| | | goodsViewHolder.ll_coupon_bg.setVisibility(View.GONE); |
| | | disCount = "¥ " + info.getZkPrice(); |
| | | } |
| | | |
| | | if (info.getShopType() == 11) {//天猫 |
| | | goodsViewHolder.iv_shop_type.setImageResource(R.drawable.ic_tmall); |
| | | } else if (info.getShopType() == 20 || info.getShopType() == 21) { |
| | | goodsViewHolder.iv_shop_type.setImageResource(R.drawable.ic_jingdong); |
| | | } else if (info.getShopType() == 30) { |
| | | goodsViewHolder.iv_shop_type.setImageResource(R.drawable.ic_pinduoduo); |
| | | } else { |
| | | goodsViewHolder.iv_shop_type.setImageResource(R.drawable.icon); |
| | | } |
| | | |
| | | int pos = disCount.indexOf("."); |
| | | Spannable span = new SpannableString(disCount); |
| | | span.setSpan(new RelativeSizeSpan(1.54f), 1, pos > 1 ? pos : disCount.length(), |
| | | Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | goodsViewHolder.tv_price.setText(span); |
| | | |
| | | goodsViewHolder.tv_sales_num.setText(info.getSalesType() == 1 ? "月销 " + info.getSalesCount() : |
| | | info.getSalesType() == 2 ? "2小时销量 " + info.getSalesCount() : info.getSalesType() == 3 ? |
| | | "今日销量 " + info.getSalesCount() : "总销量 " + info.getSalesCount()); |
| | | |
| | | |
| | | goodsViewHolder.tv_zkprice.setText("¥" + info.getZkPrice()); |
| | | goodsViewHolder.tv_zkprice.setPaintFlags(goodsViewHolder.tv_zkprice.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG); |
| | | |
| | | goodsViewHolder.tv_favourable.setBackgroundResource(R.drawable.shape_goods_list_price_fan); |
| | | goodsViewHolder.tv_favourable.setText(" 奖 " + info.getMoneyInfo().getShareMoney()); |
| | | goodsViewHolder.tv_favourable.setVisibility(View.GONE); |
| | | |
| | | if (info.getState() != 0) { |
| | | GoodsDetailListUtil.setGoodsDetail(context, content.getGoods(), goodsViewHolder.goodsRightViewHolder); |
| | | if (content.getGoods().getState() != 0) { |
| | | goodsViewHolder.view.setOnClickListener(null); |
| | | goodsViewHolder.iv_state_invalid.setVisibility(View.VISIBLE); |
| | | } else { |
| | |
| | | public void onClick(View v) { |
| | | //跳转商品详情 |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", info.getGoodsId()); |
| | | intent.putExtra("goodsType", info.getGoodsType()); |
| | | intent.putExtra("goodsId", content.getGoods().getGoodsId()); |
| | | intent.putExtra("goodsType", content.getGoods().getGoodsType()); |
| | | intent.putExtra("from", "faquan"); |
| | | mContext.startActivity(intent); |
| | | } |
| | |
| | | |
| | | class GoodsViewHolder extends RecyclerView.ViewHolder { |
| | | private View view; |
| | | //商品信息控件 |
| | | private TextView tv_price, tv_zkprice, tv_sales_num, tv_coupon_price, tv_favourable; |
| | | private LinearLayout ll_coupon_bg; |
| | | private GoodsRightViewHolder goodsRightViewHolder; |
| | | //过期标识 |
| | | private ImageView iv_state_invalid, iv_shop_type; |
| | | private ImageView iv_state_invalid; |
| | | |
| | | public GoodsViewHolder(View view) { |
| | | super(view); |
| | | this.view = view; |
| | | tv_price = view.findViewById(R.id.tv_price); |
| | | tv_zkprice = view.findViewById(R.id.tv_zkprice); |
| | | tv_sales_num = view.findViewById(R.id.tv_sales_num); |
| | | tv_coupon_price = view.findViewById(R.id.tv_coupon_price1); |
| | | tv_favourable = view.findViewById(R.id.tv_favourable); |
| | | ll_coupon_bg = view.findViewById(R.id.ll_coupon_bg1); |
| | | iv_state_invalid = view.findViewById(R.id.iv_state_invalid); |
| | | iv_shop_type = view.findViewById(R.id.iv_shop_type); |
| | | goodsRightViewHolder = new GoodsRightViewHolder(view); |
| | | } |
| | | } |
| | | } |
| | |
| | | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { |
| | | int position = parent.getChildLayoutPosition(view); |
| | | if (position < largeImgCount) { |
| | | outRect.bottom = space * 3; |
| | | outRect.bottom = space * 6; |
| | | if (position == 0) |
| | | outRect.top = 0; |
| | | } else if (position < largeImgCount + smallImageCount) { |
| | |
| | | outRect.left = space; |
| | | outRect.right = space; |
| | | } |
| | | //判断是否为最后一行 |
| | | int currentRow = cposition / lineNum; |
| | | int totalRow=smallImageCount%lineNum==0?smallImageCount/lineNum:smallImageCount/lineNum+1; |
| | | if(currentRow+1==totalRow){ |
| | | outRect.bottom = space * 6; |
| | | } |
| | | |
| | | |
| | | |
| | | } else if (position < largeImgCount + smallImageCount + goodsCount) { |
| | | outRect.bottom = space; |
| | | outRect.bottom = space * 3; |
| | | outRect.top = 0; |
| | | outRect.left = 0; |
| | | outRect.right = 0; |
| | | } else if (position < largeImgCount + smallImageCount + goodsCount + commentCount) { |
| | | outRect.bottom = space * 2; |
| | | outRect.top = space * 2; |
| | | outRect.bottom = space * 3; |
| | | outRect.top = space * 3; |
| | | int cposition = position - (largeImgCount + smallImageCount + goodsCount + commentCount); |
| | | if (cposition == 0 && goodsCount > 0) |
| | | outRect.top = 0; |
| | |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public final static String WX_APP_ID = "wx8477d2bb1d68a1cc"; |
| | | |
| | | public final static String QQ_APP_ID = "1111732008"; |
| | | |
| | | public final static String CSJ_APP_ID = "5171164"; |
| | | |
| | | public final static String GDT_APP_ID = "1110527324"; |
| | | |
| | | public final static String JD_APP_KEY = "b66094a3c2ca85886804be182294be60"; |
| | | public final static String JD_APP_SECRET = "57102d86629243e5845947d10db3fd57"; |
| | | |
| | | |
| | | } |
| | |
| | | import android.net.Uri; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.webkit.WebChromeClient; |
| | | import android.webkit.WebViewClient; |
| | | |
| | | import com.alibaba.baichuan.android.trade.AlibcTradeSDK; |
| | | import com.alibaba.baichuan.android.trade.model.AlibcShowParams; |
| | | import com.alibaba.baichuan.android.trade.model.OpenType; |
| | | import com.alibaba.baichuan.trade.biz.AlibcConstants; |
| | | import com.alibaba.baichuan.trade.biz.applink.adapter.AlibcFailModeType; |
| | | import com.alibaba.baichuan.trade.biz.core.taoke.AlibcTaokeParams; |
| | | import com.kepler.jd.Listener.OpenAppAction; |
| | | import com.kepler.jd.login.KeplerApiManager; |
| | | import com.kepler.jd.sdk.bean.KeplerAttachParameter; |
| | | import com.tejia.lijin.app.entity.TbPidInfo; |
| | | import com.tejia.lijin.app.entity.common.GoodsConvertLinkJumpLink; |
| | | import com.tejia.lijin.app.ui.invite.ShareBrowserActivity; |
| | | import com.tejia.lijin.app.util.baichuan.AlibcTradeUtil; |
| | | import com.tejia.lijin.app.util.downutil.StringUtils; |
| | | import com.tejia.lijin.app.util.goods.GoodsBuyUtil; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 去购买的跳转链接 |
| | | */ |
| | | public class GoodsBuyJumpUtil { |
| | | |
| | | |
| | | public static void jumpTB(Activity activity, TbPidInfo tInfo, String clickUrl, String couponUrl, final GoodsBuyUtil.IBuyGoodsResultListener buyGoodsResultListener) { |
| | | AlibcShowParams alibcShowParams = new AlibcShowParams(); |
| | | alibcShowParams.setOpenType(OpenType.Auto); |
| | | alibcShowParams.setBackUrl("alisdk://"); |
| | | alibcShowParams.setNativeOpenFailedMode(AlibcFailModeType.AlibcNativeFailModeJumpBROWER); |
| | | AlibcTaokeParams alibcTaokeParams = new AlibcTaokeParams("", "", ""); |
| | | if (tInfo != null) { |
| | | alibcTaokeParams = new AlibcTaokeParams("", "", ""); |
| | | alibcTaokeParams.setPid(tInfo.getPid()); |
| | | alibcTaokeParams.setAdzoneid(tInfo.getAdZoneId()); |
| | | alibcTaokeParams.pid = tInfo.getPid(); |
| | | alibcTaokeParams.adzoneid = tInfo.getAdZoneId(); |
| | | alibcTaokeParams.extraParams = new HashMap<>(); |
| | | alibcTaokeParams.extraParams.put("taokeAppkey", tInfo.getAppKey()); |
| | | } |
| | | Map<String, String> exParams = new HashMap<>(); |
| | | exParams.put(AlibcConstants.ISV_CODE, "appisvcode"); |
| | | exParams.put("alibaba", "阿里巴巴");//自定义参数部分,可任意增删改 |
| | | if (!com.wpc.library.util.common.StringUtils.isEmpty(clickUrl) || !com.wpc.library.util.common.StringUtils.isEmpty(couponUrl)) { |
| | | String url = (!com.wpc.library.util.common.StringUtils.isEmpty(couponUrl)) ? couponUrl : clickUrl; |
| | | AlibcTradeSDK.setTaokeParams(alibcTaokeParams); |
| | | buyGoodsResultListener.onJumpThirdAppStart(); |
| | | AlibcTradeUtil.openByUrl(activity, |
| | | url, null, new WebViewClient(), new WebChromeClient(), |
| | | alibcShowParams, alibcTaokeParams, null); |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void jumpPDD(Context context, GoodsConvertLinkJumpLink link) { |
| | | if (context == null) |
| | | return; |
| | |
| | | package com.tejia.lijin.app.util; |
| | | |
| | | import android.content.Context; |
| | | import android.view.Gravity; |
| | | import android.view.View; |
| | | import android.widget.Toast; |
| | | |
| | | public class ToastUtil { |
| | |
| | | showSingleToast(context, context.getString(resId)); |
| | | } |
| | | |
| | | public static void showToast(View view,Context context,int duration, int gravity) { |
| | | Toast toast = new Toast(context); |
| | | toast.setView(view); |
| | | toast.setDuration(Toast.LENGTH_SHORT); |
| | | toast.setGravity(gravity,0,0); |
| | | toast.show(); |
| | | } |
| | | |
| | | } |
| | |
| | | private static void gotoMeizuPermission(Context context) { |
| | | Intent intent = new Intent("com.meizu.safe.security.SHOW_APPSEC"); |
| | | intent.addCategory(Intent.CATEGORY_DEFAULT); |
| | | intent.putExtra("packageName", BuildConfig.APPLICATION_ID); |
| | | intent.putExtra("packageName", context.getPackageName()); |
| | | try { |
| | | context.startActivity(intent); |
| | | } catch (Exception e) { |
| | |
| | | |
| | | import android.content.Context; |
| | | |
| | | import com.tejia.lijin.app.BuXinConstant; |
| | | import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram; |
| | | import com.tencent.mm.opensdk.openapi.IWXAPI; |
| | | import com.tencent.mm.opensdk.openapi.WXAPIFactory; |
| | |
| | | public class WXUtil { |
| | | |
| | | public static void jumpWXXCX(Context mContext,String userName,String path) { |
| | | String appId =""; //BuXinConstant.WECHAT_ID; // 填应用AppId |
| | | String appId = Constant.WX_APP_ID; // 填应用AppId |
| | | IWXAPI api = WXAPIFactory.createWXAPI(mContext, appId); |
| | | WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req(); |
| | | req.userName = userName; |
New file |
| | |
| | | package com.tejia.lijin.app.util.ad; |
| | | |
| | | //广告帮助 |
| | | public class AdUtil { |
| | | |
| | | public enum AD_TYPE { |
| | | csj("穿山甲"), gdt2("广点通2.0"); |
| | | |
| | | private String name; |
| | | |
| | | private AD_TYPE(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.tejia.lijin.app.util.ad; |
| | | |
| | | import com.bytedance.sdk.openadsdk.TTNativeExpressAd; |
| | | import com.qq.e.ads.nativ.NativeExpressADView; |
| | | import com.qq.e.ads.nativ.NativeUnifiedADData; |
| | | import com.qq.e.ads.nativ.express2.NativeExpressADData2; |
| | | |
| | | //信息流原生广告容器 |
| | | public class ExpressAdContainer { |
| | | |
| | | TTNativeExpressAd csj; |
| | | NativeExpressADData2 gdt2;//2.0版广点通 |
| | | NativeUnifiedADData gdt2Unfied;//2.0广点通自渲染 |
| | | |
| | | public NativeUnifiedADData getGdt2Unfied() { |
| | | return gdt2Unfied; |
| | | } |
| | | |
| | | public void setGdt2Unfied(NativeUnifiedADData gdt2Unfied) { |
| | | this.gdt2Unfied = gdt2Unfied; |
| | | } |
| | | |
| | | public ExpressAdContainer(TTNativeExpressAd csj) { |
| | | this.csj = csj; |
| | | } |
| | | |
| | | public ExpressAdContainer(NativeExpressADView gdt) { |
| | | } |
| | | |
| | | public ExpressAdContainer(NativeExpressADData2 gdt2) { |
| | | this.gdt2 = gdt2; |
| | | } |
| | | |
| | | public ExpressAdContainer(NativeUnifiedADData gdt2Unfied) { |
| | | this.gdt2Unfied = gdt2Unfied; |
| | | } |
| | | |
| | | public TTNativeExpressAd getCsj() { |
| | | return csj; |
| | | } |
| | | |
| | | public void setCsj(TTNativeExpressAd csj) { |
| | | this.csj = csj; |
| | | } |
| | | |
| | | public NativeExpressADData2 getGdt2() { |
| | | return gdt2; |
| | | } |
| | | |
| | | public void setGdt2(NativeExpressADData2 gdt2) { |
| | | this.gdt2 = gdt2; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.tejia.lijin.app.util.ad; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.util.Log; |
| | | import android.view.View; |
| | | import android.view.ViewGroup; |
| | | import android.widget.FrameLayout; |
| | | |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdDislike; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTNativeExpressAd; |
| | | import com.qq.e.ads.nativ.NativeExpressADView; |
| | | import com.qq.e.ads.nativ.express2.AdEventListener; |
| | | import com.qq.e.ads.nativ.express2.NativeExpressAD2; |
| | | import com.qq.e.ads.nativ.express2.NativeExpressADData2; |
| | | import com.qq.e.ads.nativ.express2.VideoOption2; |
| | | import com.qq.e.comm.util.AdError; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 信息流广告管理 |
| | | */ |
| | | public class ExpressAdManager { |
| | | |
| | | |
| | | final static String TAG = "ExpressAdManager"; |
| | | |
| | | AdUtil.AD_TYPE sourceType = AdUtil.AD_TYPE.gdt2; |
| | | |
| | | private TTAdNative mTTAdNative; |
| | | private Activity mContext; |
| | | |
| | | |
| | | public ExpressAdManager(AdUtil.AD_TYPE adSource, Activity context) { |
| | | sourceType = adSource; |
| | | this.mContext = context; |
| | | if (sourceType == AdUtil.AD_TYPE.csj) { |
| | | TTAdManager ttAdManager = TTAdManagerHolder.get(); |
| | | mTTAdNative = ttAdManager.createAdNative(context); |
| | | // TTAdManagerHolder.get().requestPermissionIfNecessary(context); |
| | | } |
| | | } |
| | | |
| | | |
| | | //加载小广告 |
| | | |
| | | /** |
| | | * 加载广告 |
| | | * |
| | | * @param widthDP |
| | | * @param heightDP |
| | | * @param count |
| | | * @param adLoadListener |
| | | */ |
| | | public void loadAd(int widthDP, int heightDP, String pid, int count, final IAdLoadListener adLoadListener) { |
| | | if (sourceType == AdUtil.AD_TYPE.gdt2) { |
| | | loadGDT2(pid, widthDP, heightDP, count, new IGDTAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<NativeExpressADView> adList) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSuccess2(List<NativeExpressADData2> adList) { |
| | | List<ExpressAdContainer> adContainerList = new ArrayList<>(); |
| | | if (adList != null) |
| | | for (NativeExpressADData2 ad : adList) { |
| | | adContainerList.add(new ExpressAdContainer(ad)); |
| | | } |
| | | adLoadListener.onSuccess(adContainerList); |
| | | } |
| | | }, mContext); |
| | | |
| | | } else if (sourceType == AdUtil.AD_TYPE.csj) { |
| | | loadCSJ(pid, widthDP, heightDP, count, new ICSJAdLoadListener() { |
| | | @Override |
| | | public void onSuccess(List<TTNativeExpressAd> adList) { |
| | | List<ExpressAdContainer> adContainerList = new ArrayList<>(); |
| | | if (adList != null) { |
| | | for (TTNativeExpressAd adView : adList) { |
| | | adContainerList.add(new ExpressAdContainer(adView)); |
| | | } |
| | | } |
| | | adLoadListener.onSuccess(adContainerList); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 商品加载广告 |
| | | * |
| | | * @param adLoadListener |
| | | */ |
| | | public void loadGoodsJumpLoadingAd(String pid, final IAdLoadListener adLoadListener) { |
| | | //获取屏幕的宽 |
| | | int deviceWidth = DimenUtils.getScreenWidth(mContext); |
| | | deviceWidth = DimenUtils.px2dip(mContext, deviceWidth); |
| | | int width = deviceWidth * 3 / 4; |
| | | int height = (int) (width / 1.78f); |
| | | |
| | | loadAd(width, height, pid, 1, adLoadListener); |
| | | } |
| | | |
| | | /** |
| | | * 2.0版本广点通原生 |
| | | * |
| | | * @param positionId |
| | | * @param widthDP |
| | | * @param heightDP |
| | | * @param count |
| | | * @param adLoadListener |
| | | * @param context |
| | | */ |
| | | private void loadGDT2(String positionId, int widthDP, int heightDP, int count, final IGDTAdLoadListener adLoadListener, Context context) { |
| | | |
| | | Log.i(TAG, String.format("loadGDT2:positionId-%s widthDP-%s heightDP-%s", positionId, widthDP, heightDP)); |
| | | |
| | | NativeExpressAD2 nativeExpressAD2 = new NativeExpressAD2(context, positionId, new NativeExpressAD2.AdLoadListener() { |
| | | @Override |
| | | public void onLoadSuccess(List<NativeExpressADData2> list) { |
| | | if (adLoadListener != null) |
| | | adLoadListener.onSuccess2(list); |
| | | } |
| | | |
| | | @Override |
| | | public void onNoAD(AdError adError) { |
| | | if (adLoadListener != null) |
| | | adLoadListener.onSuccess2(null); |
| | | } |
| | | }); |
| | | |
| | | nativeExpressAD2.setAdSize(widthDP, heightDP); |
| | | VideoOption2.Builder builder = new VideoOption2.Builder(); |
| | | builder.setAutoPlayPolicy(VideoOption2.AutoPlayPolicy.WIFI) // WIFI 环境下可以自动播放视频 |
| | | .setAutoPlayMuted(true) // 自动播放时为静音 |
| | | .setDetailPageMuted(false) // 视频详情页播放时不静音 |
| | | .setMaxVideoDuration(0) // 设置返回视频广告的最大视频时长(闭区间,可单独设置),单位:秒,默认为 0 代表无限制,合法输入为:5<=maxVideoDuration<=60. 此设置会影响广告填充,请谨慎设置 |
| | | .setMinVideoDuration(0); // 设置返回视频广告的最小视频时长(闭区间,可单独设置),单位:秒,默认为 0 代表无限制, 此设置会影响广告填充,请谨慎设置 |
| | | nativeExpressAD2.setVideoOption2(builder.build()); |
| | | nativeExpressAD2.loadAd(count); |
| | | } |
| | | |
| | | /** |
| | | * 穿山甲广告 |
| | | * |
| | | * @param codeId |
| | | * @param width |
| | | * @param height |
| | | * @param count |
| | | * @param adLoadListener |
| | | */ |
| | | private void loadCSJ(String codeId, int width, int height, int count, final ICSJAdLoadListener adLoadListener) { |
| | | count = count > 3 ? 3 : count; |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId(codeId) |
| | | .setSupportDeepLink(true) |
| | | .setExpressViewAcceptedSize(width, height) |
| | | .setAdCount(count) //请求广告数量为1到3条 |
| | | .build(); |
| | | mTTAdNative.loadNativeExpressAd(adSlot, new TTAdNative.NativeExpressAdListener() { |
| | | @Override |
| | | public void onError(int i, String s) { |
| | | adLoadListener.onSuccess(null); |
| | | } |
| | | |
| | | @Override |
| | | public void onNativeExpressAdLoad(List<TTNativeExpressAd> list) { |
| | | adLoadListener.onSuccess(list); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渲染模板和填充广告 |
| | | * |
| | | * @param activity |
| | | * @param ad |
| | | * @param fl_ad |
| | | * @param adEventListener |
| | | */ |
| | | public static void renderAndFillAd(Activity activity, final ExpressAdContainer ad, final FrameLayout fl_ad, final IAdEventListener adEventListener) { |
| | | |
| | | if (ad == null) {//广告为空 |
| | | fl_ad.setVisibility(View.GONE); |
| | | } else { |
| | | fl_ad.setVisibility(View.VISIBLE); |
| | | if (ad.getGdt2() != null) { |
| | | if (fl_ad.getChildCount() > 0 && fl_ad.getChildAt(0) == ad.getGdt2().getAdView()) { |
| | | return; |
| | | } |
| | | fl_ad.removeAllViews(); |
| | | |
| | | ad.getGdt2().setAdEventListener(new AdEventListener() { |
| | | @Override |
| | | public void onClick() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onExposed() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess() { |
| | | if (ad.getGdt2().getAdView().getParent() != null) { |
| | | ((ViewGroup) ad.getGdt2().getAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_ad.addView(ad.getGdt2().getAdView()); |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdClosed() { |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | } |
| | | }); |
| | | ad.getGdt2().render(); |
| | | |
| | | } else if (ad.getCsj() != null) { |
| | | if (fl_ad.getChildCount() > 0 && fl_ad.getChildAt(0) == ad.getCsj().getExpressAdView()) { |
| | | return; |
| | | } |
| | | |
| | | |
| | | ad.getCsj().setDislikeCallback(activity, new TTAdDislike.DislikeInteractionCallback() { |
| | | |
| | | |
| | | @Override |
| | | public void onShow() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSelected(int i, String s, boolean b) { |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | |
| | | }); |
| | | ad.getCsj().render(); |
| | | if (ad.getCsj().getExpressAdView().getParent() != null) { |
| | | ((ViewGroup) ad.getCsj().getExpressAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_ad.addView(ad.getCsj().getExpressAdView()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 渲染广告 |
| | | * |
| | | * @param activity |
| | | * @param ad |
| | | * @param adRenderListener |
| | | * @param adEventListener |
| | | */ |
| | | public static void renderAd(Activity activity, final ExpressAdContainer ad, final IAdRenderListener adRenderListener, final IAdEventListener adEventListener) { |
| | | |
| | | if (ad == null) {//广告为空 |
| | | return; |
| | | } |
| | | |
| | | if (ad.getGdt2() != null) { |
| | | ad.getGdt2().setAdEventListener(new AdEventListener() { |
| | | @Override |
| | | public void onClick() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onExposed() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess() { |
| | | List<ExpressAdContainer> list = new ArrayList<>(); |
| | | list.add(ad); |
| | | if (adRenderListener != null) |
| | | adRenderListener.onRenderSuccess(list); |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail() { |
| | | List<ExpressAdContainer> list = new ArrayList<>(); |
| | | list.add(ad); |
| | | if (adRenderListener != null) |
| | | adRenderListener.onRenderFail(list); |
| | | } |
| | | |
| | | @Override |
| | | public void onAdClosed() { |
| | | if (adEventListener != null) |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | }); |
| | | ad.getGdt2().render(); |
| | | |
| | | } else if (ad.getCsj() != null) { |
| | | ad.getCsj().setExpressInteractionListener(new TTNativeExpressAd.ExpressAdInteractionListener() { |
| | | @Override |
| | | public void onAdClicked(View view, int i) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdShow(View view, int i) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail(View view, String s, int i) { |
| | | List<ExpressAdContainer> list = new ArrayList<>(); |
| | | list.add(ad); |
| | | if (adRenderListener != null) |
| | | adRenderListener.onRenderFail(list); |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess(View view, float v, float v1) { |
| | | Log.d(TAG, "onRenderSuccess"); |
| | | List<ExpressAdContainer> list = new ArrayList<>(); |
| | | list.add(ad); |
| | | if (adRenderListener != null) |
| | | adRenderListener.onRenderSuccess(list); |
| | | } |
| | | }); |
| | | if (activity != null) |
| | | ad.getCsj().setDislikeCallback(activity, new TTAdDislike.DislikeInteractionCallback() { |
| | | |
| | | |
| | | @Override |
| | | public void onShow() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSelected(int i, String s, boolean b) { |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | |
| | | |
| | | }); |
| | | ad.getCsj().render(); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 为广告绑定关闭事件 |
| | | * |
| | | * @param activity |
| | | * @param ad |
| | | * @param adEventListener |
| | | */ |
| | | public static void bindCloseListener(Activity activity, final ExpressAdContainer ad, final IAdEventListener adEventListener) { |
| | | |
| | | if (ad == null) {//广告为空 |
| | | return; |
| | | } |
| | | |
| | | if (ad.getGdt2() != null) { |
| | | ad.getGdt2().setAdEventListener(new AdEventListener() { |
| | | @Override |
| | | public void onClick() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onExposed() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail() { |
| | | } |
| | | |
| | | @Override |
| | | public void onAdClosed() { |
| | | if (adEventListener != null) |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | }); |
| | | |
| | | } else if (ad.getCsj() != null) { |
| | | ad.getCsj().setExpressInteractionListener(new TTNativeExpressAd.ExpressAdInteractionListener() { |
| | | @Override |
| | | public void onAdClicked(View view, int i) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdShow(View view, int i) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderFail(View view, String s, int i) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onRenderSuccess(View view, float v, float v1) { |
| | | |
| | | } |
| | | }); |
| | | ad.getCsj().setDislikeCallback(activity, new TTAdDislike.DislikeInteractionCallback() { |
| | | |
| | | |
| | | @Override |
| | | public void onShow() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onSelected(int i, String s, boolean b) { |
| | | if (adEventListener != null) { |
| | | adEventListener.closeAd(ad); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void onCancel() { |
| | | |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 填充广告 |
| | | * |
| | | * @param ad |
| | | * @param fl_ad |
| | | */ |
| | | public static void fillAd(final ExpressAdContainer ad, final FrameLayout fl_ad) { |
| | | |
| | | fl_ad.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (ad == null) {//广告为空 |
| | | fl_ad.setVisibility(View.GONE); |
| | | } else { |
| | | fl_ad.setVisibility(View.VISIBLE); |
| | | if (ad.getGdt2() != null) { |
| | | if (fl_ad.getChildCount() > 0 && fl_ad.getChildAt(0) == ad.getGdt2().getAdView()) { |
| | | return; |
| | | } |
| | | if (ad.getGdt2().getAdView().getParent() != null) { |
| | | ((ViewGroup) ad.getGdt2().getAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_ad.removeAllViews(); |
| | | fl_ad.addView(ad.getGdt2().getAdView()); |
| | | |
| | | } else if (ad.getCsj() != null) { |
| | | if (fl_ad.getChildCount() > 0 && fl_ad.getChildAt(0) == ad.getCsj().getExpressAdView()) { |
| | | return; |
| | | } |
| | | if (ad.getCsj().getExpressAdView().getParent() != null) { |
| | | ((ViewGroup) ad.getCsj().getExpressAdView().getParent()).removeAllViews(); |
| | | } |
| | | fl_ad.removeAllViews(); |
| | | fl_ad.addView(ad.getCsj().getExpressAdView()); |
| | | } |
| | | } |
| | | if (fl_ad.getChildCount() > 0) { |
| | | fl_ad.getChildAt(0).setVisibility(View.VISIBLE); |
| | | fl_ad.getChildAt(0).post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | interface IGDTAdLoadListener { |
| | | public void onSuccess(List<NativeExpressADView> adList); |
| | | |
| | | public void onSuccess2(List<NativeExpressADData2> adList); |
| | | } |
| | | |
| | | interface ICSJAdLoadListener { |
| | | public void onSuccess(List<TTNativeExpressAd> adList); |
| | | } |
| | | |
| | | |
| | | public interface IAdLoadListener { |
| | | public void onSuccess(List<ExpressAdContainer> adList); |
| | | } |
| | | |
| | | public interface IAdRenderListener { |
| | | public void onRenderSuccess(List<ExpressAdContainer> adList); |
| | | |
| | | public void onRenderFail(List<ExpressAdContainer> adList); |
| | | } |
| | | |
| | | public interface IAdEventListener { |
| | | public void closeAd(ExpressAdContainer ad); |
| | | } |
| | | |
| | | |
| | | public interface IAdShowListener { |
| | | public void show(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.tejia.lijin.app.util.ad; |
| | | |
| | | import android.content.Context; |
| | | |
| | | import com.bytedance.sdk.openadsdk.TTAdConfig; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdManager; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.tejia.lijin.app.R; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | |
| | | /** |
| | | * 可以用一个单例来保存TTAdManager实例,在需要初始化sdk的时候调用 |
| | | */ |
| | | public class TTAdManagerHolder { |
| | | |
| | | private static boolean sInit; |
| | | |
| | | |
| | | public static TTAdManager get() { |
| | | if (!sInit) { |
| | | throw new RuntimeException("TTAdSdk is not init, please check."); |
| | | } |
| | | return TTAdSdk.getAdManager(); |
| | | } |
| | | |
| | | public static void init(Context context) { |
| | | doInit(context); |
| | | } |
| | | |
| | | //step1:接入网盟广告sdk的初始化操作,详情见接入文档和穿山甲平台说明 |
| | | private static void doInit(Context context) { |
| | | if (!sInit) { |
| | | try { |
| | | TTAdSdk.init(context, buildConfig(context)); |
| | | sInit = true; |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | private static TTAdConfig buildConfig(Context context) { |
| | | return new TTAdConfig.Builder() |
| | | .appId(Constant.CSJ_APP_ID) |
| | | .useTextureView(true) //使用TextureView控件播放视频,默认为SurfaceView,当有SurfaceView冲突的场景,可以使用TextureView |
| | | .appName(context.getString(R.string.app_name)) |
| | | .titleBarTheme(TTAdConstant.TITLE_BAR_THEME_DARK) |
| | | .allowShowNotify(true) //是否允许sdk展示通知栏提示 |
| | | .allowShowPageWhenScreenLock(true) //是否在锁屏场景支持展示广告落地页 |
| | | .debug(true) //测试阶段打开,可以通过日志排查问题,上线时去除该调用 |
| | | .directDownloadNetworkType(TTAdConstant.NETWORK_STATE_WIFI) |
| | | .supportMultiProcess(true)//是否支持多进程 |
| | | .asyncInit(true) |
| | | .needClearTaskReset() |
| | | //.httpStack(new MyOkStack3())//自定义网络库,demo中给出了okhttp3版本的样例,其余请自行开发或者咨询工作人员。 |
| | | .build(); |
| | | } |
| | | } |
| | |
| | | * @param requestInfo |
| | | * @param resultListener |
| | | */ |
| | | public static void buy(Activity activity, Context context, GoodsBuyRequestInfo requestInfo, IBuyGoodsResultListener resultListener) { |
| | | public static void fanli(Activity activity, Context context, GoodsBuyRequestInfo requestInfo, IBuyGoodsResultListener resultListener) { |
| | | |
| | | switch (requestInfo.getGoodsType()) { |
| | | case Constant.GOODS_TYPE_TB: |
| | |
| | | /** |
| | | * 打开指定链接 |
| | | */ |
| | | private static void jumpTB(Activity activity, TbPidInfo tInfo, String clickUrl, String couponUrl, final IBuyGoodsResultListener buyGoodsResultListener) { |
| | | public static void jumpTB(Activity activity, TbPidInfo tInfo, String clickUrl, String couponUrl, final IBuyGoodsResultListener buyGoodsResultListener) { |
| | | AlibcShowParams alibcShowParams = new AlibcShowParams(); |
| | | alibcShowParams.setOpenType(OpenType.Auto); |
| | | alibcShowParams.setBackUrl("alisdk://"); |
| | |
| | | /** |
| | | * 商品购买请求参数 |
| | | */ |
| | | static class GoodsBuyRequestInfo { |
| | | public static class GoodsBuyRequestInfo { |
| | | private int goodsType; |
| | | private String goodsId; |
| | | private String couponLink; |
| | |
| | | package com.tejia.lijin.app.util.goods; |
| | | |
| | | import android.content.Context; |
| | | import android.graphics.Color; |
| | | import android.graphics.Paint; |
| | | import android.graphics.Typeface; |
| | | import android.text.Spannable; |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.style.ForegroundColorSpan; |
| | | import android.text.style.RelativeSizeSpan; |
| | | import android.text.style.StyleSpan; |
| | | import android.view.View; |
| | |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.ImageUtil; |
| | | import com.tejia.lijin.app.util.SetLabels; |
| | | import com.tejia.lijin.app.util.downutil.StringUtils; |
| | | import com.tejia.lijin.app.util.ui.GoodsRightViewHolder; |
| | | |
| | | public class GoodsDetailListUtil { |
| | |
| | | viewHolder.tv_fanli_amount.setVisibility(View.GONE); |
| | | } |
| | | |
| | | String disCount; |
| | | if (info.getMoneyInfo().getHongBaoMoney() != null) { |
| | | viewHolder.tv_hongbao_amount.setText("-" + info.getMoneyInfo().getHongBaoMoney()); |
| | | viewHolder.tv_hongbao_amount.setVisibility(View.VISIBLE); |
| | | } else { |
| | | viewHolder.tv_hongbao_amount.setVisibility(View.GONE); |
| | | } |
| | | |
| | | |
| | | String disCount = info.getMoneyInfo().getFinalMoney(); |
| | | if (info.isHasCoupon()) { |
| | | if (StringUtils.isNullOrEmpty(disCount)) |
| | | disCount = "¥ " + info.getCouponPrice(); |
| | | viewHolder.tv_coupon_amount.setVisibility(View.VISIBLE); |
| | | viewHolder.tv_coupon_amount.setText("-¥ " + info.getCouponInfo().getAmount()); |
| | | } else { |
| | | if (StringUtils.isNullOrEmpty(disCount)) |
| | | if (info.getGoodsType() == Constant.GOODS_TYPE_VIP) { |
| | | disCount = "¥ " + info.getCouponPrice(); |
| | | } else |
| | |
| | | int startIndex = disCount.indexOf("."); |
| | | if (startIndex > -1) { |
| | | viewHolder.tv_actual_price1.setText(disCount.substring(0, startIndex + 1)); |
| | | |
| | | |
| | | viewHolder.tv_actual_price2.setText(disCount.substring(startIndex + 1)); |
| | | } else { |
| | | viewHolder.tv_actual_price2.setText(""); |
| | | viewHolder.tv_actual_price1.setText(disCount); |
| | | } |
| | | |
| | | SpannableString spannableString = new SpannableString(viewHolder.tv_actual_price1.getText()); |
| | | spannableString.setSpan(new RelativeSizeSpan(0.5f), 0, 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
| | | viewHolder.tv_actual_price1.setText(spannableString); |
| | | |
| | | |
| | | viewHolder.tv_sale_num.setTextColor((info.getSalesType() == 1 || info.getSalesType() == 4) ? |
| | | mContext.getResources().getColor(R.color.gray5) : info.getSalesType() == 2 ? |
| | | mContext.getResources().getColor(R.color.goods_sale_num_text_color_orange) : |
| | |
| | | return "2小时销"; |
| | | case 3: |
| | | return "今日销"; |
| | | case 4: |
| | | default: |
| | | return "总销"; |
| | | |
| | | } |
| | | return "销量"; |
| | | } |
| | | |
| | | |
| | |
| | | case 11: |
| | | return "天猫"; |
| | | case 20: |
| | | case 21: |
| | | return "京东"; |
| | | case 30: |
| | | return "拼多多"; |
| | | case 40: |
| | | return "唯品会"; |
| | | case 50: |
| | | return "苏宁易购"; |
| | | } |
| | | return ""; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.tejia.lijin.app.util.ui.dialog; |
| | | |
| | | import android.app.Dialog; |
| | | |
| | | public class DialogUtil { |
| | | |
| | | public static void show(Dialog dialog) { |
| | | try { |
| | | if (dialog != null && !dialog.isShowing()) { |
| | | dialog.show(); |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | public static void dismiss(Dialog dialog) { |
| | | try { |
| | | if (dialog != null && dialog.isShowing()) { |
| | | dialog.dismiss(); |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | int width = DimenUtils.getScreenWidth(activity); |
| | | int widthDP = DimenUtils.px2dip(activity, width); |
| | | AuthUIConfig uiCOnfig = new AuthUIConfig.Builder() |
| | | .setPageBackgroundPath("shape_login_onkey_bg") |
| | | .setPageBackgroundPath("shape_login_onekey_bg") |
| | | |
| | | .setNavText("") |
| | | .setNavColor(Color.WHITE) |
| | | .setNavHidden(false) |
| | | .setNavReturnImgPath("ic_login_close") |
| | | .setNavReturnImgPath("icon_one_key_login_close") |
| | | .setNavReturnImgWidth(22) |
| | | .setNavReturnImgHeight(22) |
| | | .setNavReturnScaleType(ImageView.ScaleType.FIT_XY) |
| | | .setWebNavColor(Color.BLACK) |
| | | .setWebNavReturnImgPath("ic_back_two") |
| | | // .setWebNavReturnImgPath("ic_back_two") |
| | | .setWebViewStatusBarColor(Color.WHITE) |
| | | .setStatusBarColor(Color.WHITE) |
| | | |
| | | .setLogoWidth(147) |
| | | .setLogoHeight(36) |
| | | .setLogoImgPath("ic_login_logo") |
| | | // .setLogoImgPath("ic_login_logo") |
| | | .setLogoOffsetY(24 - 10) |
| | | |
| | | .setSloganOffsetY(171 - 10) |
File was renamed from app/src/main/java/com/tejia/lijin/app/util/BaseRebateJavaInterface.java |
| | |
| | | package com.tejia.lijin.app.util; |
| | | package com.tejia.lijin.app.util.web; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Intent; |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.gson.Gson; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.JumpActivityUtil; |
| | | import com.tejia.lijin.app.util.WXUtil; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.wpc.library.DeviceUuidFactory; |
| | | import com.wpc.library.util.GetManifestDataUtil; |
copy from app/src/main/java/com/tejia/lijin/app/util/BaseRebateJavaInterface.java
copy to app/src/main/java/com/tejia/lijin/app/util/web/BaseRebateJavaInterfaceBS.java
File was copied from app/src/main/java/com/tejia/lijin/app/util/BaseRebateJavaInterface.java |
| | |
| | | package com.tejia.lijin.app.util; |
| | | package com.tejia.lijin.app.util.web; |
| | | |
| | | import android.app.Activity; |
| | | import android.content.Intent; |
| | |
| | | import com.alibaba.baichuan.android.trade.model.OpenType; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.gson.Gson; |
| | | import com.tejia.lijin.app.BuXinConstant; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailActivity; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailBrowerActivity; |
| | | import com.tejia.lijin.app.ui.recommend.SearchActivity; |
| | | import com.tejia.lijin.app.util.Constant; |
| | | import com.tejia.lijin.app.util.JumpActivityUtil; |
| | | import com.tejia.lijin.app.util.WXUtil; |
| | | import com.tejia.lijin.app.util.clipboard.ClipboardUtil; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | | import com.umeng.analytics.MobclickAgent; |
| | | import com.wpc.library.DeviceUuidFactory; |
| | | import com.wpc.library.util.GetManifestDataUtil; |
| | |
| | | import com.wpc.library.util.common.PackageUtils2; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.wpc.library.util.security.MD5Utils; |
| | | import com.tejia.lijin.app.BuXinConstant; |
| | | import com.tejia.lijin.app.ui.recommend.GoodsDetailBrowerActivity; |
| | | import com.tejia.lijin.app.ui.recommend.SearchActivity; |
| | | import com.tejia.lijin.app.util.clipboard.ClipboardUtil; |
| | | import com.tejia.lijin.app.util.user.UserUtil; |
| | | |
| | | import org.json.JSONException; |
| | | import org.json.JSONObject; |
| | |
| | | |
| | | import static android.content.Context.MODE_PRIVATE; |
| | | |
| | | public class BaseRebateJavaInterface { |
| | | public class BaseRebateJavaInterfaceBS { |
| | | |
| | | Activity mContext; |
| | | |
| | | public BaseRebateJavaInterface(Activity activity) { |
| | | public BaseRebateJavaInterfaceBS(Activity activity) { |
| | | mContext = activity; |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String getUid() { |
| | | public Object getUid() { |
| | | return mContext.getSharedPreferences("user", MODE_PRIVATE).getString("uid", ""); |
| | | } |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public String getVersion() { |
| | | public Object getVersion() { |
| | | return PackageUtils2.getVersionCode(mContext) + ""; |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void toast(String str) { |
| | | Toast.makeText(mContext, str, Toast.LENGTH_LONG).show(); |
| | | public void toast(Object str) { |
| | | Toast.makeText(mContext, str.toString(), Toast.LENGTH_LONG).show(); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String getSign(String str) { |
| | | public String getSign(Object str) { |
| | | return MD5Utils.getMD532(str + "@?,223Hbb88lll"); |
| | | } |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void jumpBaiChuan(String tbClientInfo, String url, String auctionId) { |
| | | public void jumpBaiChuan(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | final String tbClientInfo = json.optString("tbClientInfo"); |
| | | final String url = json.optString("url"); |
| | | final String auctionId = json.optString("auctionId"); |
| | | |
| | | AlibcShowParams alibcShowParams = new AlibcShowParams(); |
| | | alibcShowParams.setOpenType(OpenType.Auto); |
| | | JumpActivityUtil.jumpBaiChuan(mContext, tbClientInfo, url, auctionId, alibcShowParams); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void jumpSearch(String key) { |
| | | public void jumpSearch(Object key) { |
| | | Intent intent = new Intent(mContext, SearchActivity.class); |
| | | intent.putExtra("key", key); |
| | | intent.putExtra("key", key.toString()); |
| | | mContext.startActivity(intent); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void jumpGoodsDetail(long id) { |
| | | Intent intent = new Intent(mContext, GoodsDetailBrowerActivity.class); |
| | | intent.putExtra("id", id + ""); |
| | | intent.putExtra("isTrolley", true); |
| | | mContext.startActivity(intent); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void copyText(String atr) { |
| | | ClipboardUtil.copy(mContext, atr); |
| | | public void copyText(Object atr) { |
| | | ClipboardUtil.copy(mContext, atr.toString()); |
| | | } |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void jumpPage(String pageClassName, String paramJson) { |
| | | public void jumpPage(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | String pageClassName = json.optString("pageClassName"); |
| | | String paramJson = json.optString("paramJson"); |
| | | |
| | | Intent intent = null; |
| | | JSONObject param = null; |
| | | try { |
| | |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public String getRequestBaseParams(String json) { |
| | | public String getRequestBaseParams(Object json) { |
| | | LinkedHashMap<String, String> params = new LinkedHashMap<>(); |
| | | int version = PackageUtils2.getVersionCode(mContext); |
| | | long time = System.currentTimeMillis(); |
| | | String deviceType = MobileUtil.getSystemModel(); |
| | | if (!StringUtils.isEmpty(json)) { |
| | | if (!StringUtils.isEmpty(json.toString())) { |
| | | JSONObject jsonObject = null; |
| | | try { |
| | | jsonObject = new JSONObject(json); |
| | | jsonObject = new JSONObject(json.toString()); |
| | | Iterator<String> iterator = jsonObject.keys(); |
| | | while (iterator.hasNext()) { |
| | | String key = iterator.next(); |
| | |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void umEventCount(String eventId, String paramsJSON) { |
| | | public void umEventCount(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | String eventId = json.optString("eventId"); |
| | | String paramsJSON = json.optString("paramsJSON"); |
| | | |
| | | Map map = JSON.parseObject(paramsJSON); |
| | | MobclickAgent.onEventObject(mContext, eventId, map); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void umEventCompute(String eventId, String paramsJSON, int du) { |
| | | public void umEventCompute(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | String eventId = json.optString("eventId"); |
| | | String paramsJSON = json.optString("paramsJSON"); |
| | | int du = json.optInt("du"); |
| | | |
| | | Map map = JSON.parseObject(paramsJSON); |
| | | MobclickAgent.onEventValue(mContext, eventId, map, du); |
| | | } |
| | | |
| | | /*********移进来的方法****/ |
| | | @JavascriptInterface |
| | | public void jumpGoodsSplashWithFrom(long id, String from) { |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("id", id + ""); |
| | | intent.putExtra("from", from); |
| | | mContext.startActivity(intent); |
| | | } |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void jumpGoodsDetail(String id, int goodsType) { |
| | | public void jumpGoodsDetail(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | String id = json.optString("id"); |
| | | String goodsType = json.optString("goodsType"); |
| | | String from = json.optString("from"); |
| | | |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", id); |
| | | intent.putExtra("goodsType", goodsType); |
| | | mContext.startActivity(intent); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void jumpGoodsSplash(long id) { |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", id); |
| | | intent.putExtra("goodsType", Constant.GOODS_TYPE_TB); |
| | | mContext.startActivity(intent); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void jumpPDDGoodsDetailWithFrom(long id, String from) { |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", id); |
| | | intent.putExtra("goodsType", Constant.GOODS_TYPE_PDD); |
| | | if(!StringUtils.isNullOrEmpty(from)) |
| | | intent.putExtra("from", from); |
| | | mContext.startActivity(intent); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void jumpJDGoodsDetailWithFrom(long id, String from) { |
| | | Intent intent = new Intent(mContext, GoodsDetailActivity.class); |
| | | intent.putExtra("goodsId", id); |
| | | intent.putExtra("goodsType", Constant.GOODS_TYPE_JD); |
| | | intent.putExtra("from", from); |
| | | mContext.startActivity(intent); |
| | | } |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void jumpWXXCX(String userName, String path) { |
| | | public void jumpWXXCX(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | String userName = json.optString("userName"); |
| | | String path = json.optString("path"); |
| | | WXUtil.jumpWXXCX(mContext, userName, path); |
| | | } |
| | | |
File was renamed from app/src/main/java/com/tejia/lijin/app/util/RebateJavaInterface.java |
| | |
| | | package com.tejia.lijin.app.util; |
| | | package com.tejia.lijin.app.util.web; |
| | | |
| | | import android.Manifest; |
| | | import android.app.Activity; |
| | |
| | | import com.kepler.jd.Listener.OpenAppAction; |
| | | import com.kepler.jd.login.KeplerApiManager; |
| | | import com.kepler.jd.sdk.bean.KeplerAttachParameter; |
| | | import com.tejia.lijin.app.util.JumpActivityUtil; |
| | | import com.tejia.lijin.app.util.PermissionHelper; |
| | | import com.tejia.lijin.app.util.Tools; |
| | | import com.tejia.lijin.app.util.web.BaseRebateJavaInterface; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.wpc.library.util.security.MD5Utils; |
| | | import com.tejia.lijin.app.Interface.WebInterface; |
copy from app/src/main/java/com/tejia/lijin/app/util/RebateJavaInterface.java
copy to app/src/main/java/com/tejia/lijin/app/util/web/RebateJavaInterfaceBS.java
File was copied from app/src/main/java/com/tejia/lijin/app/util/RebateJavaInterface.java |
| | |
| | | package com.tejia.lijin.app.util; |
| | | package com.tejia.lijin.app.util.web; |
| | | |
| | | import android.Manifest; |
| | | import android.app.Activity; |
| | |
| | | import android.os.Environment; |
| | | import android.os.Handler; |
| | | import android.os.Message; |
| | | import androidx.core.content.ContextCompat; |
| | | import android.util.Log; |
| | | import android.view.Gravity; |
| | | import android.view.LayoutInflater; |
| | | import android.view.View; |
| | | import android.webkit.JavascriptInterface; |
| | | import android.webkit.WebView; |
| | | import android.widget.ImageView; |
| | | import android.widget.LinearLayout; |
| | | import android.widget.TextView; |
| | | import android.widget.Toast; |
| | | |
| | | import com.bumptech.glide.Glide; |
| | | import com.bytedance.sdk.openadsdk.AdSlot; |
| | | import com.bytedance.sdk.openadsdk.TTAdConstant; |
| | | import com.bytedance.sdk.openadsdk.TTAdNative; |
| | | import com.bytedance.sdk.openadsdk.TTAdSdk; |
| | | import com.bytedance.sdk.openadsdk.TTRewardVideoAd; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.kepler.jd.Listener.OpenAppAction; |
| | | import com.kepler.jd.login.KeplerApiManager; |
| | | import com.kepler.jd.sdk.bean.KeplerAttachParameter; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.wpc.library.util.security.MD5Utils; |
| | | import com.tejia.lijin.app.Interface.WebInterface; |
| | | import com.tejia.lijin.app.R; |
| | | import com.tejia.lijin.app.callBack.GeneralBackCallback; |
| | | import com.tejia.lijin.app.callBack.PermissionInterface; |
| | | import com.tejia.lijin.app.entity.ImgText; |
| | | import com.tejia.lijin.app.entity.share.ShareImageEntity; |
| | | import com.tejia.lijin.app.ui.dialog.ShapeLoadingDialog; |
| | | import com.tejia.lijin.app.ui.invite.ShareBrowserActivity; |
| | | import com.tejia.lijin.app.util.JumpActivityUtil; |
| | | import com.tejia.lijin.app.util.PermissionHelper; |
| | | import com.tejia.lijin.app.util.ToastUtil; |
| | | import com.tejia.lijin.app.util.Tools; |
| | | import com.tejia.lijin.app.util.baichuan.AlibcTradeUtil; |
| | | import com.tejia.lijin.app.util.share.ShareImageUtil; |
| | | import com.tejia.lijin.app.util.share.ShareTextUtil; |
| | | import com.wpc.library.util.common.DimenUtils; |
| | | import com.wpc.library.util.common.StringUtils; |
| | | import com.wpc.library.util.security.MD5Utils; |
| | | import com.ysh.wpc.appupdate.download.DownLoadFile; |
| | | |
| | | import org.json.JSONArray; |
| | |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | |
| | | public class RebateJavaInterface extends BaseRebateJavaInterface implements PermissionInterface { |
| | | import androidx.core.content.ContextCompat; |
| | | import wendu.dsbridge.CompletionHandler; |
| | | |
| | | public class RebateJavaInterfaceBS extends BaseRebateJavaInterfaceBS implements PermissionInterface { |
| | | |
| | | Activity mContext; |
| | | TextView tv_top_bar_middle, tv_top_bar_left2, tv_top_bar_right; |
| | |
| | | private boolean boo = false; |
| | | private PermissionHelper mPermissionsChecker; // 权限检测器 |
| | | |
| | | public RebateJavaInterface(Activity activity, WebView webview) { |
| | | public RebateJavaInterfaceBS(Activity activity, WebView webview) { |
| | | super(activity); |
| | | mContext = activity; |
| | | this.webview = webview; |
| | | boo = true; |
| | | } |
| | | |
| | | public RebateJavaInterface(Activity activity, TextView tv_top_bar_middle |
| | | public RebateJavaInterfaceBS(Activity activity, TextView tv_top_bar_middle |
| | | , TextView tv_top_bar_left2, TextView tv_top_bar_right |
| | | , ImageView iv_right, WebView webview, ShapeLoadingDialog pd) { |
| | | super(activity); |
| | |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void setTitle(final String title) { |
| | | public void setTitle(final Object title) { |
| | | // tv_top_bar_middle.setText(title); |
| | | if (!boo) |
| | | tv_top_bar_middle.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if (null != title && !StringUtils.isEmpty(title.trim())) |
| | | tv_top_bar_middle.setText(title); |
| | | if (null != title && !StringUtils.isEmpty((title + "").trim())) |
| | | tv_top_bar_middle.setText(title + ""); |
| | | } |
| | | }); |
| | | } |
| | |
| | | * 保存网络图片 |
| | | * |
| | | * @param url |
| | | * @param name |
| | | */ |
| | | @JavascriptInterface |
| | | public void savePicture(String url, String name) { |
| | | public void savePicture(Object url) { |
| | | if (mPermissionsChecker == null) |
| | | mPermissionsChecker = new PermissionHelper(mContext, this); |
| | | if (mPermissionsChecker.lacksPermissions(getPermissions())) { //存储权限未开启 |
| | | mPermissionsChecker.showNormalDialog(); |
| | | } else {//存储权限已开 |
| | | String md5 = MD5Utils.getMD532(url); |
| | | String md5 = MD5Utils.getMD532(url.toString()); |
| | | String path = com.wpc.library.util.Environment.getExternalStorageDirectory() |
| | | + "/blksapp"; |
| | | File file = new File(path + "/" + md5 + ".jpg"); |
| | | if (!file.exists()) { |
| | | try { |
| | | File resultFile = Tools.saveImageFromPathToSdCard(mContext, url, path, md5 + ".jpg"); |
| | | File resultFile = Tools.saveImageFromPathToSdCard(mContext, url.toString(), path, md5 + ".jpg"); |
| | | if (resultFile != null) { |
| | | Toast.makeText(mContext, "图片保存到相册成功", Toast.LENGTH_LONG).show(); |
| | | } |
| | |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void savePictures(String urls) { |
| | | public void savePictures(Object urls) { |
| | | if (mPermissionsChecker == null) |
| | | mPermissionsChecker = new PermissionHelper(mContext, this); |
| | | if (mPermissionsChecker.lacksPermissions(getPermissions())) { //存储权限未开启 |
| | |
| | | } else {//存储权限已开 |
| | | List<String> urlList = new ArrayList<>(); |
| | | try { |
| | | JSONArray array = new JSONArray(urls); |
| | | JSONArray array = new JSONArray(urls.toString()); |
| | | for (int i = 0; i < array.length(); i++) { |
| | | urlList.add(array.optString(i)); |
| | | } |
| | |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void setTopMenuRightIcon(final String picUrl, final String jsCallback) { |
| | | public void setTopMenuRightIcon(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | final String picUrl = json.optString("picUrl"); |
| | | final String jsCallback = json.optString("jsCallback"); |
| | | |
| | | if (!boo) |
| | | iv_right.post(new Runnable() { |
| | | @Override |
| | |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void jumpPageWithFinishCurrentPage(String pageClassName, String paramJson) { |
| | | public void jumpPageWithFinishCurrentPage(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | final String pageClassName = json.optString("pageClassName"); |
| | | final String paramJson = json.optString("paramJson"); |
| | | |
| | | |
| | | Intent intent = null; |
| | | JSONObject param = null; |
| | | try { |
| | |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void setTopMenuRightText(final String text, final String callbackMethod) { |
| | | public void setTopMenuRightText(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | final String callbackMethod = json.optString("callbackMethod"); |
| | | final String text = json.optString("text"); |
| | | |
| | | if (!boo) |
| | | tv_top_bar_right.post(new Runnable() { |
| | | @Override |
| | |
| | | public List<ImgText> mList = new ArrayList<>(); |
| | | |
| | | @JavascriptInterface |
| | | public void addMenu(String str) { |
| | | public void addMenu(Object str) { |
| | | Gson gson = new GsonBuilder().serializeNulls().create(); |
| | | List<ImgText> list = gson.fromJson(str, new TypeToken<List<ImgText>>() { |
| | | List<ImgText> list = gson.fromJson(str + "", new TypeToken<List<ImgText>>() { |
| | | }.getType()); |
| | | if (mList.size() > 0) |
| | | mList.clear(); |
| | |
| | | |
| | | //文本分享 |
| | | @JavascriptInterface |
| | | public void shareText(int type, String text) { |
| | | public void shareText(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | int type = json.optInt("type"); |
| | | final String text = json.optString("text"); |
| | | |
| | | if (type == 1) { |
| | | ShareTextUtil.shareWXTextByIntent(mContext, text); |
| | | } else if (type == 2) { |
| | |
| | | |
| | | //图片分享 "type":1,//1-微信 2-朋友圈 3-QQ 4-空间 5-微博 6-更多 |
| | | @JavascriptInterface |
| | | public void shareImg(int type, final String url) { |
| | | public void shareImg(Object args) throws JSONException { |
| | | |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | int type = json.optInt("type"); |
| | | final String url = json.optString("url"); |
| | | |
| | | //检测权限 |
| | | String[] str = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, |
| | | Manifest.permission.WRITE_EXTERNAL_STORAGE}; |
| | |
| | | /** |
| | | * 多图分享 |
| | | * |
| | | * @param type |
| | | * @param urls |
| | | * @param args |
| | | */ |
| | | @JavascriptInterface |
| | | public void shareImgs(int type, final String urls) { |
| | | public void shareImgs(Object args) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | int type = json.optInt("type"); |
| | | final String urls = json.optString("urls"); |
| | | |
| | | |
| | | String[] str = new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, |
| | | Manifest.permission.WRITE_EXTERNAL_STORAGE}; |
| | | if (lacksPermissions(str)) {//缺少权限 |
| | |
| | | * @param url |
| | | */ |
| | | @JavascriptInterface |
| | | public void tbAuth(String url) { |
| | | if (StringUtils.isEmpty(url)) |
| | | public void tbAuth(Object url) { |
| | | if (StringUtils.isEmpty(url + "")) |
| | | return; |
| | | AlibcTradeUtil.openAuthLink(mContext, url); |
| | | AlibcTradeUtil.openAuthLink(mContext, url + ""); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param url |
| | | */ |
| | | @JavascriptInterface |
| | | public void jumpJD(String url) { |
| | | if (StringUtils.isEmpty(url)) |
| | | public void jumpJD(Object url) { |
| | | if (StringUtils.isEmpty(url + "")) |
| | | return; |
| | | KeplerApiManager.getWebViewService().openAppWebViewPage(mContext, url, new KeplerAttachParameter(), new OpenAppAction() { |
| | | KeplerApiManager.getWebViewService().openAppWebViewPage(mContext, url + "", new KeplerAttachParameter(), new OpenAppAction() { |
| | | @Override |
| | | public void onStatus(final int status, final String url) { |
| | | mContext.runOnUiThread(new Runnable() { |
| | |
| | | }); |
| | | } |
| | | |
| | | |
| | | private TTRewardVideoAd mttRewardVideoAd; |
| | | |
| | | @JavascriptInterface |
| | | public void showAwardAd(Object args, final CompletionHandler handler) throws JSONException { |
| | | JSONObject json = new JSONObject(args.toString()); |
| | | String type = json.optString("type"); |
| | | final String pid = json.optString("pid"); |
| | | final com.alibaba.fastjson.JSONObject result = new com.alibaba.fastjson.JSONObject(); |
| | | |
| | | webview.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | |
| | | TTAdNative mTTAdNative = TTAdSdk.getAdManager().createAdNative(mContext); |
| | | AdSlot adSlot = new AdSlot.Builder() |
| | | .setCodeId(pid) |
| | | .setRewardName("金币") //奖励的名称 选填 |
| | | .setRewardAmount(3) //奖励的数量 选填 |
| | | // .setUserID("tag123")//tag_id |
| | | .setMediaExtra("media_extra") //附加参数 |
| | | .setOrientation(TTAdConstant.VERTICAL) //必填参数,期望视频的播放方向:TTAdConstant.HORIZONTAL 或 TTAdConstant.VERTICAL |
| | | .build(); |
| | | |
| | | mTTAdNative.loadRewardVideoAd(adSlot, new TTAdNative.RewardVideoAdListener() { |
| | | //请求广告失败 |
| | | @Override |
| | | public void onError(int code, String message) { |
| | | result.put("code", 1); |
| | | result.put("msg", message); |
| | | handler.complete(result); |
| | | } |
| | | |
| | | //视频广告加载后,视频资源缓存到本地的回调,在此回调后,播放本地视频,流畅不阻塞。 |
| | | @Override |
| | | public void onRewardVideoCached() { |
| | | //开发者做一个标识 |
| | | if (mttRewardVideoAd != null) { |
| | | mttRewardVideoAd.showRewardVideoAd(mContext, TTAdConstant.RitScenes.CUSTOMIZE_SCENES, "scenes_test"); |
| | | mttRewardVideoAd = null; |
| | | } |
| | | } |
| | | |
| | | //视频广告的素材加载完毕,比如视频url等,在此回调后,可以播放在线视频,网络不好可能出现加载缓冲,影响体验。 |
| | | @Override |
| | | public void onRewardVideoAdLoad(TTRewardVideoAd ad) { |
| | | //开发者做一个标识 |
| | | mttRewardVideoAd = ad; |
| | | mttRewardVideoAd.setRewardAdInteractionListener(new TTRewardVideoAd.RewardAdInteractionListener() { |
| | | @Override |
| | | public void onAdShow() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdVideoBarClick() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onAdClose() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoComplete() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onVideoError() { |
| | | result.put("code", 2); |
| | | result.put("msg", "视频出错"); |
| | | handler.complete(result); |
| | | } |
| | | |
| | | @Override |
| | | public void onRewardVerify(boolean b, int i, String s, int i1, String s1) { |
| | | result.put("code", 0); |
| | | result.put("msg", "广告展示完成"); |
| | | handler.complete(result); |
| | | } |
| | | |
| | | @Override |
| | | public void onSkippedVideo() { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | @JavascriptInterface |
| | | public void toastAwardSuccess(final Object msg) { |
| | | |
| | | webview.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | View view = LayoutInflater.from(mContext).inflate(R.layout.item_reward_ad_success, null); |
| | | TextView tv_content = view.findViewById(R.id.tv_content); |
| | | tv_content.setText(msg + ""); |
| | | ToastUtil.showToast(view, view.getContext(), Toast.LENGTH_SHORT, Gravity.CENTER); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | @JavascriptInterface |
| | | public void toastAwardFail(final Object msg) { |
| | | webview.post(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | View view = LayoutInflater.from(mContext).inflate(R.layout.item_reward_ad_fail, null); |
| | | LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(DimenUtils.getScreenWidth(mContext)*4/5,LinearLayout.LayoutParams.WRAP_CONTENT); |
| | | view.setLayoutParams(params); |
| | | TextView tv_content = view.findViewById(R.id.tv_content); |
| | | tv_content.setText(msg + ""); |
| | | ToastUtil.showToast(view, view.getContext(), Toast.LENGTH_SHORT, Gravity.CENTER); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | int type; |
| | | String imgurl; |
| | | Handler handler = new Handler() { |
New file |
| | |
| | | package com.tejia.lijin.app.util.web; |
| | | |
| | | import android.app.AlertDialog; |
| | | import android.content.Context; |
| | | import android.content.DialogInterface; |
| | | import android.content.Intent; |
| | | import android.net.Uri; |
| | | import android.util.Base64; |
| | | import android.widget.Toast; |
| | | |
| | | import com.tejia.lijin.app.ui.invite.ShareBrowserActivity; |
| | | import com.tejia.lijin.app.util.ApkUtil; |
| | | import com.tejia.lijin.app.util.Tools; |
| | | import com.tejia.lijin.app.util.clipboard.ClipboardUtil; |
| | | |
| | | public class WebViewUtil { |
| | | |
| | | public static Boolean interceptUrl(final Context context, String url) { |
| | | |
| | | if (url != null && url.startsWith("yestv://copy")) { |
| | | String murl = url.split("yestv://")[1]; |
| | | String[] params = murl.split("#"); |
| | | byte raw[] = Base64.decode(params[1], Base64.DEFAULT); |
| | | |
| | | ClipboardUtil.copy(context, new String(raw)); |
| | | Toast.makeText(context, "复制成功", |
| | | Toast.LENGTH_SHORT).show(); |
| | | return true; |
| | | } else if (url != null && url.startsWith("yestv://toast")) { |
| | | String murl = url.split("yestv://")[1]; |
| | | String[] params = murl.split("#"); |
| | | byte raw[] = Base64.decode(params[1], Base64.DEFAULT); |
| | | String content = new String(raw); |
| | | Toast.makeText(context, content, Toast.LENGTH_LONG).show(); |
| | | return true; |
| | | } |
| | | if (url != null && !url.startsWith("http")) { |
| | | if (url.startsWith("weixin://wap/pay?")) { |
| | | if (Tools.isWeixinAvilible(context) == 2) { |
| | | Toast.makeText(context, |
| | | "尚未安装微信", Toast.LENGTH_LONG).show(); |
| | | return true; |
| | | } |
| | | Intent intent = new Intent(); |
| | | intent.setAction(Intent.ACTION_VIEW); |
| | | intent.setData(Uri.parse(url)); |
| | | context.startActivity(intent); |
| | | } else if (url.startsWith("alipays:") || url.startsWith("alipay")) { |
| | | try { |
| | | context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url))); |
| | | } catch (Exception e) { |
| | | new AlertDialog.Builder(context) |
| | | .setMessage("未检测到支付宝客户端,请安装后重试。") |
| | | .setPositiveButton("立即安装", new DialogInterface.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | Uri alipayUrl = Uri.parse("https://d.alipay.com"); |
| | | context.startActivity(new Intent("android.intent.action.VIEW", alipayUrl)); |
| | | } |
| | | }).setNegativeButton("取消", null).show(); |
| | | } |
| | | } else if (url.startsWith("pinduoduo://")) {//拦截拼多多页面 |
| | | if (ApkUtil.checkAPP(context, "com.xunmeng.pinduoduo")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | context.startActivity(intent); |
| | | return true; |
| | | } else { |
| | | return true; |
| | | } |
| | | } else if (url.startsWith("suning://")) {//苏宁 |
| | | if (ApkUtil.checkAPP(context, "com.suning.mobile.ebuy")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | context.startActivity(intent); |
| | | return true; |
| | | } else |
| | | return true; |
| | | } else if (url.startsWith("vipshop://")) {//唯品会 |
| | | if (ApkUtil.checkAPP(context, "com.achievo.vipshop")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| | | context.startActivity(intent); |
| | | return true; |
| | | } else |
| | | return true; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | if (url.endsWith(".apk")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW); |
| | | intent.addCategory(Intent.CATEGORY_BROWSABLE); |
| | | intent.setData(Uri.parse(url)); |
| | | context.startActivity(intent); |
| | | return true; |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <corners |
| | | android:bottomLeftRadius="15dp" |
| | | android:bottomRightRadius="15dp" /> |
| | | <solid android:color="#ffffffff" /> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | |
| | | <gradient |
| | | android:angle="135" |
| | | android:centerColor="#fff6f6f6" |
| | | android:endColor="#ffffd1d8" |
| | | android:startColor="#ffc3f3ff" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | |
| | | <corners android:radius="30dp" /> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <corners |
| | | android:topLeftRadius="15dp" |
| | | android:topRightRadius="15dp" /> |
| | | <solid android:color="#ffffffff" /> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | |
| | | <gradient |
| | | android:angle="180" |
| | | android:endColor="#ffff246b" |
| | | android:startColor="#ffff284a" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | <corners |
| | | android:topLeftRadius="15dp" |
| | | android:topRightRadius="15dp" /> |
| | | |
| | | |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="#fffffadd" /> |
| | | <gradient |
| | | android:angle="180" |
| | | android:endColor="#ffffeb7d" |
| | | android:startColor="#ffffffff" |
| | | android:startColor="#0fffffff" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | <corners android:radius="16dp" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="#FFEEF1" /> |
| | | <gradient |
| | | android:angle="180" |
| | | android:endColor="#BFFF8C" |
| | | android:startColor="#ffffffff" |
| | | android:startColor="#0fffffff" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | <corners android:radius="16dp" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="#FFEEF1" /> |
| | | <gradient |
| | | android:angle="180" |
| | | android:endColor="#FFD0D7" |
| | | android:startColor="#ffffffff" |
| | | android:startColor="#0fffffff" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | <corners android:radius="16dp" /> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <solid android:color="@color/white" /> |
| | | <corners |
| | | android:bottomLeftRadius="16dp" |
| | | android:bottomRightRadius="16dp" |
| | | android:topLeftRadius="16dp" |
| | | android:topRightRadius="16dp" /> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners |
| | | android:bottomLeftRadius="15dp" |
| | | android:bottomRightRadius="15dp" |
| | | android:topLeftRadius="15dp" |
| | | android:topRightRadius="15dp" /> |
| | | <padding |
| | | android:bottom="10dp" |
| | | android:top="10dp"></padding> |
| | | <gradient |
| | | android:angle="180" |
| | | android:endColor="#e0ff227b" |
| | | android:startColor="#e07652ff" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners |
| | | android:bottomLeftRadius="15dp" |
| | | android:bottomRightRadius="15dp" |
| | | android:topLeftRadius="15dp" |
| | | android:topRightRadius="15dp" /> |
| | | <padding |
| | | android:bottom="10dp" |
| | | android:top="10dp"></padding> |
| | | <gradient |
| | | android:angle="180" |
| | | android:endColor="#e0ff227b" |
| | | android:startColor="#e0ff2a3e" |
| | | android:type="linear" |
| | | android:useLevel="true" /> |
| | | </shape> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | |
| | | <solid android:color="#F7F7F7" /> |
| | | <solid android:color="#EAEAEA" /> |
| | | <corners android:topLeftRadius="5dp" android:topRightRadius="5dp" android:bottomLeftRadius="5dp" android:bottomRightRadius="5dp" /> |
| | | |
| | | </shape> |
| | |
| | | |
| | | <include layout="@layout/item_status_bar" /> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical" |
| | | android:visibility="gone"> |
| | | android:visibility="visible"> |
| | | |
| | | |
| | | <FrameLayout |
| | |
| | | <LinearLayout |
| | | android:id="@+id/ll_labels" |
| | | android:layout_width="0dp" |
| | | android:orientation="horizontal" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="left|center_vertical" |
| | | android:layout_weight="1"> |
| | | android:layout_weight="1" |
| | | android:orientation="horizontal"> |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="right|center_vertical" |
| | | android:text="月销 8569" |
| | | android:text="" |
| | | android:textColor="#ff888888" |
| | | android:textSize="13sp" /> |
| | | |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:text="春装2021年新款女中袖上衣v领洋气半袖针织衫不规则百搭打底毛衣" |
| | | android:text="" |
| | | android:textColor="#ff000000" |
| | | android:textSize="16sp" /> |
| | | |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="11dp" |
| | | android:text="重庆市·江北区" |
| | | android:text="" |
| | | android:textColor="#ff000000" |
| | | android:textSize="13sp" /> |
| | | |
| | |
| | | android:id="@+id/webView" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | <View |
| | | android:id="@+id/view_goods_imgs_tag" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/transparent" |
| | | android:visibility="visible" /> |
| | | |
| | | <FrameLayout |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:text="12" |
| | | android:text="" |
| | | android:textColor="@color/white" |
| | | android:textSize="12sp" /> |
| | | </LinearLayout> |
| | |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="center" |
| | | android:text="12.00" |
| | | android:text="" |
| | | android:textColor="@color/white" |
| | | android:textSize="12sp" /> |
| | | |
| | |
| | | app:indicatorName="BallPulseIndicator" /> |
| | | </FrameLayout> |
| | | |
| | | |
| | | </FrameLayout> |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_top" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_dialog_goods_detail_jump_loading_top" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_notify" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="30dp" |
| | | android:layout_marginLeft="15dp" |
| | | android:layout_marginTop="12dp" |
| | | android:layout_marginRight="15dp" |
| | | android:layout_marginBottom="12dp" |
| | | android:background="@drawable/shape_dialog_goods_detail_jump_loading_notify" |
| | | android:gravity="center"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_notify" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginRight="9dp" |
| | | android:text="铂金会员免广告,礼金提高100%" |
| | | android:textColor="#fffe4f68" |
| | | android:textSize="13sp" /> |
| | | |
| | | <ImageView |
| | | android:layout_width="5dp" |
| | | android:layout_height="9dp" |
| | | android:src="@drawable/icon_dialog_goods_detail_jump_input"></ImageView> |
| | | </LinearLayout> |
| | | |
| | | |
| | | <com.wpc.library.widget.RatioLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:ratio="0.5457"> |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_ad" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"> |
| | | |
| | | <FrameLayout |
| | | android:id="@+id/fl_ad_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent"></FrameLayout> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_skip" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="right|top" |
| | | android:layout_marginTop="7dp" |
| | | android:layout_marginRight="11dp" |
| | | android:background="@drawable/background_circle" |
| | | android:paddingLeft="10dp" |
| | | android:paddingTop="2dp" |
| | | android:paddingRight="10dp" |
| | | android:paddingBottom="2dp" |
| | | android:text="跳过" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="12sp" |
| | | android:visibility="gone" /> |
| | | </FrameLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_loading" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <com.wang.avi.AVLoadingIndicatorView |
| | | android:layout_width="60dp" |
| | | android:layout_height="60dp" |
| | | app:indicatorName="BallClipRotatePulseIndicator" /> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp" |
| | | android:text="省钱不用等,立减更省心" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="15sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </com.wpc.library.widget.RatioLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_dialog_goods_detail_jump_loading_bottom" |
| | | android:gravity="center_horizontal|center_vertical" |
| | | android:padding="15dp"> |
| | | |
| | | <ImageView |
| | | android:layout_width="50dp" |
| | | android:layout_height="50dp" |
| | | android:layout_marginLeft="23dp" |
| | | android:src="@drawable/icon_goods_detail_jump_loading_logo"> |
| | | |
| | | </ImageView> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"></ImageView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_time" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:text="5秒后自动跳转" |
| | | android:textColor="#fffa2446" |
| | | android:textSize="13sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_source_type" |
| | | android:layout_width="50dp" |
| | | android:layout_height="50dp" |
| | | android:layout_marginRight="23dp" |
| | | android:src="@drawable/icon_goods_detail_jump_loading_jd"></ImageView> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_top" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="58dp" |
| | | android:background="@drawable/shape_dialog_goods_detail_jump_loading_top_common" |
| | | android:gravity="center" |
| | | android:orientation="vertical"> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="温馨提示" |
| | | android:textColor="#ffffff" |
| | | android:textSize="18sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_dialog_goods_detail_jump_loading_bottom" |
| | | android:gravity="center_horizontal" |
| | | android:orientation="vertical" |
| | | android:padding="22dp"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@drawable/icon_goods_detail_notify"></ImageView> |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:gravity="center" |
| | | android:text="你今天的立减机会\n已经用光!" |
| | | android:textColor="#fff73547" |
| | | android:textSize="16sp" /> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="16dp" |
| | | android:text="1.确认购买后创建2.看广告增加创建次数" |
| | | android:textColor="#ff666666" |
| | | android:textSize="12sp" /> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp" |
| | | android:gravity="center"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_create" |
| | | android:layout_width="0dp" |
| | | android:layout_height="36dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:text="仍要创建" |
| | | android:textColor="#fff53245" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_fanli" |
| | | android:layout_width="0dp" |
| | | android:layout_height="36dp" |
| | | android:layout_marginLeft="8dp" |
| | | android:layout_weight="1" |
| | | android:gravity="center" |
| | | android:text="去返利" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | |
| | | android:layout_height="wrap_content" |
| | | android:ellipsize="end" |
| | | android:maxLines="2" |
| | | android:lineSpacingMultiplier="1.1" |
| | | android:text="牛仔外套女ins潮春秋装韩版宽松百搭春季2019新款123123牛仔外套女ins潮春秋装韩版宽松百搭春季2019新款123123" |
| | | android:textColor="#ff333333" |
| | | android:textSize="15sp" /> |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:ellipsize="end" |
| | | android:lineSpacingMultiplier="1.1" |
| | | android:maxLines="2" |
| | | android:text="牛仔外套女ins潮春秋装韩版宽松百搭春季2019新款123123牛仔外套女ins潮春秋装韩版宽松百搭春季2019新款123123" |
| | | android:textColor="#ff333333" |
| | | android:textSize="12sp" /> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_labels" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="2dp" |
| | | android:orientation="horizontal" |
| | | android:visibility="gone"></LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="70dp" |
| | | android:orientation="vertical"> |
| | | |
| | | <View |
| | | android:layout_width="1dp" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"></View> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:text="-¥10" |
| | | android:textColor="#ffff2b4b" |
| | | android:textSize="12sp" |
| | | android:visibility="visible" /> |
| | | android:visibility="gone" /> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | |
| | | android:layout_weight="1"></View> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_sale_num" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="月销 8968" |
| | | android:textColor="#ffaaaaaa" |
| | | android:textSize="12sp" |
| | | android:visibility="visible" /> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_labels" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="2dp" |
| | | android:orientation="horizontal" |
| | | android:visibility="gone"></LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:textColor="#ffffac00" |
| | | android:textSize="12sp"></TextView> |
| | | |
| | | <View |
| | | android:layout_width="0dp" |
| | | android:layout_height="1dp" |
| | | android:layout_weight="1"></View> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_price" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="¥128.9" |
| | | android:textColor="#ffa1a0a0" |
| | | android:textSize="12sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | |
| | | android:textSize="12sp" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | |
| | | android:orientation="vertical" |
| | | android:padding="0dp"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_sale_num" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="月销 8968" |
| | | android:textColor="#ffaaaaaa" |
| | | android:textSize="12sp" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_price" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="2dp" |
| | | android:text="¥128.9" |
| | | android:textColor="#ffa1a0a0" |
| | | android:textSize="12sp" /> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_reward_ad_fail_bg" |
| | | android:gravity="center_horizontal" |
| | | android:orientation="vertical"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@drawable/icon_reward_ad_fail"></ImageView> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:text="很抱歉!" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="18sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_content" |
| | | android:layout_width="233dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="18dp" |
| | | android:layout_marginBottom="12dp" |
| | | android:gravity="center" |
| | | android:text="激励视频没看完\n |
| | | 未获得铂金会员权益" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@drawable/shape_reward_ad_success_bg" |
| | | android:gravity="center_horizontal" |
| | | android:orientation="vertical"> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:drawableLeft="@drawable/icon_reward_ad_success_happy_left" |
| | | android:drawableRight="@drawable/icon_reward_ad_success_happy_right" |
| | | android:drawablePadding="10dp" |
| | | android:gravity="bottom" |
| | | android:text=" 恭喜你!" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="18sp" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_content" |
| | | android:layout_width="233dp" |
| | | android:gravity="center" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginBottom="10dp" |
| | | android:text="成功获得1天铂金会员权益" |
| | | android:textColor="#ffffffff" |
| | | android:textSize="15sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | |
| | | android:paddingRight="15dp" |
| | | android:paddingBottom="15dp"> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:id="@+id/ll_user" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="10dp" |
| | | android:orientation="vertical"> |
| | | <!--用户信息区域 --> |
| | | |
| | |
| | | android:paddingLeft="3dp" |
| | | android:paddingTop="1dp" |
| | | android:paddingRight="5.5dp" |
| | | android:paddingBottom="1dp"> |
| | | android:paddingBottom="1dp" |
| | | android:visibility="gone"> |
| | | |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | |
| | | android:textSize="15sp"></TextView> |
| | | </LinearLayout> |
| | | |
| | | </FrameLayout> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"></View> |
| | | |
| | | <!--分享信息区域 --> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_publish_time" |
| | | android:layout_width="wrap_content" |
| | |
| | | android:text="3天前" |
| | | android:textColor="#999999" |
| | | android:textSize="12sp"></TextView> |
| | | |
| | | </FrameLayout> |
| | | |
| | | |
| | | <!--分享信息区域 --> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="center_vertical"> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_labels" |
| | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="20dp"> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_content" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="10dp" |
| | | android:layout_marginLeft="50dp" |
| | | android:layout_weight="1" |
| | | android:orientation="vertical"> |
| | | |
| | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="5dp" |
| | | android:layout_marginTop="0dp" |
| | | android:layout_marginBottom="10dp" |
| | | android:gravity="right" |
| | | android:orientation="vertical" |
| | |
| | | android:maxLines="6" |
| | | android:text="1231313221112123213" |
| | | android:textColor="#000000" |
| | | android:textSize="16sp"></TextView> |
| | | android:textSize="15sp"></TextView> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | </FrameLayout> |
| | | <!--操作面板 --> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="10dp" |
| | | android:gravity="center"> |
| | | android:gravity="center" |
| | | android:visibility="gone"> |
| | | |
| | | |
| | | <LinearLayout |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:background="@drawable/shape_send_circle_recommend_bg" |
| | | android:padding="5dp"> |
| | | |
| | | <TextView |
| | |
| | | android:ellipsize="end" |
| | | android:maxLines="6" |
| | | android:text="12321223" |
| | | android:textColor="#000000" |
| | | android:textSize="14sp"></TextView> |
| | | android:textColor="#333333" |
| | | android:textSize="13sp"></TextView> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | |
| | | android:orientation="vertical" |
| | | android:padding="5dp"> |
| | | |
| | | <FrameLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="94dp"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_height="match_parent" |
| | | android:orientation="vertical"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="-6sp"> |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_shop_type" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="15.5dp" |
| | | android:layout_marginTop="7sp"></ImageView> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:gravity="bottom"> |
| | | android:gravity="center_vertical"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_price" |
| | | android:layout_width="wrap_content" |
| | | android:id="@+id/tv_name" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="5dp" |
| | | android:text="28.9" |
| | | android:textColor="@color/theme" |
| | | android:textSize="13sp" |
| | | android:textStyle="bold"></TextView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_zkprice" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="9.5dp" |
| | | android:text="¥78.9" |
| | | android:textColor="#ffaaaaaa" |
| | | android:textSize="12sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_sales_num" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="9.5dp" |
| | | android:text="月销 8968" |
| | | android:textColor="#ffaaaaaa" |
| | | android:textSize="12sp" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="5dp"> |
| | | |
| | | <include layout="@layout/item_coupon_common"></include> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_favourable" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="20dp" |
| | | android:layout_gravity="center_vertical" |
| | | android:background="@drawable/shape_goods_list_price_fan" |
| | | android:layout_weight="1" |
| | | android:ellipsize="end" |
| | | android:gravity="center_vertical" |
| | | android:lines="1" |
| | | android:paddingLeft="1dp" |
| | | android:paddingRight="9dp" |
| | | android:text="分享奖金 ¥99.9" |
| | | android:textColor="@color/white" |
| | | android:textSize="12sp" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | </LinearLayout> |
| | | |
| | | android:maxLines="2" |
| | | android:lineSpacingMultiplier="1.2" |
| | | android:text="牛仔外套女ins潮春秋装韩版宽松百搭春季2019新款123123牛仔外套女ins潮春秋装韩版宽松百搭春季2019新款123123" |
| | | android:textColor="#666666" |
| | | android:textSize="13sp" /> |
| | | |
| | | <ImageView |
| | | android:layout_width="24dp" |
| | | android:layout_height="24dp" |
| | | android:layout_gravity="right|center_vertical" |
| | | android:layout_marginLeft="10dp" |
| | | android:layout_marginRight="5dp" |
| | | android:src="@drawable/icon_send_circle_in"></ImageView> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="8dp" |
| | | android:gravity="center_vertical" |
| | | android:visibility="gone"> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_shop_name" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_weight="1" |
| | | android:drawableLeft="@drawable/ic_item_goods_shop" |
| | | android:drawablePadding="5dp" |
| | | android:ellipsize="end" |
| | | android:gravity="center_vertical" |
| | | android:lines="1" |
| | | android:text="三只松鼠官方旗舰店" |
| | | android:textColor="#ffa1a0a0" |
| | | android:textSize="12sp" |
| | | android:visibility="gone" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll_labels" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="2dp" |
| | | android:orientation="horizontal" |
| | | android:visibility="gone"></LinearLayout> |
| | | |
| | | <View |
| | | android:layout_width="1dp" |
| | | android:layout_height="0dp" |
| | | android:layout_weight="1"> |
| | | |
| | | </View> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_coupon_amount" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="5dp" |
| | | android:background="@drawable/shape_item_goods_coupon_bg" |
| | | android:drawableLeft="@drawable/icon_item_goods_coupon" |
| | | android:drawablePadding="3dp" |
| | | android:gravity="center_vertical" |
| | | android:text="-¥100" |
| | | android:textColor="#ffffac00" |
| | | android:textSize="12sp"></TextView> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_fanli_amount" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="5dp" |
| | | android:background="@drawable/shape_item_goods_fanli_bg" |
| | | android:drawableLeft="@drawable/icon_item_goods_fanli" |
| | | android:drawablePadding="3dp" |
| | | android:text="-¥10" |
| | | android:textColor="#ff55be00" |
| | | android:textSize="12sp" |
| | | android:visibility="visible" /> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_hongbao_amount" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="5dp" |
| | | android:background="@drawable/shape_item_goods_hongbao_bg" |
| | | android:drawableLeft="@drawable/icon_item_goods_hongbao" |
| | | android:drawablePadding="3dp" |
| | | android:text="-¥10" |
| | | android:textColor="#ffff2b4b" |
| | | android:textSize="12sp" |
| | | android:visibility="gone" /> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_gravity="right|bottom" |
| | | android:layout_marginBottom="-4dp" |
| | | android:gravity="right|bottom" |
| | | android:orientation="vertical" |
| | | android:padding="0dp"> |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_sale_num" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="5dp" |
| | | android:text="月销 8968" |
| | | android:textColor="#A1A0A0" |
| | | android:textSize="12sp" |
| | | android:visibility="visible" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_price" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginLeft="10dp" |
| | | android:text="¥128.9" |
| | | android:textColor="#A1A0A0" |
| | | android:textSize="12sp" /> |
| | | |
| | | </LinearLayout> |
| | | |
| | | |
| | | <LinearLayout |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_actual_price1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:padding="0dp" |
| | | android:text="¥28" |
| | | android:textColor="#ffff2b4b" |
| | | android:textSize="23sp" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_actual_price2" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:padding="0dp" |
| | | android:text="" |
| | | android:textColor="#ffff2b4b" |
| | | android:textSize="13sp" /> |
| | | </LinearLayout> |
| | | |
| | | |
| | | </LinearLayout> |
| | | |
| | | </FrameLayout> |
| | | |
| | | |
| | | <ImageView |
| | | android:id="@+id/iv_state_invalid" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <paths> |
| | | <!--为了适配所有路径可以设置 path = "." --> |
| | | <external-path name="tt_external_root" path="." /> |
| | | <external-path name="tt_external_download" path="Download" /> |
| | | <external-files-path name="tt_external_files_download" path="Download" /> |
| | | <files-path name="tt_internal_file_download" path="Download" /> |
| | | <cache-path name="tt_internal_cache_download" path="Download" /> |
| | | </paths> |
| | |
| | | |
| | | } |
| | | dependencies { |
| | | classpath 'com.android.tools.build:gradle:3.5.1' |
| | | classpath 'com.android.tools.build:gradle:4.0.1' |
| | | classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'//Added line |
| | | // NOTE: Do not place your application dependencies here; they belong |
| | | // in the individual module build.gradle files |
| | |
| | | // maven { url "https://raw.github.com/bmob/bmob-android-sdk/master" } |
| | | maven { url "https://jitpack.io" } |
| | | google() |
| | | |
| | | |
| | | } |
| | | } |
| | | task clean(type: Delete) { |
| | |
| | | //判断是否是AndroidN以及更高的版本 |
| | | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { |
| | | intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); |
| | | Uri contentUri = FileProvider.getUriForFile(context.getApplicationContext(), BuildConfig.APPLICATION_ID + ".fileprovider", file); |
| | | Uri contentUri = FileProvider.getUriForFile(context.getApplicationContext(), getPackageName() + ".fileprovider", file); |
| | | intent.setDataAndType(contentUri, "application/vnd.android.package-archive"); |
| | | } else { |
| | | Uri uri = Uri.fromFile(file); |
| | |
| | | api files('libs/umeng-sharetool-6.9.6.jar') |
| | | // api files('libs/SocialSDK_sms.jar') |
| | | api files('libs/open_sdk_r5990_lite.jar') |
| | | api files('libs/core-4.3.1-openDefaultRelease.aar') |
| | | provided files('libs/core-4.3.1-openDefaultRelease.aar') |
| | | } |
| | | |
| | | android { |