package com.ym.zxhcsdkaar;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;

import com.ym.zxhcsdk.HcAppliContext;
import com.ym.zxhcsdk.HcDownLoadUtils;
import com.ym.zxhcsdk.HcAdBean;
import com.ym.zxhcsdk.PhoneUtils;
import com.ym.zxhcsdk.ZXHCConstant;
import com.ym.zxhcsdk.ads.RewardVideoPlayerUtils;
import com.ym.zxhcsdk.ads.RewardvideoPortraitADActivity;
import com.ym.zxhcsdk.listener.FeedAdListener;
import com.ym.zxhcsdk.listener.RewardVideoAdLoadListener;
import com.ym.zxhcsdk.listener.SplashAdListener;
import com.ym.zxhcsdk.manager.ZXHCADManager;
import com.ym.zxhcsdk.manager.ZXHCAdViewManager;
import com.ym.zxhcsdk.view.ZXHCFeedAD;
import com.ym.zxhcsdk.view.ZXHCRewardVideoAD;
import com.ym.zxhcsdk.view.ZXHCSplashAD;

public class MainActivity extends Activity {
    ZXHCFeedAD feedAD1;
    ViewGroup vp;
    ZXHCSplashAD zxhcSplashAD;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        ZXHCADManager.getInstance().InitAd(this, "1000127", true);
        //Splash();
//        ZXHCADManager.getInstance().InitAd(this, "1000298", true);
        String url = "http://sspv2test.zhangxinhuichuan.com/ssp/v1/ads?pid=2100154&type=api&ad_type=3&ad_w=480&ad_h=720&app_package=com.popcap.pvz2cthd&app_id=1000127&app_name=com.popcap.pvz2cthd&app_versionid=1005&device_geo_lat=&device_geo_lon=&device_imei=X6GNU17524105082&device_adid=d0cf1c3d5280f16b&device_mac=F0:C8:50:A1:4E:8E&device_width=1920&device_height=1132&device_imsi=460000501365163&device_carrier=&device_network=1&device_os=Android&device_os_version=24&device_density=2.0&device_ppi=2.0&device_ip=183.211.87.156&device_ua=Dalvik%2F2.1.0+%28Linux%3B+U%3B+Android+9%3B+Redmi+Note+8+Pro+MIUI%2FV10.4.9.0.PGGCNXM%29&device_type=0&is_mobile=1&device_model=FLA-AL10&device_brand=HUAWEI";
        String BaseUrl = "http://sspv2test.zhangxinhuichuan.com/ssp/v1/ads";
        vp = findViewById(R.id.test_img_ad);

