Subversion Repositories SmartDukaan

Rev

Rev 18078 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18078 Rev 18503
Line 76... Line 76...
76
 
76
 
77
    public DealsHomeFragment(){
77
    public DealsHomeFragment(){
78
 
78
 
79
    }
79
    }
80
 
80
 
81
    static boolean FLAG=false,REDIRECT=false,PAGE_LOAD=false,PAYTMFLAG=false;
81
    static boolean FLAG=false,REDIRECT=false,PAGE_LOAD=false,PAYTMFLAG=false,isPause=false;
82
    WebView webView;
82
    WebView webView;
83
    WebView amazonWebView,amazonOrderHistoryWebView,amazonOrderHistoryCancelledWebView,paytmWebView;
83
    WebView amazonWebView,amazonOrderHistoryWebView,amazonOrderHistoryCancelledWebView,paytmWebView;
84
    WebView amazonAllUrlsWebView;
84
    WebView amazonAllUrlsWebView;
85
    SharedPreferences userData;
85
    SharedPreferences userData;
86
    SharedPreferences apiData;
86
    SharedPreferences apiData;
Line 192... Line 192...
192
              cookieManager1.setCookie(url, "walletAuthentication=true");
192
              cookieManager1.setCookie(url, "walletAuthentication=true");
193
              cookieManager1.setCookie(url, "shopcluesActive=true");
193
              cookieManager1.setCookie(url, "shopcluesActive=true");
194
              cookieManager1.setCookie(url, "paytmActive=true");
194
              cookieManager1.setCookie(url, "paytmActive=true");
195
              cookieManager1.setCookie(url, "shareApps=true");
195
              cookieManager1.setCookie(url, "shareApps=true");
196
              cookieManager1.setCookie(url, "homeshop18=true");
196
              cookieManager1.setCookie(url, "homeshop18=true");
-
 
197
              cookieManager1.setCookie(url, "isRedirect=true");
197
          }
198
          }
198
          if(!(userData.getBoolean("paytmLoggedIn",false))){
199
          if(!(userData.getBoolean("paytmLoggedIn",false))){
199
             Log.d("User Not Logged In","User Not logged In");
200
             Log.d("User Not Logged In","User Not logged In");
200
          }else {
201
          }else {
201
              if (userData.getString("paytmOrder", "").equalsIgnoreCase("true")) {
202
              if (userData.getString("paytmOrder", "").equalsIgnoreCase("true")) {
Line 280... Line 281...
280
        }
281
        }
281
 
282
 
282
        @Override
283
        @Override
283
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
284
        public boolean shouldOverrideUrlLoading(WebView view, String url) {
284
 
285
 
-
 
286
            if(apiData.getString("isRedirect","false").equalsIgnoreCase("true")){
-
 
287
                List<String> browserRedirectUrl = new ArrayList<>();
-
 
288
                StringTokenizer st = new StringTokenizer(apiData.getString("redirect.urls",""),"|");
-
 
289
                while(st.hasMoreTokens()){
-
 
290
                    browserRedirectUrl.add( st.nextToken());
-
 
291
                }
-
 
292
                for(String s:browserRedirectUrl){
-
 
293
                    if(url.contains(s)){
-
 
294
                        isPause=true;
-
 
295
                        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
-
 
296
                        startActivity(intent);
-
 
297
                        return true;
-
 
298
                    }
-
 
299
                }
285
 
300
            }
286
            if(url.contains("apprub")){
301
            if(url.contains("apprub")){
287
                onShareClick(url);
302
                onShareClick(url);
288
                return true;
303
                return true;
289
            }
304
            }
290
            if(url.contains(apiData.getString("wallet.auth","api.profittill.com/special/native/login")) || userData.getString("id","").isEmpty()){
305
            if(url.contains(apiData.getString("wallet.auth","api.profittill.com/special/native/login")) || userData.getString("id","").isEmpty()){
Line 357... Line 372...
357
                        cookieManager.setCookie(url, "walletAuthentication=true");
372
                        cookieManager.setCookie(url, "walletAuthentication=true");
358
                        cookieManager.setCookie(url, "shopcluesActive=true");
373
                        cookieManager.setCookie(url, "shopcluesActive=true");
359
                        cookieManager.setCookie(url, "paytmActive=true");
374
                        cookieManager.setCookie(url, "paytmActive=true");
360
                        cookieManager.setCookie(url, "shareApps=true");
375
                        cookieManager.setCookie(url, "shareApps=true");
361
                        cookieManager.setCookie(url, "homeshop18=true");
376
                        cookieManager.setCookie(url, "homeshop18=true");
-
 
377
                        cookieManager.setCookie(url, "isRedirect=true");
362
                    }
378
                    }
363
                    if(url.contains("dl.flipkart.com/dl/")){
379
                    if(url.contains("dl.flipkart.com/dl/")){
364
                        flipkartUrl=url;
380
                        flipkartUrl=url;
365
 
381
 
366
                        if(flipkartData.getInt("showagainflag",0)<3) {
382
                        if(flipkartData.getInt("showagainflag",0)<3) {
Line 1997... Line 2013...
1997
                webView.loadUrl("javascript:window.HTMLOUT.showHTML('<head>'+document.getElementsByTagName('html')[0].innerHTML+'</head>');");
2013
                webView.loadUrl("javascript:window.HTMLOUT.showHTML('<head>'+document.getElementsByTagName('html')[0].innerHTML+'</head>');");
1998
            }
2014
            }
1999
        });
2015
        });
2000
 
2016
 
2001
    }
2017
    }
-
 
2018
 
-
 
2019
    @Override
-
 
2020
    public void onPause() {
-
 
2021
        super.onPause();
-
 
2022
        if(webView!=null) {
-
 
2023
            if(isPause) {
-
 
2024
                webView.loadUrl(apiData.getString("mobile.website.url", "") + "?user_id=" + userData.getString("id", ""));
-
 
2025
                isPause=false;
-
 
2026
            }
-
 
2027
        }
-
 
2028
    }
2002
}
2029
}