| Line 1... |
Line 1... |
| 1 |
package com.saholic.profittill.main;
|
1 |
package com.saholic.profittill.main;
|
| 2 |
|
2 |
|
| 3 |
import android.app.Activity;
|
3 |
import android.app.Fragment;
|
| 4 |
import android.app.AlertDialog;
|
- |
|
| 5 |
import android.app.ProgressDialog;
|
- |
|
| 6 |
import android.content.Context;
|
4 |
import android.content.Context;
|
| 7 |
import android.content.DialogInterface;
|
- |
|
| 8 |
import android.content.Intent;
|
5 |
import android.content.Intent;
|
| 9 |
import android.content.SharedPreferences;
|
6 |
import android.content.SharedPreferences;
|
| 10 |
import android.content.pm.ActivityInfo;
|
7 |
import android.content.pm.ActivityInfo;
|
| 11 |
import android.graphics.Bitmap;
|
- |
|
| 12 |
import android.graphics.Color;
|
- |
|
| 13 |
import android.net.Uri;
|
- |
|
| 14 |
import android.os.AsyncTask;
|
- |
|
| 15 |
import android.os.Bundle;
|
8 |
import android.os.Bundle;
|
| 16 |
import android.app.Fragment;
|
- |
|
| 17 |
import android.support.v4.view.ViewPager;
|
9 |
import android.support.v4.view.ViewPager;
|
| 18 |
import android.util.Log;
|
- |
|
| 19 |
import android.view.KeyEvent;
|
10 |
import android.view.KeyEvent;
|
| 20 |
import android.view.LayoutInflater;
|
11 |
import android.view.LayoutInflater;
|
| 21 |
import android.view.View;
|
12 |
import android.view.View;
|
| 22 |
import android.view.ViewGroup;
|
13 |
import android.view.ViewGroup;
|
| 23 |
import android.webkit.JavascriptInterface;
|
- |
|
| 24 |
import android.webkit.WebView;
|
- |
|
| 25 |
import android.webkit.WebViewClient;
|
- |
|
| 26 |
import android.widget.Button;
|
14 |
import android.widget.Button;
|
| 27 |
import android.widget.TextView;
|
15 |
import android.widget.TextView;
|
| 28 |
import android.widget.Toast;
|
- |
|
| 29 |
|
16 |
|
| 30 |
import com.google.android.gms.analytics.HitBuilders;
|
17 |
import com.google.android.gms.analytics.HitBuilders;
|
| 31 |
import com.google.android.gms.analytics.Tracker;
|
18 |
import com.google.android.gms.analytics.Tracker;
|
| 32 |
import com.saholic.profittill.R;
|
19 |
import com.saholic.profittill.R;
|
| 33 |
import com.saholic.profittill.Utils.CustomPageAdapter;
|
20 |
import com.saholic.profittill.Utils.CustomPageAdapter;
|
| 34 |
import com.viewpagerindicator.CirclePageIndicator;
|
21 |
import com.viewpagerindicator.CirclePageIndicator;
|
| 35 |
|
22 |
|
| 36 |
import org.apache.http.HttpEntity;
|
- |
|
| 37 |
import org.apache.http.HttpResponse;
|
- |
|
| 38 |
import org.apache.http.NameValuePair;
|
- |
|
| 39 |
import org.apache.http.client.ClientProtocolException;
|
- |
|
| 40 |
import org.apache.http.client.HttpClient;
|
- |
|
| 41 |
import org.apache.http.client.entity.UrlEncodedFormEntity;
|
- |
|
| 42 |
import org.apache.http.client.methods.HttpPost;
|
- |
|
| 43 |
import org.apache.http.entity.StringEntity;
|
- |
|
| 44 |
import org.apache.http.impl.client.DefaultHttpClient;
|
- |
|
| 45 |
import org.apache.http.message.BasicNameValuePair;
|
- |
|
| 46 |
import org.json.JSONArray;
|
- |
|
| 47 |
import org.json.JSONException;
|
- |
|
| 48 |
import org.json.JSONObject;
|
- |
|
| 49 |
|
- |
|
| 50 |
import java.io.BufferedReader;
|
- |
|
| 51 |
import java.io.IOException;
|
- |
|
| 52 |
import java.io.InputStream;
|
- |
|
| 53 |
import java.io.InputStreamReader;
|
- |
|
| 54 |
import java.text.SimpleDateFormat;
|
- |
|
| 55 |
import java.util.ArrayList;
|
- |
|
| 56 |
import java.util.Date;
|
- |
|
| 57 |
import java.util.StringTokenizer;
|
- |
|
| 58 |
|
- |
|
| 59 |
|
23 |
|
| 60 |
public class HowItWorksFragment extends Fragment {
|
24 |
public class HowItWorksFragment extends Fragment {
|
| 61 |
SharedPreferences userData;
|
25 |
SharedPreferences userData;
|
| 62 |
SharedPreferences apiData;
|
26 |
SharedPreferences apiData;
|
| 63 |
SharedPreferences.Editor userDataEditor;
|
27 |
SharedPreferences.Editor userDataEditor;
|
| Line 85... |
Line 49... |
| 85 |
skipHowItWorks = (TextView)rootView.findViewById(R.id.skipHowItWorks);
|
49 |
skipHowItWorks = (TextView)rootView.findViewById(R.id.skipHowItWorks);
|
| 86 |
Tracker t = ((GoogleAnalyticsTracker) getActivity().getApplicationContext()).getTracker(
|
50 |
Tracker t = ((GoogleAnalyticsTracker) getActivity().getApplicationContext()).getTracker(
|
| 87 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
51 |
GoogleAnalyticsTracker.TrackerName.APP_TRACKER);
|
| 88 |
t.setScreenName("Tutorials Screen");
|
52 |
t.setScreenName("Tutorials Screen");
|
| 89 |
t.send(new HitBuilders.ScreenViewBuilder().build());
|
53 |
t.send(new HitBuilders.ScreenViewBuilder().build());
|
| 90 |
final int[] flag = new int[] {R.drawable.dealstutorial1, R.drawable.cashback,
|
54 |
/*final int[] flag = new int[] {R.drawable.mypreferencesnew,R.drawable.dealstutorial1, R.drawable.cashback,
|
| 91 |
R.drawable.mypreferencestutorial, R.drawable.searchtutorial};
|
55 |
R.drawable.mypreferencestutorial, R.drawable.searchtutorial};*/
|
| 92 |
|
56 |
|
| - |
|
57 |
final int[] flag = new int[] {R.drawable.dealstutorial1,R.drawable.searchtutorialnew, R.drawable.cashback,
|
| - |
|
58 |
R.drawable.filter, R.drawable.preference};
|
| - |
|
59 |
|
| 93 |
String[] rank = new String[] { "1", "2", "3", "4"};
|
60 |
String[] rank = new String[] { "1", "2", "3", "4","5"};
|
| 94 |
String[] openingText = new String[] { "We recommend, You profit","Get Cashback every time you shop", "Get deals that you are looking for", "Compare prices from all the big stores" };
|
61 |
/*String[] openingText = new String[] { "First, Tell Us What You Like","We recommend, You profit","Get Cashback every time you shop", "Get deals that you are looking for", "Compare prices from all the big stores" };
|
| 95 |
String[] middleText = new String[] { "We search the whole internet to find the best deals on mobiles and other products only for you", "Redeem your cashback every week. Get the money in your Saholic Wallet and use that on Mobile and DTH recharges.", "You can easily set up your preferences for the category, brand and price range that you are interested in", "You have a single screen to look at prices from Flipkart, Amazon, Snapdeal and more!"};
|
62 |
String[] middleText = new String[] { "Start by listing your favorite brands, your price range, & get better, targeted deals","We search the whole internet to find the best deals on mobiles and other products only for you", "Redeem your cashback every week. Get the money in your Saholic Wallet and use that on Mobile and DTH recharges.", "You can easily set up your preferences for the category, brand and price range that you are interested in", "You have a single screen to look at prices from Flipkart, Amazon, Snapdeal and more!"};*/
|
| - |
|
63 |
|
| - |
|
64 |
String[] openingText = new String[] {"We recommend, You profit","Compare prices from all the big stores","Get Cashback every time you shop", "Get deals that you are looking for", "Now, Tell Us What You Like" };
|
| - |
|
65 |
String[] middleText = new String[] {"We search the whole internet to find the best deals on mobiles and other products only for you","You have a single screen to look at prices from Flipkart, Amazon, Snapdeal and more!", "Redeem your cashback every week. Get the money in your Saholic Wallet and use that on Mobile and DTH recharges.", "Simply use the filter tool to refine all deals by brand, price, popularity and our recommendations", "Start by listing your favorite brands, your price range, & get better, targeted deals"};
|
| 96 |
vpPager = (ViewPager)rootView.findViewById(R.id.pager);
|
66 |
vpPager = (ViewPager)rootView.findViewById(R.id.pager);
|
| 97 |
CustomPageAdapter adapter = new CustomPageAdapter(getActivity(),rank,flag,openingText,middleText);
|
67 |
CustomPageAdapter adapter = new CustomPageAdapter(getActivity(),rank,flag,openingText,middleText);
|
| 98 |
vpPager.setAdapter(adapter);
|
68 |
vpPager.setAdapter(adapter);
|
| 99 |
mIndicator = (CirclePageIndicator)rootView.findViewById(R.id.indicator);
|
69 |
mIndicator = (CirclePageIndicator)rootView.findViewById(R.id.indicator);
|
| 100 |
mIndicator.setViewPager(vpPager);
|
70 |
mIndicator.setViewPager(vpPager);
|
| Line 133... |
Line 103... |
| 133 |
});
|
103 |
});
|
| 134 |
|
104 |
|
| 135 |
skipHowItWorks.setOnClickListener(new View.OnClickListener() {
|
105 |
skipHowItWorks.setOnClickListener(new View.OnClickListener() {
|
| 136 |
@Override
|
106 |
@Override
|
| 137 |
public void onClick(View v) {
|
107 |
public void onClick(View v) {
|
| - |
|
108 |
userDataEditor.putString("preferences","true").commit();
|
| - |
|
109 |
PreferencesFragment my_preferences = new PreferencesFragment();
|
| 138 |
startActivity(new Intent(getActivity(),MainActivity.class));
|
110 |
getActivity().getFragmentManager().beginTransaction()
|
| - |
|
111 |
.replace(R.id.frame_container, my_preferences, "Mike")
|
| - |
|
112 |
.addToBackStack(null)
|
| - |
|
113 |
.commit();
|
| 139 |
}
|
114 |
}
|
| 140 |
});
|
115 |
});
|
| 141 |
textDealsView.setOnClickListener(new View.OnClickListener() {
|
116 |
textDealsView.setOnClickListener(new View.OnClickListener() {
|
| 142 |
@Override
|
117 |
@Override
|
| 143 |
public void onClick(View v) {
|
118 |
public void onClick(View v) {
|
| - |
|
119 |
userDataEditor.putString("preferences","true").commit();
|
| - |
|
120 |
PreferencesFragment my_preferences = new PreferencesFragment();
|
| 144 |
startActivity(new Intent(getActivity(),MainActivity.class));
|
121 |
getActivity().getFragmentManager().beginTransaction()
|
| - |
|
122 |
.replace(R.id.frame_container, my_preferences, "Mike")
|
| - |
|
123 |
.addToBackStack(null)
|
| - |
|
124 |
.commit();
|
| - |
|
125 |
|
| 145 |
}
|
126 |
}
|
| 146 |
});
|
127 |
});
|
| 147 |
|
128 |
|
| 148 |
return rootView;
|
129 |
return rootView;
|
| 149 |
|
130 |
|