This commit is contained in:
yadavendras
2016-12-30 14:56:27 +05:30
18 changed files with 330 additions and 155 deletions
+6
View File
@@ -48,12 +48,18 @@
<activity android:name=".download.DownloadActivity" />
<activity
android:name=".geotag.GeoTagStoreList"
android:label="@string/title_activity_store_list_geotag"
android:theme="@style/AppTheme.NoActionBar" />
android:name=".gsk_dailyentry.CategoryListActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!--android:label="@string/title_activity_category_list"-->
<activity
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
@@ -1,4 +1,4 @@
package cpm.com.gskmtorange.Database;
package cpm.com.gskmtorange.database;
import android.content.ContentValues;
import android.content.Context;
@@ -9,6 +9,12 @@ import android.util.Log;
import java.util.ArrayList;
import cpm.com.gskmtorange.gettersetter.StoreBean;
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
@@ -22,6 +28,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
/**
* Created by ashishc on 29-12-2016.
*/
@@ -1,4 +1,4 @@
package cpm.com.gskmtorange.GeoTag;
package cpm.com.gskmtorange.geotag;
import android.content.SharedPreferences;
import android.location.Location;
@@ -9,10 +9,7 @@ import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.android.gms.location.LocationListener;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import cpm.com.gskmtorange.R;
@@ -1,11 +1,32 @@
package cpm.com.gskmtorange.GeoTag;
package cpm.com.gskmtorange.geotag;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import java.util.ArrayList;
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
import cpm.com.gskmtorange.database.GSKOrangeDB;
import cpm.com.gskmtorange.gettersetter.StoreBean;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
/**
* Created by ashishc on 27-12-2016.
@@ -13,28 +34,147 @@ import cpm.com.gskmtorange.R;
public class GeoTagStoreList extends AppCompatActivity {
ListView lv;
private SharedPreferences preferences;
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
String date,visit_status;
GSKOrangeDB db;
ListView list;
LinearLayout parent_linear,nodata_linear;
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.storelistlayout);
lv = (ListView) findViewById(R.id.list);
nodata_linear = (LinearLayout) findViewById(R.id.no_data_lay);
parent_linear = (LinearLayout) findViewById(R.id.parent_linear);
list = (ListView) findViewById(R.id.list_id);
// nodata_linear = (LinearLayout) findViewById(R.id.no_data_lay);
//parent_linear = (LinearLayout) findViewById(R.id.parent_linear);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
preferences = PreferenceManager.getDefaultSharedPreferences(this);
date = preferences.getString(CommonString.KEY_DATE, null);
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
db = new GSKOrangeDB(GeoTagStoreList.this);
db.open();
list = (ListView)findViewById(R .id.list_id);
storelist = db.getStoreData(date);
if (storelist.size()>0) {
list.setAdapter(new MyAdaptor());
}
list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Toast.makeText(getApplicationContext(),"Click",Toast.LENGTH_LONG).show();
}
});
}
private class MyAdaptor extends BaseAdapter {
@Override
public int getCount() {
return storelist.size();
}
@Override
public Object getItem(int position) {
return position;
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
GeoTagStoreList.ViewHolder holder = null;
if (convertView == null) {
holder = new GeoTagStoreList.ViewHolder();
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.geotagstorelist, null);
holder.storename = (TextView) convertView.findViewById(R.id.geolistviewxml_storename);
holder.imgtick = (ImageView) convertView
.findViewById(R.id.imageView1);
convertView.setTag(holder);
} else {
holder = (GeoTagStoreList.ViewHolder) convertView.getTag();
}
holder.storename.setText(storelist.get(position).getSTORE_NAME());
//holder.storeaddress.setText(storelist.get(position).getCITY());
return convertView;
}
}
private class ViewHolder {
TextView storename, storeaddress;
ImageView imgtick;
Button checkout;
RelativeLayout l1;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if(id==android.R.id.home){
// NavUtils.navigateUpFromSameTask(this);
finish();
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
}
return super.onOptionsItemSelected(item);
}
}
@@ -1,4 +1,4 @@
package cpm.com.gskmtorange.GetterSetter;
package cpm.com.gskmtorange.gettersetter;
/**
* Created by ashishc on 29-12-2016.
@@ -17,20 +17,20 @@ import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;
import cpm.com.gskmtorange.geotag.GeoTagStoreList;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;
import java.text.SimpleDateFormat;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
@@ -156,7 +156,15 @@ public class MainActivity extends AppCompatActivity
} else if (id == R.id.nav_upload) {
} else if (id == R.id.nav_geotag) {
}
else if (id == R.id.nav_geotag) {
Intent startDownload = new Intent(this,GeoTagStoreList.class);
startActivity(startDownload);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
} else if (id == R.id.nav_exit) {
@@ -3,7 +3,6 @@ package cpm.com.gskmtorange.dailyentry;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
@@ -24,8 +23,8 @@ import android.widget.Toast;
import java.util.ArrayList;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.GetterSetter.StoreBean;
import cpm.com.gskmtorange.database.GSKOrangeDB;
import cpm.com.gskmtorange.gettersetter.StoreBean;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
@@ -26,8 +26,7 @@ import java.io.StringReader;
import java.net.MalformedURLException;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.LoginActivity;
import cpm.com.gskmtorange.database.GSKOrangeDB;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
@@ -5,7 +5,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="cpm.com.gskmtorange.GeoTag.GeoTagActivity">
tools:context="cpm.com.gskmtorange.geotag.GeoTagActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
@@ -11,7 +11,7 @@
android:paddingRight="@dimen/custom_margin"
android:paddingTop="@dimen/custom_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="cpm.com.gskmtorange.GeoTag.GeoTagActivity"
tools:context="cpm.com.gskmtorange.geotag.GeoTagActivity"
tools:showIn="@layout/activity_geo_tag">
</fragment>
@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:layout_weight="35"
card_view:cardBackgroundColor="@color/colorOrange"
card_view:cardCornerRadius="15dp">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="55dp"
android:layout_marginBottom="1sp"
android:padding="10sp">
<ImageView
android:id="@+id/geolistviewxml_storeico"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginRight="6sp"
android:paddingTop="5sp"
android:src="@mipmap/store" />
<TextView
android:id="@+id/geolistviewxml_storename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/geolistviewxml_storeico"
android:layout_toRightOf="@+id/geolistviewxml_storeico"
android:text="GSK MT ORANGE STORE"
android:textColor="#1F3A6C"
android:textSize="12sp"
android:textStyle="bold" />
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/geolistviewxml_storeico"
android:layout_alignParentRight="true"
android:background="@mipmap/geopin" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
@@ -68,7 +68,7 @@
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:choiceMode="singleChoice"
android:divider="#ff9933"
android:dividerHeight="2dp"
android:drawSelectorOnTop="false"
android:fastScrollEnabled="true"
@@ -1,143 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:weightSum="10"
android:id="@+id/parent_linear"
android:background="#fff">
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:orientation="vertical" >
<TextView
android:id="@+id/geotag_title_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="Store List"
android:textColor="#e2e2e2"
android:textStyle="bold"
android:textSize="30sp" />
</LinearLayout>
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:weightSum="100">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay">
</android.support.v7.widget.Toolbar>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="9"
android:paddingTop="5dp"
android:divider="@null"
android:dividerHeight="0dp"
<LinearLayout
android:id="@+id/storename"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_weight="10"
android:background="#ff9933"
android:padding="5sp"
android:visibility="gone">
<TextView
android:id="@+id/store_ID"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:paddingLeft="20dp"
android:text="Stores"
android:textColor="#ffffff"
android:textSize="20sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/storelist"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_weight="100"
>
</ListView>
<ListView
android:id="@+id/list_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:cacheColorHint="#00000000"
android:choiceMode="singleChoice"
android:dividerHeight="2dp"
android:drawSelectorOnTop="false"
android:fastScrollEnabled="true"
android:smoothScrollbar="true" />
<LinearLayout
android:id="@+id/no_data_lay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="8"
android:background="@color/grey_background"
android:visibility="gone"
>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
card_view:cardBackgroundColor="@color/white"
card_view:cardCornerRadius="5dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="No data available"
android:textSize="25sp"
android:textStyle="bold"
android:gravity="center"/>
</android.support.v7.widget.CardView>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="4"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:background="@drawable/sad_cloud"
android:layout_centerInParent="true"
/>
<View
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<android.support.v7.widget.CardView
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
card_view:cardBackgroundColor="@color/white"
card_view:cardCornerRadius="5dp"
>
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Please download data"
android:textSize="25sp"
android:textStyle="bold"
android:gravity="center"/>
</android.support.v7.widget.CardView>
</LinearLayout>
</LinearLayout>
</LinearLayout>
@@ -1,16 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:layout_weight="35"
card_view:cardBackgroundColor="@color/colorOrange"
card_view:cardCornerRadius="15dp">
<RelativeLayout
android:id="@+id/storenamelistview_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:background="@drawable/list_selector"
android:padding="10sp">
<ImageView
@@ -20,7 +34,7 @@
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginRight="6sp"
android:background="@drawable/store"
android:background="@mipmap/store"
android:paddingTop="5sp" />
<TextView
@@ -29,7 +43,7 @@
android:layout_height="wrap_content"
android:layout_alignTop="@+id/storelistviewxml_storeico"
android:layout_toRightOf="@+id/storelistviewxml_storeico"
android:text="Balaji Tele Communication"
android:text="GSK MT ORANGE STORE"
android:textColor="#1F3A6C"
android:textSize="16sp"
android:textStyle="bold" />
@@ -54,5 +68,5 @@
android:focusable="false"
android:visibility="invisible" />
</RelativeLayout>
</android.support.v7.widget.CardView>
</RelativeLayout>
Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

@@ -9,4 +9,8 @@
<color name="grey_background">#EEEEEE</color>
<color name="blue">#2196F3</color>
<color name="colorOrange">#FFE0B2</color>
</resources>