| Line 93... |
Line 93... |
| 93 |
String redirectUrl;
|
93 |
String redirectUrl;
|
| 94 |
MixpanelAPI mixpanel;
|
94 |
MixpanelAPI mixpanel;
|
| 95 |
String notificationURL;
|
95 |
String notificationURL;
|
| 96 |
ArrayList<NameValuePair> nameValuePairsGcm;
|
96 |
ArrayList<NameValuePair> nameValuePairsGcm;
|
| 97 |
|
97 |
|
| 98 |
|
- |
|
| 99 |
private DrawerLayout mDrawerLayout;
|
98 |
private DrawerLayout mDrawerLayout;
|
| 100 |
private ExpandableListView mDrawerList;
|
99 |
private ExpandableListView mDrawerList;
|
| 101 |
private LinearLayout navDrawerView;
|
100 |
private LinearLayout navDrawerView;
|
| 102 |
ExpandableNavigationAdapter customAdapter;
|
101 |
ExpandableNavigationAdapter customAdapter;
|
| 103 |
private ActionBarDrawerToggle mDrawerToggle;
|
102 |
private ActionBarDrawerToggle mDrawerToggle;
|
| Line 265... |
Line 264... |
| 265 |
flag=6;
|
264 |
flag=6;
|
| 266 |
}
|
265 |
}
|
| 267 |
else if(desEncrypter.decrypt(url.getQueryParameter("key")).equalsIgnoreCase("tutorial")){
|
266 |
else if(desEncrypter.decrypt(url.getQueryParameter("key")).equalsIgnoreCase("tutorial")){
|
| 268 |
flag=7;
|
267 |
flag=7;
|
| 269 |
}else{
|
268 |
}else{
|
| - |
|
269 |
String dealsUrl= apiData.getString("mobile.website.url","http://api.profittill.com/deals");
|
| - |
|
270 |
Map<String,String> paramsMap =new HashMap<String, String>();
|
| - |
|
271 |
paramsMap.put("user_id",userData.getString("id",""));
|
| 270 |
flag=20;
|
272 |
flag=20;
|
| 271 |
notificationURL = apiData.getString("mobile.website.url","http://api.profittill.com/deals")+"?user_id=" + userData.getString("id","");
|
273 |
notificationURL = UtilityFunctions.addParamsToUrl(dealsUrl,paramsMap);
|
| 272 |
}
|
274 |
}
|
| 273 |
}else if (url.getQueryParameter("intent_type").equalsIgnoreCase("update")){
|
275 |
}else if (url.getQueryParameter("intent_type").equalsIgnoreCase("update")){
|
| 274 |
String campaignId = url.getQueryParameter("campaign");
|
276 |
String campaignId = url.getQueryParameter("campaign");
|
| 275 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
277 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
| 276 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
278 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| Line 298... |
Line 300... |
| 298 |
} catch (android.content.ActivityNotFoundException anfe) {
|
300 |
} catch (android.content.ActivityNotFoundException anfe) {
|
| 299 |
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getApplicationContext().getPackageName()));
|
301 |
intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + getApplicationContext().getPackageName()));
|
| 300 |
}
|
302 |
}
|
| 301 |
startActivity(intent);
|
303 |
startActivity(intent);
|
| 302 |
}else{
|
304 |
}else{
|
| - |
|
305 |
String dealsUrl= apiData.getString("mobile.website.url","http://api.profittill.com/deals");
|
| - |
|
306 |
Map<String,String> paramsMap =new HashMap<String, String>();
|
| - |
|
307 |
paramsMap.put("user_id",userData.getString("id",""));
|
| 303 |
flag=20;
|
308 |
flag=20;
|
| 304 |
notificationURL = apiData.getString("mobile.website.url","http://api.profittill.com/deals")+"?user_id=" + userData.getString("id","");
|
309 |
notificationURL = UtilityFunctions.addParamsToUrl(dealsUrl,paramsMap);
|
| 305 |
}
|
310 |
}
|
| 306 |
}else if(getIntent().getAction()=="11"){
|
311 |
}else if(getIntent().getAction()=="11"){
|
| 307 |
flag=11;
|
312 |
flag=11;
|
| 308 |
}else {
|
313 |
}else {
|
| 309 |
Bundle i = getIntent().getExtras();
|
314 |
Bundle i = getIntent().getExtras();
|
| - |
|
315 |
try{
|
| 310 |
if (i != null) {
|
316 |
if (i != null) {
|
| 311 |
flag = Integer.parseInt(i.getString("displayView"));
|
317 |
flag = Integer.parseInt(i.getString("displayView"));
|
| 312 |
if (flag == 31) {
|
318 |
if (flag == 31) {
|
| 313 |
redirectUrl = i.getString("redirectUrl");
|
319 |
redirectUrl = i.getString("redirectUrl");
|
| 314 |
}
|
320 |
}
|
| - |
|
321 |
}}
|
| - |
|
322 |
catch (Exception e){
|
| - |
|
323 |
e.printStackTrace();
|
| 315 |
}
|
324 |
}
|
| 316 |
}
|
325 |
}
|
| 317 |
|
326 |
|
| 318 |
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.WHITE));
|
327 |
getSupportActionBar().setBackgroundDrawable(new ColorDrawable(Color.WHITE));
|
| 319 |
getSupportActionBar().setIcon(R.drawable.logo_cirlce_1);
|
328 |
getSupportActionBar().setIcon(R.drawable.logo_cirlce_1);
|
| Line 485... |
Line 494... |
| 485 |
@Override
|
494 |
@Override
|
| 486 |
public void onGroupExpand(int groupPosition) {
|
495 |
public void onGroupExpand(int groupPosition) {
|
| 487 |
int len = customAdapter.getGroupCount();
|
496 |
int len = customAdapter.getGroupCount();
|
| 488 |
int index = mDrawerList.getFlatListPosition(ExpandableListView.getPackedPositionForGroup(groupPosition));
|
497 |
int index = mDrawerList.getFlatListPosition(ExpandableListView.getPackedPositionForGroup(groupPosition));
|
| 489 |
mDrawerList.setItemChecked(index, true);
|
498 |
mDrawerList.setItemChecked(index, true);
|
| 490 |
String parentTitle = ((ExpandableNavigationItem) customAdapter.getGroup(groupPosition)).getTitle();
|
499 |
String parentTitle = customAdapter.getGroup(groupPosition).getTitle();
|
| 491 |
if (groupPosition == 3) {
|
500 |
if (groupPosition == 3) {
|
| 492 |
if (mDrawerList.isGroupExpanded(2)) {
|
501 |
if (mDrawerList.isGroupExpanded(2)) {
|
| 493 |
mDrawerList.collapseGroup(2);
|
502 |
mDrawerList.collapseGroup(2);
|
| 494 |
}
|
503 |
}
|
| 495 |
} else if (groupPosition == 2) {
|
504 |
} else if (groupPosition == 2) {
|
| Line 933... |
Line 942... |
| 933 |
.build());
|
942 |
.build());
|
| 934 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
943 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
| 935 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","Deals","Deals Clicked"),
|
944 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","Deals","Deals Clicked"),
|
| 936 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
945 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
| 937 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
946 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| - |
|
947 |
String dealsUrl= apiData.getString("mobile.website.url","http://api.profittill.com/deals");
|
| - |
|
948 |
Map<String,String> paramsMap =new HashMap<String, String>();
|
| 938 |
args.putString("key", apiData.getString("mobile.website.url","")+"?user_id="+id+"&version="+UtilityFunctions.getVersionCode());
|
949 |
paramsMap.put("user_id",id+"&version="+UtilityFunctions.getVersionCode());
|
| - |
|
950 |
args.putString("key", UtilityFunctions.addParamsToUrl(dealsUrl,paramsMap));
|
| 939 |
fragment = new DealsHomeFragment();
|
951 |
fragment = new DealsHomeFragment();
|
| 940 |
fragment.setArguments(args);
|
952 |
fragment.setArguments(args);
|
| 941 |
break;
|
953 |
break;
|
| 942 |
case 1:
|
954 |
case 1:
|
| 943 |
JSONObject props1 = new JSONObject();
|
955 |
JSONObject props1 = new JSONObject();
|