        new OaidUtils().GetOaid(MainActivity.this, new IOaidListener() {
            @Override
            public void getOaid(String oaid) {
                Log.d("wxw", "oaid" + oaid);
                ZXHCConstant.device_oaid = oaid;
            }
        });
        findViewById(R.id.test_DownLoad).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                feedAD1.destroyFeedAd(vp);
//                String ss = "{\"monitorUrl\":[\"https://mutalisk.vipfengfei.com/i?p=HRkmRge9ayxEdzuEkaW02tnWiTWtG6ZKl5VIdBRFWU7QiDgaw0euZhyUYtYk5emDjyYEzrO3-UtnJFDTUgmXSxeBkP1da-yWJxomOHl-EwijXSYfJ_WvQP_h7jDBH3qlr9J9b11kEklvlFTiKe83vPPQyIAs9SWrvXAO_Dezemmj42Xkoe15G6MOn1pipfg8ykk50RVL8NLD_ONEKt1ReqiY-oonQZg-66y8acqvGeHVk-dQAI9XOOxHdXR--CCw1IREVbw_VJDPZAeOj9xMzF3-p_oT6_iCY3cWhzkqMyhBA0F_y4FBH7zU0bWF2AD_z1fR_wjyC2ZROzGY5Fvd-R4Cc5mofSMG-IxaaajOkKRItWsZCVqk62KJhTehLp1-WOJs51YuShMxw04JDVNNd5RG8-RtNxo7-XQMoeLkd0CHIQuLwMm2I9WGjxziF1ZRLo9YqdVVwBlFMzwSZlQtKThu-8Ukxak2-nDLOPQINYBhfKpTbqnFAYsvWtZm6OjaA7d9TOLdKdmzV1t8HWTDWj_s9fy95dOmCHuGpd2M2WUqwo4qDpY91VP06Gl08-Ai06qRuNa_fjE6rPBsaZZqqJSmBUoF-Q09qjEioygiuIBxWwfMZ7E8_CEwkUNz0gSW3Ws9jLd3FiPr1b0TlPqyTbYa8uFjWKjdel26rNfQsnl2iQGHT4MTXZZnt4cN9w0ACe9epfYgZSxJD08aNsV4-IfKr3kMCCQ_LVy7GY-hT64\",\"https://uat1.8le8le.com/adShow?v=4&amp;b=false&amp;p=14bb935aff56feac3400f51eda3ee2ce&amp;l=0&amp;mp=UlrZvaYzKT6tYBpRbuQleQ&amp;s=800221&amp;r=1003047&amp;req=1562896083275571434&amp;d=568234&amp;rg=eyJkcmlkIjoiIiwiZGVhbElkIjoiIiwiY3JpZHMiOlsiODU0Nzk1MDU5NDI2NjA4NDk4MSJdLCJwZElkIjoiIiwicmVzcG9uc2VJZCI6IjE1NjI4OTYwODMyNzU1NzE0MzQiLCJ0IjoxNjE4ODg3ODYyNTc5LCJpIjoiZmY3NGM2MTAtNjZhMi00NjAyLTgxOTAtM2RmMGUzMDY2ZjZmXzEyNTkiLCJiaWQiOiIyMTYxODg4Nzg2MjQyOTJlZGQzNjY2NGRhNTQwM2M5YTdiMjFmMjdhMzFhMzMzIiwiciI6IjEwMDMwNDciLCJkIjoiNTY4MjM0IiwicmVxIjoiMTU2Mjg5NjA4MzI3NTU3MTQzNCIsInJlc3AiOiIxNTYyODk2MDgzMjc1NTcxNDM0IiwidSI6IjVhYTgzNDBhLTdlNjEtNDU4My04ZmQzLTYxOWFkZDY1MzQ1ZSIsInRyIjoiIiwidG0iOiIiLCJ2dCI6IiIsInR2dCI6IiIsIm9hIjoiNWFhODM0MGEtN2U2MS00NTgzLThmZDMtNjE5YWRkNjUzNDVlIiwiaXMiOjB9\",\"https://o2o-ad-log-gateway.alibaba.com/dsp/show?cost=aqgUjeGPKV5qcre9k-fi4g&amp;bidimpid=216188878624292edd36664da5403c9a7b21f27a31a333&amp;impid=ff74c610-66a2-4602-8190-3df0e3066f6f_1259&amp;snid=216188878624292edd36664da5403c9a7b21f27a31a333&amp;pt=102301015&amp;city=110100&amp;urlToken=96182a21c3aee43df68da0a73172b4227a2efb77&amp;nid=e63f3617df155f2b62ce048bc904014f&lt;=39.93933868408203&amp;sign=2&amp;pid=o2o_109305_100001_100003&amp;ua=&amp;advs=2&amp;svg_template_id=205445&amp;uid=80220620424269138&amp;o2i_code=59c1a380bbd9933dd545c63badd564b0&amp;o2i_business=1&amp;business=1&amp;cpx=cpm&amp;creative_text_id=0&amp;tagLevel=A212&amp;crowdTagInstallApp=41&amp;isVip=false&amp;reqId=1562896083275571434&amp;et=1618887862429&amp;ads=17776BC66EA10A4893268AF951200ECE9B533649A565E6436A632D8E7790413582C35CA4F10794CA31CB8818A71E22F9AA41EDE22A91313A68B0874319AB31C893A77336594E6104BE306ACF2DED39D7C4D2176E28BDF70E279C93EDA095CC049E2C53ACF39E52D840AE4D0C3C84DCB7139FFCC95EC52ECA89E14AC1CB63EF328BB2DAC3F6D0ED2BD5C73635CAAF8F37CA3BE979B3918EB0A51CAAEC0C2664FA365F678546CD76DB9991AFE3E7B4E22EF4DB036AF700C99BC36D1D6DD98C1CEA1C177B3AE9480D4E7693DCC70668B3182F9173558675CD85A35D00884A9BBBC27B38D69D856E155C3163B934A4DD878ABDBE11E2937CE1A470252E3E56ACC33C49622E16F3D29F39B9C6AF961C9332A73837297D12E73E2C676C07DA8D4CC2B877E94D5AF2457C05C1F3A224621275CA&amp;ipid=rgyun%3A1003047&amp;adx=2&amp;template_id=83401&amp;lg=116.43070220947266&amp;innerpt=102301009&amp;bid=5964&amp;ts=1618887862498&amp;\",\"http://api.nebulae.com.cn/ad/monitor?request_id=b37a9fdadc2965f2334d17b9272843d1&amp;event=show&amp;bid=f4ae9b19-1518-4240-a8b7-07aa3655fd9c&amp;app_id=6695299&amp;position=669529902103&amp;os=android&amp;winner=fengfei&amp;ad_type=2&amp;dsp_position=ad&amp;creative_id=0&amp;dsp_position_id=476\"],\"clickUrl\":[\"https://mutalisk.vipfengfei.com/c?p=XTwwrqGhuVnLDJvDSWCA00rdx89DJ05dmQglur44qJuzdxs4jVXB2KIgpniOplBT32CKAqP231BoCKLFH0WM0iIPIeEOpNx_17TM2C00SIQ2EPWDNrxnWdMUtClbs6yPt4efSSzAgPuWsJapIwv7T7fD8N4ibFXGSTnP0w9Z6h9XIRk1Yz79ZnZYdpNv1Qsqrrsupa-DcxvTujUqOCiI5bPqyYfHgMV8kfVa7RgQWmoYIvYhd2fbycymzphechCWqj7RBEjpiDr-TPtXToj60IldU2HpPwX1sqguXAO29GmotwEsnCdPQq9WouqY4cHDcVMNEcGXDsWTnW833DFOhLCpIGJmIQKUspQ9bUSuF4tEw8GM5n0CzC4UfYpIoXFWXXnjQpb9N2tSx9QpiOmHy7a6kYd_h6xVyo-C4ac0XJIxkhJXeyLsej276EjLQoH4m-HKa2AySGrA6QGg_aLEwFZfJFCp_a7Apo2Sj6m-PFiplfUdZ1KWXaBj5ktvevfxn4Plggedk5DZcGRv9-gL-snhQIw6TcajV7avHCoHodqOR4gKwdXecPnVUdGUiSiHZOUT5zLUGB7B2AO6D3hEx0JchvrMnPhHaSFIlwcuFkLk0SdJH-sO-yM0--U0Y33e\",\"https://uat1.8le8le.com/adClick?v=4&amp;b=false&amp;p=&amp;s=800221&amp;r=1003047&amp;req=1562896083275571434&amp;d=568234&amp;rg=eyJkcCI6IjExIiwidFRJZCI6IiIsInRTSWQiOiIiLCJkcmlkIjoiIiwiZGVhbElkIjoiIiwiY3JpZHMiOlsiODU0Nzk1MDU5NDI2NjA4NDk4MSJdLCJ0IjoxNjE4ODg3ODYyNTc5LCJzdCI6IjkwMDAwMCIsInJlcSI6IjE1NjI4OTYwODMyNzU1NzE0MzQiLCJyZXNwIjoiMTU2Mjg5NjA4MzI3NTU3MTQzNCIsImkiOiJmZjc0YzYxMC02NmEyLTQ2MDItODE5MC0zZGYwZTMwNjZmNmZfMTI1OSIsInIiOiIxMDAzMDQ3IiwianQiOjMsInR5IjoiMCIsImQiOiI1NjgyMzQiLCJ1IjoiNWFhODM0MGEtN2U2MS00NTgzLThmZDMtNjE5YWRkNjUzNDVlIiwicyI6IiIsInZ0IjoiIiwidHZ0IjoiIiwib2EiOiI1YWE4MzQwYS03ZTYxLTQ1ODMtOGZkMy02MTlhZGQ2NTM0NWUiLCJpcyI6MCwicGlkIjoiIn0\",\"https://o2o-ad-log-gateway.alibaba.com/dsp/click?snid=216188878624292edd36664da5403c9a7b21f27a31a333&amp;pt=102301015&amp;city=110100&amp;urlToken=96182a21c3aee43df68da0a73172b4227a2efb77&amp;nid=e63f3617df155f2b62ce048bc904014f&lt;=39.93933868408203&amp;sign=2&amp;pid=o2o_109305_100001_100003&amp;ua=&amp;advs=2&amp;svg_template_id=205445&amp;uid=80220620424269138&amp;o2i_code=59c1a380bbd9933dd545c63badd564b0&amp;o2i_business=1&amp;business=1&amp;cpx=cpm&amp;creative_text_id=0&amp;tagLevel=A212&amp;crowdTagInstallApp=41&amp;isVip=false&amp;reqId=1562896083275571434&amp;et=1618887862429&amp;ads=17776BC66EA10A4893268AF951200ECE9B533649A565E6436A632D8E7790413582C35CA4F10794CA31CB8818A71E22F9AA41EDE22A91313A68B0874319AB31C893A77336594E6104BE306ACF2DED39D7C4D2176E28BDF70E279C93EDA095CC049E2C53ACF39E52D840AE4D0C3C84DCB7139FFCC95EC52ECA89E14AC1CB63EF328BB2DAC3F6D0ED2BD5C73635CAAF8F37CA3BE979B3918EB0A51CAAEC0C2664FA365F678546CD76DB9991AFE3E7B4E22EF4DB036AF700C99BC36D1D6DD98C1CEA1C177B3AE9480D4E7693DCC70668B3182F9173558675CD85A35D00884A9BBBC27B38D69D856E155C3163B934A4DD878ABDBE11E2937CE1A470252E3E56ACC33C49622E16F3D29F39B9C6AF961C9332A73837297D12E73E2C676C07DA8D4CC2B877E94D5AF2457C05C1F3A224621275CA&amp;ipid=rgyun%3A1003047&amp;adx=2&amp;template_id=83401&amp;lg=116.43070220947266&amp;innerpt=102301009&amp;bid=5964&amp;ts=1618887862498&amp;\",\"https://mutalisk.vipfengfei.com/tr?p=h11XqAeWR6CLLBbgQ_9LjGEP9NIISh8y9FdErTTh20CDAnPXaXCCfl--xAHlLewHygNvLsYsgsq2AbRAqhSA7vcRHsEFgWbQE7Inl1YBgEYpubFG0knFC8YpdI8nkOJkF6woyLb68Sk2NUButNqjbhlUTYD2YM96uI_5QozRaxi5sdp1Os9UBiTct2S-WF3z2y36_JCLoxTCtYk7SgNhMg8GK14iGCKVjCJ0MKSYp__00Wbylvr28Rqyc3-dW34aUtxNCBCuA3edjfesHF3-YC-KhbiSkpDOlDJwpO6H81_QVN7EeMdReP3KZI5ZCKfr7spxaGjMY5zJFkdIi9tgANVaQpZOHJG2nR3wwf4X3g7KtqY7yb3ju2mjd02T8-DBQ0KBbDJB4tHhzh_uWyFoLjyGWblxbDlt_oKruOg4oZJ0SMlB5x56IS1-WA1FCRBkCMmflKpl5oP43jBZkEMGe-vu36ppOBqkdtLUecKuYrY8rMTRe1hhaDRzwJ-O3LlQM_VXo0MZbe_qaOfzTRkS2zrOulrFOAMJo5MArQuiytGwyZZbTF_5_DfDUKO5pRRJsNIXz7LyJhkuVA9gYohqWUEnaUtS9ZhXrGdXnFW28GTLb4KWF0yjsEMEkK2KwVKgHE4GtqAqiqEjU1mRNqGR0NDF5WwI1xL5c9w_LHeEuVwsOs96QUTlZUne2QGwzvAA&amp;t_code=1\",\"http://api.nebulae.com.cn/ad/monitor?request_id=b37a9fdadc2965f2334d17b9272843d1&amp;event=click&amp;bid=f4ae9b19-1518-4240-a8b7-07aa3655fd9c&amp;app_id=6695299&amp;position=669529902103&amp;os=android&amp;ad_type=2&amp;winner=fengfei&amp;dsp_position=ad&amp;creative_id=0&amp;dsp_position_id=476&amp;down_x=__DOWN_X__&amp;down_y=__DOWN_Y__&amp;up_x=__UP_X__&amp;up_y=__UP_Y__&amp;ts=__UTC_TS__\"],\"srcUrls\":[\"http://ilce.alicdn.com/montage/205445-719542fbbdc6592e18defbf8c4b4f423.jpg?channel=72&amp;content=%7B%2266%22%3A%7B%22attrs%22%3A%7B%22value%22%3A%2210%22%7D%7D%2C%2214%22%3A%7B%22attrs%22%3A%7B%22value%22%3A%22https%3A%2F%2Fcube.elemecdn.com%2Fb%2Fe1%2Fe2f582dfa0420ef2475a3cb665c43jpeg.jpeg%3FimageMogr2%2Fformat%2Fjpeg%22%7D%7D%2C%2216%22%3A%7B%22attrs%22%3A%7B%22value%22%3A%22%E6%B4%BB%E5%8A%A8%E5%86%85%E5%AE%B9%2F%E5%95%86%E5%93%81%E4%BB%A5%E6%B4%BB%E5%8A%A8%E9%A1%B5%E9%9D%A2%E5%8F%8A%E5%BA%97%E9%93%BA%E6%98%BE%E7%A4%BA%E4%B8%BA%E5%87%86%E3%80%82%22%7D%7D%2C%226%22%3A%7B%22attrs%22%3A%7B%22value%22%3A%22%E9%87%91%E6%8E%8C%E5%8B%BA%28%E6%82%A0%E5%94%90%E5%B9%BF%E5%9C%BA%E5%BA%97%29%22%7D%7D%2C%2218%22%3A%7B%22attrs%22%3A%7B%22value%22%3A%22%E6%9C%80%E9%AB%98%E9%A2%86%E5%8F%96%22%7D%7D%2C%2270%22%3A%7B%22attrs%22%3A%7B%22value%22%3A%22%E5%85%83%22%7D%7D%2C%2272%22%3A%7B%22attrs%22%3A%7B%22value%22%3A%22%E4%B8%8A%E9%A5%BF%E4%BA%86%E4%B9%88%E9%A2%86%E7%BA%A2%E5%8C%85%22%7D%7D%7D\"],\"dUrl\":[\"https://uat1.8le8le.com/dplClick?v=1&amp;b=false&amp;p=&amp;g=https%3A%2F%2Ffc.ele.me%2Fa%2FODE0NDg2MWI0YjFjMTFlYjlhM2QwMjQyMGI1OWUxMjQ%3D%3Fo2i_dsp_channel%3D2%26shop_id%3D9288BE3821DB05F3F2372A6781EC94E3%26one_id%3D80220620424269138%26business%3D1%26item_id%3D7183A28F68F611E917531A5D786AF5E7668863F4C74A3779%26o2i_code%3D59c1a380bbd9933dd545c63badd564b0%26latitude%3D39.93933868408203%26o2i_snid%3D216188878624292edd36664da5403c9a7b21f27a31a333%26o2i_deviceid%3De63f3617df155f2b62ce048bc904014f%26isCharge%3D0%26city_id%3D110100%26longitude%3D116.43070220947266%26o2i_islp%3D0&amp;s=800221&amp;r=1003047&amp;req=1562896083275571434&amp;d=568234&amp;rg=eyJkcCI6IjExIiwiZHJpZCI6IiIsInQiOjE2MTg4ODc4NjI0MTMsInN0IjoiOTAwMDAwIiwicmVxIjoiMTU2Mjg5NjA4MzI3NTU3MTQzNCIsInJlc3AiOiIxNTYyODk2MDgzMjc1NTcxNDM0IiwiaSI6ImZmNzRjNjEwLTY2YTItNDYwMi04MTkwLTNkZjBlMzA2NmY2Zl8xMjU5IiwiciI6IjEwMDMwNDciLCJqdCI6MywiZCI6IjU2ODIzNCIsInUiOiI1YWE4MzQwYS03ZTYxLTQ1ODMtOGZkMy02MTlhZGQ2NTM0NWUiLCJzIjoiIn0\"],\"pid\":\"1100437\",\"cid\":0,\"plan_id\":0,\"target_type\":\"0\",\"deeplink\":\"eleme://web?action=ali.open.nav&amp;module=h5&amp;packageName=me.ele&amp;bc_fl_src=locallife_wtdsp_59c1a380bbd9933dd545c63badd564b0_2093579_216188878624292edd36664da5403c9a7b21f27a31a333_1&amp;url=https%3A%2F%2Ffc.ele.me%2Fa%2FODE0NDg2MWI0YjFjMTFlYjlhM2QwMjQyMGI1OWUxMjQ%3D%3Fo2i_dsp_channel%3D2%26shop_id%3D9288BE3821DB05F3F2372A6781EC94E3%26one_id%3D80220620424269138%26business%3D1%26item_id%3D7183A28F68F611E917531A5D786AF5E7668863F4C74A3779%26o2i_code%3D59c1a380bbd9933dd545c63badd564b0%26latitude%3D39.93933868408203%26o2i_snid%3D216188878624292edd36664da5403c9a7b21f27a31a333%26o2i_deviceid%3De63f3617df155f2b62ce048bc904014f%26isCharge%3D0%26city_id%3D110100%26longitude%3D116.43070220947266%26o2i_islp%3D1&amp;source=dsp_2&amp;o2i_code=59c1a380bbd9933dd545c63badd564b0&amp;o2i_snid=216188878624292edd36664da5403c9a7b21f27a31a333&amp;fastmode=1\",\"dpSuccmonitorUrls\":[\"https://mutalisk.vipfengfei.com/tr?p=ZGqtW8fhvOmToYn721-DQGEP9NIISh8y9FdErTTh20CDAnPXaXCCfl--xAHlLewHygNvLsYsgsq2AbRAqhSA7vcRHsEFgWbQE7Inl1YBgEYpubFG0knFC8YpdI8nkOJkF6woyLb68Sk2NUButNqjbhlUTYD2YM96uI_5QozRaxi5sdp1Os9UBiTct2S-WF3z2y36_JCLoxTCtYk7SgNhMg8GK14iGCKVjCJ0MKSYp__00Wbylvr28Rqyc3-dW34aUtxNCBCuA3edjfesHF3-YC-KhbiSkpDOlDJwpO6H81_QVN7EeMdReP3KZI5ZCKfr7spxaGjMY5zJFkdIi9tgANVaQpZOHJG2nR3wwf4X3g7KtqY7yb3ju2mjd02T8-DBQ0KBbDJB4tHhzh_uWyFoLjyGWblxbDlt_oKruOg4oZJ0SMlB5x56IS1-WA1FCRBkCMmflKpl5oP43jBZkEMGe-vu36ppOBqkdtLUecKuYrY8rMTRe1hhaDRzwJ-O3LlQM_VXo0MZbe_qaOfzTRkS2zrOulrFOAMJo5MArQuiytGwyZZbTF_5_DfDUKO5pRRJsNIXz7LyJhkuVA9gYohqWUEnaUtS9ZhXrGdXnFW28GTLb4KWF0yjsEMEkK2KwVKgHE4GtqAqiqEjU1mRNqGR0NDF5WwI1xL5c9w_LHeEuVwsOs96QUTlZUne2QGwzvAA&amp;t_code=2\"]}";
//                HcAdBean adBean = PhoneUtils.getInstance().jsonToObj(ss);
//                adBean.setShowReport(false);
//                adBean.setClickReport(false);
//                adBean.setClickDpLinkSucReport(false);
//                adBean.setClickDpLinkfailReport(false);
//                Log.d("wxw",""+ adBean.getDUrl());
//                Intent intent = new  Intent(MainActivity.this, HcWebActivity.class);
//                intent.putExtra("url","https://uat1.8le8le.com/dplClick?v=1&b=false&p=&g=https%3A%2F%2Ffc.ele.me%2Fa%2FODE0NDg2MWI0YjFjMTFlYjlhM2QwMjQyMGI1OWUxMjQ%3D%3Fo2i_dsp_channel%3D2%26shop_id%3D9288BE3821DB05F3F2372A6781EC94E3%26one_id%3D80220620424269138%26business%3D1%26item_id%3D7183A28F68F611E917531A5D786AF5E7668863F4C74A3779%26o2i_code%3D59c1a380bbd9933dd545c63badd564b0%26latitude%3D39.93933868408203%26o2i_snid%3D216188878624292edd36664da5403c9a7b21f27a31a333%26o2i_deviceid%3De63f3617df155f2b62ce048bc904014f%26isCharge%3D0%26city_id%3D110100%26longitude%3D116.43070220947266%26o2i_islp%3D0&s=800221&r=1003047&req=1562896083275571434&d=568234&rg=eyJkcCI6IjExIiwiZHJpZCI6IiIsInQiOjE2MTg4ODc4NjI0MTMsInN0IjoiOTAwMDAwIiwicmVxIjoiMTU2Mjg5NjA4MzI3NTU3MTQzNCIsInJlc3AiOiIxNTYyODk2MDgzMjc1NTcxNDM0IiwiaSI6ImZmNzRjNjEwLTY2YTItNDYwMi04MTkwLTNkZjBlMzA2NmY2Zl8xMjU5IiwiciI6IjEwMDMwNDciLCJqdCI6MywiZCI6IjU2ODIzNCIsInUiOiI1YWE4MzQwYS03ZTYxLTQ1ODMtOGZkMy02MTlhZGQ2NTM0NWUiLCJzIjoiIn0");
////                intent.putExtra("url","https://fc.ele.me/a/ODE0NDg2MWI0YjFjMTFlYjlhM2QwMjQyMGI1OWUxMjQ=?o2i_dsp_channel=2&shop_id=9288BE3821DB05F3F2372A6781EC94E3&one_id=80220620424269138&business=1&item_id=7183A28F68F611E917531A5D786AF5E7668863F4C74A3779&o2i_code=59c1a380bbd9933dd545c63badd564b0&latitude=39.93933868408203&o2i_snid=216188878624292edd36664da5403c9a7b21f27a31a333&o2i_deviceid=e63f3617df155f2b62ce048bc904014f&isCharge=0&city_id=110100&longitude=116.43070220947266&o2i_islp=0");
//                startActivity(intent);

//                String sss = "{\"height\":1080,\"width\":1920,\"monitorUrl\":[\"http://m-x.fastadx.com/report?t=1620717016183\\u0026a=show\",\"http://m-x.fastadx.com/stat/s?t=1620717016183\"],\"clickUrl\":[\"http://m-x.fastadx.com/report?t=1620717016183\\u0026a=click\\u0026ts=__UTC_TS__\\u0026p=__RE_DOWN_X__,__RE_DOWN_Y__,__RE_UP_X__,__RE_UP_Y__\\u0026p2=ABS_CLK_PNT_DOWN_X,ABS_CLK_PNT_DOWN_Y,ABS_CLK_PNT_UP_X,ABS_CLK_PNT_UP_Y\",\"http://m-x.fastadx.com/stat/c?t=1620717016183\"],\"srcUrls\":[\"http://up-app.image.alimmdn.com/gg/test-5-10/kaiping1080x1920-2.png\"],\"dUrl\":[\"https://a.app.qq.com/o/simple.jsp?pkgname=cn.sqyhq.quan\\u0026channel=0002160650432d595942\\u0026fromcase=60001\\u0026p=__RE_DOWN_X__,__RE_DOWN_Y__,__RE_UP_X__,__RE_UP_Y__\\u0026p2=ABS_CLK_PNT_DOWN_X,ABS_CLK_PNT_DOWN_Y,ABS_CLK_PNT_UP_X,ABS_CLK_PNT_UP_Y\"],\"pid\":\"1100437\",\"cid\":0,\"plan_id\":0,\"target_type\":\"0\",\"title\":\"神奇优惠券\",\"content\":\"3秒找淘宝隐藏优惠券 一年省2000元\",\"icon\":\"http://api.mssp.adunite.com/config/mob_adlogo.png\"}";
                String sss = "{\"height\":1280,\"width\":720,\"monitorUrl\":[\"http://m-x.fastadx.com/report?t=1620717001126&a=show\",\"http://m-x.fastadx.com/stat/s?t=1620717001126\"],\"clickUrl\":[\"http://m-x.fastadx.com/report?t=1620717001126&a=click&ts=__UTC_TS__&p=__RE_DOWN_X__,__RE_DOWN_Y__,__RE_UP_X__,__RE_UP_Y__&p2=ABS_CLK_PNT_DOWN_X,ABS_CLK_PNT_DOWN_Y,ABS_CLK_PNT_UP_X,ABS_CLK_PNT_UP_Y\",\"http://m-x.fastadx.com/stat/c?t=1620717001126\"],\"srcUrls\":[\"http://up-app.image.alimmdn.com/gg/quan/first/day1280x720.jpg\"],\"dUrl\":[\"http://m.api.quarticmedia.com/others/MagicCoupon-YinyongbaoRelease-4.6.0_460_jiagu_sign.apk?p=__RE_DOWN_X__,__RE_DOWN_Y__,__RE_UP_X__,__RE_UP_Y__&p2=ABS_CLK_PNT_DOWN_X,ABS_CLK_PNT_DOWN_Y,ABS_CLK_PNT_UP_X,ABS_CLK_PNT_UP_Y\"],\"pid\":\"1100438\",\"cid\":0,\"plan_id\":0,\"target_type\":\"1\",\"package_name\":\"cn.sqyhq.quan\",\"down_url\":\"http://m.api.quarticmedia.com/others/MagicCoupon-YinyongbaoRelease-4.6.0_460_jiagu_sign.apk?p=__RE_DOWN_X__,__RE_DOWN_Y__,__RE_UP_X__,__RE_UP_Y__&p2=ABS_CLK_PNT_DOWN_X,ABS_CLK_PNT_DOWN_Y,ABS_CLK_PNT_UP_X,ABS_CLK_PNT_UP_Y\",\"title\":\"神奇优惠券\",\"content\":\"3秒找淘宝隐藏优惠券 一年省2000元\",\"icon\":\"http://api.mssp.adunite.com/config/mob_adlogo.png\",\"startInstallmonitorUrls\":[\"http://m-x.fastadx.com/report?t=1620717001126&a=installstart&click_id=__CLICK_ID__\"],\"finishInstallmonitorUrls\":[\"http://m-x.fastadx.com/report?t=1620717001126&a=installend&click_id=__CLICK_ID__\"],\"startdownloadmonitorUrls\":[\"http://m-x.fastadx.com/report?t=1620717001126&a=downstart&click_id=__CLICK_ID__\"],\"finishdownloadmonitorUrls\":[\"http://m-x.fastadx.com/report?t=1620717001126&a=downend&click_id=__CLICK_ID__\"],\"activemonitorUrls\":[\"http://m-x.fastadx.com/report?t=1620717001126&a=open\"]}";
                HcAdBean adBean = PhoneUtils.getInstance().jsonToObj(sss);
                adBean.setShowReport(false);
                adBean.setClickReport(false);
                adBean.setClickDpLinkSucReport(false);
                adBean.setClickDpLinkfailReport(false);
                new HcDownLoadUtils(MainActivity.this).downloadAPK(adBean);
                new TDUtils().TD(HcAppliContext.get(), new ITdListener() {
                    @Override
                    public void getTd(String s) {
                        Log.d("wxwTD", "TD " + s);
                    }
                });
            }
        });

        findViewById(R.id.test_Feed).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                feedAD1 = new ZXHCFeedAD(MainActivity.this, "2100154", 1080, 720, new FeedAdListener() {
                    @Override
                    public void OnAdLoaded() {
//                        vp = ZXHCAdViewManager.getInstance().newFrameLayout(MainActivity.this);
                        ZXHCAdViewManager.getInstance().showAdView(MainActivity.this, vp, true);
                        feedAD1.showAd(vp);
                    }

                    @Override
                    public void OnError(String error) {
                        Log.d("wxw", "OnError" + error);
                    }

                    @Override
                    public void OnAdClicked() {
                        Log.d("wxw", "OnAdClicked");
                    }

                    @Override
                    public void OnAdShow() {
                        Log.d("wxw", "OnAdShow");
                    }

                    @Override
                    public void OnAdClosed() {
                        Log.d("wxw", "OnAdClosed");
                    }
                });
                feedAD1.loadAD();
            }
        });
        findViewById(R.id.test_splsh).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Splash();
            }
        });

        findViewById(R.id.RewardAd).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                RewardAd();
            }
        });
        findViewById(R.id.RewardAd_show).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(MainActivity.this, RewardvideoPortraitADActivity.class));
            }
        });

    }

    private void  Splash(){
        //2100154 落地页
        //2100155 下载
        //2100156 跳转链接
        zxhcSplashAD = new ZXHCSplashAD(MainActivity.this, "2100154", new SplashAdListener() {
            @Override
            public void OnAdLoaded() {
                ViewGroup vp = ZXHCAdViewManager.getInstance().newFrameLayout(MainActivity.this);
                ZXHCAdViewManager.getInstance().showAdView(MainActivity.this, vp, false);
                zxhcSplashAD.showAd(vp);
            }

            @Override
            public void OnError(String error) {
                Log.d("wxw", "OnError" + error);
            }

            @Override
            public void OnAdClicked() {
                Log.d("wxw", "OnAdClicked");
            }

            @Override
            public void OnAdShow() {
                Log.d("wxw", "OnAdShow");
            }

            @Override
            public void OnAdClosed() {
                Log.d("wxw", "OnAdClosed");
            }
        }, 3);
        zxhcSplashAD.fetchAdOnly();
    }



    private void RewardAd() {
        ZXHCRewardVideoAD zxhcRewardVideoAD = new ZXHCRewardVideoAD(this,"1100139");
        zxhcRewardVideoAD.loadRewardAD(new RewardVideoAdLoadListener() {
            @Override
            public void OnAdLoaded() {
                RewardVideoPlayerUtils.getInstance().setVideo(zxhcRewardVideoAD);
            }

            @Override
            public void OnLoadError(String error) {

            }
        });
    }
}