Merge branch 'master' into GeoT
@@ -41,7 +41,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
|
||||
<activity
|
||||
android:name=".SplashScreenActivity"
|
||||
android:label="@string/app_name"
|
||||
@@ -28,10 +29,12 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".LoginActivity"
|
||||
android:label="@string/title_activity_login"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name"
|
||||
@@ -41,20 +44,52 @@
|
||||
android:name=".SelectLanguageActivity"
|
||||
android:label="@string/title_activity_select_language"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
<activity android:name=".download.DownloadActivity"></activity>
|
||||
|
||||
<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"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<!-- android:label="@string/title_activity_category_wise_performance" -->
|
||||
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.DailyDataMenuActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<!--android:label="@string/title_activity_daily_main_menu"-->
|
||||
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<!--android:label="@string/title_activity_msl__availability"-->
|
||||
<activity
|
||||
android:name=".dailyentry.StoreListActivity"
|
||||
android:label="@string/title_activity_store_list_geotag"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<activity
|
||||
android:name=".gsk_dailyentry.Stock_FacingActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -9,32 +9,42 @@ 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;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
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.
|
||||
*/
|
||||
|
||||
public class GSKOrangeDB extends SQLiteOpenHelper{
|
||||
|
||||
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE";
|
||||
public static final int DATABASE_VERSION = 13;
|
||||
private SQLiteDatabase db;
|
||||
TableBean tableBean;
|
||||
|
||||
public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE";
|
||||
public static final int DATABASE_VERSION = 13;
|
||||
private SQLiteDatabase db;
|
||||
TableBean tableBean;
|
||||
|
||||
public GSKOrangeDB(Context context) {
|
||||
super(context, DATABASE_NAME, null, DATABASE_VERSION);
|
||||
|
||||
}
|
||||
|
||||
public void open() {
|
||||
try {
|
||||
|
||||
db = this.getWritableDatabase();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -45,37 +55,32 @@ public class GSKOrangeDB extends SQLiteOpenHelper{
|
||||
public void onCreate(SQLiteDatabase db) {
|
||||
|
||||
db.execSQL(TableBean.getJourneyPlan());
|
||||
db.execSQL(TableBean.getBrandMaster());
|
||||
db.execSQL(TableBean.getSkuMaster());
|
||||
db.execSQL(TableBean.getCategoryMaster());
|
||||
db.execSQL(TableBean.getSubCategoryMaster());
|
||||
db.execSQL(TableBean.getDisplayMaster());
|
||||
|
||||
|
||||
|
||||
|
||||
db.execSQL(TableBean.getMappingStock());
|
||||
db.execSQL(TableBean.getMappingT2p());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
db.execSQL("DROP TABLE IF EXISTS " + TableBean.getJourneyPlan());
|
||||
|
||||
}
|
||||
|
||||
public void deleteTableWithStoreID(String storeid, String process_id){
|
||||
|
||||
public void deleteTableWithStoreID(String storeid, String process_id) {
|
||||
}
|
||||
|
||||
public void deleteAllTables(){
|
||||
public void deleteAllTables() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||
|
||||
db.delete("JOURNEY_PLAN", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
|
||||
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
|
||||
@@ -115,21 +120,11 @@ public class GSKOrangeDB extends SQLiteOpenHelper{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex) {
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception in JCP", ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public ArrayList<StoreBean> getStoreData(String date) {
|
||||
|
||||
|
||||
@@ -208,13 +203,138 @@ public class GSKOrangeDB extends SQLiteOpenHelper{
|
||||
return list;
|
||||
}
|
||||
|
||||
//Gagan Goel
|
||||
public void InsertCategory(CategoryMasterGetterSetter data) {
|
||||
db.delete("CATEGORY_MASTER", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getCATEGORY_ID().size(); i++) {
|
||||
|
||||
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
|
||||
values.put("CATEGORY", data.getCATEGORY().get(i));
|
||||
values.put("CATEGORY_SEQUENCE", data.getCATEGORY_SEQUENCE().get(i));
|
||||
|
||||
db.insert("CATEGORY_MASTER", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in CATEGORY_MASTER " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertMappingStock(MappingStockGetterSetter data) {
|
||||
db.delete("MAPPING_STOCK", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getKEYACCOUNT_ID().size(); i++) {
|
||||
|
||||
values.put("KEYACCOUNT_ID", data.getKEYACCOUNT_ID().get(i));
|
||||
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
|
||||
values.put("CLASS_ID", data.getCLASS_ID().get(i));
|
||||
values.put("SKU_ID", data.getSKU_ID().get(i));
|
||||
values.put("MUST_HAVE", data.getMUST_HAVE().get(i));
|
||||
values.put("MBQ", data.getMBQ().get(i));
|
||||
|
||||
db.insert("MAPPING_STOCK", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertSubCategoryMaster(SubCategoryMasterGetterSetter data) {
|
||||
db.delete("SUB_CATEGORY_MASTER", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getSUB_CATEGORY_ID().size(); i++) {
|
||||
|
||||
values.put("SUB_CATEGORY_ID", data.getSUB_CATEGORY_ID().get(i));
|
||||
values.put("SUB_CATEGORY", data.getSUB_CATEGORY().get(i));
|
||||
values.put("CATEGORY_ID", data.getCATEGORY_ID().get(i));
|
||||
values.put("SUB_CATEGORY_SEQUENCE", data.getSUB_CATEGORY_SEQUENCE().get(i));
|
||||
|
||||
db.insert("SUB_CATEGORY_MASTER", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertBrandMaster(BrandMasterGetterSetter data) {
|
||||
db.delete("BRAND_MASTER", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getBRAND_ID().size(); i++) {
|
||||
|
||||
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
||||
values.put("BRAND", data.getBRAND().get(i));
|
||||
values.put("SUB_CATEGORY_ID", data.getSUB_CATEGORY_ID().get(i));
|
||||
values.put("COMPANY_ID", data.getCOMPANY_ID().get(i));
|
||||
values.put("BRAND_SEQUENCE", data.getBRAND_SEQUENCE().get(i));
|
||||
|
||||
db.insert("BRAND_MASTER", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in BRAND_MASTER " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertSkuMaster(SkuMasterGetterSetter data) {
|
||||
db.delete("SKU_MASTER", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getSKU_ID().size(); i++) {
|
||||
|
||||
values.put("SKU_ID", data.getSKU_ID().get(i));
|
||||
values.put("SKU", data.getSKU().get(i));
|
||||
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
||||
values.put("MRP", data.getMRP().get(i));
|
||||
values.put("SKU_SEQUENCE", data.getSKU_SEQUENCE().get(i));
|
||||
|
||||
db.insert("SKU_MASTER", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in SKU_MASTER " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertDisplayMaster(DisplayMasterGetterSetter data) {
|
||||
db.delete("DISPLAY_MASTER", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getDISPLAY_ID().size(); i++) {
|
||||
|
||||
values.put("DISPLAY_ID", data.getDISPLAY_ID().get(i));
|
||||
values.put("DISPLAY", data.getDISPLAY().get(i));
|
||||
values.put("IMAGE_URL", data.getIMAGE_URL().get(i));
|
||||
|
||||
db.insert("DISPLAY_MASTER", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in DISPLAY_MASTER " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void InsertMAPPING_T2P(MAPPINGT2PGetterSetter data) {
|
||||
db.delete("MAPPING_T2P", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
|
||||
|
||||
values.put("STORE_ID", data.getSTORE_ID().get(i));
|
||||
values.put("BRAND_ID", data.getBRAND_ID().get(i));
|
||||
values.put("DISPLAY_ID", data.getDISPLAY_ID().get(i));
|
||||
|
||||
db.insert("MAPPING_T2P", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in MAPPING_T2P " + ex.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ import cpm.com.gskmtorange.R;
|
||||
* Created by ashishc on 27-12-2016.
|
||||
*/
|
||||
|
||||
public class GeoTagActivity extends AppCompatActivity //implements OnMapReadyCallback,GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener
|
||||
{
|
||||
public class GeoTagActivity extends AppCompatActivity {
|
||||
//implements OnMapReadyCallback,GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener{
|
||||
|
||||
private GoogleMap mMap;
|
||||
double latitude =0.0;
|
||||
@@ -49,6 +49,7 @@ public class GeoTagActivity extends AppCompatActivity //implements OnMapReady
|
||||
|
||||
mapFragment = (SupportMapFragment) getSupportFragmentManager()
|
||||
.findFragmentById(R.id.map);
|
||||
//mapFragment.getMapAsync(this);
|
||||
// mapFragment.getMapAsync(this);
|
||||
|
||||
|
||||
|
||||
@@ -115,13 +115,11 @@ public class LoginActivity extends AppCompatActivity {
|
||||
// Set up the login form.
|
||||
museridView = (AutoCompleteTextView) findViewById(R.id.userid);
|
||||
//populateAutoComplete();
|
||||
|
||||
mPasswordView = (EditText) findViewById(R.id.password);
|
||||
|
||||
museridView.setText("testmer");
|
||||
mPasswordView.setText("cpm123");
|
||||
|
||||
|
||||
mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package cpm.com.gskmtorange;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.support.design.widget.NavigationView;
|
||||
@@ -19,8 +23,16 @@ 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.constant.CommonString;
|
||||
import cpm.com.gskmtorange.gsk_dailyentry.CategoryListActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StoreListActivity;
|
||||
import cpm.com.gskmtorange.download.DownloadActivity;
|
||||
|
||||
@@ -47,7 +59,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
webView = (WebView) findViewById(R.id.webview);
|
||||
|
||||
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK,"");
|
||||
String url = preferences.getString(CommonString.KEY_NOTICE_BOARD_LINK, "");
|
||||
user_name = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
//user_type = preferences.getString(CommonString.KEY_USER_TYPE, null);
|
||||
|
||||
@@ -55,7 +67,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
webView.getSettings().setJavaScriptEnabled(true);
|
||||
|
||||
if(!url.equals("")){
|
||||
if (!url.equals("")) {
|
||||
|
||||
webView.loadUrl(url);
|
||||
|
||||
@@ -80,7 +92,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
View 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_username.setText(user_name);
|
||||
@@ -130,7 +142,7 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
if (id == R.id.nav_route_plan) {
|
||||
|
||||
Intent startDownload = new Intent(this,StoreListActivity.class);
|
||||
Intent startDownload = new Intent(this, StoreListActivity.class);
|
||||
startActivity(startDownload);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
@@ -154,32 +166,68 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//}
|
||||
|
||||
else if (id == R.id.nav_export) {
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
else if (id == R.id.nav_exit) {
|
||||
} else if (id == R.id.nav_exit) {
|
||||
|
||||
} else if (id == R.id.nav_services) {
|
||||
|
||||
}else if (id == R.id.nav_setting) {
|
||||
} else if (id == R.id.nav_setting) {
|
||||
startActivity(new Intent(MainActivity.this, CategoryListActivity.class));
|
||||
} else if (id == R.id.nav_export) {
|
||||
|
||||
AlertDialog.Builder builder1 = new AlertDialog.Builder(MainActivity.this);
|
||||
builder1.setMessage("Are you sure you want to take the backup of your data")
|
||||
.setCancelable(false)
|
||||
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||
@SuppressWarnings("resource")
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
try {
|
||||
/*File file = new File(Environment
|
||||
.getExternalStorageDirectory(),
|
||||
"capital_backup");
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
}*/
|
||||
|
||||
File sd = Environment.getExternalStorageDirectory();
|
||||
File data = Environment.getDataDirectory();
|
||||
|
||||
if (sd.canWrite()) {
|
||||
long date = System.currentTimeMillis();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("MMM/dd/yy");
|
||||
String dateString = sdf.format(date);
|
||||
|
||||
String currentDBPath = "//data//cpm.com.gskmtorange//databases//" + GSKOrangeDB.DATABASE_NAME;
|
||||
String backupDBPath = "GSKMT_ORANGE_Database_backup" + dateString.replace('/', '-');
|
||||
|
||||
String path = Environment.getExternalStorageDirectory().getPath();
|
||||
|
||||
File currentDB = new File(data, currentDBPath);
|
||||
File backupDB = new File(path, backupDBPath);
|
||||
|
||||
//Snackbar.make(rec_store_data, "Database Exported Successfully", Snackbar.LENGTH_SHORT).show();
|
||||
|
||||
if (currentDB.exists()) {
|
||||
@SuppressWarnings("resource")
|
||||
FileChannel src = new FileInputStream(currentDB).getChannel();
|
||||
FileChannel dst = new FileOutputStream(backupDB).getChannel();
|
||||
dst.transferFrom(src, 0, src.size());
|
||||
src.close();
|
||||
dst.close();
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert1 = builder1.create();
|
||||
alert1.show();
|
||||
}
|
||||
|
||||
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
|
||||
|
||||
@@ -70,7 +70,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, null);
|
||||
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||
new UploadTask(DownloadActivity.this).execute();
|
||||
}
|
||||
|
||||
@@ -79,8 +79,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
String name;
|
||||
}
|
||||
|
||||
private class UploadTask extends AsyncTask<Void , Data, String>{
|
||||
|
||||
private class UploadTask extends AsyncTask<Void, Data, String> {
|
||||
private Context context;
|
||||
|
||||
UploadTask(Context context) {
|
||||
@@ -100,75 +99,63 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
message = (TextView) dialog.findViewById(R.id.message);
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... voids) {
|
||||
|
||||
try {
|
||||
|
||||
String resultHttp="";
|
||||
String resultHttp = "";
|
||||
data = new Data();
|
||||
|
||||
data.value = 10;
|
||||
data.name = "JCP Data Downloading";
|
||||
publishProgress(data);
|
||||
|
||||
XmlPullParserFactory factory = XmlPullParserFactory
|
||||
.newInstance();
|
||||
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
||||
factory.setNamespaceAware(true);
|
||||
XmlPullParser xpp = factory.newPullParser();
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "JOURNEY_PLAN");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
|
||||
SoapEnvelope.VER11);
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(
|
||||
CommonString.URL);
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL,
|
||||
envelope);
|
||||
Object result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
|
||||
if (result.toString() != null) {
|
||||
//InputStream stream = new ByteArrayInputStream(result.toString().getBytes("UTF-8"));
|
||||
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||
// xpp.setInput(stream,"UTF-8");
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||
// xpp.setInput(stream,"UTF-8");
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
|
||||
jcpgettersetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
||||
|
||||
if(jcpgettersetter.getSTORE_ID().size()>0){
|
||||
if (jcpgettersetter.getSTORE_ID().size() > 0) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
String jcpTable = jcpgettersetter.getTable_journey_plan();
|
||||
TableBean.setJourneyPlan(jcpTable);
|
||||
|
||||
}else{
|
||||
} else {
|
||||
return "JOURNEY_PLAN";
|
||||
}
|
||||
|
||||
data.value = 10;
|
||||
data.name = "JCP Data Downloading";
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
// Store List Master
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "SKU_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
@@ -178,36 +165,33 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
skumastergettersetter =XMLHandlers.skuMasterXMLHandler(xpp, eventType);
|
||||
if(skumastergettersetter.getSKU_ID().size()>0){
|
||||
skumastergettersetter = XMLHandlers.skuMasterXMLHandler(xpp, eventType);
|
||||
if (skumastergettersetter.getSKU_ID().size() > 0) {
|
||||
String skutable = skumastergettersetter.getTable_SKU_MASTER();
|
||||
if(skutable!=null){
|
||||
if (skutable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setSkuMaster(skutable);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return "SKU_MASTER";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.name = "SKU_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// BRAND_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
// BRAND_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "BRAND_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
@@ -217,36 +201,33 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
brandMasterGetterSetter =XMLHandlers.brandMasterXMLHandler(xpp, eventType);
|
||||
if(brandMasterGetterSetter.getBRAND_ID().size()>0){
|
||||
brandMasterGetterSetter = XMLHandlers.brandMasterXMLHandler(xpp, eventType);
|
||||
if (brandMasterGetterSetter.getBRAND_ID().size() > 0) {
|
||||
String brandtable = brandMasterGetterSetter.getTable_BRAND_MASTER();
|
||||
if(brandtable!=null){
|
||||
if (brandtable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setBrandMaster(brandtable);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return "BRAND_MASTER";
|
||||
}
|
||||
|
||||
data.value = 30;
|
||||
data.name = "BRAND_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// SUB_CATEGORY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
// SUB_CATEGORY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "SUB_CATEGORY_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
@@ -256,36 +237,32 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
subCategoryMasterGetterSetter =XMLHandlers.subCategoryMasterXMLHandler(xpp, eventType);
|
||||
if(subCategoryMasterGetterSetter.getSUB_CATEGORY_ID().size()>0){
|
||||
subCategoryMasterGetterSetter = XMLHandlers.subCategoryMasterXMLHandler(xpp, eventType);
|
||||
if (subCategoryMasterGetterSetter.getSUB_CATEGORY_ID().size() > 0) {
|
||||
String categorytable = subCategoryMasterGetterSetter.getTable_SUB_CATEGORY_MASTER();
|
||||
if(categorytable!=null){
|
||||
if (categorytable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setSubCategoryMaster(categorytable);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return "SUB_CATEGORY_MASTER";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.value = 40;
|
||||
data.name = "SUB_CATEGORY_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// CATEGORY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
// CATEGORY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "CATEGORY_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
@@ -295,36 +272,32 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
categoryMasterGetterSetter =XMLHandlers.categoryMasterXMLHandler(xpp, eventType);
|
||||
if(categoryMasterGetterSetter.getCATEGORY_ID().size()>0){
|
||||
categoryMasterGetterSetter = XMLHandlers.categoryMasterXMLHandler(xpp, eventType);
|
||||
if (categoryMasterGetterSetter.getCATEGORY_ID().size() > 0) {
|
||||
String skutable = categoryMasterGetterSetter.getTable_CATEGORY_MASTER();
|
||||
if(skutable!=null){
|
||||
if (skutable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setCategoryMaster(skutable);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return "CATEGORY_MASTER";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.value = 50;
|
||||
data.name = "CATEGORY_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// DISPLAY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
// DISPLAY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "DISPLAY_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
@@ -334,36 +307,32 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
displayMasterGetterSetter =XMLHandlers.displayMasterXMLHandler(xpp, eventType);
|
||||
if(displayMasterGetterSetter.getDISPLAY_ID().size()>0){
|
||||
displayMasterGetterSetter = XMLHandlers.displayMasterXMLHandler(xpp, eventType);
|
||||
if (displayMasterGetterSetter.getDISPLAY_ID().size() > 0) {
|
||||
String display_table = displayMasterGetterSetter.getTable_DISPLAY_MASTER();
|
||||
if(display_table!=null){
|
||||
if (display_table != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setDisplayMaster(display_table);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return "DISPLAY_MASTER";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.value = 60;
|
||||
data.name = "DISPLAY_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// MAPPING_STOCK
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
// MAPPING_STOCK
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_STOCK");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
@@ -373,36 +342,32 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
mappingStockGetterSetter =XMLHandlers.mappingStockXMLHandler(xpp, eventType);
|
||||
if(mappingStockGetterSetter.getSKU_ID().size()>0){
|
||||
mappingStockGetterSetter = XMLHandlers.mappingStockXMLHandler(xpp, eventType);
|
||||
if (mappingStockGetterSetter.getSKU_ID().size() > 0) {
|
||||
String stocktable = mappingStockGetterSetter.getTable_MAPPING_STOCK();
|
||||
if(stocktable!=null){
|
||||
if (stocktable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setMappingStock(stocktable);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return "MAPPING_STOCK";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.value = 80;
|
||||
data.name = "MAPPING_STOCK Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// MAPPING_T2P
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
// MAPPING_T2P
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_T2P");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
@@ -412,84 +377,65 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
mappingt2PGetterSetter =XMLHandlers.mappingT2pXMLHandler(xpp, eventType);
|
||||
if(mappingt2PGetterSetter.getSTORE_ID().size()>0){
|
||||
mappingt2PGetterSetter = XMLHandlers.mappingT2pXMLHandler(xpp, eventType);
|
||||
if (mappingt2PGetterSetter.getSTORE_ID().size() > 0) {
|
||||
String t2ptable = mappingt2PGetterSetter.getTable_MAPPING_T2P();
|
||||
if(t2ptable!=null){
|
||||
if (t2ptable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setMappingT2p(t2ptable);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
return "MAPPING_T2P";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.value = 100;
|
||||
data.name = "MAPPING_T2P Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
db.open();
|
||||
|
||||
db.InsertJCP(jcpgettersetter);
|
||||
db.InsertCategory(categoryMasterGetterSetter);
|
||||
db.InsertSubCategoryMaster(subCategoryMasterGetterSetter);
|
||||
db.InsertBrandMaster(brandMasterGetterSetter);
|
||||
db.InsertSkuMaster(skumastergettersetter);
|
||||
db.InsertDisplayMaster(displayMasterGetterSetter);
|
||||
|
||||
db.InsertMAPPING_T2P(mappingt2PGetterSetter);
|
||||
db.InsertMappingStock(mappingStockGetterSetter);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}catch (MalformedURLException e) {
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
/*final AlertMessage message = new AlertMessage(
|
||||
CompleteDownloadActivity.this,
|
||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// TODO Auto-generated method stub
|
||||
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||
}
|
||||
});
|
||||
|
||||
} catch (IOException e) {
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
CompleteDownloadActivity.this,
|
||||
AlertMessage.MESSAGE_SOCKETEXCEPTION, "socket", e);*/
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
showAlert(CommonString.MESSAGE_SOCKETEXCEPTION);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
catch (Exception e) {
|
||||
} catch (Exception e) {
|
||||
/* final AlertMessage message = new AlertMessage(
|
||||
CompleteDownloadActivity.this,
|
||||
AlertMessage.MESSAGE_EXCEPTION, "download", e);*/
|
||||
@@ -498,15 +444,12 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
e.printStackTrace();
|
||||
e.getCause();*/
|
||||
runOnUiThread(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
showAlert(CommonString.MESSAGE_EXCEPTION);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -517,7 +460,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
pb.setProgress(values[0].value);
|
||||
percentage.setText(values[0].value + "%");
|
||||
message.setText(values[0].name);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -525,7 +467,6 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
super.onPostExecute(s);
|
||||
|
||||
dialog.dismiss();
|
||||
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||
|
||||
public class CategoryListActivity extends AppCompatActivity {
|
||||
RecyclerView recyclerView;
|
||||
ArrayList<CategoryGetterSetter> categoryList;
|
||||
CategoryListAdapter adapter;
|
||||
TextView txt_categoryName;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_category_list);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||
txt_categoryName.setText("Category List");
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
categoryList = new ArrayList<>();
|
||||
|
||||
CategoryGetterSetter data = new CategoryGetterSetter();
|
||||
data.setCategory_name("Oral Health");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new CategoryGetterSetter();
|
||||
data.setCategory_name("Nutritionals");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new CategoryGetterSetter();
|
||||
data.setCategory_name("Wellness");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
adapter = new CategoryListAdapter(CategoryListActivity.this, categoryList);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
|
||||
}
|
||||
|
||||
public class CategoryListAdapter extends RecyclerView.Adapter<CategoryListAdapter.MyViewHolder> {
|
||||
private LayoutInflater inflator;
|
||||
List<CategoryGetterSetter> list = Collections.emptyList();
|
||||
Context context;
|
||||
|
||||
public CategoryListAdapter(CategoryListActivity context, List<CategoryGetterSetter> list) {
|
||||
inflator = LayoutInflater.from(context);
|
||||
this.list = list;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoryListAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||
View view = inflator.inflate(R.layout.category_menu_row, parent, false);
|
||||
MyViewHolder holder = new MyViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(MyViewHolder holder, int position) {
|
||||
final CategoryGetterSetter categoryData = list.get(position);
|
||||
|
||||
holder.categoryName.setText(categoryData.getCategory_name());
|
||||
holder.categoryIcon.setImageResource(categoryData.getCategory_img());
|
||||
|
||||
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent(CategoryListActivity.this, CategoryWisePerformanceActivity.class);
|
||||
intent.putExtra("categoryName", categoryData.getCategory_name());
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView categoryName;
|
||||
ImageView categoryIcon;
|
||||
LinearLayout lay_menu;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
categoryName = (TextView) itemView.findViewById(R.id.categoryName);
|
||||
categoryIcon = (ImageView) itemView.findViewById(R.id.categoryIcon);
|
||||
lay_menu = (LinearLayout) itemView.findViewById(R.id.lay_menu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@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) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
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.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||
|
||||
public class CategoryWisePerformanceActivity extends AppCompatActivity {
|
||||
TextView txt_categoryName;
|
||||
RecyclerView recyclerView;
|
||||
|
||||
String categoryName = "";
|
||||
|
||||
ArrayList<CategoryWisePerformaceGetterSetter> categoryWisePerformanceList;
|
||||
CategoryWisePerformaceAdapter adapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_category_wise_performance);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
|
||||
txt_categoryName.setText("CategoryWise Performance " + categoryName);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
/* Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();*/
|
||||
Intent intent = new Intent(CategoryWisePerformanceActivity.this, DailyDataMenuActivity.class);
|
||||
intent.putExtra("categoryName", categoryName);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
categoryWisePerformanceList = new ArrayList<>();
|
||||
CategoryWisePerformaceGetterSetter data = new CategoryWisePerformaceGetterSetter();
|
||||
|
||||
data.setPeriod("Period");
|
||||
data.setSos("SOS");
|
||||
data.setT2p("T2P");
|
||||
data.setPromo("Promo");
|
||||
data.setMsl_availability("MSL Availability");
|
||||
data.setOss("OSS");
|
||||
categoryWisePerformanceList.add(data);
|
||||
|
||||
data = new CategoryWisePerformaceGetterSetter();
|
||||
data.setPeriod("LTM");
|
||||
data.setSos("75");
|
||||
data.setT2p("0");
|
||||
data.setPromo("0");
|
||||
data.setMsl_availability("25");
|
||||
data.setOss("55");
|
||||
categoryWisePerformanceList.add(data);
|
||||
|
||||
data = new CategoryWisePerformaceGetterSetter();
|
||||
data.setPeriod("MTM");
|
||||
data.setSos("75");
|
||||
data.setT2p("0");
|
||||
data.setPromo("0");
|
||||
data.setMsl_availability("25");
|
||||
data.setOss("55");
|
||||
categoryWisePerformanceList.add(data);
|
||||
|
||||
data = new CategoryWisePerformaceGetterSetter();
|
||||
data.setPeriod("RTM");
|
||||
data.setSos("75");
|
||||
data.setT2p("0");
|
||||
data.setPromo("0");
|
||||
data.setMsl_availability("25");
|
||||
data.setOss("55");
|
||||
categoryWisePerformanceList.add(data);
|
||||
|
||||
data = new CategoryWisePerformaceGetterSetter();
|
||||
data.setPeriod("LTM");
|
||||
data.setSos("75");
|
||||
data.setT2p("0");
|
||||
data.setPromo("0");
|
||||
data.setMsl_availability("25");
|
||||
data.setOss("55");
|
||||
categoryWisePerformanceList.add(data);
|
||||
|
||||
data = new CategoryWisePerformaceGetterSetter();
|
||||
data.setPeriod("MTM");
|
||||
data.setSos("75");
|
||||
data.setT2p("0");
|
||||
data.setPromo("0");
|
||||
data.setMsl_availability("25");
|
||||
data.setOss("55");
|
||||
categoryWisePerformanceList.add(data);
|
||||
|
||||
data = new CategoryWisePerformaceGetterSetter();
|
||||
data.setPeriod("RTM");
|
||||
data.setSos("75");
|
||||
data.setT2p("0");
|
||||
data.setPromo("0");
|
||||
data.setMsl_availability("25");
|
||||
data.setOss("55");
|
||||
categoryWisePerformanceList.add(data);
|
||||
|
||||
adapter = new CategoryWisePerformaceAdapter(CategoryWisePerformanceActivity.this, categoryWisePerformanceList);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
|
||||
}
|
||||
|
||||
public class CategoryWisePerformaceAdapter extends RecyclerView.Adapter<CategoryWisePerformaceAdapter.MyViewHolder> {
|
||||
Context context;
|
||||
private LayoutInflater inflator;
|
||||
List<CategoryWisePerformaceGetterSetter> list = Collections.emptyList();
|
||||
|
||||
public CategoryWisePerformaceAdapter(Context context, List<CategoryWisePerformaceGetterSetter> list) {
|
||||
inflator = LayoutInflater.from(context);
|
||||
this.list = list;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CategoryWisePerformaceAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||
View view = inflator.inflate(R.layout.item_category_wise_performance, parent, false);
|
||||
CategoryWisePerformaceAdapter.MyViewHolder holder = new CategoryWisePerformaceAdapter.MyViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(CategoryWisePerformaceAdapter.MyViewHolder holder, int position) {
|
||||
final CategoryWisePerformaceGetterSetter categoryData = list.get(position);
|
||||
|
||||
holder.txt_period.setText(categoryData.getPeriod());
|
||||
holder.txt_sos.setText(categoryData.getSos());
|
||||
holder.txt_t2p.setText(categoryData.getT2p());
|
||||
holder.txt_promo.setText(categoryData.getPromo());
|
||||
holder.txt_msl_availability.setText(categoryData.getMsl_availability());
|
||||
holder.txt_oss.setText(categoryData.getOss());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView txt_period, txt_sos, txt_t2p, txt_promo, txt_msl_availability, txt_oss;
|
||||
LinearLayout lay_menu;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
lay_menu = (LinearLayout) itemView.findViewById(R.id.lay_menu);
|
||||
txt_period = (TextView) itemView.findViewById(R.id.txt_period);
|
||||
txt_sos = (TextView) itemView.findViewById(R.id.txt_sos);
|
||||
txt_t2p = (TextView) itemView.findViewById(R.id.txt_t2p);
|
||||
txt_promo = (TextView) itemView.findViewById(R.id.txt_promo);
|
||||
txt_msl_availability = (TextView) itemView.findViewById(R.id.txt_msl_availability);
|
||||
txt_oss = (TextView) itemView.findViewById(R.id.txt_oss);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@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) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
||||
|
||||
public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
RecyclerView recyclerView;
|
||||
ArrayList<DailyDataMenuGetterSetter> categoryList;
|
||||
DailyDataMenuAdapter adapter;
|
||||
TextView txt_categoryName;
|
||||
String categoryName = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_daily_data_menu);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
|
||||
txt_categoryName.setText("Daily Data Menu - " + categoryName);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
categoryList = new ArrayList<>();
|
||||
|
||||
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name("MSL Availability");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name("Stock & Facing");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name("T2P Compliance");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name("Additional Visibility");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name("Promo Compliance");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name("Competition Visibility");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name("Competition Promo");
|
||||
data.setCategory_img(R.drawable.category);
|
||||
categoryList.add(data);
|
||||
|
||||
adapter = new DailyDataMenuAdapter(DailyDataMenuActivity.this, categoryList);
|
||||
recyclerView.setAdapter(adapter);
|
||||
recyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
|
||||
}
|
||||
|
||||
public class DailyDataMenuAdapter extends RecyclerView.Adapter<DailyDataMenuAdapter.MyViewHolder> {
|
||||
private LayoutInflater inflator;
|
||||
List<DailyDataMenuGetterSetter> list = Collections.emptyList();
|
||||
Context context;
|
||||
|
||||
public DailyDataMenuAdapter(Context context, List<DailyDataMenuGetterSetter> list) {
|
||||
inflator = LayoutInflater.from(context);
|
||||
this.list = list;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DailyDataMenuAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int i) {
|
||||
View view = inflator.inflate(R.layout.daily_main_menu_row, parent, false);
|
||||
DailyDataMenuAdapter.MyViewHolder holder = new DailyDataMenuAdapter.MyViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(DailyDataMenuAdapter.MyViewHolder holder, int position) {
|
||||
final DailyDataMenuGetterSetter dailyData = list.get(position);
|
||||
|
||||
holder.categoryName.setText(dailyData.getCategory_name());
|
||||
holder.categoryIcon.setImageResource(dailyData.getCategory_img());
|
||||
|
||||
holder.lay_menu.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (dailyData.getCategory_name().equalsIgnoreCase("MSL Availability")) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_AvailabilityActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
startActivity(intent);
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase("Stock & Facing")) {
|
||||
Intent intent1 = new Intent(DailyDataMenuActivity.this, Stock_FacingActivity.class);
|
||||
intent1.putExtra("categoryName", dailyData.getCategory_name());
|
||||
startActivity(intent1);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView categoryName;
|
||||
ImageView categoryIcon;
|
||||
LinearLayout lay_menu;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
categoryName = (TextView) itemView.findViewById(R.id.categoryName);
|
||||
categoryIcon = (ImageView) itemView.findViewById(R.id.categoryIcon);
|
||||
lay_menu = (LinearLayout) itemView.findViewById(R.id.lay_menu);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
getMenuInflater().inflate(R.menu.main, menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
@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) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,360 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.BaseExpandableListAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||
|
||||
public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
ExpandableListView expandableListView;
|
||||
TextView txt_mslAvailabilityName;
|
||||
|
||||
ArrayList<MSL_AvailabilityGetterSetter> headerDataList;
|
||||
ArrayList<MSL_AvailabilityGetterSetter> childDataList;
|
||||
List<MSL_AvailabilityGetterSetter> hashMapListHeaderData;
|
||||
HashMap<MSL_AvailabilityGetterSetter, List<MSL_AvailabilityGetterSetter>> hashMapListChildData;
|
||||
|
||||
ExpandableListAdapter adapter;
|
||||
|
||||
String title;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_msl__availability);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||
txt_mslAvailabilityName = (TextView) findViewById(R.id.txt_mslAvailabilityName);
|
||||
|
||||
title = getIntent().getStringExtra("categoryName");
|
||||
txt_mslAvailabilityName.setText(title);
|
||||
|
||||
prepareList();
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
});
|
||||
|
||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView arg0, int arg1) {
|
||||
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
|
||||
expandableListView.invalidateViews();
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group click listener
|
||||
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
|
||||
@Override
|
||||
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group expanded listener
|
||||
expandableListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
||||
@Override
|
||||
public void onGroupExpand(int groupPosition) {
|
||||
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getWindow().getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group collasped listener
|
||||
expandableListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
|
||||
@Override
|
||||
public void onGroupCollapse(int groupPosition) {
|
||||
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getWindow().getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Listview on child click listener
|
||||
expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
|
||||
@Override
|
||||
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
|
||||
int childPosition, long id) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
headerDataList = new ArrayList<>();
|
||||
|
||||
MSL_AvailabilityGetterSetter msl = new MSL_AvailabilityGetterSetter();
|
||||
msl.setBrandName("Parodontax header 1");
|
||||
msl.setMbq("1");
|
||||
msl.setAvailable("No");
|
||||
headerDataList.add(msl);
|
||||
|
||||
msl = new MSL_AvailabilityGetterSetter();
|
||||
msl.setBrandName("Parodontax header 2");
|
||||
msl.setMbq("2");
|
||||
msl.setAvailable("Yes");
|
||||
headerDataList.add(msl);
|
||||
|
||||
msl = new MSL_AvailabilityGetterSetter();
|
||||
msl.setBrandName("Parodontax header 3");
|
||||
msl.setMbq("3");
|
||||
msl.setAvailable("Yes");
|
||||
headerDataList.add(msl);
|
||||
|
||||
msl = new MSL_AvailabilityGetterSetter();
|
||||
msl.setBrandName("Parodontax header 4");
|
||||
msl.setMbq("4");
|
||||
msl.setAvailable("No");
|
||||
headerDataList.add(msl);
|
||||
|
||||
|
||||
hashMapListHeaderData = new ArrayList<>();
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
if (headerDataList.size() > 0) {
|
||||
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
childDataList = new ArrayList<>();
|
||||
|
||||
MSL_AvailabilityGetterSetter msl1 = new MSL_AvailabilityGetterSetter();
|
||||
msl.setBrandName("Parodontax 1");
|
||||
msl.setMbq("1");
|
||||
msl.setAvailable("No");
|
||||
childDataList.add(msl1);
|
||||
|
||||
msl1 = new MSL_AvailabilityGetterSetter();
|
||||
msl.setBrandName("Parodontax 2");
|
||||
msl.setMbq("2");
|
||||
msl.setAvailable("No");
|
||||
childDataList.add(msl1);
|
||||
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
|
||||
expandableListView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||
private Context _context;
|
||||
private List<MSL_AvailabilityGetterSetter> _listDataHeader;
|
||||
private HashMap<MSL_AvailabilityGetterSetter, List<MSL_AvailabilityGetterSetter>> _listDataChild;
|
||||
|
||||
public ExpandableListAdapter(Context context, List<MSL_AvailabilityGetterSetter> listDataHeader,
|
||||
HashMap<MSL_AvailabilityGetterSetter, List<MSL_AvailabilityGetterSetter>> listChildData) {
|
||||
this._context = context;
|
||||
this._listDataHeader = listDataHeader;
|
||||
this._listDataChild = listChildData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGroup(int groupPosition) {
|
||||
return this._listDataHeader.get(groupPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGroupCount() {
|
||||
return this._listDataHeader.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getGroupId(int groupPosition) {
|
||||
return groupPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
|
||||
MSL_AvailabilityGetterSetter headerTitle = (MSL_AvailabilityGetterSetter) getGroup(groupPosition);
|
||||
|
||||
if (convertView == null) {
|
||||
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = infalInflater.inflate(R.layout.item_msl_availability_header, null, false);
|
||||
}
|
||||
|
||||
TextView txt_categoryHeader = (TextView) convertView.findViewById(R.id.txt_categoryHeader);
|
||||
RelativeLayout rel_header = (RelativeLayout) convertView.findViewById(R.id.rel_categoryHeader);
|
||||
ImageView img_camera = (ImageView) convertView.findViewById(R.id.img_camera);
|
||||
|
||||
txt_categoryHeader.setTypeface(null, Typeface.BOLD);
|
||||
txt_categoryHeader.setText(headerTitle.getBrandName());
|
||||
|
||||
/*img_camera.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String date = new Date().toLocaleString().toString();
|
||||
String TempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock" + headerTitle.getBrand_cd() + "_" + store_cd + "_" + visit_date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img1.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
headerTitle.setImg_cam(img1);
|
||||
img1 = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTitle.getImg_cam().equals("")) {
|
||||
img_camera.setBackgroundResource(R.drawable.cam);
|
||||
} else {
|
||||
img_camera.setBackgroundResource(R.drawable.camtick);
|
||||
}
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
txt_header.setTextColor(getResources().getColor(R.color.red));
|
||||
} else {
|
||||
txt_header.setTextColor(getResources().getColor(R.color.grey_dark));
|
||||
}
|
||||
}*/
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getChild(int groupPosition, int childPosititon) {
|
||||
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).get(childPosititon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChildrenCount(int groupPosition) {
|
||||
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getChildId(int groupPosition, int childPosition) {
|
||||
return childPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,
|
||||
View convertView, ViewGroup parent) {
|
||||
MSL_AvailabilityGetterSetter childData = (MSL_AvailabilityGetterSetter) getChild(groupPosition, childPosition);
|
||||
ViewHolder holder = null;
|
||||
|
||||
if (convertView == null) {
|
||||
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = infalInflater.inflate(R.layout.item_msl_availability_child, null, false);
|
||||
|
||||
holder = new ViewHolder();
|
||||
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
||||
holder.lin_category = (LinearLayout) convertView.findViewById(R.id.lin_category);
|
||||
|
||||
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
||||
holder.ed_mbq = (EditText) convertView.findViewById(R.id.ed_mbq);
|
||||
holder.toggle_available = (ToggleButton) convertView.findViewById(R.id.toggle_available);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
holder.txt_skuName.setText(childData.getBrandName());
|
||||
holder.ed_mbq.setText(childData.getMbq());
|
||||
|
||||
holder.toggle_available.setTextOff("No");
|
||||
holder.toggle_available.setTextOn("Yes");
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasStableIds() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChildSelectable(int groupPosition, int childPosition) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class ViewHolder {
|
||||
EditText ed_mbq;
|
||||
CardView cardView;
|
||||
TextView txt_skuName;
|
||||
ToggleButton toggle_available;
|
||||
LinearLayout lin_category;
|
||||
}
|
||||
|
||||
@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) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,467 @@
|
||||
package cpm.com.gskmtorange.gsk_dailyentry;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Typeface;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.BaseExpandableListAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ToggleButton;
|
||||
|
||||
import java.io.File;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
|
||||
|
||||
public class Stock_FacingActivity extends AppCompatActivity {
|
||||
ExpandableListView expandableListView;
|
||||
TextView txt_stockFacingName;
|
||||
|
||||
ArrayList<Stock_FacingGetterSetter> headerDataList;
|
||||
ArrayList<Stock_FacingGetterSetter> childDataList;
|
||||
List<Stock_FacingGetterSetter> hashMapListHeaderData;
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> hashMapListChildData;
|
||||
|
||||
ExpandableListAdapter adapter;
|
||||
|
||||
String title;
|
||||
|
||||
String path = "", str = "", _pathforcheck = "", img1 = "";
|
||||
static int child_position = -1;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_stock_facing);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||
txt_stockFacingName = (TextView) findViewById(R.id.txt_stockFacingName);
|
||||
|
||||
title = getIntent().getStringExtra("categoryName");
|
||||
txt_stockFacingName.setText(title);
|
||||
|
||||
prepareList();
|
||||
|
||||
str = Environment.getExternalStorageState();
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
});
|
||||
|
||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onScrollStateChanged(AbsListView arg0, int arg1) {
|
||||
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
|
||||
expandableListView.invalidateViews();
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group click listener
|
||||
expandableListView.setOnGroupClickListener(new ExpandableListView.OnGroupClickListener() {
|
||||
@Override
|
||||
public boolean onGroupClick(ExpandableListView parent, View v, int groupPosition, long id) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group expanded listener
|
||||
expandableListView.setOnGroupExpandListener(new ExpandableListView.OnGroupExpandListener() {
|
||||
@Override
|
||||
public void onGroupExpand(int groupPosition) {
|
||||
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getWindow().getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Listview Group collasped listener
|
||||
expandableListView.setOnGroupCollapseListener(new ExpandableListView.OnGroupCollapseListener() {
|
||||
@Override
|
||||
public void onGroupCollapse(int groupPosition) {
|
||||
InputMethodManager inputManager = (InputMethodManager) getApplicationContext()
|
||||
.getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (getWindow().getCurrentFocus() != null) {
|
||||
inputManager.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
|
||||
getCurrentFocus().clearFocus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Listview on child click listener
|
||||
expandableListView.setOnChildClickListener(new ExpandableListView.OnChildClickListener() {
|
||||
@Override
|
||||
public boolean onChildClick(ExpandableListView parent, View v, int groupPosition,
|
||||
int childPosition, long id) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
headerDataList = new ArrayList<>();
|
||||
|
||||
Stock_FacingGetterSetter msl = new Stock_FacingGetterSetter();
|
||||
msl.setBrandName("Parodontax header 1");
|
||||
msl.setMbq("1");
|
||||
msl.setAvailable("No");
|
||||
headerDataList.add(msl);
|
||||
|
||||
msl = new Stock_FacingGetterSetter();
|
||||
msl.setBrandName("Parodontax header 2");
|
||||
msl.setMbq("2");
|
||||
msl.setAvailable("Yes");
|
||||
headerDataList.add(msl);
|
||||
|
||||
msl = new Stock_FacingGetterSetter();
|
||||
msl.setBrandName("Parodontax header 3");
|
||||
msl.setMbq("3");
|
||||
msl.setAvailable("Yes");
|
||||
headerDataList.add(msl);
|
||||
|
||||
msl = new Stock_FacingGetterSetter();
|
||||
msl.setBrandName("Parodontax header 4");
|
||||
msl.setMbq("4");
|
||||
msl.setAvailable("No");
|
||||
headerDataList.add(msl);
|
||||
|
||||
|
||||
hashMapListHeaderData = new ArrayList<>();
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
if (headerDataList.size() > 0) {
|
||||
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
childDataList = new ArrayList<>();
|
||||
|
||||
Stock_FacingGetterSetter msl1 = new Stock_FacingGetterSetter();
|
||||
msl.setBrandName("Parodontax 1");
|
||||
msl.setMbq("1");
|
||||
msl.setAvailable("No");
|
||||
childDataList.add(msl1);
|
||||
|
||||
msl1 = new Stock_FacingGetterSetter();
|
||||
msl.setBrandName("Parodontax 2");
|
||||
msl.setMbq("2");
|
||||
msl.setAvailable("No");
|
||||
childDataList.add(msl1);
|
||||
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
adapter = new ExpandableListAdapter(this, hashMapListHeaderData, hashMapListChildData);
|
||||
expandableListView.setAdapter(adapter);
|
||||
}
|
||||
|
||||
public class ExpandableListAdapter extends BaseExpandableListAdapter {
|
||||
private Context _context;
|
||||
private List<Stock_FacingGetterSetter> _listDataHeader;
|
||||
private HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> _listDataChild;
|
||||
|
||||
public ExpandableListAdapter(Context context, List<Stock_FacingGetterSetter> listDataHeader,
|
||||
HashMap<Stock_FacingGetterSetter, List<Stock_FacingGetterSetter>> listChildData) {
|
||||
this._context = context;
|
||||
this._listDataHeader = listDataHeader;
|
||||
this._listDataChild = listChildData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getGroup(int groupPosition) {
|
||||
return this._listDataHeader.get(groupPosition);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGroupCount() {
|
||||
return this._listDataHeader.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getGroupId(int groupPosition) {
|
||||
return groupPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
|
||||
final Stock_FacingGetterSetter headerTitle = (Stock_FacingGetterSetter) getGroup(groupPosition);
|
||||
|
||||
if (convertView == null) {
|
||||
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = infalInflater.inflate(R.layout.item_stock_facing_header, null, false);
|
||||
}
|
||||
|
||||
TextView txt_stockFaceupHeader = (TextView) convertView.findViewById(R.id.txt_stockFaceupHeader);
|
||||
LinearLayout lin_stockFaceupHeader = (LinearLayout) convertView.findViewById(R.id.lin_stockFaceupHeader);
|
||||
ImageView img_reference = (ImageView) convertView.findViewById(R.id.img_reference);
|
||||
ImageView img_camera1 = (ImageView) convertView.findViewById(R.id.img_camera1);
|
||||
ImageView img_camera2 = (ImageView) convertView.findViewById(R.id.img_camera2);
|
||||
ImageView img_edit = (ImageView) convertView.findViewById(R.id.img_edit);
|
||||
|
||||
txt_stockFaceupHeader.setTypeface(null, Typeface.BOLD);
|
||||
txt_stockFaceupHeader.setText(headerTitle.getBrandName());
|
||||
|
||||
img_camera1.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String date = new Date().toLocaleString().toString();
|
||||
String tempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock Camera1_" + tempDate + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img1.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
//headerTitle.setImg_cam(img1);
|
||||
img1 = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*if (headerTitle.getImg_cam().equals("")) {
|
||||
img_camera1.setBackgroundResource(R.drawable.ic_menu_camera);
|
||||
} else {
|
||||
//img_camera1.setBackgroundResource(R.drawable.camtick);
|
||||
}*/
|
||||
|
||||
/*img_camera.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
String date = new Date().toLocaleString().toString();
|
||||
String TempDate = new Date().toLocaleString().toString().replace(' ', '_').replace(',', '_').replace(':', '-');
|
||||
|
||||
_pathforcheck = "Stock" + headerTitle.getBrand_cd() + "_" + store_cd + "_" + visit_date.replace("/", "") + getCurrentTime().replace(":", "") + ".jpg";
|
||||
child_position = groupPosition;
|
||||
path = str + _pathforcheck;
|
||||
|
||||
startCameraActivity(groupPosition);
|
||||
}
|
||||
});
|
||||
|
||||
if (!img1.equalsIgnoreCase("")) {
|
||||
if (groupPosition == child_position) {
|
||||
headerTitle.setImg_cam(img1);
|
||||
img1 = "";
|
||||
}
|
||||
}
|
||||
|
||||
if (headerTitle.getImg_cam().equals("")) {
|
||||
img_camera.setBackgroundResource(R.drawable.cam);
|
||||
} else {
|
||||
img_camera.setBackgroundResource(R.drawable.camtick);
|
||||
}
|
||||
|
||||
if (!checkflag) {
|
||||
if (checkHeaderArray.contains(groupPosition)) {
|
||||
txt_header.setTextColor(getResources().getColor(R.color.red));
|
||||
} else {
|
||||
txt_header.setTextColor(getResources().getColor(R.color.grey_dark));
|
||||
}
|
||||
}*/
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getChild(int groupPosition, int childPosititon) {
|
||||
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).get(childPosititon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChildrenCount(int groupPosition) {
|
||||
return this._listDataChild.get(this._listDataHeader.get(groupPosition)).size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getChildId(int groupPosition, int childPosition) {
|
||||
return childPosition;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,
|
||||
View convertView, ViewGroup parent) {
|
||||
Stock_FacingGetterSetter childData = (Stock_FacingGetterSetter) getChild(groupPosition, childPosition);
|
||||
ViewHolder holder = null;
|
||||
|
||||
if (convertView == null) {
|
||||
LayoutInflater infalInflater = (LayoutInflater) this._context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||
convertView = infalInflater.inflate(R.layout.item_stock_facing_child, null, false);
|
||||
|
||||
holder = new ViewHolder();
|
||||
holder.cardView = (CardView) convertView.findViewById(R.id.card_view);
|
||||
holder.lin_category = (LinearLayout) convertView.findViewById(R.id.lin_category);
|
||||
|
||||
holder.txt_skuName = (TextView) convertView.findViewById(R.id.txt_skuName);
|
||||
holder.ed_stock = (EditText) convertView.findViewById(R.id.ed_stock);
|
||||
holder.ed_facing = (EditText) convertView.findViewById(R.id.ed_facing);
|
||||
convertView.setTag(holder);
|
||||
} else {
|
||||
holder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
|
||||
holder.txt_skuName.setText(childData.getBrandName());
|
||||
holder.ed_stock.setText(childData.getMbq());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasStableIds() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isChildSelectable(int groupPosition, int childPosition) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public class ViewHolder {
|
||||
EditText ed_stock, ed_facing;
|
||||
CardView cardView;
|
||||
TextView txt_skuName;
|
||||
LinearLayout lin_category;
|
||||
}
|
||||
|
||||
private void startCameraActivity(int position) {
|
||||
try {
|
||||
Log.e("Stock & Facing ", "startCameraActivity()");
|
||||
File file = new File(path);
|
||||
Uri outputFileUri = Uri.fromFile(file);
|
||||
|
||||
/*String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
|
||||
for (int n = 0; n < list.size(); n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
// Log.d("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
// Log.d("TAG", "package name : " + list.get(n).packageName);
|
||||
if (list.get(n).loadLabel(packageManager).toString().equalsIgnoreCase("Camera")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, position);*/
|
||||
|
||||
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
startActivityForResult(intent, position);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
Log.e("Stock & Facing", "resultCode: " + resultCode);
|
||||
switch (resultCode) {
|
||||
case 0:
|
||||
Log.e("Stock & Facing", "User cancelled");
|
||||
break;
|
||||
case -1:
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
img1 = _pathforcheck;
|
||||
//adapter.notifyDataSetChanged();
|
||||
_pathforcheck = "";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
// TODO Auto-generated method stub
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
public String getCurrentTime() {
|
||||
Calendar m_cal = Calendar.getInstance();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||
String cdate = formatter.format(m_cal.getTime());
|
||||
/* String intime = m_cal.get(Calendar.HOUR_OF_DAY) + ":"
|
||||
+ m_cal.get(Calendar.MINUTE) + ":" + m_cal.get(Calendar.SECOND);*/
|
||||
|
||||
return cdate;
|
||||
}
|
||||
|
||||
@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) {
|
||||
finish();
|
||||
}
|
||||
|
||||
//noinspection SimplifiableIfStatement
|
||||
if (id == R.id.action_settings) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by gagang on 22-12-2016.
|
||||
*/
|
||||
|
||||
public class CategoryGetterSetter {
|
||||
|
||||
String category_name;
|
||||
int category_img = -1;
|
||||
|
||||
public String getCategory_name() {
|
||||
return category_name;
|
||||
}
|
||||
|
||||
public void setCategory_name(String category_name) {
|
||||
this.category_name = category_name;
|
||||
}
|
||||
|
||||
public int getCategory_img() {
|
||||
return category_img;
|
||||
}
|
||||
|
||||
public void setCategory_img(int category_img) {
|
||||
this.category_img = category_img;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by gagang on 23-12-2016.
|
||||
*/
|
||||
|
||||
public class CategoryWisePerformaceGetterSetter {
|
||||
String period, sos, t2p, promo, msl_availability, oss;
|
||||
|
||||
public String getPeriod() {
|
||||
return period;
|
||||
}
|
||||
|
||||
public void setPeriod(String period) {
|
||||
this.period = period;
|
||||
}
|
||||
|
||||
public String getSos() {
|
||||
return sos;
|
||||
}
|
||||
|
||||
public void setSos(String sos) {
|
||||
this.sos = sos;
|
||||
}
|
||||
|
||||
public String getT2p() {
|
||||
return t2p;
|
||||
}
|
||||
|
||||
public void setT2p(String t2p) {
|
||||
this.t2p = t2p;
|
||||
}
|
||||
|
||||
public String getPromo() {
|
||||
return promo;
|
||||
}
|
||||
|
||||
public void setPromo(String promo) {
|
||||
this.promo = promo;
|
||||
}
|
||||
|
||||
public String getMsl_availability() {
|
||||
return msl_availability;
|
||||
}
|
||||
|
||||
public void setMsl_availability(String msl_availability) {
|
||||
this.msl_availability = msl_availability;
|
||||
}
|
||||
|
||||
public String getOss() {
|
||||
return oss;
|
||||
}
|
||||
|
||||
public void setOss(String oss) {
|
||||
this.oss = oss;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by gagang on 22-12-2016.
|
||||
*/
|
||||
|
||||
public class DailyDataMenuGetterSetter {
|
||||
|
||||
String category_name;
|
||||
int category_img = -1;
|
||||
|
||||
public String getCategory_name() {
|
||||
return category_name;
|
||||
}
|
||||
|
||||
public void setCategory_name(String category_name) {
|
||||
this.category_name = category_name;
|
||||
}
|
||||
|
||||
public int getCategory_img() {
|
||||
return category_img;
|
||||
}
|
||||
|
||||
public void setCategory_img(int category_img) {
|
||||
this.category_img = category_img;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by gagang on 23-12-2016.
|
||||
*/
|
||||
|
||||
public class MSL_AvailabilityGetterSetter {
|
||||
String brandName, mbq, available;
|
||||
|
||||
public String getBrandName() {
|
||||
return brandName;
|
||||
}
|
||||
|
||||
public void setBrandName(String brandName) {
|
||||
this.brandName = brandName;
|
||||
}
|
||||
|
||||
public String getMbq() {
|
||||
return mbq;
|
||||
}
|
||||
|
||||
public void setMbq(String mbq) {
|
||||
this.mbq = mbq;
|
||||
}
|
||||
|
||||
public String getAvailable() {
|
||||
return available;
|
||||
}
|
||||
|
||||
public void setAvailable(String available) {
|
||||
this.available = available;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 28-12-2016.
|
||||
*/
|
||||
|
||||
public class SkuGetterSetter {
|
||||
String SKU_ID, SKU, BRAND_ID, MRP, SKU_SEQUENCE;
|
||||
|
||||
public String getSKU_ID() {
|
||||
return SKU_ID;
|
||||
}
|
||||
|
||||
public void setSKU_ID(String SKU_ID) {
|
||||
this.SKU_ID = SKU_ID;
|
||||
}
|
||||
|
||||
public String getSKU() {
|
||||
return SKU;
|
||||
}
|
||||
|
||||
public void setSKU(String SKU) {
|
||||
this.SKU = SKU;
|
||||
}
|
||||
|
||||
public String getBRAND_ID() {
|
||||
return BRAND_ID;
|
||||
}
|
||||
|
||||
public void setBRAND_ID(String BRAND_ID) {
|
||||
this.BRAND_ID = BRAND_ID;
|
||||
}
|
||||
|
||||
public String getMRP() {
|
||||
return MRP;
|
||||
}
|
||||
|
||||
public void setMRP(String MRP) {
|
||||
this.MRP = MRP;
|
||||
}
|
||||
|
||||
public String getSKU_SEQUENCE() {
|
||||
return SKU_SEQUENCE;
|
||||
}
|
||||
|
||||
public void setSKU_SEQUENCE(String SKU_SEQUENCE) {
|
||||
this.SKU_SEQUENCE = SKU_SEQUENCE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by gagang on 23-12-2016.
|
||||
*/
|
||||
|
||||
public class Stock_FacingGetterSetter {
|
||||
String brandName, mbq, available;
|
||||
|
||||
public String getBrandName() {
|
||||
return brandName;
|
||||
}
|
||||
|
||||
public void setBrandName(String brandName) {
|
||||
this.brandName = brandName;
|
||||
}
|
||||
|
||||
public String getMbq() {
|
||||
return mbq;
|
||||
}
|
||||
|
||||
public void setMbq(String mbq) {
|
||||
this.mbq = mbq;
|
||||
}
|
||||
|
||||
public String getAvailable() {
|
||||
return available;
|
||||
}
|
||||
|
||||
public void setAvailable(String available) {
|
||||
this.available = available;
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 8.3 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 9.3 KiB |
|
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
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:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_category_list" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
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:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_category_wise_performance" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
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:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_daily_main_menu" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
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:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_msl__availability" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
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:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_stock_facing" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
android:backgroundTint="@color/colorPrimary"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
card_view:cardBackgroundColor="@android:color/white"
|
||||
card_view:cardUseCompatPadding="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lay_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="2">
|
||||
<!--android:weightSum="10"-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/categoryIcon"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:src="@drawable/category" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/categoryName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#FFF"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:text="Category List"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="#f2711f"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/content_main"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_category_list">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_categoryName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF1710F"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:text="Category Performance"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/content_category_wise_performance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_category_wise_performance">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_categoryName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF1710F"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:text="Category Performance"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/content_daily_main_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_daily_data_menu">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_categoryName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF1710F"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:text="Category Performance"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/content_msl__availability"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_msl__availability">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_mslAvailabilityName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF1710F"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:text="Must Have Availability"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lin_category"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:weightSum="5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SKU"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="MBQ"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Available"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ExpandableListView
|
||||
android:id="@+id/expandableListView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:cacheColorHint="#00000000"
|
||||
android:divider="@null"
|
||||
android:dividerHeight="0dp"
|
||||
android:scrollingCache="false" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/content_msl__availability"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:showIn="@layout/activity_msl__availability">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_stockFacingName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#FFF1710F"
|
||||
android:paddingBottom="10dp"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingTop="10dp"
|
||||
android:text="Stock Facing"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="@android:color/black" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lin_category"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:weightSum="5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SKU"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Stock"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Faceup"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ExpandableListView
|
||||
android:id="@+id/expandableListView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:cacheColorHint="#00000000"
|
||||
android:divider="@null"
|
||||
android:dividerHeight="0dp"
|
||||
android:scrollingCache="false" />
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?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="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
card_view:cardBackgroundColor="@android:color/white"
|
||||
card_view:cardUseCompatPadding="true">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lay_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="5dp"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="2">
|
||||
<!--android:weightSum="10"-->
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/categoryIcon"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:src="@drawable/category" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:weightSum="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/categoryName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="1"
|
||||
android:background="#FFF"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:padding="10dp"
|
||||
android:text="Category List"
|
||||
android:textAppearance="?android:textAppearanceSmall"
|
||||
android:textColor="#f2711f"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,133 @@
|
||||
<?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="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lay_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="30">
|
||||
<!--android:background="#F1E9E9"-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_period"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Period"
|
||||
android:textColor="#000"
|
||||
android:textSize="20sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f2711f" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_sos"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SOS"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f2711f" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_t2p"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="T2P"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f2711f" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_promo"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Promo"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f2711f" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_msl_availability"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="MSL Availability"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<View
|
||||
android:layout_width="1dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f2711f" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_oss"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="5"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="OSS"
|
||||
android:textColor="#000"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#888" />
|
||||
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
card_view:cardCornerRadius="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lin_category"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:weightSum="5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SKU"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_skuName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SKU Name Value "
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="MBQ"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />-->
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ed_mbq"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:inputType="number"
|
||||
android:maxLength="7"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222"
|
||||
android:textColorHint="#666" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Available"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />-->
|
||||
|
||||
<ToggleButton
|
||||
android:id="@+id/toggle_available"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
card_view:cardBackgroundColor="@color/grey_background"
|
||||
card_view:cardCornerRadius="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rel_categoryHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_categoryHeader"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="25dp"
|
||||
android:text="Brand Name "
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_camera"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginRight="30dp"
|
||||
android:src="@drawable/ic_menu_camera"
|
||||
android:visibility="invisible" />
|
||||
</RelativeLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
card_view:cardCornerRadius="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lin_category"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:weightSum="5">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="2.5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SKU"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_skuName"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="SKU Name Value "
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Stock"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />-->
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ed_stock"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:inputType="number"
|
||||
android:maxLength="7"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222"
|
||||
android:textColorHint="#666" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.25"
|
||||
android:orientation="vertical">
|
||||
|
||||
<!--<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:text="Faceup"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />-->
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ed_facing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:inputType="number"
|
||||
android:maxLength="7"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222"
|
||||
android:textColorHint="#666" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
card_view:cardBackgroundColor="@color/grey_background"
|
||||
card_view:cardCornerRadius="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/lin_stockFaceupHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="2">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/txt_stockFaceupHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="25dp"
|
||||
android:paddingRight="5dp"
|
||||
android:text="Brand Name "
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="#222" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_reference"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@android:drawable/btn_star_big_off" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_camera1"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/ic_menu_camera" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_camera2"
|
||||
android:layout_width="30dp"
|
||||
android:layout_height="30dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:src="@drawable/ic_menu_camera" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_edit"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:src="@android:drawable/ic_menu_edit" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
</LinearLayout>
|
||||
@@ -37,4 +37,9 @@
|
||||
<string name="menu_setting">Setting</string>
|
||||
<string name="menu_services">Services</string>
|
||||
|
||||
<string name="title_activity_category_list">Category List</string>
|
||||
<string name="title_activity_category_wise_performance">CategoryWise Performance</string>
|
||||
<string name="title_activity_daily_main_menu">DailyMainMenuActivity</string>
|
||||
<string name="title_activity_msl__availability">MSL_AvailabilityActivity</string>
|
||||
|
||||
</resources>
|
||||
|
||||