| Line 72... |
Line 72... |
| 72 |
import java.util.List;
|
72 |
import java.util.List;
|
| 73 |
import java.util.Map;
|
73 |
import java.util.Map;
|
| 74 |
|
74 |
|
| 75 |
|
75 |
|
| 76 |
public class MainActivity extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
|
76 |
public class MainActivity extends ActionBarActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener {
|
| 77 |
/*private DrawerLayout mDrawerLayout;
|
- |
|
| 78 |
private ListView mDrawerList;
|
- |
|
| 79 |
private ActionBarDrawerToggle mDrawerToggle;*/
|
- |
|
| 80 |
public GoogleApiClient mGoogleApiClient;
|
77 |
public GoogleApiClient mGoogleApiClient;
|
| 81 |
SharedPreferences userData;
|
78 |
SharedPreferences userData;
|
| 82 |
SharedPreferences apiData;
|
79 |
SharedPreferences apiData;
|
| 83 |
boolean glogout;
|
80 |
boolean glogout;
|
| 84 |
SharedPreferences.Editor userDataEditor;
|
81 |
SharedPreferences.Editor userDataEditor;
|
| 85 |
SharedPreferences.Editor apiSettingsEditor;
|
82 |
SharedPreferences.Editor apiSettingsEditor;
|
| 86 |
SharedPreferences.Editor inviteDataEditor;
|
83 |
SharedPreferences.Editor inviteDataEditor;
|
| 87 |
SharedPreferences inviteData;
|
84 |
SharedPreferences inviteData;
|
| 88 |
private String[] navMenuTitles;
|
- |
|
| 89 |
private TypedArray navMenuIcons;
|
- |
|
| 90 |
String type1;
|
85 |
String type1;
|
| 91 |
private ArrayList<NavDrawerItem> navDrawerItems;
|
- |
|
| 92 |
private NavDrawerListAdapter adapter;
|
- |
|
| 93 |
int flag;
|
86 |
int flag;
|
| 94 |
boolean shouldGoInvisible;
|
87 |
boolean shouldGoInvisible;
|
| 95 |
int titleVisible;
|
88 |
int titleVisible;
|
| 96 |
StringBuilder subtag,sb;
|
- |
|
| 97 |
String userIdAffliate;
|
- |
|
| 98 |
Date dateAffliate;
|
- |
|
| 99 |
String stringDateAffliate;
|
- |
|
| 100 |
SimpleDateFormat dateFormatAffliate;
|
- |
|
| 101 |
String redirectUrl;
|
89 |
String redirectUrl;
|
| 102 |
MixpanelAPI mixpanel;
|
90 |
MixpanelAPI mixpanel;
|
| 103 |
String notificationURL;
|
91 |
String notificationURL;
|
| 104 |
ArrayList<NameValuePair> nameValuePairsGcm;
|
92 |
ArrayList<NameValuePair> nameValuePairsGcm;
|
| 105 |
|
93 |
|
| Line 110... |
Line 98... |
| 110 |
ExpandableNavigationAdapter customAdapter;
|
98 |
ExpandableNavigationAdapter customAdapter;
|
| 111 |
private ActionBarDrawerToggle mDrawerToggle;
|
99 |
private ActionBarDrawerToggle mDrawerToggle;
|
| 112 |
private CharSequence mDrawerTitle;
|
100 |
private CharSequence mDrawerTitle;
|
| 113 |
private CharSequence mTitle;
|
101 |
private CharSequence mTitle;
|
| 114 |
private String[] mPlanetTitles;
|
102 |
private String[] mPlanetTitles;
|
| 115 |
private String[] mHelpTitle;
|
103 |
private String[] mHelpTtiles;
|
| 116 |
private int selectedPosition;
|
104 |
private int selectedPosition;
|
| 117 |
List<ExpandableNavigationItem> listParent;
|
105 |
List<ExpandableNavigationItem> listParent;
|
| 118 |
HashMap<String, List<String>> listDataChild;
|
106 |
HashMap<String, List<String>> listDataChild;
|
| 119 |
|
107 |
|
| 120 |
|
108 |
|
| Line 264... |
Line 252... |
| 264 |
.addOnConnectionFailedListener(this).addApi(Plus.API)
|
252 |
.addOnConnectionFailedListener(this).addApi(Plus.API)
|
| 265 |
.addScope(Plus.SCOPE_PLUS_LOGIN).build();
|
253 |
.addScope(Plus.SCOPE_PLUS_LOGIN).build();
|
| 266 |
mGoogleApiClient.connect();
|
254 |
mGoogleApiClient.connect();
|
| 267 |
}
|
255 |
}
|
| 268 |
|
256 |
|
| 269 |
/*mTitle = mDrawerTitle = getTitle();*//*
|
- |
|
| 270 |
// load slide menu items
|
- |
|
| 271 |
navMenuTitles = getResources().getStringArray(R.array.nav_drawer_items);
|
- |
|
| 272 |
|
- |
|
| 273 |
// nav drawer icons from resources
|
- |
|
| 274 |
navMenuIcons = getResources()
|
- |
|
| 275 |
.obtainTypedArray(R.array.nav_drawer_icons);
|
- |
|
| 276 |
|
- |
|
| 277 |
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
- |
|
| 278 |
mDrawerList = (ListView) findViewById(R.id.list_slidermenu);
|
- |
|
| 279 |
mDrawerLayout.setBackgroundColor(getResources().getColor(R.color.White));
|
- |
|
| 280 |
navDrawerItems = new ArrayList<NavDrawerItem>();
|
- |
|
| 281 |
|
- |
|
| 282 |
|
- |
|
| 283 |
|
- |
|
| 284 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[0], navMenuIcons.getResourceId(0, -1)));
|
- |
|
| 285 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[1], navMenuIcons.getResourceId(1, 0)));
|
- |
|
| 286 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[2], navMenuIcons.getResourceId(2, -1)));
|
- |
|
| 287 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[3], navMenuIcons.getResourceId(3, -1)));
|
- |
|
| 288 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[4], navMenuIcons.getResourceId(4, -1)));
|
- |
|
| 289 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[5], navMenuIcons.getResourceId(5, -1)));
|
- |
|
| 290 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[6], navMenuIcons.getResourceId(6, -1)));
|
- |
|
| 291 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[7], navMenuIcons.getResourceId(7, -1)));
|
- |
|
| 292 |
navDrawerItems.add(new NavDrawerItem(navMenuTitles[8], navMenuIcons.getResourceId(8, -1)));
|
- |
|
| 293 |
*//* navDrawerItems.add(new NavDrawerItem(navMenuTitles[9], navMenuIcons.getResourceId(9, -1)));*//*
|
- |
|
| 294 |
navMenuIcons.recycle();
|
- |
|
| 295 |
|
- |
|
| 296 |
mDrawerList.setOnItemClickListener(new SlideMenuClickListener());
|
- |
|
| 297 |
ExpandableListViewClick
|
- |
|
| 298 |
// setting the nav drawer list adapter
|
- |
|
| 299 |
adapter = new NavDrawerListAdapter(getApplicationContext(),navDrawerItems);
|
- |
|
| 300 |
mDrawerList.setAdapter(adapter);
|
- |
|
| 301 |
|
- |
|
| 302 |
// enabling action bar app icon and behaving it as toggle button
|
- |
|
| 303 |
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
- |
|
| 304 |
getSupportActionBar().setHomeButtonEnabled(true);
|
- |
|
| 305 |
|
- |
|
| 306 |
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout,
|
- |
|
| 307 |
R.drawable.menu_button_2, //nav menu toggle icon
|
- |
|
| 308 |
R.string.hello_world, // nav drawer open - description for accessibility
|
- |
|
| 309 |
R.string.hello_world// nav drawer close - description for accessibility
|
- |
|
| 310 |
) {
|
- |
|
| 311 |
public void onDrawerClosed(View view) {
|
- |
|
| 312 |
if(titleVisible!=0) {
|
- |
|
| 313 |
if(titleVisible==1)
|
- |
|
| 314 |
getSupportActionBar().setCustomView(R.layout.actionbarmyfavorites);
|
- |
|
| 315 |
|
- |
|
| 316 |
if(titleVisible==2)
|
- |
|
| 317 |
getSupportActionBar().setCustomView(R.layout.actionbarprefernces);
|
- |
|
| 318 |
|
- |
|
| 319 |
if(titleVisible==3)
|
- |
|
| 320 |
getSupportActionBar().setCustomView(R.layout.actionbarmywallet);
|
- |
|
| 321 |
|
- |
|
| 322 |
if(titleVisible==4)
|
- |
|
| 323 |
getSupportActionBar().setCustomView(R.layout.actionbarmyorders);
|
- |
|
| 324 |
|
- |
|
| 325 |
if(titleVisible==5)
|
- |
|
| 326 |
getSupportActionBar().setCustomView(R.layout.actionbarpendingcashback);
|
- |
|
| 327 |
|
- |
|
| 328 |
if(titleVisible==6)
|
- |
|
| 329 |
getSupportActionBar().setCustomView(R.layout.actionbarmyprofile);
|
- |
|
| 330 |
|
- |
|
| 331 |
|
- |
|
| 332 |
}
|
- |
|
| 333 |
else{
|
- |
|
| 334 |
if (getTitle().equals("Deals")) {
|
- |
|
| 335 |
getSupportActionBar().setCustomView(R.layout.actionbardeals);
|
- |
|
| 336 |
}
|
- |
|
| 337 |
if (getTitle().equals("Saholic") || getTitle().equals("Flipkart") || getTitle().equals("Snapdeal") || getTitle().equals("Amazon")) {
|
- |
|
| 338 |
getSupportActionBar().setCustomView(R.layout.actionbarprofittill);
|
- |
|
| 339 |
}
|
- |
|
| 340 |
if (getTitle().equals("FAQ")) {
|
- |
|
| 341 |
getSupportActionBar().setCustomView(R.layout.actionbaraboutus);
|
- |
|
| 342 |
}
|
- |
|
| 343 |
if (getTitle().equals("Contact Us")) {
|
- |
|
| 344 |
getSupportActionBar().setCustomView(R.layout.actionbarcontactus);
|
- |
|
| 345 |
}
|
- |
|
| 346 |
if (getTitle().equals("Search")) {
|
- |
|
| 347 |
getSupportActionBar().setCustomView(R.layout.actionbarsearch);
|
- |
|
| 348 |
}
|
- |
|
| 349 |
if (getTitle().equals("How It Works")) {
|
- |
|
| 350 |
getSupportActionBar().setCustomView(R.layout.actionbarhowitworks);
|
- |
|
| 351 |
}
|
- |
|
| 352 |
}
|
- |
|
| 353 |
shouldGoInvisible = false;
|
- |
|
| 354 |
invalidateOptionsMenu();
|
- |
|
| 355 |
}
|
- |
|
| 356 |
|
- |
|
| 357 |
public void onDrawerOpened(View drawerView) {
|
- |
|
| 358 |
getSupportActionBar().setCustomView(R.layout.actionbarprofittill);
|
- |
|
| 359 |
shouldGoInvisible = true;
|
- |
|
| 360 |
invalidateOptionsMenu();
|
- |
|
| 361 |
}
|
- |
|
| 362 |
@Override
|
- |
|
| 363 |
public void onDrawerSlide(View drawerView, float slideOffset) {
|
- |
|
| 364 |
|
- |
|
| 365 |
|
- |
|
| 366 |
}
|
- |
|
| 367 |
|
- |
|
| 368 |
};
|
- |
|
| 369 |
mDrawerLayout.setDrawerListener(mDrawerToggle);
|
- |
|
| 370 |
|
- |
|
| 371 |
if (savedInstanceState == null) {
|
- |
|
| 372 |
|
- |
|
| 373 |
if (flag == 7) {
|
- |
|
| 374 |
getSupportActionBar().setCustomView(R.layout.actionbarhowitworks);
|
- |
|
| 375 |
displayView(flag);
|
- |
|
| 376 |
} else if (flag == 6) {
|
- |
|
| 377 |
getSupportActionBar().setCustomView(R.layout.actionbarcontactus);
|
- |
|
| 378 |
displayView(flag);
|
- |
|
| 379 |
} else if (flag == 15) {
|
- |
|
| 380 |
getSupportActionBar().setCustomView(R.layout.actionbarmyprofile);
|
- |
|
| 381 |
MyProfile myProfile = new MyProfile();
|
- |
|
| 382 |
this.getFragmentManager().beginTransaction()
|
- |
|
| 383 |
.replace(R.id.frame_container, myProfile, "Mike")
|
- |
|
| 384 |
.addToBackStack(null)
|
- |
|
| 385 |
.commit();
|
- |
|
| 386 |
}else if (flag == 20) {
|
- |
|
| 387 |
getSupportActionBar().setCustomView(R.layout.actionbardeals);
|
- |
|
| 388 |
JSONObject propsNotification = new JSONObject();
|
- |
|
| 389 |
try {
|
- |
|
| 390 |
mixpanel.identify(userData.getString("id",null));
|
- |
|
| 391 |
propsNotification.put("Screen", "Notification Url opened");
|
- |
|
| 392 |
mixpanel.track("Notification Opened", propsNotification);
|
- |
|
| 393 |
} catch (JSONException e) {
|
- |
|
| 394 |
e.printStackTrace();
|
- |
|
| 395 |
}
|
- |
|
| 396 |
Bundle args = new Bundle();
|
- |
|
| 397 |
DealsHomeFragment notifcationFragment = new DealsHomeFragment();
|
- |
|
| 398 |
args.putString("key", notificationURL);
|
- |
|
| 399 |
this.getFragmentManager().beginTransaction()
|
- |
|
| 400 |
.replace(R.id.frame_container, notifcationFragment, "Mike")
|
- |
|
| 401 |
.addToBackStack(null)
|
- |
|
| 402 |
.commit();
|
- |
|
| 403 |
notifcationFragment.setArguments(args);
|
- |
|
| 404 |
}else if (flag == 31) {
|
- |
|
| 405 |
getSupportActionBar().setCustomView(R.layout.actionbardeals);
|
- |
|
| 406 |
Bundle args = new Bundle();
|
- |
|
| 407 |
DealsHomeFragment redirectUrlFragment = new DealsHomeFragment();
|
- |
|
| 408 |
args.putString("key", redirectUrl);
|
- |
|
| 409 |
this.getFragmentManager().beginTransaction()
|
- |
|
| 410 |
.replace(R.id.frame_container, redirectUrlFragment, "Mike")
|
- |
|
| 411 |
.addToBackStack(null)
|
- |
|
| 412 |
.commit();
|
- |
|
| 413 |
redirectUrlFragment.setArguments(args);
|
- |
|
| 414 |
}else {
|
- |
|
| 415 |
getSupportActionBar().setCustomView(R.layout.actionbardeals);
|
- |
|
| 416 |
displayView(0);
|
- |
|
| 417 |
}
|
- |
|
| 418 |
|
- |
|
| 419 |
}*/
|
- |
|
| 420 |
|
- |
|
| 421 |
mTitle = mDrawerTitle = getTitle();
|
257 |
mTitle = mDrawerTitle = getTitle();
|
| 422 |
|
258 |
|
| 423 |
navDrawerView = (LinearLayout) findViewById(R.id.navDrawerView);
|
259 |
navDrawerView = (LinearLayout) findViewById(R.id.navDrawerView);
|
| 424 |
mPlanetTitles = getResources().getStringArray(R.array.stores_array);
|
260 |
mPlanetTitles = getResources().getStringArray(R.array.stores_array);
|
| 425 |
|
- |
|
| - |
|
261 |
mHelpTtiles= getResources().getStringArray(R.array.help_array);
|
| 426 |
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
262 |
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
|
| 427 |
// mDrawerList = (ListView) findViewById(R.id.left_drawer);
|
- |
|
| 428 |
|
- |
|
| 429 |
mDrawerList = (ExpandableListView) findViewById(R.id.nav_left_drawer);
|
263 |
mDrawerList = (ExpandableListView) findViewById(R.id.nav_left_drawer);
|
| 430 |
|
264 |
|
| 431 |
// set a custom shadow that overlays the main content when the drawer
|
- |
|
| 432 |
// opens
|
- |
|
| 433 |
//mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
|
- |
|
| 434 |
|
- |
|
| 435 |
listParent = new ArrayList<ExpandableNavigationItem>();
|
265 |
listParent = new ArrayList<ExpandableNavigationItem>();
|
| 436 |
listDataChild = new HashMap<String, List<String>>();
|
266 |
listDataChild = new HashMap<String, List<String>>();
|
| 437 |
|
- |
|
| 438 |
// Navigation Drawer of Flight starts
|
- |
|
| 439 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Deals)));
|
267 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Deals)));
|
| 440 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Search)));
|
268 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Search)));
|
| 441 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Stores)));
|
269 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Stores)));
|
| 442 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Contact_Us)));
|
- |
|
| 443 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Tutorials)));
|
270 |
listParent.add(new ExpandableNavigationItem(getString(R.string.Help)));
|
| 444 |
listParent.add(new ExpandableNavigationItem(getString(R.string.About_Us)));
|
- |
|
| 445 |
|
- |
|
| 446 |
listDataChild.put(getString(R.string.Deals), new ArrayList<String>());
|
271 |
listDataChild.put(getString(R.string.Deals), new ArrayList<String>());
|
| 447 |
listDataChild.put(getString(R.string.Search), new ArrayList<String>());
|
272 |
listDataChild.put(getString(R.string.Search), new ArrayList<String>());
|
| 448 |
|
- |
|
| 449 |
/*listDataChild.put(getString(R.string.Help), Arrays.asList(mHelpTitle));*/
|
- |
|
| 450 |
listDataChild.put(getString(R.string.Stores), Arrays.asList(mPlanetTitles));
|
273 |
listDataChild.put(getString(R.string.Stores), Arrays.asList(mPlanetTitles));
|
| 451 |
listDataChild.put(getString(R.string.Contact_Us), new ArrayList<String>());
|
- |
|
| 452 |
listDataChild.put(getString(R.string.Tutorials), new ArrayList<String>());
|
274 |
listDataChild.put(getString(R.string.Help), Arrays.asList(mHelpTtiles));
|
| 453 |
listDataChild.put(getString(R.string.About_Us), new ArrayList<String>());
|
- |
|
| 454 |
|
275 |
|
| 455 |
customAdapter = new ExpandableNavigationAdapter(this, listParent, listDataChild);
|
276 |
customAdapter = new ExpandableNavigationAdapter(this, listParent, listDataChild);
|
| 456 |
// setting list adapter
|
- |
|
| - |
|
277 |
|
| 457 |
mDrawerList.setAdapter(customAdapter);
|
278 |
mDrawerList.setAdapter(customAdapter);
|
| 458 |
mDrawerList.setChoiceMode(ExpandableListView.CHOICE_MODE_SINGLE);
|
279 |
mDrawerList.setChoiceMode(ExpandableListView.CHOICE_MODE_SINGLE);
|
| 459 |
// // set up the drawer's list view with items and click listener
|
- |
|
| 460 |
// mDrawerList.setAdapter(new ArrayAdapter<String>(this, R.layout.drawer_list_item, mPlanetTitles));
|
- |
|
| 461 |
// mDrawerList.setOnItemClickListener(new DrawerItemClickListener());
|
- |
|
| 462 |
|
280 |
|
| 463 |
// enable ActionBar app icon to behave as action to toggle nav drawer
|
- |
|
| 464 |
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
281 |
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
| 465 |
getSupportActionBar().setHomeButtonEnabled(true);
|
282 |
getSupportActionBar().setHomeButtonEnabled(true);
|
| 466 |
//mDrawerList.setOnItemClickListener(new ExpandableListViewClick());
|
- |
|
| 467 |
//mDrawerList.setOnGroupClickListener(new ExpandableListViewGroupClick());
|
- |
|
| 468 |
mDrawerList.setOnChildClickListener(new ExpandableListViewChildClick());
|
283 |
mDrawerList.setOnChildClickListener(new ExpandableListViewChildClick());
|
| 469 |
mDrawerList.setOnGroupExpandListener(new ExpandableGroupExpandListener());
|
284 |
mDrawerList.setOnGroupExpandListener(new ExpandableGroupExpandListener());
|
| 470 |
mDrawerToggle = new ActionBarDrawerToggle(this, /* host Activity */
|
285 |
mDrawerToggle = new ActionBarDrawerToggle(this,
|
| 471 |
mDrawerLayout, /* DrawerLayout object */
|
286 |
mDrawerLayout,
|
| 472 |
R.drawable.menu_button_2, /* nav drawer image to replace 'Up' caret */
|
287 |
R.drawable.menu_button_2,
|
| 473 |
R.string.drawer_open, /* "open drawer" description for accessibility */
|
288 |
R.string.drawer_open,
|
| 474 |
R.string.drawer_close /* "close drawer" description for accessibility */
|
289 |
R.string.drawer_close
|
| 475 |
) {
|
290 |
) {
|
| 476 |
public void onDrawerClosed(View view) {
|
291 |
public void onDrawerClosed(View view) {
|
| 477 |
if(titleVisible!=0) {
|
292 |
if(titleVisible!=0) {
|
| 478 |
if(titleVisible==1)
|
293 |
if(titleVisible==1)
|
| 479 |
getSupportActionBar().setCustomView(R.layout.actionbarmyfavorites);
|
294 |
getSupportActionBar().setCustomView(R.layout.actionbarmyfavorites);
|
| Line 564... |
Line 379... |
| 564 |
displayView(0);
|
379 |
displayView(0);
|
| 565 |
}
|
380 |
}
|
| 566 |
}
|
381 |
}
|
| 567 |
}
|
382 |
}
|
| 568 |
|
383 |
|
| 569 |
private class ExpandableGroupExpandListener implements ExpandableListView.OnGroupExpandListener{
|
384 |
private class ExpandableGroupExpandListener implements ExpandableListView.OnGroupExpandListener {
|
| 570 |
@Override
|
385 |
@Override
|
| 571 |
public void onGroupExpand(int groupPosition) {
|
386 |
public void onGroupExpand(int groupPosition) {
|
| 572 |
int len = customAdapter.getGroupCount();
|
387 |
int len = customAdapter.getGroupCount();
|
| 573 |
|
- |
|
| 574 |
int index = mDrawerList.getFlatListPosition(ExpandableListView.getPackedPositionForGroup(groupPosition));
|
388 |
int index = mDrawerList.getFlatListPosition(ExpandableListView.getPackedPositionForGroup(groupPosition));
|
| 575 |
mDrawerList.setItemChecked(index, true);
|
389 |
mDrawerList.setItemChecked(index, true);
|
| 576 |
String parentTitle = ((ExpandableNavigationItem) customAdapter.getGroup(groupPosition)).getTitle();
|
390 |
String parentTitle = ((ExpandableNavigationItem) customAdapter.getGroup(groupPosition)).getTitle();
|
| - |
|
391 |
|
| 577 |
Log.d("Group Pos in child View", "" + groupPosition);
|
392 |
if (groupPosition == 0 || groupPosition == 1) {
|
| 578 |
if(!(parentTitle.equalsIgnoreCase(getString(R.string.Stores)))) {
|
393 |
displayView(groupPosition);
|
| 579 |
mDrawerLayout.closeDrawer(navDrawerView);
|
394 |
mDrawerLayout.closeDrawer(navDrawerView);
|
| 580 |
mDrawerList.collapseGroup(2);
|
395 |
mDrawerList.collapseGroup(2);
|
| - |
|
396 |
mDrawerList.collapseGroup(3);
|
| 581 |
}
|
397 |
} else {
|
| 582 |
if(groupPosition!=2){
|
398 |
if (groupPosition == 3) {
|
| - |
|
399 |
if (mDrawerList.isGroupExpanded(2)) {
|
| 583 |
displayView(groupPosition);
|
400 |
mDrawerList.collapseGroup(2);
|
| 584 |
}
|
401 |
}
|
| 585 |
setActionBarTitlte(parentTitle);
|
402 |
} else if (groupPosition == 2) {
|
| 586 |
|
- |
|
| 587 |
for (int i = 0; i < len; i++) {
|
403 |
if (mDrawerList.isGroupExpanded(3)) {
|
| 588 |
if(i!=2) {
|
404 |
mDrawerList.collapseGroup(3);
|
| 589 |
mDrawerList.collapseGroup(i);
|
405 |
}
|
| 590 |
}
|
406 |
}
|
| 591 |
}
|
407 |
}
|
| - |
|
408 |
setActionBarTitlte(parentTitle);
|
| 592 |
}
|
409 |
}
|
| 593 |
}
|
- |
|
| 594 |
|
- |
|
| 595 |
|
- |
|
| 596 |
|
410 |
|
| - |
|
411 |
}
|
| 597 |
|
412 |
|
| 598 |
private class ExpandableListViewChildClick implements ExpandableListView.OnChildClickListener {
|
413 |
private class ExpandableListViewChildClick implements ExpandableListView.OnChildClickListener {
|
| 599 |
@Override
|
414 |
@Override
|
| 600 |
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
|
415 |
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
|
| 601 |
int index = parent.getFlatListPosition(ExpandableListView.getPackedPositionForChild(groupPosition, childPosition));
|
416 |
int index = parent.getFlatListPosition(ExpandableListView.getPackedPositionForChild(groupPosition, childPosition));
|
| 602 |
parent.setItemChecked(index, true);
|
417 |
parent.setItemChecked(index, true);
|
| 603 |
mDrawerLayout.closeDrawer(navDrawerView);
|
418 |
mDrawerLayout.closeDrawer(navDrawerView);
|
| - |
|
419 |
if(groupPosition==2) {
|
| 604 |
displayChildView(childPosition);
|
420 |
displayChildView(childPosition);
|
| - |
|
421 |
}else if(groupPosition==3){
|
| - |
|
422 |
if (childPosition==0) {
|
| - |
|
423 |
getSupportActionBar().setCustomView(R.layout.actionbarcontactus);
|
| - |
|
424 |
}
|
| - |
|
425 |
else if (childPosition==1) {
|
| - |
|
426 |
getSupportActionBar().setCustomView(R.layout.actionbarhowitworks);
|
| - |
|
427 |
}
|
| - |
|
428 |
else if (childPosition==2) {
|
| - |
|
429 |
getSupportActionBar().setCustomView(R.layout.actionbaraboutus);
|
| - |
|
430 |
}
|
| - |
|
431 |
displayHelpChildView(childPosition);
|
| - |
|
432 |
}
|
| 605 |
return false;
|
433 |
return false;
|
| 606 |
}
|
434 |
}
|
| - |
|
435 |
|
| 607 |
}
|
436 |
}
|
| - |
|
437 |
|
| - |
|
438 |
private void displayHelpChildView(int position) {
|
| - |
|
439 |
titleVisible=0;
|
| - |
|
440 |
Tracker t = ((GoogleAnalyticsTracker) getApplicationContext()).getTracker(
|
| - |
|
441 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| - |
|
442 |
Fragment fragment = null;
|
| - |
|
443 |
Map<String, String> jsonParams;
|
| - |
|
444 |
switch (position) {
|
| - |
|
445 |
case 0:
|
| - |
|
446 |
JSONObject propsContactUs = new JSONObject();
|
| - |
|
447 |
try {
|
| - |
|
448 |
mixpanel.identify(userData.getString("id",null));
|
| - |
|
449 |
propsContactUs.put("Screen", "Contact Us");
|
| - |
|
450 |
mixpanel.track("Contact Us", propsContactUs);
|
| - |
|
451 |
} catch (JSONException e) {
|
| - |
|
452 |
e.printStackTrace();
|
| - |
|
453 |
}
|
| - |
|
454 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
455 |
.setCategory("Menu")
|
| - |
|
456 |
.setAction("Contact Us ")
|
| - |
|
457 |
.setLabel("Contact us Clicked")
|
| - |
|
458 |
.build());
|
| - |
|
459 |
fragment = new ContactUsFragment();
|
| - |
|
460 |
break;
|
| - |
|
461 |
case 1:
|
| - |
|
462 |
JSONObject propsHowItWorks = new JSONObject();
|
| - |
|
463 |
try {
|
| - |
|
464 |
mixpanel.identify(userData.getString("id",null));
|
| - |
|
465 |
propsHowItWorks.put("Screen", "How it Works");
|
| - |
|
466 |
mixpanel.track("How it Works", propsHowItWorks);
|
| - |
|
467 |
} catch (JSONException e) {
|
| - |
|
468 |
e.printStackTrace();
|
| - |
|
469 |
}
|
| - |
|
470 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
471 |
.setCategory("Menu")
|
| - |
|
472 |
.setAction("Tutorials ")
|
| - |
|
473 |
.setLabel("Tutorials Clicked")
|
| - |
|
474 |
.build());
|
| - |
|
475 |
fragment = new HowItWorksFragment();
|
| - |
|
476 |
break;
|
| - |
|
477 |
case 2:
|
| - |
|
478 |
JSONObject propsAboutUs = new JSONObject();
|
| - |
|
479 |
try {
|
| - |
|
480 |
mixpanel.identify(userData.getString("id",null));
|
| - |
|
481 |
propsAboutUs.put("Screen", "About Us");
|
| - |
|
482 |
mixpanel.track("About Us", propsAboutUs);
|
| - |
|
483 |
} catch (JSONException e) {
|
| - |
|
484 |
e.printStackTrace();
|
| - |
|
485 |
}
|
| - |
|
486 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
487 |
.setCategory("Menu")
|
| - |
|
488 |
.setAction("About Us ")
|
| - |
|
489 |
.setLabel("About us Clicked")
|
| - |
|
490 |
.build());
|
| - |
|
491 |
fragment = new AboutUsFragment();
|
| - |
|
492 |
break;
|
| - |
|
493 |
default:
|
| - |
|
494 |
break;
|
| - |
|
495 |
}
|
| - |
|
496 |
if (fragment != null) {
|
| - |
|
497 |
FragmentManager fragmentManager = getFragmentManager();
|
| - |
|
498 |
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
|
| - |
|
499 |
|
| - |
|
500 |
} else {
|
| - |
|
501 |
Log.e("MainActivity", "Error in creating fragment");
|
| - |
|
502 |
}
|
| - |
|
503 |
}
|
| - |
|
504 |
|
| 608 |
@Override
|
505 |
@Override
|
| 609 |
public boolean onCreateOptionsMenu(Menu menu) {
|
506 |
public boolean onCreateOptionsMenu(Menu menu) {
|
| 610 |
mainMenu=menu;
|
507 |
mainMenu=menu;
|
| 611 |
super.onCreateOptionsMenu(menu);
|
508 |
super.onCreateOptionsMenu(menu);
|
| 612 |
getMenuInflater().inflate(R.menu.menu_main, menu);
|
509 |
getMenuInflater().inflate(R.menu.menu_main, menu);
|
| Line 924... |
Line 821... |
| 924 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
821 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| 925 |
args.putString("key", apiData.getString("search.url",null)+"?user_id="+id);
|
822 |
args.putString("key", apiData.getString("search.url",null)+"?user_id="+id);
|
| 926 |
fragment = new DealsHomeFragment();
|
823 |
fragment = new DealsHomeFragment();
|
| 927 |
fragment.setArguments(args);
|
824 |
fragment.setArguments(args);
|
| 928 |
break;
|
825 |
break;
|
| 929 |
case 3:
|
- |
|
| 930 |
JSONObject propsContactUs = new JSONObject();
|
- |
|
| 931 |
try {
|
- |
|
| 932 |
mixpanel.identify(userData.getString("id",null));
|
- |
|
| 933 |
propsContactUs.put("Screen", "Contact Us");
|
- |
|
| 934 |
mixpanel.track("Contact Us", propsContactUs);
|
- |
|
| 935 |
} catch (JSONException e) {
|
- |
|
| 936 |
e.printStackTrace();
|
- |
|
| 937 |
}
|
- |
|
| 938 |
t.send(new HitBuilders.EventBuilder()
|
- |
|
| 939 |
.setCategory("Menu")
|
- |
|
| 940 |
.setAction("Contact Us ")
|
- |
|
| 941 |
.setLabel("Contact us Clicked")
|
- |
|
| 942 |
.build());
|
- |
|
| 943 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
- |
|
| 944 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","Contact Us","Contact Us Clicked"),
|
- |
|
| 945 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
- |
|
| 946 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
- |
|
| 947 |
fragment = new ContactUsFragment();
|
- |
|
| 948 |
break;
|
- |
|
| 949 |
case 4:
|
- |
|
| 950 |
JSONObject propsHowItWorks = new JSONObject();
|
- |
|
| 951 |
try {
|
- |
|
| 952 |
mixpanel.identify(userData.getString("id",null));
|
- |
|
| 953 |
propsHowItWorks.put("Screen", "How it Works");
|
- |
|
| 954 |
mixpanel.track("How it Works", propsHowItWorks);
|
- |
|
| 955 |
} catch (JSONException e) {
|
- |
|
| 956 |
e.printStackTrace();
|
- |
|
| 957 |
}
|
- |
|
| 958 |
t.send(new HitBuilders.EventBuilder()
|
- |
|
| 959 |
.setCategory("Menu")
|
- |
|
| 960 |
.setAction("Tutorials ")
|
- |
|
| 961 |
.setLabel("Tutorials Clicked")
|
- |
|
| 962 |
.build());
|
- |
|
| 963 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
- |
|
| 964 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","How it Works","How it works Clicked"),
|
- |
|
| 965 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
- |
|
| 966 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
- |
|
| 967 |
fragment = new HowItWorksFragment();
|
- |
|
| 968 |
break;
|
- |
|
| 969 |
case 5:
|
- |
|
| 970 |
JSONObject propsAboutUs = new JSONObject();
|
- |
|
| 971 |
try {
|
- |
|
| 972 |
mixpanel.identify(userData.getString("id",null));
|
- |
|
| 973 |
propsAboutUs.put("Screen", "About Us");
|
- |
|
| 974 |
mixpanel.track("About Us", propsAboutUs);
|
- |
|
| 975 |
} catch (JSONException e) {
|
- |
|
| 976 |
e.printStackTrace();
|
- |
|
| 977 |
}
|
- |
|
| 978 |
t.send(new HitBuilders.EventBuilder()
|
- |
|
| 979 |
.setCategory("Menu")
|
- |
|
| 980 |
.setAction("About Us ")
|
- |
|
| 981 |
.setLabel("About us Clicked")
|
- |
|
| 982 |
.build());
|
- |
|
| 983 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
- |
|
| 984 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","About Us","About Us Clicked"),
|
- |
|
| 985 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
- |
|
| 986 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
- |
|
| 987 |
fragment = new AboutUsFragment();
|
- |
|
| 988 |
break;
|
- |
|
| 989 |
default:
|
826 |
default:
|
| 990 |
break;
|
827 |
break;
|
| 991 |
}
|
828 |
}
|
| 992 |
/* if (fragment != null) {
|
- |
|
| 993 |
FragmentManager fragmentManager = getFragmentManager();
|
- |
|
| 994 |
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
|
- |
|
| 995 |
mDrawerList.setItemChecked(position, true);
|
- |
|
| 996 |
mDrawerList.setSelection(position);
|
- |
|
| 997 |
setTitle(navMenuTitles[position]);
|
- |
|
| 998 |
mDrawerLayout.closeDrawer(mDrawerList);
|
- |
|
| 999 |
}*/
|
- |
|
| 1000 |
if (fragment != null) {
|
829 |
if (fragment != null) {
|
| 1001 |
FragmentManager fragmentManager = getFragmentManager();
|
830 |
FragmentManager fragmentManager = getFragmentManager();
|
| 1002 |
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
|
831 |
fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
|
| 1003 |
|
832 |
|
| 1004 |
} else {
|
833 |
} else {
|
| Line 1062... |
Line 891... |
| 1062 |
fragment.setArguments(args);
|
891 |
fragment.setArguments(args);
|
| 1063 |
break;
|
892 |
break;
|
| 1064 |
case 2:
|
893 |
case 2:
|
| 1065 |
t.send(new HitBuilders.EventBuilder()
|
894 |
t.send(new HitBuilders.EventBuilder()
|
| 1066 |
.setCategory("Menu")
|
895 |
.setCategory("Menu")
|
| - |
|
896 |
.setAction("HomeShop18 ")
|
| - |
|
897 |
.setLabel("HomeShop18 Clicked")
|
| - |
|
898 |
.build());
|
| - |
|
899 |
|
| - |
|
900 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
| - |
|
901 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","HomeShop18","HomeShop18 Clicked"),
|
| - |
|
902 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
| - |
|
903 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| - |
|
904 |
args.putString("key", apiData.getString("affiliate.url.redirect","")+"?user_id="+userData.getString("id","")+"&store_id="+UtilityFunctions.getNewStoreId(UtilityFunctions.generateStoreMap(apiData.getString("stores.code","amazon=1,flipkart=2,snapdeal=3,spice=4,shopclues=5,paytm=6,homeshop18=7,")),ProfitTillConstants.HOMESHOP18));
|
| - |
|
905 |
//args.putString("key","https://paytm.com");
|
| - |
|
906 |
fragment = new DealsHomeFragment();
|
| - |
|
907 |
fragment.setArguments(args);
|
| - |
|
908 |
break;
|
| - |
|
909 |
case 3:
|
| - |
|
910 |
t.send(new HitBuilders.EventBuilder()
|
| - |
|
911 |
.setCategory("Menu")
|
| 1067 |
.setAction("Paytm ")
|
912 |
.setAction("Paytm ")
|
| 1068 |
.setLabel("Paytm Clicked")
|
913 |
.setLabel("Paytm Clicked")
|
| 1069 |
.build());
|
914 |
.build());
|
| 1070 |
|
915 |
|
| 1071 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
916 |
new Analytics(ProfitTillConstants.ANALYTICS_URL,
|
| 1072 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","Paytm","Paytm Clicked"),
|
917 |
AnalyticsUtility.getAnalyticsRequest(MainActivity.this,userData.getString("id",""),"Menu","Paytm","Paytm Clicked"),
|
| 1073 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
918 |
AnalyticsJsonResponse.getAnalyticsRequestInstance(),
|
| 1074 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
919 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| 1075 |
args.putString("key", apiData.getString("affiliate.url.redirect","")+"?user_id="+userData.getString("id","")+"&store_id="+UtilityFunctions.getNewStoreId(UtilityFunctions.generateStoreMap(apiData.getString("stores.code","amazon=1,flipkart=2,snapdeal=3,spice=4,shopclues=5,")),ProfitTillConstants.PAYTM));
|
920 |
args.putString("key", apiData.getString("affiliate.url.redirect","")+"?user_id="+userData.getString("id","")+"&store_id="+UtilityFunctions.getNewStoreId(UtilityFunctions.generateStoreMap(apiData.getString("stores.code","amazon=1,flipkart=2,snapdeal=3,spice=4,shopclues=5,")),ProfitTillConstants.PAYTM));
|
| 1076 |
//args.putString("key","https://paytm.com");
|
- |
|
| 1077 |
fragment = new DealsHomeFragment();
|
921 |
fragment = new DealsHomeFragment();
|
| 1078 |
fragment.setArguments(args);
|
922 |
fragment.setArguments(args);
|
| 1079 |
break;
|
923 |
break;
|
| 1080 |
case 3:
|
924 |
case 4:
|
| 1081 |
JSONObject propsSaholic = new JSONObject();
|
925 |
JSONObject propsSaholic = new JSONObject();
|
| 1082 |
try {
|
926 |
try {
|
| 1083 |
mixpanel.identify(userData.getString("id",null));
|
927 |
mixpanel.identify(userData.getString("id",null));
|
| 1084 |
propsSaholic.put("Screen", "Saholic");
|
928 |
propsSaholic.put("Screen", "Saholic");
|
| 1085 |
mixpanel.track("Saholic", propsSaholic);
|
929 |
mixpanel.track("Saholic", propsSaholic);
|
| Line 1097... |
Line 941... |
| 1097 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
941 |
AnalyticsErrorResponse.getAnalyitcsResponseInstance()).anlyticsRequest(MainActivity.this);
|
| 1098 |
args.putString("key", apiData.getString("saholic.autologin.url","")+"?user_id="+userData.getString("id",""));
|
942 |
args.putString("key", apiData.getString("saholic.autologin.url","")+"?user_id="+userData.getString("id",""));
|
| 1099 |
fragment = new DealsHomeFragment();
|
943 |
fragment = new DealsHomeFragment();
|
| 1100 |
fragment.setArguments(args);
|
944 |
fragment.setArguments(args);
|
| 1101 |
break;
|
945 |
break;
|
| 1102 |
case 4:
|
946 |
case 5:
|
| 1103 |
JSONObject propsShopclues = new JSONObject();
|
947 |
JSONObject propsShopclues = new JSONObject();
|
| 1104 |
try {
|
948 |
try {
|
| 1105 |
mixpanel.identify(userData.getString("id",null));
|
949 |
mixpanel.identify(userData.getString("id",null));
|
| 1106 |
propsShopclues.put("Screen", "Shopclues");
|
950 |
propsShopclues.put("Screen", "Shopclues");
|
| 1107 |
mixpanel.track("Shopclues", propsShopclues);
|
951 |
mixpanel.track("Shopclues", propsShopclues);
|
| Line 1127... |
Line 971... |
| 1127 |
cookieManager1.setCookie(url, "shopcluesActive=true");
|
971 |
cookieManager1.setCookie(url, "shopcluesActive=true");
|
| 1128 |
}
|
972 |
}
|
| 1129 |
fragment = new DealsHomeFragment();
|
973 |
fragment = new DealsHomeFragment();
|
| 1130 |
fragment.setArguments(args);
|
974 |
fragment.setArguments(args);
|
| 1131 |
break;
|
975 |
break;
|
| 1132 |
case 5:
|
976 |
case 6:
|
| 1133 |
JSONObject propsSnapdeal = new JSONObject();
|
977 |
JSONObject propsSnapdeal = new JSONObject();
|
| 1134 |
try {
|
978 |
try {
|
| 1135 |
mixpanel.identify(userData.getString("id",null));
|
979 |
mixpanel.identify(userData.getString("id",null));
|
| 1136 |
propsSnapdeal.put("Screen", "Snapdeal");
|
980 |
propsSnapdeal.put("Screen", "Snapdeal");
|
| 1137 |
mixpanel.track("Snapdeal", propsSnapdeal);
|
981 |
mixpanel.track("Snapdeal", propsSnapdeal);
|
| Line 1239... |
Line 1083... |
| 1239 |
|
1083 |
|
| 1240 |
if ( connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTED ||
|
1084 |
if ( connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTED ||
|
| 1241 |
connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTING ||
|
1085 |
connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.CONNECTING ||
|
| 1242 |
connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTING ||
|
1086 |
connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTING ||
|
| 1243 |
connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTED ) {
|
1087 |
connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.CONNECTED ) {
|
| 1244 |
|
- |
|
| 1245 |
Toast.makeText(this, " Connected ", Toast.LENGTH_LONG).show();
|
- |
|
| 1246 |
return true;
|
1088 |
return true;
|
| 1247 |
|
1089 |
|
| 1248 |
} else if (
|
1090 |
} else if (
|
| 1249 |
connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.DISCONNECTED ||
|
1091 |
connec.getNetworkInfo(0).getState() == android.net.NetworkInfo.State.DISCONNECTED ||
|
| 1250 |
connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.DISCONNECTED ) {
|
1092 |
connec.getNetworkInfo(1).getState() == android.net.NetworkInfo.State.DISCONNECTED ) {
|
| 1251 |
|
- |
|
| 1252 |
Toast.makeText(this, " Not Connected ", Toast.LENGTH_LONG).show();
|
- |
|
| 1253 |
return false;
|
1093 |
return false;
|
| 1254 |
}
|
1094 |
}
|
| 1255 |
return false;
|
1095 |
return false;
|
| 1256 |
}
|
1096 |
}
|
| 1257 |
class NotificationOpenedData extends AsyncTask<ArrayList<NameValuePair>, Integer, String> {
|
1097 |
class NotificationOpenedData extends AsyncTask<ArrayList<NameValuePair>, Integer, String> {
|
| Line 1272... |
Line 1112... |
| 1272 |
httppost.setEntity(new UrlEncodedFormEntity(arg0[0]));
|
1112 |
httppost.setEntity(new UrlEncodedFormEntity(arg0[0]));
|
| 1273 |
HttpResponse response = httpclient.execute(httppost);
|
1113 |
HttpResponse response = httpclient.execute(httppost);
|
| 1274 |
HttpEntity entity = response.getEntity();
|
1114 |
HttpEntity entity = response.getEntity();
|
| 1275 |
int status = response.getStatusLine().getStatusCode();
|
1115 |
int status = response.getStatusLine().getStatusCode();
|
| 1276 |
|
1116 |
|
| 1277 |
if(status == 200){
|
- |
|
| 1278 |
Log.d("Notification Opened","Notication opened and main activity page and sent successfully");
|
- |
|
| 1279 |
Log.d("ResponseCode GCM ",status+"");
|
- |
|
| 1280 |
} else {
|
- |
|
| 1281 |
Log.d("ResponseCode GCM ",status+"");
|
- |
|
| 1282 |
}
|
- |
|
| 1283 |
|
- |
|
| 1284 |
nameValuePairsGcm.clear();
|
1117 |
nameValuePairsGcm.clear();
|
| 1285 |
Log.e("pass 1", "connection success ");
|
- |
|
| 1286 |
} catch (Exception e) {
|
1118 |
} catch (Exception e) {
|
| 1287 |
Log.e("Fail 1", e.toString());
|
1119 |
e.printStackTrace();
|
| 1288 |
|
- |
|
| 1289 |
}
|
1120 |
}
|
| 1290 |
return "success";
|
1121 |
return "success";
|
| 1291 |
}
|
1122 |
}
|
| 1292 |
|
1123 |
|
| 1293 |
@Override
|
1124 |
@Override
|
| 1294 |
protected void onPostExecute(String result) {
|
1125 |
protected void onPostExecute(String result) {
|
| 1295 |
super.onPostExecute(result);
|
1126 |
super.onPostExecute(result);
|
| 1296 |
Log.d("Notification Opened","Notication opened and main activity page");
|
- |
|
| 1297 |
}
|
1127 |
}
|
| 1298 |
}
|
1128 |
}
|
| 1299 |
}
|
1129 |
}
|
| 1300 |
|
1130 |
|