Merge branch 'master' of https://github.com/CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/GSKORANGEV1 into Category_G
# Conflicts: # GSKMTOrange/src/main/AndroidManifest.xml # GSKMTOrange/src/main/java/cpm/com/gskmtorange/MainActivity.java
This commit is contained in:
@@ -419,7 +419,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE " +
|
||||
dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE,M.MBQ " +
|
||||
"from MAPPING_STOCK M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
@@ -441,6 +441,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
|
||||
cd.setMrp(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MRP")));
|
||||
cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE")));
|
||||
cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ")));
|
||||
cd.setToggleValue("0");
|
||||
|
||||
list.add(cd);
|
||||
dbcursor.moveToNext();
|
||||
|
||||
@@ -16,7 +16,6 @@ public class CommonString {
|
||||
public static final String KEY_STOREVISITED_STATUS = "STOREVISITED_STATUS";
|
||||
|
||||
|
||||
|
||||
public static final String KEY_PATH = "path";
|
||||
public static final String KEY_VERSION = "APP_VERSION";
|
||||
|
||||
@@ -53,5 +52,23 @@ public class CommonString {
|
||||
public static final String MESSAGE_EXCEPTION = "Problem Occured : Report The Problem To Parinaam ";
|
||||
public static final String MESSAGE_SOCKETEXCEPTION = "Network Communication Failure. Check Your Network Connection";
|
||||
|
||||
public static final String TABLE_INSERT_MSL_AVAILABILITY = "Msl_Availability_Data";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_MSL_AVAILABILITY = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_INSERT_MSL_AVAILABILITY
|
||||
+ "("
|
||||
+ "KEY_ID"
|
||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
|
||||
+ "Common_ID"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "POST_WORK_IMAGE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "POST_WORK_IMAGE1"
|
||||
+ " VARCHAR"
|
||||
|
||||
+ ")";
|
||||
|
||||
}
|
||||
|
||||
+32
-4
@@ -16,6 +16,7 @@ import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.AbsListView;
|
||||
import android.widget.BaseExpandableListAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ImageView;
|
||||
@@ -70,7 +71,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
|
||||
prepareList();
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
final FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@@ -82,6 +83,15 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
expandableListView.setOnScrollListener(new AbsListView.OnScrollListener() {
|
||||
@Override
|
||||
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
|
||||
int lastItem = firstVisibleItem + visibleItemCount;
|
||||
|
||||
if (firstVisibleItem == 0) {
|
||||
fab.setVisibility(View.VISIBLE);
|
||||
} else if (lastItem == totalItemCount) {
|
||||
fab.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
fab.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -139,7 +149,6 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void prepareList() {
|
||||
@@ -264,7 +273,7 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public View getChildView(final int groupPosition, final int childPosition, boolean isLastChild,
|
||||
View convertView, ViewGroup parent) {
|
||||
MSL_AvailabilityGetterSetter childData = (MSL_AvailabilityGetterSetter) getChild(groupPosition, childPosition);
|
||||
final MSL_AvailabilityGetterSetter childData = (MSL_AvailabilityGetterSetter) getChild(groupPosition, childPosition);
|
||||
ViewHolder holder = null;
|
||||
|
||||
if (convertView == null) {
|
||||
@@ -284,11 +293,30 @@ public class MSL_AvailabilityActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
holder.txt_skuName.setText(childData.getSku());
|
||||
holder.txt_mbq.setText(childData.getMrp());
|
||||
holder.txt_mbq.setText(childData.getMbq());
|
||||
|
||||
holder.toggle_available.setTextOff("No");
|
||||
holder.toggle_available.setTextOn("Yes");
|
||||
|
||||
if (childData.getToggleValue().equals("1")) {
|
||||
holder.toggle_available.setChecked(true);
|
||||
} else {
|
||||
holder.toggle_available.setChecked(false);
|
||||
}
|
||||
|
||||
holder.toggle_available.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
childData.setToggleValue("1");
|
||||
} else {
|
||||
childData.setToggleValue("0");
|
||||
}
|
||||
|
||||
expandableListView.invalidateViews();
|
||||
}
|
||||
});
|
||||
|
||||
return convertView;
|
||||
}
|
||||
|
||||
|
||||
+18
-1
@@ -5,7 +5,8 @@ package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
*/
|
||||
|
||||
public class MSL_AvailabilityGetterSetter {
|
||||
String sub_category_id, sub_category, brand_id, brand, sku_id, sku, mrp, sku_sequence;
|
||||
String sub_category_id, sub_category, brand_id, brand,
|
||||
sku_id, sku, mrp, sku_sequence, toggleValue,mbq;
|
||||
|
||||
public String getSub_category_id() {
|
||||
return sub_category_id;
|
||||
@@ -70,4 +71,20 @@ public class MSL_AvailabilityGetterSetter {
|
||||
public void setSku_sequence(String sku_sequence) {
|
||||
this.sku_sequence = sku_sequence;
|
||||
}
|
||||
|
||||
public String getToggleValue() {
|
||||
return toggleValue;
|
||||
}
|
||||
|
||||
public void setToggleValue(String toggleValue) {
|
||||
this.toggleValue = toggleValue;
|
||||
}
|
||||
|
||||
public String getMbq() {
|
||||
return mbq;
|
||||
}
|
||||
|
||||
public void setMbq(String mbq) {
|
||||
this.mbq = mbq;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user