Merge remote-tracking branch 'origin/GeoT' into GeoT
# Conflicts: # GSKMTOrange/src/main/AndroidManifest.xml # GSKMTOrange/src/main/java/cpm/com/gskmtorange/GeoTag/GeoTagActivity.java
This commit is contained in:
@@ -8,6 +8,7 @@ import android.graphics.Bitmap;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
import android.support.design.widget.Snackbar;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.support.design.widget.NavigationView;
|
import android.support.design.widget.NavigationView;
|
||||||
@@ -29,9 +30,11 @@ import java.io.FileInputStream;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
import cpm.com.gskmtorange.GeoTag.GeoTagStoreList;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||||
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
|
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
|
||||||
@@ -43,20 +46,20 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
WebView webView;
|
WebView webView;
|
||||||
ImageView imageView;
|
ImageView imageView;
|
||||||
|
String date, visit_status;
|
||||||
private SharedPreferences preferences = null;
|
private SharedPreferences preferences = null;
|
||||||
|
GSKOrangeDB db;
|
||||||
String user_name, user_type;
|
String user_name, user_type;
|
||||||
|
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||||
|
View headerView;
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||||
|
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||||
imageView = (ImageView) findViewById(R.id.img_main);
|
imageView = (ImageView) findViewById(R.id.img_main);
|
||||||
|
|
||||||
webView = (WebView) findViewById(R.id.webview);
|
webView = (WebView) findViewById(R.id.webview);
|
||||||
@@ -65,6 +68,9 @@ public class MainActivity extends AppCompatActivity
|
|||||||
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||||
//user_type = preferences.getString(CommonString.KEY_USER_TYPE, null);
|
//user_type = preferences.getString(CommonString.KEY_USER_TYPE, null);
|
||||||
|
|
||||||
|
db = new GSKOrangeDB(MainActivity.this);
|
||||||
|
db.open();
|
||||||
|
|
||||||
webView.setWebViewClient(new MyWebViewClient());
|
webView.setWebViewClient(new MyWebViewClient());
|
||||||
|
|
||||||
webView.getSettings().setJavaScriptEnabled(true);
|
webView.getSettings().setJavaScriptEnabled(true);
|
||||||
@@ -92,7 +98,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
|
||||||
|
|
||||||
View headerView = LayoutInflater.from(this).inflate(R.layout.nav_header_main, navigationView, false);
|
headerView = LayoutInflater.from(this).inflate(R.layout.nav_header_main, navigationView, false);
|
||||||
|
|
||||||
TextView tv_username = (TextView) headerView.findViewById(R.id.nav_user_name);
|
TextView tv_username = (TextView) headerView.findViewById(R.id.nav_user_name);
|
||||||
//tv_usertype = (TextView) headerView.findViewById(R.id.nav_user_type);
|
//tv_usertype = (TextView) headerView.findViewById(R.id.nav_user_type);
|
||||||
@@ -162,11 +168,21 @@ public class MainActivity extends AppCompatActivity
|
|||||||
else if (id == R.id.nav_geotag) {
|
else if (id == R.id.nav_geotag) {
|
||||||
|
|
||||||
|
|
||||||
|
storelist = db.getStoreData(date);
|
||||||
|
|
||||||
Intent startDownload = new Intent(this,GeoTagStoreList.class);
|
|
||||||
startActivity(startDownload);
|
|
||||||
|
|
||||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
if(storelist.size()>0)
|
||||||
|
{
|
||||||
|
Intent startDownload = new Intent(this,GeoTagStoreList.class);
|
||||||
|
startActivity(startDownload);
|
||||||
|
|
||||||
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Snackbar.make(headerView, R.string.title_store_list_download_data, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} else if (id == R.id.nav_exit) {
|
} else if (id == R.id.nav_exit) {
|
||||||
|
|
||||||
@@ -179,6 +195,7 @@ public class MainActivity extends AppCompatActivity
|
|||||||
|
|
||||||
} else if (id == R.id.nav_setting) {
|
} else if (id == R.id.nav_setting) {
|
||||||
startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
||||||
|
|
||||||
} else if (id == R.id.nav_export) {
|
} else if (id == R.id.nav_export) {
|
||||||
|
|
||||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
|
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
|
||||||
|
|||||||
Reference in New Issue
Block a user