Msl_Availability_StockFacing_New Merge into Main Project
This commit is contained in:
+14
-18
@@ -113,6 +113,7 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.additionalvisibilitylayout);
|
setContentView(R.layout.additionalvisibilitylayout);
|
||||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
@@ -703,9 +704,19 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
// if this button is clicked, just close
|
// if this button is clicked, just close
|
||||||
// the dialog box and do nothing
|
// the dialog box and do nothing
|
||||||
btntoggle.setChecked(true);
|
//btntoggle.setChecked(true);
|
||||||
|
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
|
|
||||||
|
togglevalue = "1";
|
||||||
|
btntoggle.setChecked(true);
|
||||||
|
brandlayout.setVisibility(View.GONE);
|
||||||
|
diaplylayout.setVisibility(View.VISIBLE);
|
||||||
|
cameralayout.setVisibility(View.VISIBLE);
|
||||||
|
btnsku.setVisibility(View.VISIBLE);
|
||||||
|
btnaddlayout.setVisibility(View.VISIBLE);
|
||||||
|
cardvew.setVisibility(View.VISIBLE);
|
||||||
|
listviewlay.setVisibility(View.INVISIBLE);
|
||||||
|
maincard.setVisibility(View.INVISIBLE);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -824,7 +835,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class CustomAdapter extends ArrayAdapter<String> {
|
public class CustomAdapter extends ArrayAdapter<String> {
|
||||||
|
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
@@ -949,7 +959,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class CustomSkuMasterAdpter extends ArrayAdapter<String> {
|
public class CustomSkuMasterAdpter extends ArrayAdapter<String> {
|
||||||
|
|
||||||
private Activity activity;
|
private Activity activity;
|
||||||
@@ -1012,7 +1021,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void startCameraActivity() {
|
protected void startCameraActivity() {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
@@ -1116,7 +1124,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void showSkuDialog() {
|
public void showSkuDialog() {
|
||||||
|
|
||||||
final ArrayList<BrandMasterGetterSetter> brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId);
|
final ArrayList<BrandMasterGetterSetter> brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId);
|
||||||
@@ -1311,7 +1318,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View arg0) {
|
public void onClick(View arg0) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
@@ -1337,7 +1343,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class MyAdaptorStock extends BaseAdapter {
|
public class MyAdaptorStock extends BaseAdapter {
|
||||||
|
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
@@ -1451,7 +1456,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class MyAdaptorAdditionalStock extends BaseAdapter {
|
public class MyAdaptorAdditionalStock extends BaseAdapter {
|
||||||
|
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
@@ -1491,21 +1495,15 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View getView(final int position1, View convertView, ViewGroup parent) {
|
public View getView(final int position1, View convertView, ViewGroup parent) {
|
||||||
|
|
||||||
final ViewHolder holder;
|
final ViewHolder holder;
|
||||||
|
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
|
convertView = mInflater.inflate(R.layout.additionallistlayout, null);
|
||||||
convertView = mInflater
|
|
||||||
.inflate(R.layout.additionallistlayout, null);
|
|
||||||
holder = new ViewHolder();
|
holder = new ViewHolder();
|
||||||
|
|
||||||
holder.brand = (TextView) convertView.findViewById(R.id.brand_name);
|
holder.brand = (TextView) convertView.findViewById(R.id.brand_name);
|
||||||
|
|
||||||
holder.display = (TextView) convertView.findViewById(R.id.display_name);
|
holder.display = (TextView) convertView.findViewById(R.id.display_name);
|
||||||
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
holder.qty_bought = (TextView) convertView.findViewById(R.id.qty_bought);
|
||||||
|
|
||||||
|
|
||||||
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
holder.delete = (Button) convertView.findViewById(R.id.delete_btn);
|
||||||
|
|
||||||
convertView.setTag(holder);
|
convertView.setTag(holder);
|
||||||
@@ -1517,7 +1515,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdditionalVisibility.this);
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AdditionalVisibility.this);
|
||||||
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
|
||||||
@@ -1671,7 +1668,6 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean updateResources(Context context, String language) {
|
private static boolean updateResources(Context context, String language) {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+64
-44
@@ -24,7 +24,6 @@ import android.provider.MediaStore;
|
|||||||
import android.support.design.widget.FloatingActionButton;
|
import android.support.design.widget.FloatingActionButton;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.CardView;
|
|
||||||
import android.support.v7.widget.LinearLayoutManager;
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
import android.support.v7.widget.RecyclerView;
|
import android.support.v7.widget.RecyclerView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
@@ -57,8 +56,6 @@ import java.util.List;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
|
||||||
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
import cpm.com.gskmtorange.constant.CommonString;
|
import cpm.com.gskmtorange.constant.CommonString;
|
||||||
@@ -87,13 +84,14 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
String error_msg;
|
String error_msg;
|
||||||
private SharedPreferences preferences;
|
private SharedPreferences preferences;
|
||||||
Spinner spinner_brand;
|
Spinner spinner_brand;
|
||||||
Button btn_add,btn_close;
|
Button btn_add, btn_close;
|
||||||
ListView listview;
|
ListView listview;
|
||||||
LinearLayout linearlay;
|
LinearLayout linearlay;
|
||||||
//CardView cardlay;
|
//CardView cardlay;
|
||||||
String brand_name="",brand_id="";
|
String brand_name = "", brand_id = "";
|
||||||
ArrayList<BrandAvabilityGetterSetter> brand_new_list=new ArrayList<BrandAvabilityGetterSetter>();
|
ArrayList<BrandAvabilityGetterSetter> brand_new_list = new ArrayList<BrandAvabilityGetterSetter>();
|
||||||
ArrayList<BrandAvabilityGetterSetter> brandList;
|
ArrayList<BrandAvabilityGetterSetter> brandList;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@@ -247,7 +245,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
holder.btn_gaps.setOnClickListener(new View.OnClickListener() {
|
holder.btn_gaps.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -284,8 +281,53 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
mItem.setImage2("");
|
mItem.setImage2("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(T2PComplianceActivity.this);
|
||||||
|
alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title));
|
||||||
|
|
||||||
|
// set dialog message
|
||||||
|
alertDialogBuilder
|
||||||
|
.setMessage(getResources().getString(R.string.data_will_be_lost))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getResources().getString(R.string.yes), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
mItem.setPresent(false);
|
||||||
|
mItem.getGapsChecklist().clear();
|
||||||
|
mItem.getSkulist().clear();
|
||||||
|
|
||||||
|
//Camera
|
||||||
|
if (!mItem.getImage().equals("")) {
|
||||||
|
new File(str + mItem.getImage()).delete();
|
||||||
|
mItem.setImage("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Camera 1
|
||||||
|
if (!mItem.getImage1().equals("")) {
|
||||||
|
new File(str + mItem.getImage1()).delete();
|
||||||
|
mItem.setImage1("");
|
||||||
|
}
|
||||||
|
|
||||||
|
//Camera 2
|
||||||
|
if (!mItem.getImage2().equals("")) {
|
||||||
|
new File(str + mItem.getImage2()).delete();
|
||||||
|
mItem.setImage2("");
|
||||||
|
}
|
||||||
|
|
||||||
|
t2PAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.setNegativeButton(getResources().getString(R.string.no), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
|
||||||
|
dialog.cancel();
|
||||||
|
mItem.setPresent(true);
|
||||||
|
t2PAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
AlertDialog alertDialog = alertDialogBuilder.create();
|
||||||
|
alertDialog.show();
|
||||||
|
}
|
||||||
t2PAdapter.notifyDataSetChanged();
|
t2PAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -336,7 +378,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck = "T2P_Image_" + store_id+ categoryId+ "_" + mItem.getBrand_id() +
|
_pathforcheck = "T2P_Image_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
getCurrentTime().replace(":", "") + ".jpg";
|
||||||
child_position = position;
|
child_position = position;
|
||||||
@@ -349,7 +391,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
if (mItem.getImage().equals("")) {
|
if (mItem.getImage().equals("")) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (mItem.isPresent()) {
|
if (mItem.isPresent()) {
|
||||||
|
|
||||||
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
holder.img_cam.setBackgroundResource(R.mipmap.camera_orange);
|
||||||
@@ -366,7 +407,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
holder.img_cam1.setOnClickListener(new View.OnClickListener() {
|
holder.img_cam1.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck1 = "T2P_Image1_" + store_id+categoryId + "_" + mItem.getBrand_id() +
|
_pathforcheck1 = "T2P_Image1_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
getCurrentTime().replace(":", "") + ".jpg";
|
||||||
child_position1 = position;
|
child_position1 = position;
|
||||||
@@ -394,7 +435,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
holder.img_cam2.setOnClickListener(new View.OnClickListener() {
|
holder.img_cam2.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
_pathforcheck2 = "T2P_Image2_" + store_id + categoryId+"_" + mItem.getBrand_id() +
|
_pathforcheck2 = "T2P_Image2_" + store_id + categoryId + "_" + mItem.getBrand_id() +
|
||||||
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
mItem.getDisplay_id() + visit_date.replace("/", "") + "_" +
|
||||||
getCurrentTime().replace(":", "") + ".jpg";
|
getCurrentTime().replace(":", "") + ".jpg";
|
||||||
child_position2 = position;
|
child_position2 = position;
|
||||||
@@ -427,40 +468,28 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
holder.img_cam.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
|
||||||
/* Intent in =new Intent(T2PComplianceActivity.this,T2pBrand_Avaibility.class);
|
/* Intent in =new Intent(T2PComplianceActivity.this,T2pBrand_Avaibility.class);
|
||||||
in.putExtra("categoryName", categoryName);
|
in.putExtra("categoryName", categoryName);
|
||||||
in.putExtra("categoryId", categoryId);
|
in.putExtra("categoryId", categoryId);
|
||||||
startActivity(in);*/
|
startActivity(in);*/
|
||||||
|
|
||||||
showBrandAvabilitydialog(mItem.getBrandlist());
|
showBrandAvabilitydialog(mItem.getBrandlist());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (mItem.getBrandlist().size() > 0) {
|
||||||
|
|
||||||
if(mItem.getBrandlist().size()>0)
|
|
||||||
{
|
|
||||||
|
|
||||||
holder.img_cam.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
|
holder.img_cam.setBackgroundResource(R.mipmap.new_no_camera_done_edit);
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
if (mItem.isPresent()) {
|
if (mItem.isPresent()) {
|
||||||
|
|
||||||
holder.img_cam.setBackgroundResource(R.mipmap.new_no_camera_edit);
|
holder.img_cam.setBackgroundResource(R.mipmap.new_no_camera_edit);
|
||||||
} else {
|
} else {
|
||||||
//if not present camera disabled
|
//if not present camera disabled
|
||||||
holder.img_cam.setBackgroundResource(R.mipmap.no_camera);
|
holder.img_cam.setBackgroundResource(R.mipmap.no_camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
boolean is_enabled = mItem.isPresent();
|
boolean is_enabled = mItem.isPresent();
|
||||||
|
|
||||||
holder.toggle_btn.setChecked(is_enabled);
|
holder.toggle_btn.setChecked(is_enabled);
|
||||||
@@ -490,7 +519,6 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
holder.btn_sku.setBackgroundColor(getResources().getColor(R.color.grey_background));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -508,12 +536,10 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
public final Button btn_gaps, btn_sku, btn_ref_img;
|
public final Button btn_gaps, btn_sku, btn_ref_img;
|
||||||
public final ToggleButton toggle_btn;
|
public final ToggleButton toggle_btn;
|
||||||
|
|
||||||
|
|
||||||
public ViewHolder(View view) {
|
public ViewHolder(View view) {
|
||||||
super(view);
|
super(view);
|
||||||
|
|
||||||
mView = view;
|
mView = view;
|
||||||
|
|
||||||
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
|
tv_brand = (TextView) mView.findViewById(R.id.tv_brand);
|
||||||
tv_display = (TextView) mView.findViewById(R.id.tv_display);
|
tv_display = (TextView) mView.findViewById(R.id.tv_display);
|
||||||
img_cam = (ImageView) mView.findViewById(R.id.img_cam);
|
img_cam = (ImageView) mView.findViewById(R.id.img_cam);
|
||||||
@@ -525,9 +551,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
btn_ref_img = (Button) mView.findViewById(R.id.btn_ref_image);
|
btn_ref_img = (Button) mView.findViewById(R.id.btn_ref_image);
|
||||||
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
|
parentLayout = (LinearLayout) mView.findViewById(R.id.parent_layout);
|
||||||
toggle_btn = (ToggleButton) mView.findViewById(R.id.toggle_btn);
|
toggle_btn = (ToggleButton) mView.findViewById(R.id.toggle_btn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -805,18 +829,18 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//temp value in case camera is gallery app above jellybean
|
//temp value in case camera is gallery app above jellybean
|
||||||
String packag = list.get(n).loadLabel(packageManager).toString();
|
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") ||packag.equalsIgnoreCase("الاستوديو") ) {
|
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||||
gallery_package = list.get(n).packageName;
|
gallery_package = list.get(n).packageName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||||
|
|
||||||
defaultCameraPackage = list.get(n).packageName;
|
defaultCameraPackage = list.get(n).packageName;
|
||||||
break;
|
break;
|
||||||
@@ -932,8 +956,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
flag = false;
|
flag = false;
|
||||||
error_msg = getResources().getString(R.string.click_image);
|
error_msg = getResources().getString(R.string.click_image);
|
||||||
break;
|
break;
|
||||||
}
|
} else if (camera_allow.equals("0") && t2PGetterSetters.get(i).getBrandlist().size() == 0) {
|
||||||
else if (camera_allow.equals("0") && t2PGetterSetters.get(i).getBrandlist().size() == 0) {
|
|
||||||
flag = false;
|
flag = false;
|
||||||
error_msg = getResources().getString(R.string.title_activity_fill_brand);
|
error_msg = getResources().getString(R.string.title_activity_fill_brand);
|
||||||
break;
|
break;
|
||||||
@@ -1230,7 +1253,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
} else if (language.equalsIgnoreCase(CommonString.KEY_LANGUAGE_OMAN)) {
|
||||||
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
lang = CommonString.KEY_RETURE_LANGUAGE_OMAN;
|
||||||
}else{
|
} else {
|
||||||
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
lang = CommonString.KEY_RETURN_LANGUAGE_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1311,10 +1334,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
//// new <code></code>
|
//// new <code></code>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
||||||
|
|
||||||
final ArrayList<BrandAvabilityGetterSetter> brandList = db.getBrandAvailbilitydata(store_id, categoryId,keyAccount_id,class_id,storeType_id);
|
final ArrayList<BrandAvabilityGetterSetter> brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id);
|
||||||
|
|
||||||
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
||||||
brand.setBRAND(getResources().getString(R.string.select));
|
brand.setBRAND(getResources().getString(R.string.select));
|
||||||
@@ -1386,7 +1408,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
BrandAvabilityGetterSetter ab = new BrandAvabilityGetterSetter();
|
BrandAvabilityGetterSetter ab = new BrandAvabilityGetterSetter();
|
||||||
|
|
||||||
if (!brand_name.equalsIgnoreCase("") && brand_name!=null){
|
if (!brand_name.equalsIgnoreCase("") && brand_name != null) {
|
||||||
|
|
||||||
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
||||||
|
|
||||||
@@ -1402,12 +1424,10 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
// cardlay.setVisibility(View.VISIBLE);
|
// cardlay.setVisibility(View.VISIBLE);
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
spinner_brand.setSelection(0);
|
spinner_brand.setSelection(0);
|
||||||
brand_name="";
|
brand_name = "";
|
||||||
brand_id="";
|
brand_id = "";
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG)
|
Snackbar.make(v, "Please select dropdown", Snackbar.LENGTH_LONG)
|
||||||
.setAction("Action", null).show();
|
.setAction("Action", null).show();
|
||||||
}
|
}
|
||||||
|
|||||||
+62
-18
@@ -733,23 +733,6 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
finalHolder.stock.setVisibility(View.VISIBLE);
|
finalHolder.stock.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
|
||||||
@Override
|
|
||||||
public void onFocusChange(View v, boolean hasFocus) {
|
|
||||||
final EditText caption = (EditText) v;
|
|
||||||
final String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
|
||||||
|
|
||||||
if (!edFaceup.equals("")) {
|
|
||||||
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
|
||||||
childData.setFacing(faceup);
|
|
||||||
} else {
|
|
||||||
childData.setFacing("");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
holder.facing.setText(childData.getFacing());
|
|
||||||
|
|
||||||
|
|
||||||
holder.stock.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
holder.stock.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -783,10 +766,71 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
holder.stock.setText(childData.getStock());
|
holder.stock.setText(childData.getStock());
|
||||||
|
|
||||||
|
|
||||||
|
final ViewHolder finalHolder1 = holder;
|
||||||
|
holder.facing.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
final EditText caption = (EditText) v;
|
||||||
|
final String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||||
|
|
||||||
|
//Toggle is no selected
|
||||||
|
if (childData.getToggleValue().equals("0")) {
|
||||||
|
|
||||||
|
//if stock is emplty
|
||||||
|
if (childData.getStock().equals("")) {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.msl_availability_new_stock_value))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
} else {
|
||||||
|
if (edFaceup != null && !edFaceup.equals("")) {
|
||||||
|
|
||||||
|
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||||
|
if (Integer.parseInt(faceup) <= Integer.parseInt(childData.getStock())) {
|
||||||
|
|
||||||
|
if (!edFaceup.equals("")) {
|
||||||
|
childData.setFacing(faceup);
|
||||||
|
} else {
|
||||||
|
childData.setFacing("");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(MSL_Availability_StockFacingActivity.this);
|
||||||
|
builder.setMessage(getString(R.string.check_faceup))
|
||||||
|
.setCancelable(false)
|
||||||
|
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
dialog.dismiss();
|
||||||
|
finalHolder1.facing.setText("");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = builder.create();
|
||||||
|
alert.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!edFaceup.equals("")) {
|
||||||
|
String faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||||
|
childData.setFacing(faceup);
|
||||||
|
} else {
|
||||||
|
childData.setFacing("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
holder.facing.setText(childData.getFacing());
|
||||||
|
|
||||||
|
|
||||||
//empty check color change
|
//empty check color change
|
||||||
if (!checkflag) {
|
if (!checkflag) {
|
||||||
boolean tempflag = false;
|
boolean tempflag = false;
|
||||||
|
|||||||
@@ -2,20 +2,16 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
android:weightSum="100">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="96dp"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp">
|
||||||
android:weightSum="100">
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="2dp"
|
android:layout_marginBottom="2dp"
|
||||||
@@ -26,10 +22,8 @@
|
|||||||
android:weightSum="25">
|
android:weightSum="25">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
||||||
android:layout_weight="10"
|
android:layout_weight="10"
|
||||||
android:text="@string/brandname"
|
android:text="@string/brandname"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
@@ -39,41 +33,34 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="15"
|
android:layout_weight="15"
|
||||||
android:inputType="text">
|
android:inputType="text" />
|
||||||
|
|
||||||
</TextView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="2dp"
|
android:layout_marginBottom="2dp"
|
||||||
android:layout_weight="10"
|
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:weightSum="50">
|
android:weightSum="2">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
android:layout_weight="30"
|
android:padding="10dp"
|
||||||
android:text="@string/displayname"
|
android:text="@string/displayname"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceListItem"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/display_name"
|
android:id="@+id/display_name"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
android:layout_weight="15">
|
android:padding="10dp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceListItem" />
|
||||||
</TextView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/third"
|
android:id="@+id/third"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -88,7 +75,6 @@
|
|||||||
android:id="@+id/facing"
|
android:id="@+id/facing"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
|
||||||
android:layout_weight="10"
|
android:layout_weight="10"
|
||||||
android:text="Quantity"
|
android:text="Quantity"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
@@ -98,35 +84,23 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="15"
|
android:layout_weight="15"
|
||||||
android:inputType="number">
|
android:inputType="number" />
|
||||||
|
|
||||||
</TextView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
<!-- </LinearLayout> -->
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="10"
|
android:orientation="vertical">
|
||||||
android:orientation="vertical"
|
|
||||||
android:weightSum="25">
|
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/delete_btn"
|
android:id="@+id/delete_btn"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:layout_weight="7"
|
|
||||||
android:background="@color/grey_background"
|
android:background="@color/grey_background"
|
||||||
android:text="@string/delete"
|
android:text="@string/delete" />
|
||||||
android:layout_gravity="right"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -15,10 +15,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="bottom|end"
|
android:layout_gravity="bottom|end"
|
||||||
android:layout_margin="@dimen/fab_margin"
|
android:layout_margin="@dimen/fab_margin"
|
||||||
app:srcCompat="@drawable/save_icon"
|
|
||||||
app:backgroundTint="@color/colorAccent"
|
app:backgroundTint="@color/colorAccent"
|
||||||
/>
|
app:srcCompat="@drawable/save_icon" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
|
android:maxLength="5"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="#222"
|
android:textColor="#222"
|
||||||
android:textColorHint="#666" />
|
android:textColorHint="#666" />
|
||||||
@@ -118,6 +119,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
|
android:maxLength="5"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="#222"
|
android:textColor="#222"
|
||||||
android:textColorHint="#666"
|
android:textColorHint="#666"
|
||||||
|
|||||||
@@ -300,4 +300,5 @@
|
|||||||
<string name="faceup_value">Please fill faceup value or fill 0 </string>
|
<string name="faceup_value">Please fill faceup value or fill 0 </string>
|
||||||
<string name="stock_value">Please fill stock value or fill 0 </string>
|
<string name="stock_value">Please fill stock value or fill 0 </string>
|
||||||
<string name="check_stock">Stock can not be greater equal than MBQ value</string>
|
<string name="check_stock">Stock can not be greater equal than MBQ value</string>
|
||||||
|
<string name="msl_availability_new_stock_value">Please first fill the stock value </string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user