# Conflicts:
#	GSKMTOrange/src/main/AndroidManifest.xml
#	GSKMTOrange/src/main/java/cpm/com/gskmtorange/MainActivity.java
This commit is contained in:
Gagan290
2017-01-06 17:52:25 +05:30
parent 6b08d54536
commit 04875b6fc8
29 changed files with 1419 additions and 54 deletions
+6 -11
View File
@@ -48,13 +48,10 @@
android:name=".download.DownloadActivity"
android:screenOrientation="portrait" />
<activity
android:name=".GeoTag.GeoTagStoreList"
android:label="@string/title_activity_store_list_geotag"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".dailyentry.StoreListActivity"
android:label="@string/title_activity_store_list_geotag"
@@ -64,7 +61,6 @@
android:name=".dailyentry.StoreimageActivity"
android:label="@string/title_activity_store_list_geotag"
android:theme="@style/AppTheme.NoActionBar" />
<activity
android:name=".GeoTag.GeoTagActivity"
android:label="@string/title_activity_store_geotag"
@@ -77,42 +73,37 @@
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".dailyentry.T2PComplianceActivity"
android:label="@string/title_activity_t2_pcompliance"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar" />
<!--Gagan Start Declaration-->
<!-- Gagan Start Declaration -->
<activity
android:name=".gsk_dailyentry.CategoryListActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".gsk_dailyentry.CategoryWisePerformanceActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".gsk_dailyentry.DailyDataMenuActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".gsk_dailyentry.MSL_AvailabilityActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".gsk_dailyentry.Stock_FacingActivity"
android:configChanges="screenSize|orientation|keyboardHidden"
@@ -120,7 +111,11 @@
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<!--Gagan End Declaration-->
<!-- Gagan End Declaration -->
<activity
android:name=".gsk_dailyentry.PromoComplianceActivity"
android:label="@string/title_activity_promo_compliance"
android:theme="@style/AppTheme.NoActionBar"></activity>
</application>
</manifest>
@@ -23,9 +23,12 @@ import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.GapsChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Stock_FacingGetterSetter;
@@ -68,11 +71,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(TableBean.getDisplayMaster());
db.execSQL(TableBean.getMappingStock());
db.execSQL(TableBean.getMappingT2p());
db.execSQL(TableBean.getMappingAdditionalPromotion());
db.execSQL(TableBean.getMappingPromotion());
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY);
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_HEADER);
db.execSQL(CommonString.CREATE_TABLE_INSERT_STOCK_FACING_CHILD);
db.execSQL(CommonString.CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE);
//Gagan End
@@ -805,6 +811,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
}
}
//Category List
public ArrayList<CategoryGetterSetter> getCategoryListData(String keyAccountId, String storeTypeId, String classId) {
ArrayList<CategoryGetterSetter> list = new ArrayList<>();
@@ -1044,7 +1051,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.update(CommonString.TABLE_INSERT_MSL_AVAILABILITY, values,
"Brand_Id ='" + hashMapListHeaderData.get(i).getBrand_id() + "' AND SKU_ID ='" + data.getSku_id() +
"' AND Category_Id='" + categoryId + "'", null);
"' AND Category_Id='" + categoryId + "' AND Store_Id='" + storeId + "'", null);
}
}
db.setTransactionSuccessful();
@@ -1307,7 +1314,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
//db.insert(CommonString.TABLE_INSERT_STOCK_FACING_HEADER, null, values1);
db.update(CommonString.TABLE_INSERT_STOCK_FACING_HEADER, values1,
"Category_Id='" + categoryId + "'", null);
"Category_Id='" + categoryId + "' AND Store_Id='" + storeId + "' ", null);
for (int j = 0; j < hashMapListChildData.get(hashMapListHeaderData.get(i)).size(); j++) {
Stock_FacingGetterSetter data = hashMapListChildData.get(hashMapListHeaderData.get(i)).get(j);
@@ -1318,7 +1325,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
//db.insert(CommonString.TABLE_INSERT_STOCK_FACING_CHILD, null, values);
db.update(CommonString.TABLE_INSERT_STOCK_FACING_CHILD, values,
"Brand_Id ='" + hashMapListHeaderData.get(i).getBrand_id() + "' AND SKU_ID ='" + data.getSku_id() +
"' AND Category_Id='" + categoryId + "'", null);
"' AND Category_Id='" + categoryId + "' AND Store_Id='" + storeId + "'", null);
}
}
db.setTransactionSuccessful();
@@ -1328,5 +1335,169 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
}
}
public void InsertMAPPING_ADDITIONAL_PROMOTION(MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter data) {
db.delete("MAPPING_ADDITIONAL_PROMOTION", 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("SKU_ID", data.getSKU_ID().get(i));
values.put("SKU", data.getSKU().get(i));
values.put("PROMO_ID", data.getPROMO_ID().get(i));
values.put("PROMO", data.getPROMO().get(i));
db.insert("MAPPING_ADDITIONAL_PROMOTION", null, values);
}
} catch (Exception ex) {
Log.d("Exception ", " in MAPPING_ADDITIONAL_PROMOTION " + ex.toString());
}
}
public void InsertMAPPING_PROMOTION(MappingPromotionGetterSetter data) {
db.delete("MAPPING_PROMOTION", 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("SKU_ID", data.getSKU_ID().get(i));
values.put("SKU", data.getSKU().get(i));
values.put("PROMO_ID", data.getPROMO_ID().get(i));
values.put("PROMO", data.getPROMO().get(i));
db.insert("MAPPING_PROMOTION", null, values);
}
} catch (Exception ex) {
Log.d("Exception ", " in MAPPING_PROMOTION " + ex.toString());
}
}
//Promo Compliance
public ArrayList<Promo_Compliance_DataGetterSetter> getPromoComplianceSkuData(String store_id) {
ArrayList<Promo_Compliance_DataGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("Select * from MAPPING_PROMOTION " +
"where STORE_ID='" + store_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
Promo_Compliance_DataGetterSetter cd = new Promo_Compliance_DataGetterSetter();
cd.setStore_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STORE_ID")));
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
cd.setPromo_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO_ID")));
cd.setPromo(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO")));
cd.setIn_stock("1");
cd.setPromo_announcer("1");
cd.setRunning_pos("1");
list.add(cd);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
Log.d("Exception ", "getPromoComplianceSkuData!" + e.toString());
return list;
}
return list;
}
public ArrayList<Promo_Compliance_DataGetterSetter> getPromoSpinnerData(String store_id) {
ArrayList<Promo_Compliance_DataGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
Promo_Compliance_DataGetterSetter promo = new Promo_Compliance_DataGetterSetter();
promo.setPromo_id("0");
promo.setPromo("Select");
list.add(promo);
dbcursor = db.rawQuery("Select * from MAPPING_ADDITIONAL_PROMOTION " +
"where STORE_ID='" + store_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
Promo_Compliance_DataGetterSetter cd = new Promo_Compliance_DataGetterSetter();
cd.setPromo_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO_ID")));
cd.setPromo(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO")));
list.add(cd);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
Log.d("Exception ", "getPromoComplianceSkuData!" + e.toString());
return list;
}
return list;
}
public void InsertAdditionalPromoData(Promo_Compliance_DataGetterSetter data) {
ContentValues values = new ContentValues();
try {
values.put("STORE_ID", Integer.parseInt(data.getStore_id()));
values.put("SKU_ID", Integer.parseInt(data.getSku_id()));
values.put("SKU", data.getSku());
values.put("PROMO_ID", Integer.parseInt(data.getPromo_id()));
values.put("PROMO", data.getPromo());
values.put("IN_STOCK_VALUE", Integer.parseInt(data.getPromo()));
values.put("PROMO_ANNOUNCER_VALUE", Integer.parseInt(data.getPromo()));
values.put("RUNNING_POS_VALUE", Integer.parseInt(data.getPromo()));
db.insert(CommonString.TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE, null, values);
} catch (Exception ex) {
Log.d("Exception ", " InsertAdditionalPromoData " + ex.toString());
}
}
public ArrayList<Promo_Compliance_DataGetterSetter> getAdditionalPromoData() {
ArrayList<Promo_Compliance_DataGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("Select * from Additional_Promo_Compliance_Data ", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
Promo_Compliance_DataGetterSetter cd = new Promo_Compliance_DataGetterSetter();
cd.setStore_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STORE_ID")));
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
cd.setPromo_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO_ID")));
cd.setPromo(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO")));
cd.setIn_stock(dbcursor.getString(dbcursor.getColumnIndexOrThrow("IN_STOCK_VALUE")));
cd.setPromo_announcer(dbcursor.getString(dbcursor.getColumnIndexOrThrow("PROMO_ANNOUNCER_VALUE")));
cd.setRunning_pos(dbcursor.getString(dbcursor.getColumnIndexOrThrow("RUNNING_POS_VALUE")));
list.add(cd);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
Log.d("Exception ", "getPromoComplianceSkuData!" + e.toString());
return list;
}
return list;
}
//Gagan End Method
}
@@ -660,10 +660,10 @@ public class LoginActivity extends AppCompatActivity {
String lang ;
if(language.equals("English")){
if(language.equalsIgnoreCase("English")){
lang = "EN";
}
else if(language.equals("UAE")) {
else if(language.equalsIgnoreCase("UAE")) {
lang = "AR";
}
else {
@@ -51,7 +51,6 @@ public class CommonString {
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
public static final String KEY_JOURNEY_PLAN = "JOURNEY_PLAN";
public static final String KEY_P = "P";
@@ -63,7 +62,7 @@ public class CommonString {
public static final String KEY_INVALID = "INVALID";
public static final String STORE_STATUS_LEAVE = "L";
public static final String KEY_VALID = "Valid";
public static final String DATA_DELETE_ALERT_MESSAGE="Saved data will be lost - Do you want to continue?";
public static final String DATA_DELETE_ALERT_MESSAGE = "Saved data will be lost - Do you want to continue?";
public static final String KEY_CHECK_IN = "I";
// webservice constants
@@ -97,11 +96,6 @@ public class CommonString {
//Alert Messages
public static final String MESSAGE_FAILURE = "Server Error.Please Access After Some Time";
public static final String MESSAGE_FALSE = "Invalid User";
public static final String MESSAGE_CHANGED = "Invalid UserId Or Password / Password Has Been Changed.";
@@ -112,24 +106,18 @@ public class CommonString {
public static final String TABLE_COVERAGE_DATA = "COVERAGE_DATA";
public static final String CREATE_TABLE_COVERAGE_DATA = "CREATE TABLE IF NOT EXISTS "
+ TABLE_COVERAGE_DATA + " (" + KEY_ID
+ " INTEGER PRIMARY KEY AUTOINCREMENT ," + KEY_STORE_ID
+ " VARCHAR,USER_ID VARCHAR, " + KEY_IN_TIME + " VARCHAR,"
+ KEY_OUT_TIME + " VARCHAR," + KEY_VISIT_DATE + " VARCHAR,"
+ KEY_LATITUDE + " VARCHAR," + KEY_LONGITUDE + " VARCHAR,"+ KEY_MERCHANDISER_ID + " VARCHAR,"
+ KEY_COVERAGE_STATUS + " VARCHAR,"+ KEY_IMAGE + " VARCHAR,"
+ KEY_LATITUDE + " VARCHAR," + KEY_LONGITUDE + " VARCHAR," + KEY_MERCHANDISER_ID + " VARCHAR,"
+ KEY_COVERAGE_STATUS + " VARCHAR," + KEY_IMAGE + " VARCHAR,"
+ KEY_GEO_TAG + " VARCHAR,"
+ KEY_REASON_ID + " VARCHAR," + KEY_COVERAGE_REMARK
+ " VARCHAR," + KEY_REASON + " VARCHAR)";
public static final String CREATE_TABLE_STORE_GEOTAGGING = "CREATE TABLE IF NOT EXISTS "
+ TABLE_STORE_GEOTAGGING
+ " ("
@@ -154,7 +142,6 @@ public class CommonString {
+ "FRONT_IMAGE" + " VARCHAR)";
//Gagan Code Start
//File Path
@@ -271,5 +258,39 @@ public class CommonString {
+ ")";
public static final String TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "Additional_Promo_Compliance_Data";
public static final String CREATE_TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE = "CREATE TABLE IF NOT EXISTS "
+ TABLE_INSERT_ADDITIONAL_PROMO_COMPLIANCE
+ "("
+ "KEY_ID"
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
+ "STORE_ID"
+ " INTEGER,"
+ "SKU_ID"
+ " INTEGER,"
+ "SKU"
+ " VARCHAR,"
+ "PROMO_ID"
+ " INTEGER,"
+ "PROMO"
+ " VARCHAR,"
+ "IN_STOCK_VALUE"
+ " INTEGER,"
+ "PROMO_ANNOUNCER_VALUE"
+ " INTEGER,"
+ "RUNNING_POS_VALUE"
+ " INTEGER"
+ ")";
//Gagan Code End
}
@@ -36,6 +36,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
@@ -68,6 +69,7 @@ public class DownloadActivity extends AppCompatActivity {
MappingDisplayChecklistGetterSetter mappingChecklistGetterSetter;
NonWorkingReasonGetterSetter nonWorkingReasonGetterSetter;
MappingPromotionGetterSetter mappingPromotionGetterSetter;
MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter mapping_additional_promotion_masterGetterSetter;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -511,6 +513,7 @@ public class DownloadActivity extends AppCompatActivity {
}
publishProgress(data);
// MAPPING_PROMOTION
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
request.addProperty("UserName", userId);
@@ -545,6 +548,47 @@ public class DownloadActivity extends AppCompatActivity {
}
publishProgress(data);
//Gagan start code
// MAPPING_ADDITIONAL_PROMOTION
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
request.addProperty("UserName", userId);
request.addProperty("Type", "MAPPING_ADDITIONAL_PROMOTION");
request.addProperty("cultureid", culture_id);
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(CommonString.URL);
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
result = (Object) envelope.getResponse();
if (result.toString() != null) {
xpp.setInput(new StringReader(result.toString()));
xpp.next();
eventType = xpp.getEventType();
mapping_additional_promotion_masterGetterSetter = XMLHandlers.mappingAdditionalPromotionXMLHandler(xpp, eventType);
if (mapping_additional_promotion_masterGetterSetter.getSTORE_ID().size() > 0) {
String mapping_additional_promotion_table = mapping_additional_promotion_masterGetterSetter.getTable_MAPPING_ADDITIONAL_PROMOTION();
if (mapping_additional_promotion_table != null) {
resultHttp = CommonString.KEY_SUCCESS;
TableBean.setMappingAdditionalPromotion(mapping_additional_promotion_table);
}
} else {
//return "MAPPING_ADDITIONAL_PROMOTION";
}
data.value = 100;
data.name = "MAPPING_ADDITIONAL_PROMOTION Data Download";
}
publishProgress(data);
//Gagan end code
db.open();
db.InsertJCP(jcpgettersetter);
db.InsertCategory(categoryMasterGetterSetter);
@@ -557,6 +601,8 @@ public class DownloadActivity extends AppCompatActivity {
db.InsertMappingStock(mappingStockGetterSetter);
db.InsertDisplayChecklistMaster(checklistMasterGetterSetter);
db.InsertMappingDisplayChecklist(mappingChecklistGetterSetter);
db.InsertMAPPING_ADDITIONAL_PROMOTION(mapping_additional_promotion_masterGetterSetter);
db.InsertMAPPING_PROMOTION(mappingPromotionGetterSetter);
} catch (MalformedURLException e) {
/*final AlertMessage message = new AlertMessage(
@@ -69,7 +69,7 @@ public class CategoryListActivity extends AppCompatActivity {
//txt_categoryName.setText("Category List");
txt_categoryName.setText(getResources().getString(R.string.title_activity_category_list));
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab_category);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
@@ -97,7 +97,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
data.setCategory_img(R.drawable.category);
categoryList.add(data);
data = new DailyDataMenuGetterSetter();
/*data = new DailyDataMenuGetterSetter();
data.setCategory_name(getResources().getString(R.string.daily_data_menu_competition_tracking));
//data.setCategory_name("Competition Tracking");
data.setCategory_img(R.drawable.category);
@@ -107,7 +107,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
data.setCategory_name(getResources().getString(R.string.daily_data_menu_additional_promotions));
//data.setCategory_name("Competition Promo");
data.setCategory_img(R.drawable.category);
categoryList.add(data);
categoryList.add(data);*/
adapter = new DailyDataMenuAdapter(DailyDataMenuActivity.this, categoryList);
recyclerView.setAdapter(adapter);
@@ -152,6 +152,11 @@ public class DailyDataMenuActivity extends AppCompatActivity {
intent.putExtra("categoryName", dailyData.getCategory_name());
intent.putExtra("categoryId", categoryId);
startActivity(intent);
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_promo_compliance))) {
Intent intent = new Intent(DailyDataMenuActivity.this, PromoComplianceActivity.class);
intent.putExtra("categoryName", dailyData.getCategory_name());
intent.putExtra("categoryId", categoryId);
startActivity(intent);
}
}
});
@@ -0,0 +1,259 @@
package cpm.com.gskmtorange.gsk_dailyentry;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.view.ScrollingView;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.ToggleButton;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import cpm.com.gskmtorange.Database.GSKOrangeDB;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonString;
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.Promo_Compliance_DataGetterSetter;
public class PromoComplianceActivity extends AppCompatActivity {
LinearLayout lin_promo_sku, lin_addtional_promo;
View view_promo_sku, view_additional_promo;
Spinner sp_promo;
ToggleButton toggle_add_InStock, toggle_add_promoAnnouncer, toggle_add_runningPos;
ArrayList<Promo_Compliance_DataGetterSetter> promoSkuListData;
ArrayList<Promo_Compliance_DataGetterSetter> promoSpinnerListData;
ArrayList<Promo_Compliance_DataGetterSetter> additionalPromoListData;
GSKOrangeDB db;
String categoryName, categoryId;
private SharedPreferences preferences;
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_promo_compliance);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
lin_promo_sku = (LinearLayout) findViewById(R.id.lin_promo_sku);
lin_addtional_promo = (LinearLayout) findViewById(R.id.lin_addtional_promo);
view_promo_sku = findViewById(R.id.view_promo_sku);
view_additional_promo = findViewById(R.id.view_additional_promo);
sp_promo = (Spinner) findViewById(R.id.sp_promo);
toggle_add_InStock = (ToggleButton) findViewById(R.id.toggle_add_InStock);
toggle_add_promoAnnouncer = (ToggleButton) findViewById(R.id.toggle_add_promoAnnouncer);
toggle_add_runningPos = (ToggleButton) findViewById(R.id.toggle_add_runningPos);
db = new GSKOrangeDB(this);
db.open();
//preference data
preferences = PreferenceManager.getDefaultSharedPreferences(this);
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
visit_date = preferences.getString(CommonString.KEY_DATE, null);
date = preferences.getString(CommonString.KEY_DATE, null);
username = preferences.getString(CommonString.KEY_USERNAME, null);
intime = preferences.getString(CommonString.KEY_STORE_IN_TIME, "");
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
//Intent data
categoryName = getIntent().getStringExtra("categoryName");
categoryId = getIntent().getStringExtra("categoryId");
prepareList();
promoSkuListView();
additionalPromoListData = new ArrayList<>();
//AdditionalPromoListView();
Promo_Compliance_DataGetterSetter cd = new Promo_Compliance_DataGetterSetter();
cd.setStore_id("");
cd.setSku_id("");
cd.setSku("");
cd.setPromo_id("");
cd.setPromo("");
cd.setIn_stock("1");
cd.setPromo_announcer("1");
cd.setRunning_pos("1");
cd.setSp_promo("0");
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();
}
});
/*ViewTreeObserver.OnScrollChangedListener onScrollChangedListener
= new ViewTreeObserver.OnScrollChangedListener() {
@Override
public void onScrollChanged() {
}
};*/
}
private void prepareList() {
//Promo SKU List
promoSkuListData = db.getPromoComplianceSkuData(store_id);
//Promo Spinner List
promoSpinnerListData = db.getPromoSpinnerData(store_id);
ArrayAdapter<String> sp_promo_adapter = new ArrayAdapter<>(PromoComplianceActivity.this, android.R.layout.simple_list_item_1);
for (int i = 0; i < promoSpinnerListData.size(); i++) {
sp_promo_adapter.add(promoSpinnerListData.get(i).getPromo());
}
sp_promo.setAdapter(sp_promo_adapter);
}
private void promoSkuListView() {
View view;
for (int i = 0; i < promoSkuListData.size(); i++) {
view = getLayoutInflater().inflate(R.layout.item_promo_sku_list, null, false);
final Promo_Compliance_DataGetterSetter data = promoSkuListData.get(i);
TextView txt_promoSkuName = (TextView) view.findViewById(R.id.txt_promoSkuName);
ToggleButton toggle_inStock = (ToggleButton) view.findViewById(R.id.toggle_inStock);
ToggleButton toggle_promoAnnouncer = (ToggleButton) view.findViewById(R.id.toggle_promoAnnouncer);
ToggleButton toggle_runningPos = (ToggleButton) view.findViewById(R.id.toggle_runningPos);
txt_promoSkuName.setText(data.getPromo());
//In Stock
toggle_inStock.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
data.setIn_stock("1");
} else {
data.setIn_stock("0");
}
}
});
if (data.getIn_stock().equals("1")) {
toggle_inStock.setChecked(true);
} else {
toggle_inStock.setChecked(false);
}
//Promo Announcer
toggle_promoAnnouncer.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
data.setPromo_announcer("1");
} else {
data.setPromo_announcer("0");
}
}
});
if (data.getPromo_announcer().equals("1")) {
toggle_promoAnnouncer.setChecked(true);
} else {
toggle_promoAnnouncer.setChecked(false);
}
//Running on POS
toggle_runningPos.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
data.setRunning_pos("1");
} else {
data.setRunning_pos("0");
}
}
});
if (data.getRunning_pos().equals("1")) {
toggle_runningPos.setChecked(true);
} else {
toggle_runningPos.setChecked(false);
}
lin_promo_sku.addView(view);
}
}
private void AdditionalPromoListView() {
additionalPromoListData.clear();
//Additional Promo List
additionalPromoListData = db.getAdditionalPromoData();
View view;
for (int i = 0; i < additionalPromoListData.size(); i++) {
view = getLayoutInflater().inflate(R.layout.item_additional_promo_list, null, false);
final Promo_Compliance_DataGetterSetter data = additionalPromoListData.get(i);
TextView txt_promoSkuName = (TextView) view.findViewById(R.id.txt_promoSkuName);
TextView txt_inStock = (TextView) view.findViewById(R.id.txt_inStock);
TextView txt_promoAnnouncer = (TextView) view.findViewById(R.id.txt_promoAnnouncer);
TextView txt_runningPos = (TextView) view.findViewById(R.id.txt_runningPos);
txt_promoSkuName.setText(data.getPromo());
//In Stock
if (data.getIn_stock().equals("1")) {
txt_inStock.setText("Yes");
} else {
txt_inStock.setText("No");
}
//Promo Announcer
if (data.getPromo_announcer().equals("1")) {
txt_promoAnnouncer.setText("Yes");
} else {
txt_promoAnnouncer.setText("No");
}
//Running on POS
if (data.getRunning_pos().equals("1")) {
txt_runningPos.setText("Yes");
} else {
txt_runningPos.setText("No");
}
lin_addtional_promo.addView(view);
}
}
}
@@ -0,0 +1,65 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
/**
* Created by gagang on 06-01-2017.
*/
public class MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter {
String table_MAPPING_ADDITIONAL_PROMOTION;
ArrayList<String> STORE_ID = new ArrayList<>();
ArrayList<String> SKU_ID = new ArrayList<>();
ArrayList<String> SKU = new ArrayList<>();
ArrayList<String> PROMO_ID = new ArrayList<>();
ArrayList<String> PROMO = new ArrayList<>();
public String getTable_MAPPING_ADDITIONAL_PROMOTION() {
return table_MAPPING_ADDITIONAL_PROMOTION;
}
public void setTable_MAPPING_ADDITIONAL_PROMOTION(String table_MAPPING_ADDITIONAL_PROMOTION) {
this.table_MAPPING_ADDITIONAL_PROMOTION = table_MAPPING_ADDITIONAL_PROMOTION;
}
public ArrayList<String> getSTORE_ID() {
return STORE_ID;
}
public void setSTORE_ID(String STORE_ID) {
this.STORE_ID.add(STORE_ID);
}
public ArrayList<String> getSKU_ID() {
return SKU_ID;
}
public void setSKU_ID(String SKU_ID) {
this.SKU_ID.add(SKU_ID);
}
public ArrayList<String> getSKU() {
return SKU;
}
public void setSKU(String SKU) {
this.SKU.add(SKU);
}
public ArrayList<String> getPROMO_ID() {
return PROMO_ID;
}
public void setPROMO_ID(String PROMO_ID) {
this.PROMO_ID.add(PROMO_ID);
}
public ArrayList<String> getPROMO() {
return PROMO;
}
public void setPROMO(String PROMO) {
this.PROMO.add(PROMO);
}
}
@@ -7,7 +7,6 @@ import java.util.ArrayList;
*/
public class MappingPromotionGetterSetter {
String table_MAPPING_PROMOTION;
ArrayList<String> STORE_ID = new ArrayList<>();
@@ -0,0 +1,83 @@
package cpm.com.gskmtorange.xmlGetterSetter;
import java.util.ArrayList;
/**
* Created by gagang on 06-01-2017.
*/
public class Promo_Compliance_DataGetterSetter {
String store_id, sku_id, sku, promo_id, promo, in_stock, promo_announcer, running_pos, sp_promo;
public String getStore_id() {
return store_id;
}
public void setStore_id(String store_id) {
this.store_id = store_id;
}
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 getPromo_id() {
return promo_id;
}
public void setPromo_id(String promo_id) {
this.promo_id = promo_id;
}
public String getPromo() {
return promo;
}
public void setPromo(String promo) {
this.promo = promo;
}
public String getIn_stock() {
return in_stock;
}
public void setIn_stock(String in_stock) {
this.in_stock = in_stock;
}
public String getPromo_announcer() {
return promo_announcer;
}
public void setPromo_announcer(String promo_announcer) {
this.promo_announcer = promo_announcer;
}
public String getRunning_pos() {
return running_pos;
}
public void setRunning_pos(String running_pos) {
this.running_pos = running_pos;
}
public String getSp_promo() {
return sp_promo;
}
public void setSp_promo(String sp_promo) {
this.sp_promo = sp_promo;
}
}
@@ -19,6 +19,10 @@ public class TableBean {
public static String NON_WORKING_REASON;
public static String MAPPING_PROMOTION;
//Gagan start code
public static String MAPPING_ADDITIONAL_PROMOTION;
//Gagan end code
public static String getJourneyPlan() {
return JOURNEY_PLAN;
}
@@ -114,4 +118,16 @@ public class TableBean {
public static void setMappingPromotion(String mappingPromotion) {
MAPPING_PROMOTION = mappingPromotion;
}
//Gagan start code
public static String getMappingAdditionalPromotion() {
return MAPPING_ADDITIONAL_PROMOTION;
}
public static void setMappingAdditionalPromotion(String mappingAdditionalPromotion) {
MAPPING_ADDITIONAL_PROMOTION = mappingAdditionalPromotion;
}
//Gagan end code
}
@@ -13,6 +13,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
@@ -186,7 +187,7 @@ public class XMLHandlers {
// SKU_MASTER XML HANDLER
public static SkuMasterGetterSetter skuMasterXMLHandler(XmlPullParser xpp,
int eventType) {
int eventType) {
SkuMasterGetterSetter sku = new SkuMasterGetterSetter();
try {
@@ -226,7 +227,7 @@ public class XMLHandlers {
// BRAND_MASTER XML HANDLER
public static BrandMasterGetterSetter brandMasterXMLHandler(XmlPullParser xpp,
int eventType) {
int eventType) {
BrandMasterGetterSetter brand = new BrandMasterGetterSetter();
try {
@@ -303,7 +304,7 @@ public class XMLHandlers {
// CATEGORY_MASTER XML HANDLER
public static CategoryMasterGetterSetter categoryMasterXMLHandler(XmlPullParser xpp,
int eventType) {
int eventType) {
CategoryMasterGetterSetter category = new CategoryMasterGetterSetter();
try {
@@ -369,7 +370,7 @@ public class XMLHandlers {
// MAPPING_STOCK XML HANDLER
public static MappingStockGetterSetter mappingStockXMLHandler(XmlPullParser xpp,
int eventType) {
int eventType) {
MappingStockGetterSetter stock = new MappingStockGetterSetter();
try {
@@ -411,7 +412,7 @@ public class XMLHandlers {
// MAPPING_T2P XML HANDLER
public static MAPPINGT2PGetterSetter mappingT2pXMLHandler(XmlPullParser xpp,
int eventType) {
int eventType) {
MAPPINGT2PGetterSetter t2p = new MAPPINGT2PGetterSetter();
try {
@@ -475,7 +476,7 @@ public class XMLHandlers {
// MAPPING_DISPLAY_CHECKLIST XML HANDLER
public static MappingDisplayChecklistGetterSetter mappingMappingDisplayChecklistXMLHandler(XmlPullParser xpp,
int eventType) {
int eventType) {
MappingDisplayChecklistGetterSetter checklist = new MappingDisplayChecklistGetterSetter();
try {
@@ -505,7 +506,7 @@ public class XMLHandlers {
// NON_WORKING_REASON XML HANDLER
public static NonWorkingReasonGetterSetter nonWorkingReasonXMLHandler(XmlPullParser xpp,
int eventType) {
int eventType) {
NonWorkingReasonGetterSetter reason = new NonWorkingReasonGetterSetter();
try {
@@ -540,13 +541,13 @@ public class XMLHandlers {
}
// MAPPING_PROMOTION XML HANDLER
public static MappingPromotionGetterSetter mappingPromotionXMLHandler(XmlPullParser xpp,
int eventType) {
public static MappingPromotionGetterSetter mappingPromotionXMLHandler(XmlPullParser xpp, int eventType) {
MappingPromotionGetterSetter t2p = new MappingPromotionGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("META_DATA")) {
t2p.setTable_MAPPING_PROMOTION(xpp.nextText());
}
@@ -569,12 +570,51 @@ public class XMLHandlers {
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return t2p;
}
//Gagan Start Code
//MAPPING_ADDITIONAL_PROMOTION
public static MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter mappingAdditionalPromotionXMLHandler(XmlPullParser xpp, int eventType) {
MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter map = new MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter();
try {
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
if (xpp.getEventType() == XmlPullParser.START_TAG) {
if (xpp.getName().equals("META_DATA")) {
map.setTable_MAPPING_ADDITIONAL_PROMOTION(xpp.nextText());
}
if (xpp.getName().equals("STORE_ID")) {
map.setSTORE_ID(xpp.nextText());
}
if (xpp.getName().equals("SKU_ID")) {
map.setSKU_ID(xpp.nextText());
}
if (xpp.getName().equals("SKU")) {
map.setSKU(xpp.nextText());
}
if (xpp.getName().equals("PROMO_ID")) {
map.setPROMO_ID(xpp.nextText());
}
if (xpp.getName().equals("PROMO")) {
map.setPROMO(xpp.nextText());
}
}
xpp.next();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return map;
}
//Gagan End Code
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

@@ -1,7 +1,6 @@
<?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">
@@ -23,12 +22,11 @@
<include layout="@layout/content_category_list" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:id="@+id/fab_category"
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"
android:visibility="gone"
app:srcCompat="@drawable/save_icon" />
@@ -28,7 +28,6 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:backgroundTint="@color/colorPrimary"
app:srcCompat="@drawable/right_arrow" />
</android.support.design.widget.CoordinatorLayout>
@@ -28,7 +28,6 @@
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:backgroundTint="@color/colorPrimary"
android:visibility="gone"
app:srcCompat="@drawable/save_icon" />
@@ -26,7 +26,6 @@
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"
tools:context="cpm.com.gskmtorange.gsk_dailyentry.PromoComplianceActivity">
<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_promo_compliance" />
<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"
app:srcCompat="@drawable/save_icon" />
</android.support.design.widget.CoordinatorLayout>
@@ -26,7 +26,6 @@
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,262 @@
<?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:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_promo_compliance"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="cpm.com.gskmtorange.gsk_dailyentry.PromoComplianceActivity"
tools:showIn="@layout/activity_promo_compliance">
<ScrollView
android:id="@+id/scrollView_promoCompliance"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--Promo sku List-->
<LinearLayout
android:id="@+id/lin_promo_sku"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
<View
android:id="@+id/view_promo_sku"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorPrimaryDark" />
<!--Add Additional layout-->
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="5dp"
card_view:cardCornerRadius="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:weightSum="4">
<!--Additional Promo-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="#70888888"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:text="Additional Promos"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
</LinearLayout>
<!--Promo Spinner-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="2">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight=".8"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:text="Promos"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
<Spinner
android:id="@+id/sp_promo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1.2" />
</LinearLayout>
<!--InStock, Promo Announcer, Running on Pos-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="In Stock"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal"
android:orientation="vertical">
<ToggleButton
android:id="@+id/toggle_add_InStock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Promo Announcer"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal"
android:orientation="vertical">
<ToggleButton
android:id="@+id/toggle_add_promoAnnouncer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Running on POS"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal"
android:orientation="vertical">
<ToggleButton
android:id="@+id/toggle_add_runningPos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<!--Add Button-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="5dp"
android:layout_weight="1"
android:orientation="vertical"
android:paddingRight="15dp">
<Button
android:id="@+id/btn_add"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:background="@color/colorPrimaryDark"
android:text="Add"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<!--Additional List-->
<View
android:id="@+id/view_additional_promo"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/colorPrimaryDark" />
<LinearLayout
android:id="@+id/lin_addtional_promo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
@@ -0,0 +1,198 @@
<?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:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
card_view:cardCornerRadius="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:text="Promos SKU"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
<!--Promo sku name-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_promoName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:text="MIGROS COMPLETE"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
</LinearLayout>
<!--InStock, Promo Announcer, Running on Pos-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="In Stock"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal|center_vertical"
android:orientation="vertical">
<!--<ToggleButton
android:id="@+id/toggle_inStock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />-->
<TextView
android:id="@+id/txt_inStock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Yes"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Promo Announcer"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal|center_vertical"
android:orientation="vertical">
<!--<ToggleButton
android:id="@+id/toggle_promoAnnouncer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />-->
<TextView
android:id="@+id/txt_promoAnnouncer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Yes"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Running on POS"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal|center_vertical"
android:orientation="horizontal">
<!--<ToggleButton
android:id="@+id/toggle_runningPos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />-->
<TextView
android:id="@+id/txt_runningPos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Yes"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
@@ -0,0 +1,176 @@
<?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:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
card_view:cardCornerRadius="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingTop="5dp"
android:text="Promos SKU"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
<!--Promo sku name-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<TextView
android:id="@+id/txt_promoSkuName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="5dp"
android:text="MIGROS COMPLETE"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/black" />
</LinearLayout>
<!--InStock, Promo Announcer, Running on Pos-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="In Stock"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal"
android:orientation="vertical">
<ToggleButton
android:id="@+id/toggle_inStock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Promo Announcer"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal"
android:orientation="vertical">
<ToggleButton
android:id="@+id/toggle_promoAnnouncer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical"
android:weightSum="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Running on POS"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3"
android:gravity="center_horizontal"
android:orientation="horizontal">
<ToggleButton
android:id="@+id/toggle_runningPos"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="No"
android:textOn="Yes" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
@@ -94,5 +94,6 @@
<string name="title_store_list_checkout_current">Please checkout from current store</string>
<string name="title_store_list_checkout_Already_filled">Data already filled</string>
<string name="title_activity_promo_compliance">PromoCompliance</string>
</resources>