Commit 4523b052 by DESKTOP-85HSV6H\KP

initial_commit

parents
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="NullableNotNullManager">
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
<option name="myNotNulls">
<value>
<list size="4">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
</list>
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Carrefour.iml" filepath="$PROJECT_DIR$/Carrefour.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.techware.promode.carrefour"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
}
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package com.techware.promode.carrefour;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.techware.promode.carrefour", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.techware.promode.carrefour">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activity.HomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.PitNumberActivity" />
<activity android:name=".activity.FileTransferActivity" />
<activity android:name=".activity.it.WasteActivity" />
<activity android:name=".activity.it.SubMenuActivity" />
<activity android:name=".activity.receive.ReceiveActivity" />
<activity android:name=".activity.elie.ElieActivity" />
<activity android:name=".activity.order.OrderActivity" />
<activity android:name=".activity.merchandise.MerchandiseActivity" />
<activity android:name=".activity.it.LabelSurveyActivity" />
<activity android:name=".activity.it.StockTakeActivity" />
<activity android:name=".activity.it.PrintLabelActivity" />
<activity android:name=".activity.it.PrintLabelSelectedActivity" />
<activity android:name=".activity.it.MinStockActivity" />
<activity android:name=".activity.it.FacingActivity" />
<activity android:name=".activity.it.PromotionActivity" />
<activity android:name=".activity.it.OutOfActivity" />
<activity android:name=".activity.it.CompetitionActivity" />
<activity android:name=".activity.it.ItemListActivity" />
<activity android:name=".activity.it.InternalSaleAndCorrctionActivity" />
<activity android:name=".activity.receive.ReceiveSelectedActivity" />
<activity android:name=".activity.AuthenticateActivity" />
<activity android:name=".activity.receive.ReceivingActivity" />
<activity android:name=".activity.receive.ReturnActivity" />
<activity android:name=".activity.receive.PriceSurveyActivity" />
<activity android:name=".activity.receive.RestoreActivity" />
<activity android:name=".activity.receive.StoreToOffsiteActivity" />
<activity android:name=".activity.receive.OffsiteToStoreActivity" />
<activity android:name=".activity.elie.ExpiryCaptureActivity" />
<activity android:name=".activity.elie.ExpiredActionActivity" />
<activity android:name=".activity.elie.RestoreActivity" />
<activity android:name=".activity.order.NewOrderActivity" />
<activity android:name=".activity.order.RestoreActivity" />
<activity android:name=".activity.merchandise.ItemListActivity" />
<activity android:name=".activity.merchandise.PrintLabelActivity" />
<activity android:name=".activity.merchandise.PrintLabelSelectedActivity" />
<activity android:name=".activity.info.ProductInfoActivity" />
<activity android:name=".activity.info.LabelActivity" />
<activity android:name=".activity.info.OrderInfoActivity" />
<activity android:name=".activity.info.WeekMovementActivity"></activity>
</application>
</manifest>
\ No newline at end of file
[{"menu":"IT","submenu":[{"item":"submenu1"},{"item":"submenu2"}]},{"menu":"Receive","submenu":[{"item":"submenu1"},{"item":"submenu2"}]}]
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<MenuList>
<MainMenu Menu="1 - IT">
<Sub Submenu="1 - Waste" />
<Sub Submenu="2 - Label Survey" />
<Sub Submenu="3 - Stock Take" />
<Sub Submenu="4 - Print Labels" />
<Sub Submenu="5 - Min. Stock" />
<Sub Submenu="6 - Facing" />
<Sub Submenu="7 - Promotion" />
<Sub Submenu="8 - Out of Stock" />
<Sub Submenu="9 - Competition" />
<Sub Submenu="10 - Item List" />
<Sub Submenu="11 - Internal Sales &amp; Int. Sales Correction" />
<!--<Sub Submenu="Int. Sales Correct" />-->
<Sub Submenu="12 - Restore" />
<!--<Sub Submenu="Exit" />-->
</MainMenu>
<MainMenu Menu="2 - Receive">
<Sub Submenu="Receiving" />
<Sub Submenu="Return" />
<Sub Submenu="Price Survey" />
<Sub Submenu="Restore" />
<Sub Submenu="Store to Off-Site" />
<Sub Submenu="Off-Site to Store " />
<Sub Submenu="Exit" />
</MainMenu>
<MainMenu Menu="3 - ELIE">
<Sub Submenu="Expiry Capture" />
<Sub Submenu="Expired Action" />
<Sub Submenu="Restore" />
<Sub Submenu="Exit" />
</MainMenu>
<MainMenu Menu="4 - Orders">
<Sub Submenu="1 - New Order" />
<Sub Submenu="2 - Restore" />
<Sub Submenu="3 - Exit" />
<Sub Submenu="4 - Get Order" />
</MainMenu>
<MainMenu Menu="5 - Info">
<!--<Sub Submenu="Main page" />-->
<!--<Sub Submenu="Label" />-->
<!--<Sub Submenu="Order" />-->
<!--<Sub Submenu="Week" />-->
<!--<Sub Submenu="Exit" />-->
</MainMenu>
<MainMenu Menu="6 - Merchand">
<Sub Submenu="1 - ItemList" />
<Sub Submenu="2 - Print Labels" />
<Sub Submenu="0 - Exit" />
</MainMenu>
<MainMenu Menu="0 - Exit">
</MainMenu>
</MenuList>
\ No newline at end of file
package com.techware.promode.carrefour;
/**
* Created by KP on 5/9/2018.
*/
public class Constants {
public static final String PREF_FILE = "File";
public static final String KEYBOARD_STATUS = "keyboard_status";
}
package com.techware.promode.carrefour;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;
import com.techware.promode.carrefour.R;
/**
* Created by KP on 4/28/2018.
*/
public class CustomDialog extends Dialog implements View.OnClickListener{
OnInteractionListener listener;
Button yesButton, noButton;
TextView mTextDesc;
String desc = "";
public CustomDialog(@NonNull Activity context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.dialog_layout);
yesButton = findViewById(R.id.buttonYes);
noButton = findViewById(R.id.buttonNo);
mTextDesc = findViewById(R.id.txt_already_exists);
yesButton.setOnClickListener(this);
noButton.setOnClickListener(this);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(getWindow().getAttributes());
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
getWindow().setAttributes(lp);
mTextDesc.setText(desc);
}
public void setListener(OnInteractionListener l){
this.listener = l;
}
public void setDescData(String desc){
this.desc = desc;
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.buttonYes:
listener.onYesButtonClick();
break;
case R.id.buttonNo:
listener.onNoButtonClick();
break;
}
}
public interface OnInteractionListener{
void onYesButtonClick();
void onNoButtonClick();
}
}
package com.techware.promode.carrefour;
import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
/**
* Created by KP on 4/28/2018.
*/
public class ExitDialog extends Dialog implements View.OnClickListener{
OnInteractionListener listener;
Button yesButton, noButton;
public ExitDialog(@NonNull Activity context) {
super(context);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.dialog_exit);
yesButton = findViewById(R.id.buttonYes);
noButton = findViewById(R.id.buttonNo);
yesButton.setOnClickListener(this);
noButton.setOnClickListener(this);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(getWindow().getAttributes());
lp.width = WindowManager.LayoutParams.MATCH_PARENT;
getWindow().setAttributes(lp);
}
public void setListener(OnInteractionListener l){
this.listener = l;
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.buttonYes:
listener.onYesButtonClick();
break;
case R.id.buttonNo:
listener.onNoButtonClick();
break;
}
}
public interface OnInteractionListener{
void onYesButtonClick();
void onNoButtonClick();
}
}
package com.techware.promode.carrefour.activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.elie.ExpiredActionActivity;
import com.techware.promode.carrefour.activity.elie.ExpiryCaptureActivity;
import com.techware.promode.carrefour.activity.elie.RestoreActivity;
public class AuthenticateActivity extends AppCompatActivity implements View.OnClickListener {
Button mBackButton;
Button mOkButton;
String selectedSubMenu;
EditText usernameEditText;
EditText pwdEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_authenticate);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null) {
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBackButton = findViewById(R.id.btn_back);
mOkButton = findViewById(R.id.btn_ok);
usernameEditText = findViewById(R.id.etxt_username);
pwdEditText = findViewById(R.id.etxt_pwd);
mBackButton.setOnClickListener(this);
mOkButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
usernameEditText.setFocusableInTouchMode(true);
pwdEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_ok:
switch (selectedSubMenu) {
case "Receiving":
break;
case "Exit":
finishAffinity();
break;
case "Expiry Capture": {
Intent intent = new Intent(getApplicationContext(), ExpiryCaptureActivity.class);
intent.putExtra("submenu", "Expiry Capture");
startActivity(intent);
finish();
}
break;
case "Expired Action": {
Intent intent = new Intent(getApplicationContext(), ExpiredActionActivity.class);
intent.putExtra("submenu", "Expired Action");
startActivity(intent);
finish();
}
break;
case "Restore": {
if (getIntent().getStringExtra("menu") != null && getIntent().getStringExtra("menu").equalsIgnoreCase("3 - ELIE")) {
Intent intent = new Intent(getApplicationContext(), RestoreActivity.class);
intent.putExtra("submenu", "Restore");
startActivity(intent);
finish();
} else {
Intent intent = new Intent(getApplicationContext(), com.techware.promode.carrefour.activity.receive.RestoreActivity.class);
intent.putExtra("submenu", "Restore");
startActivity(intent);
finish();
}
}
break;
}
break;
case R.id.btn_back:
finish();
break;
}
}
}
package com.techware.promode.carrefour.activity;
import android.content.Intent;
import android.graphics.Typeface;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.receive.ReceivingActivity;
public class FileTransferActivity extends AppCompatActivity {
TextView textViewDescription;
String selectedSubMenu, selectedMenu = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_file_transfer);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
if (getIntent() != null && getIntent().getStringExtra("menu") != null){
selectedMenu = getIntent().getStringExtra("menu");
}
initViews();
}
private void initViews() {
textViewDescription = findViewById(R.id.text_desc);
}
public void goToMainMenu(View view){
Intent intent = new Intent(getApplicationContext(), HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
}
public void goToContinue(View view){
switch (selectedSubMenu){
case "Receiving": {
Intent intent = new Intent(getApplicationContext(), ReceivingActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
}break;
case "1 - ItemList": {
Intent intent = new Intent(getApplicationContext(), HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
// if (selectedMenu.equalsIgnoreCase("6 - Merchand")) {
// }else{
//
// }
}break;
case "10 - Item List": {
Intent intent = new Intent(getApplicationContext(), HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
// if (selectedMenu.equalsIgnoreCase("6 - Merchand")) {
// }else{
//
// }
}break;
default:
Intent intent = new Intent(getApplicationContext(), HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}
}
package com.techware.promode.carrefour.activity;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.EditText;
import com.techware.promode.carrefour.R;
public class PitNumberActivity extends AppCompatActivity {
EditText mPitNumberTextView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pit_number);
mPitNumberTextView = findViewById(R.id.etxt_pitnumber);
}
}
package com.techware.promode.carrefour.activity.elie;
import android.content.Intent;
import android.content.res.AssetManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.AuthenticateActivity;
import com.techware.promode.carrefour.activity.FileTransferActivity;
import com.techware.promode.carrefour.activity.it.WasteActivity;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
public class ElieActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
RecyclerView mMenuRecyclerView;
private String selMenu;
ArrayList<String> subMenuList = new ArrayList<>();
RelativeLayout mBackLayout;
CustomDialog dialog;
private String selectedSubMenu = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_elie);
if (getIntent().getStringExtra("menu") != null)
selMenu = getIntent().getStringExtra("menu");
mBackLayout = findViewById(R.id.layout_back);
iniRecyclerView();
mBackLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void iniRecyclerView() {
mMenuRecyclerView = findViewById(R.id.rv_menu);
mMenuRecyclerView.setHasFixedSize(true);
mMenuRecyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
loadMenuList();
mMenuRecyclerView.setAdapter(new SubMenuAdapter(subMenuList));
}
public void showCustomDialog(String s) {
dialog = new CustomDialog(this);
dialog.setListener(this);
dialog.setDescData(getResources().getString(R.string.exit_message_label));
dialog.show();
//selectedSubMenu = s;
}
private void loadMenuList() {
// Load XML for parsing.
AssetManager assetManager = getAssets();
InputStream inputStream = null;
try {
inputStream = assetManager.open("menu.xml");
} catch (IOException e) {
Log.e("tag", e.getMessage());
}
String s = readTextFile(inputStream);
//Toast.makeText(this, "" + s, Toast.LENGTH_SHORT).show();
processScannedData(s);
}
@Override
public void onYesButtonClick() {
if (dialog != null)
dialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (dialog != null)
dialog.dismiss();
}
private class SubMenuAdapter extends RecyclerView.Adapter<SubMenuAdapter.ViewHolder> {
private ArrayList<String> mList = new ArrayList<>();
public SubMenuAdapter(ArrayList<String> subMenuList) {
this.mList.clear();
this.mList.addAll(subMenuList);
}
@NonNull
@Override
public SubMenuAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sub_menu_row_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final SubMenuAdapter.ViewHolder holder, int position) {
holder.submenuTextView.setText(mList.get(position));
holder.submenuLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (holder.submenuTextView.getText().toString()) {
case "Expiry Capture": {
Intent intent = new Intent(getApplicationContext(), AuthenticateActivity.class);
intent.putExtra("submenu", "Expiry Capture");
startActivity(intent);
}break;
case "Expired Action": {
Intent intent = new Intent(getApplicationContext(), AuthenticateActivity.class);
intent.putExtra("submenu", "Expired Action");
startActivity(intent);
}break;
case "Restore": {
Intent intent = new Intent(getApplicationContext(), AuthenticateActivity.class);
intent.putExtra("submenu", "Restore");
intent.putExtra("menu", "3 - ELIE");
startActivity(intent);
}break;
case "Exit": {
showCustomDialog("");
}break;
}
}
});
}
@Override
public int getItemCount() {
return mList.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout submenuLayout;
TextView submenuTextView;
public ViewHolder(View itemView) {
super(itemView);
submenuLayout = itemView.findViewById(R.id.layout_submenu);
submenuTextView = itemView.findViewById(R.id.txt_submenu);
}
}
}
private String readTextFile(InputStream inputStream) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte buf[] = new byte[1024];
int len;
try {
while ((len = inputStream.read(buf)) != -1) {
outputStream.write(buf, 0, len);
}
outputStream.close();
inputStream.close();
} catch (IOException e) {
}
return outputStream.toString();
}
protected void processScannedData(String scanData) {
XmlPullParserFactory pullParserFactory;
String tempVal = null, subMenuVal = null;
try {
// init the parserfactory
pullParserFactory = XmlPullParserFactory.newInstance();
// get the parser
XmlPullParser parser = pullParserFactory.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(new StringReader(scanData));
boolean submenuFlag = false;
// parse the XML
int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_DOCUMENT) {
Log.d("Rajdeol", "Start document");
} else if (eventType == XmlPullParser.START_TAG) {
tempVal = parser.getAttributeValue(null, "Menu");
subMenuVal = parser.getAttributeValue(null, "Submenu");
if (tempVal != null)
submenuFlag = false;
if (tempVal != null && tempVal.equalsIgnoreCase(selMenu)) {
submenuFlag = true;
}
if (submenuFlag && subMenuVal != null)
subMenuList.add(subMenuVal);
} else if (eventType == XmlPullParser.END_TAG) {
Log.d("Rajdeol", "End tag " + parser.getName());
} else if (eventType == XmlPullParser.TEXT) {
Log.d("Rajdeol", "Text " + parser.getText());
}
eventType = parser.next();
}
// display the data on screen
displayScannedData();
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}// EO function
private void displayScannedData() {
String str = "";
for (String model :
subMenuList) {
str += model;
}
//Toast.makeText(this, ""+ str, Toast.LENGTH_SHORT).show();
}
}
package com.techware.promode.carrefour.activity.elie;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class ExpiredActionActivity extends AppCompatActivity {
EditText mLocationTypeEditText;
EditText mLocationEditText;
EditText mBarcodeEditText;
EditText mQtyEditText;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_expired_action);
mLocationTypeEditText = findViewById(R.id.etxt_loc_type);
mLocationEditText = findViewById(R.id.etxt_location);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mQtyEditText = findViewById(R.id.etxt_qty);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null)
selectedSubMenu = getIntent().getStringExtra("submenu");
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mLocationTypeEditText.setFocusableInTouchMode(true);
mLocationEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
}
}
public void clickBackListener(View v){
finish();
}
public void clickModifyListener(View v){
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu",selectedSubMenu);
startActivity(intent);
}
public void clickChangeListener(View v){
mLocationTypeEditText.setEnabled(true);
}
}
package com.techware.promode.carrefour.activity.elie;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
public class ExpiryCaptureActivity extends AppCompatActivity {
EditText mChangeLocEditText;
EditText mQtyEditText;
EditText mBarcodeEditText;
EditText mLocEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_expiry_capture);
mChangeLocEditText = findViewById(R.id.etxt_loc_type);
mQtyEditText = findViewById(R.id.etxt_qty);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mLocEditText = findViewById(R.id.etxt_location);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mLocEditText.setFocusableInTouchMode(true);
mChangeLocEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
}
}
public void clickBack(View v){
finish();
}
public void clickModifyButton(View v){
}
public void clickChangeButton(View v){
mChangeLocEditText.setEnabled(true);
}
}
package com.techware.promode.carrefour.activity.elie;
import android.content.res.AssetManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.R;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
public class RestoreActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
RecyclerView mMenuRecyclerView;
private String selMenu;
ArrayList<String> subMenuList = new ArrayList<>();
CustomDialog dialog;
private String selectedSubMenu = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_restore2);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
iniRecyclerView();
}
private void iniRecyclerView() {
mMenuRecyclerView = findViewById(R.id.rv_menu);
mMenuRecyclerView.setHasFixedSize(true);
mMenuRecyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
loadMenuList();
mMenuRecyclerView.setAdapter(new SubMenuAdapter(subMenuList));
}
private void loadMenuList() {
// Load XML for parsing.
AssetManager assetManager = getAssets();
InputStream inputStream = null;
try {
inputStream = assetManager.open("menu.xml");
} catch (IOException e) {
Log.e("tag", e.getMessage());
}
String s = readTextFile(inputStream);
//Toast.makeText(this, "" + s, Toast.LENGTH_SHORT).show();
processScannedData(s);
}
public void showCustomDialog(String s) {
dialog = new CustomDialog(this);
dialog.setListener(this);
dialog.setDescData(getResources().getString(R.string.exit_message_label));
dialog.show();
selectedSubMenu = s;
}
@Override
public void onYesButtonClick() {
if (dialog != null)
dialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (dialog != null)
dialog.dismiss();
}
private class SubMenuAdapter extends RecyclerView.Adapter<SubMenuAdapter.ViewHolder> {
private ArrayList<String> mList = new ArrayList<>();
public SubMenuAdapter(ArrayList<String> subMenuList) {
this.mList.clear();
this.mList.addAll(subMenuList);
}
@NonNull
@Override
public SubMenuAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sub_menu_row_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final SubMenuAdapter.ViewHolder holder, int position) {
holder.submenuTextView.setText(mList.get(position));
holder.submenuLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (holder.submenuTextView.getText().toString()) {
case "Expiry Capture": {
}break;
case "Expired Action": {
}break;
case "Exit": {
showCustomDialog("");
}break;
}
}
});
}
@Override
public int getItemCount() {
return mList.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout submenuLayout;
TextView submenuTextView;
public ViewHolder(View itemView) {
super(itemView);
submenuLayout = itemView.findViewById(R.id.layout_submenu);
submenuTextView = itemView.findViewById(R.id.txt_submenu);
}
}
}
private String readTextFile(InputStream inputStream) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte buf[] = new byte[1024];
int len;
try {
while ((len = inputStream.read(buf)) != -1) {
outputStream.write(buf, 0, len);
}
outputStream.close();
inputStream.close();
} catch (IOException e) {
}
return outputStream.toString();
}
protected void processScannedData(String scanData) {
XmlPullParserFactory pullParserFactory;
String tempVal = null, subMenuVal = null;
try {
// init the parserfactory
pullParserFactory = XmlPullParserFactory.newInstance();
// get the parser
XmlPullParser parser = pullParserFactory.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(new StringReader(scanData));
boolean submenuFlag = false;
// parse the XML
int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_DOCUMENT) {
Log.d("Rajdeol", "Start document");
} else if (eventType == XmlPullParser.START_TAG) {
tempVal = parser.getAttributeValue(null, "Menu");
subMenuVal = parser.getAttributeValue(null, "Submenu");
if (tempVal != null)
submenuFlag = false;
if (tempVal != null && tempVal.equalsIgnoreCase("3 - ELIE")) {
submenuFlag = true;
}
if (submenuFlag && subMenuVal != null && !subMenuVal.equalsIgnoreCase("Restore"))
subMenuList.add(subMenuVal);
} else if (eventType == XmlPullParser.END_TAG) {
Log.d("Rajdeol", "End tag " + parser.getName());
} else if (eventType == XmlPullParser.TEXT) {
Log.d("Rajdeol", "Text " + parser.getText());
}
eventType = parser.next();
}
// display the data on screen
displayScannedData();
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}// EO function
private void displayScannedData() {
String str = "";
for (String model :
subMenuList) {
str += model;
}
//Toast.makeText(this, ""+ str, Toast.LENGTH_SHORT).show();
}
}
package com.techware.promode.carrefour.activity.info;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.R;
public class LabelActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
CustomDialog customDialog;
EditText storeEditText;
EditText barcodeEditText;
EditText numberEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_label);
initViews();
handleKeyboard();
}
private void initViews() {
storeEditText = findViewById(R.id.etxt_store);
barcodeEditText = findViewById(R.id.etxt_barcode);
numberEditText = findViewById(R.id.etxt_number);
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
storeEditText.setFocusableInTouchMode(true);
barcodeEditText.setFocusableInTouchMode(true);
numberEditText.setFocusableInTouchMode(true);
}
}
public void onMainPageClick(View v){
Intent intent = new Intent(getApplicationContext(), ProductInfoActivity.class);
startActivity(intent);
finish();
}
public void onLabelPageClick(View v){
Intent intent = new Intent(getApplicationContext(), LabelActivity.class);
startActivity(intent);
finish();
}
public void onOrderPageClick(View v){
Intent intent = new Intent(getApplicationContext(), OrderInfoActivity.class);
startActivity(intent);
finish();
}
public void onWeekPageClick(View v){
Intent intent = new Intent(getApplicationContext(), WeekMovementActivity.class);
startActivity(intent);
finish();
}
public void onExitClick(View v){
customDialog = new CustomDialog(this);
customDialog.setDescData(getResources().getString(R.string.exit_message_label));
customDialog.setListener(this);
customDialog.show();
}
@Override
public void onYesButtonClick() {
if (customDialog != null)
customDialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (customDialog != null)
customDialog.dismiss();
}
}
package com.techware.promode.carrefour.activity.info;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.R;
public class OrderInfoActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
CustomDialog customDialog;
EditText itemCodeEditText;
EditText barCodeEditText;
EditText supplierDcEditText;
EditText stockBeginDatEditText;
EditText lastReceiptEditText;
EditText pendingOrdersEditText;
EditText orderDateEditText;
EditText nextDelDateEditText;
EditText pcbEditText;
EditText stockMinEditText;
EditText facingEditText;
EditText supplierLpoTypeEditText;
EditText supplierLeadTimeEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order_info);
initViews();
handleKeyboard();
}
private void initViews() {
itemCodeEditText = findViewById(R.id.etxt_item_code);
barCodeEditText = findViewById(R.id.etxt_barcode);
supplierDcEditText = findViewById(R.id.etxt_supp_dc);
stockBeginDatEditText = findViewById(R.id.text_stock_beginning_day);
lastReceiptEditText = findViewById(R.id.etxt_last_rec_date);
pendingOrdersEditText = findViewById(R.id.etxt_pending_orders);
orderDateEditText = findViewById(R.id.etxt_order_date);
nextDelDateEditText = findViewById(R.id.etxt_next_del_date);
pcbEditText = findViewById(R.id.etxt_pcb);
stockMinEditText = findViewById(R.id.etxt_stock_min);
facingEditText = findViewById(R.id.etxt_facing);
supplierLpoTypeEditText = findViewById(R.id.etxt_supplier_lpo_type);
supplierLeadTimeEditText = findViewById(R.id.etxt_supplier_lead_time);
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
itemCodeEditText.setFocusableInTouchMode(true);
barCodeEditText.setFocusableInTouchMode(true);
supplierDcEditText.setFocusableInTouchMode(true);
stockBeginDatEditText.setFocusableInTouchMode(true);
lastReceiptEditText.setFocusableInTouchMode(true);
pendingOrdersEditText.setFocusableInTouchMode(true);
orderDateEditText.setFocusableInTouchMode(true);
nextDelDateEditText.setFocusableInTouchMode(true);
pcbEditText.setFocusableInTouchMode(true);
stockMinEditText.setFocusableInTouchMode(true);
facingEditText.setFocusableInTouchMode(true);
supplierLpoTypeEditText.setFocusableInTouchMode(true);
supplierLeadTimeEditText.setFocusableInTouchMode(true);
}
}
public void onMainPageClick(View v){
Intent intent = new Intent(getApplicationContext(), ProductInfoActivity.class);
startActivity(intent);
finish();
}
public void onLabelPageClick(View v){
Intent intent = new Intent(getApplicationContext(), LabelActivity.class);
startActivity(intent);
finish();
}
public void onOrderPageClick(View v){
Intent intent = new Intent(getApplicationContext(), OrderInfoActivity.class);
startActivity(intent);
finish();
}
public void onWeekPageClick(View v){
Intent intent = new Intent(getApplicationContext(), WeekMovementActivity.class);
startActivity(intent);
finish();
}
public void onExitClick(View v){
customDialog = new CustomDialog(this);
customDialog.setDescData(getResources().getString(R.string.exit_message_label));
customDialog.setListener(this);
customDialog.show();
}
@Override
public void onYesButtonClick() {
if (customDialog != null)
customDialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (customDialog != null)
customDialog.dismiss();
}
}
package com.techware.promode.carrefour.activity.info;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.R;
public class ProductInfoActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
CustomDialog customDialog;
EditText itemCodeEditText;
EditText barCodeEditText;
EditText avgNormalSaleEditText;
EditText secEditText;
EditText famEditText;
EditText sellingPriceEditText;
EditText assortmentEditText;
EditText facingEditText;
EditText stockBeginDayEditText;
EditText numberOfDaysEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_product_info);
initViews();
handleKeyboard();
}
private void initViews() {
itemCodeEditText = findViewById(R.id.etxt_item_code);
barCodeEditText = findViewById(R.id.etxt_barcode);
avgNormalSaleEditText = findViewById(R.id.etxt_avg_normal_sale);
secEditText = findViewById(R.id.etxt_sec);
famEditText = findViewById(R.id.etxt_fam);
sellingPriceEditText = findViewById(R.id.etxt_selling_price);
assortmentEditText = findViewById(R.id.etxt_assortment);
facingEditText = findViewById(R.id.etxt_facing);
stockBeginDayEditText = findViewById(R.id.etxt_stock_beg_day);
numberOfDaysEditText = findViewById(R.id.etxt_no_of_days);
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
itemCodeEditText.setFocusableInTouchMode(true);
barCodeEditText.setFocusableInTouchMode(true);
avgNormalSaleEditText.setFocusableInTouchMode(true);
secEditText.setFocusableInTouchMode(true);
famEditText.setFocusableInTouchMode(true);
sellingPriceEditText.setFocusableInTouchMode(true);
assortmentEditText.setFocusableInTouchMode(true);
facingEditText.setFocusableInTouchMode(true);
stockBeginDayEditText.setFocusableInTouchMode(true);
numberOfDaysEditText.setFocusableInTouchMode(true);
}
}
public void onMainPageClick(View v){
Intent intent = new Intent(getApplicationContext(), ProductInfoActivity.class);
startActivity(intent);
finish();
}
public void onLabelPageClick(View v){
Intent intent = new Intent(getApplicationContext(), LabelActivity.class);
startActivity(intent);
finish();
}
public void onOrderPageClick(View v){
Intent intent = new Intent(getApplicationContext(), OrderInfoActivity.class);
startActivity(intent);
finish();
}
public void onWeekPageClick(View v){
Intent intent = new Intent(getApplicationContext(), WeekMovementActivity.class);
startActivity(intent);
finish();
}
public void onExitClick(View v){
customDialog = new CustomDialog(this);
customDialog.setDescData(getResources().getString(R.string.exit_message_label));
customDialog.setListener(this);
customDialog.show();
}
@Override
public void onYesButtonClick() {
if (customDialog != null)
customDialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (customDialog != null)
customDialog.dismiss();
}
}
package com.techware.promode.carrefour.activity.info;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.R;
public class WeekMovementActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
CustomDialog customDialog;
EditText itemCodeEditText;
EditText barCodeEditText;
EditText sellingStockEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_week_movement);
initViews();
handleKeyboard();
}
private void initViews() {
itemCodeEditText = findViewById(R.id.etxt_item_code);
barCodeEditText = findViewById(R.id.etxt_barcode);
sellingStockEditText = findViewById(R.id.etxt_selling_stock);
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
itemCodeEditText.setFocusableInTouchMode(true);
barCodeEditText.setFocusableInTouchMode(true);
sellingStockEditText.setFocusableInTouchMode(true);
}
}
public void onMainPageClick(View v){
Intent intent = new Intent(getApplicationContext(), ProductInfoActivity.class);
startActivity(intent);
finish();
}
public void onLabelPageClick(View v){
Intent intent = new Intent(getApplicationContext(), LabelActivity.class);
startActivity(intent);
finish();
}
public void onOrderPageClick(View v){
Intent intent = new Intent(getApplicationContext(), OrderInfoActivity.class);
startActivity(intent);
finish();
}
public void onWeekPageClick(View v){
Intent intent = new Intent(getApplicationContext(), WeekMovementActivity.class);
startActivity(intent);
finish();
}
public void onExitClick(View v){
customDialog = new CustomDialog(this);
customDialog.setDescData(getResources().getString(R.string.exit_message_label));
customDialog.setListener(this);
customDialog.show();
}
@Override
public void onYesButtonClick() {
if (customDialog != null)
customDialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (customDialog != null)
customDialog.dismiss();
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class CompetitionActivity extends AppCompatActivity implements View.OnClickListener {
Button mBackButton;
Button mModifyButton;
Button mDeleteButton;
String selectedSubMenu;
Button mChangeButton;
EditText mStoreEditText;
EditText mPriceEditText;
EditText mBarcodeEditText;
boolean isTypeSelected = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_competition);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mDeleteButton = findViewById(R.id.btn_delete);
mChangeButton = findViewById(R.id.btn_change);
mStoreEditText = findViewById(R.id.etxt_store);
mPriceEditText = findViewById(R.id.etxt_price);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
mDeleteButton.setOnClickListener(this);
mChangeButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mStoreEditText.setFocusableInTouchMode(true);
mPriceEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_delete:
break;
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
case R.id.btn_change:
if (!isTypeSelected){
mStoreEditText.setEnabled(true);
isTypeSelected = true;
}else{
mStoreEditText.setEnabled(false);
isTypeSelected = false;
}
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class FacingActivity extends AppCompatActivity implements View.OnClickListener {
Button mBuackButton;
Button mModifyButton;
EditText mFacingEditText;
EditText mQtyEditText;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_facing);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBuackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mFacingEditText = findViewById(R.id.etxt_barcode);
mQtyEditText = findViewById(R.id.etxt_qty);
mBuackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mFacingEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class InternalSaleAndCorrctionActivity extends AppCompatActivity implements View.OnClickListener {
CheckBox mQtyCheckBox;
EditText mQtyEditText;
EditText mBarcodeEditText;
EditText mDeptEditText, mChangeSectionEditText;
Button mChangeButton, mChangeSectionButton;
Button mBackButton;
Button mModifyButton;
Button mDeleteButton;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_internal_sale_and_corrction);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mQtyEditText = findViewById(R.id.etxt_qty);
mQtyCheckBox = findViewById(R.id.check_qty);
mDeptEditText = findViewById(R.id.etxt_waste_type);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mChangeSectionEditText = findViewById(R.id.etxt_change_section);
mChangeButton = findViewById(R.id.btn_change);
mChangeSectionButton = findViewById(R.id.btn_change_section);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mDeleteButton = findViewById(R.id.btn_delete);
mQtyCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mQtyEditText.setEnabled(isChecked);
}
});
mChangeButton.setOnClickListener(this);
mChangeSectionButton.setOnClickListener(this);
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
mDeleteButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mDeptEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
mChangeSectionEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_delete:
break;
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
case R.id.btn_change:
mDeptEditText.setEnabled(true);
break;
case R.id.btn_change_section:
mChangeSectionEditText.setEnabled(true);
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class ItemListActivity extends AppCompatActivity implements View.OnClickListener {
Button mBuackButton;
Button mModifyButton;
EditText mQtyEditText;
EditText mBarcodeEditText;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_item_list);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBuackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mQtyEditText = findViewById(R.id.etxt_qty);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mBuackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mQtyEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class LabelSurveyActivity extends AppCompatActivity {
Button mBackButton;
Button mModifyButton;
String selectedSubMenu;
EditText mShelfPriceEditText;
EditText mBarcodeEditText;
EditText mSectionEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_label_survey);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mShelfPriceEditText = findViewById(R.id.etxt_shelf_price);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mSectionEditText = findViewById(R.id.etxt_section);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBackButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
mModifyButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
}
});
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mSectionEditText.setFocusableInTouchMode(true);
mShelfPriceEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class MinStockActivity extends AppCompatActivity implements View.OnClickListener {
Button mBuackButton;
Button mModifyButton;
EditText mBarcodeEditText;
EditText mQtyEditText;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_min_stock);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBuackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mQtyEditText = findViewById(R.id.etxt_qty);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mBuackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mQtyEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class OutOfActivity extends AppCompatActivity implements View.OnClickListener {
Button mBuackButton;
Button mModifyButton;
EditText mBarcodeEditText;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_out_of);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBuackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mBuackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mBarcodeEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.techware.promode.carrefour.R;
public class PrintLabelActivity extends AppCompatActivity implements View.OnClickListener {
RadioGroup mPrintRadioGroup;
RadioButton mRadioButton;
Button mBackButton;
Button mModifyButton;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_print_label);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mPrintRadioGroup = findViewById(R.id.radio_group_label);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
int selId = mPrintRadioGroup.getCheckedRadioButtonId();
mRadioButton = findViewById(selId);
String printType = mRadioButton.getText().toString();
Intent intent = new Intent(getApplicationContext(), PrintLabelSelectedActivity.class);
intent.putExtra("print_type", printType);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.TextView;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
public class PrintLabelSelectedActivity extends AppCompatActivity implements View.OnClickListener {
TextView mTitleTextView;
CheckBox mQtyCheckBox;
EditText mQtyEditText;
EditText mBarcodeEditText;
String selectedSubMenu;
Button mBackButton;
Button mModifyButton;
Button mDeleteButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_print_label_selected);
mTitleTextView = findViewById(R.id.txt_title);
mQtyCheckBox = findViewById(R.id.check_qty);
mQtyEditText = findViewById(R.id.etxt_qty);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mDeleteButton = findViewById(R.id.btn_delete);
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
mDeleteButton.setOnClickListener(this);
if (getIntent() != null && getIntent().getStringExtra("print_type") != null){
selectedSubMenu = getIntent().getStringExtra("print_type");
mTitleTextView.setText(selectedSubMenu);
}
mQtyCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mQtyEditText.setEnabled(isChecked);
}
});
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mBarcodeEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
break;
case R.id.btn_delete:
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class PromotionActivity extends AppCompatActivity implements View.OnClickListener {
Button mBuackButton;
Button mModifyButton;
EditText mBarcodeEditText;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_promotion);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBuackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mBuackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mBarcodeEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class StockTakeActivity extends AppCompatActivity implements View.OnClickListener{
Button mBackButton;
Button mModifyButton;
Button mDeleteButton;
String selectedSubMenu;
CheckBox mQtyCheckBox;
EditText mQtyEditText;
EditText mBarcodeEditText;
Button mChangeButton;
EditText mWasteTypeEditText;
boolean isTypeSelected = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_stock_take);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
initViews();
handleKeyboard();
}
private void initViews() {
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mDeleteButton = findViewById(R.id.btn_delete);
mQtyCheckBox = findViewById(R.id.check_qty);
mQtyEditText = findViewById(R.id.etxt_qty);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mChangeButton = findViewById(R.id.btn_change);
mWasteTypeEditText = findViewById(R.id.etxt_waste_type);
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
mDeleteButton.setOnClickListener(this);
mChangeButton.setOnClickListener(this);
mQtyCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mQtyEditText.setEnabled(isChecked);
}
});
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mBarcodeEditText.setFocusableInTouchMode(true);
mWasteTypeEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_delete:
break;
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
case R.id.btn_change:
if (!isTypeSelected){
mWasteTypeEditText.setEnabled(true);
isTypeSelected = true;
}else{
mWasteTypeEditText.setEnabled(false);
isTypeSelected = false;
}
break;
}
}
}
package com.techware.promode.carrefour.activity.it;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class WasteActivity extends AppCompatActivity implements View.OnClickListener {
CheckBox mQtyCheckBox;
EditText mQtyEditText;
EditText mWasteTypeEditText;
EditText mBarcodeEditText;
Button mChangeButton;
Button mBackButton;
Button mModifyButton;
Button mDeleteButton;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_waste);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
initViews();
handleKeyboard();
}
private void initViews() {
mQtyEditText = findViewById(R.id.etxt_qty);
mQtyCheckBox = findViewById(R.id.check_qty);
mWasteTypeEditText = findViewById(R.id.etxt_waste_type);
mChangeButton = findViewById(R.id.btn_change);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mDeleteButton = findViewById(R.id.btn_delete);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mQtyCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mQtyEditText.setEnabled(isChecked);
}
});
mChangeButton.setOnClickListener(this);
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
mDeleteButton.setOnClickListener(this);
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mBarcodeEditText.setFocusableInTouchMode(true);
mWasteTypeEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_delete:
break;
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
case R.id.btn_change:
mWasteTypeEditText.setEnabled(true);
break;
}
}
}
package com.techware.promode.carrefour.activity.merchandise;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class ItemListActivity extends AppCompatActivity implements View.OnClickListener {
Button mBuackButton;
Button mModifyButton;
EditText barcodeEditText;
EditText qtyEditText;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_item_list2);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mBuackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
barcodeEditText = findViewById(R.id.etxt_barcode);
qtyEditText = findViewById(R.id.etxt_qty);
mBuackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
barcodeEditText.setFocusableInTouchMode(true);
qtyEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.merchandise;
import android.content.Intent;
import android.content.res.AssetManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.ExitDialog;
import com.techware.promode.carrefour.R;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
public class MerchandiseActivity extends AppCompatActivity implements ExitDialog.OnInteractionListener {
RecyclerView mMenuRecyclerView;
private String selMenu;
ArrayList<String> subMenuList = new ArrayList<>();
RelativeLayout mBackLayout;
ExitDialog dialog;
private String selectedSubMenu = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_merchandise);
if (getIntent().getStringExtra("menu") != null)
selMenu = getIntent().getStringExtra("menu");
mBackLayout = findViewById(R.id.layout_back);
iniRecyclerView();
mBackLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void iniRecyclerView() {
mMenuRecyclerView = findViewById(R.id.rv_menu);
mMenuRecyclerView.setHasFixedSize(true);
mMenuRecyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
loadMenuList();
mMenuRecyclerView.setAdapter(new SubMenuAdapter(subMenuList));
}
private void loadMenuList() {
// Load XML for parsing.
AssetManager assetManager = getAssets();
InputStream inputStream = null;
try {
inputStream = assetManager.open("menu.xml");
} catch (IOException e) {
Log.e("tag", e.getMessage());
}
String s = readTextFile(inputStream);
//Toast.makeText(this, "" + s, Toast.LENGTH_SHORT).show();
processScannedData(s);
}
@Override
public void onYesButtonClick() {
if (dialog != null)
dialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (dialog != null)
dialog.dismiss();
}
public void showExitDialog(){
dialog = new ExitDialog(this);
dialog.setListener(this);
dialog.show();
}
private class SubMenuAdapter extends RecyclerView.Adapter<SubMenuAdapter.ViewHolder> {
private ArrayList<String> mList = new ArrayList<>();
public SubMenuAdapter(ArrayList<String> subMenuList) {
this.mList.clear();
this.mList.addAll(subMenuList);
}
@NonNull
@Override
public SubMenuAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sub_menu_row_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final SubMenuAdapter.ViewHolder holder, int position) {
holder.submenuTextView.setText(mList.get(position));
holder.submenuLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (holder.submenuTextView.getText().toString()) {
case "1 - ItemList": {
Intent intent = new Intent(getApplicationContext(), ItemListActivity.class);
intent.putExtra("submenu", "1 - ItemList");
startActivity(intent);
}break;
case "2 - Print Labels": {
Intent intent = new Intent(getApplicationContext(), PrintLabelActivity.class);
intent.putExtra("submenu", "2 - Print Labels");
startActivity(intent);
}break;
case "0 - Exit": {
showExitDialog();
}break;
}
}
});
}
@Override
public int getItemCount() {
return mList.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout submenuLayout;
TextView submenuTextView;
public ViewHolder(View itemView) {
super(itemView);
submenuLayout = itemView.findViewById(R.id.layout_submenu);
submenuTextView = itemView.findViewById(R.id.txt_submenu);
}
}
}
private String readTextFile(InputStream inputStream) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte buf[] = new byte[1024];
int len;
try {
while ((len = inputStream.read(buf)) != -1) {
outputStream.write(buf, 0, len);
}
outputStream.close();
inputStream.close();
} catch (IOException e) {
}
return outputStream.toString();
}
protected void processScannedData(String scanData) {
XmlPullParserFactory pullParserFactory;
String tempVal = null, subMenuVal = null;
try {
// init the parserfactory
pullParserFactory = XmlPullParserFactory.newInstance();
// get the parser
XmlPullParser parser = pullParserFactory.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(new StringReader(scanData));
boolean submenuFlag = false;
// parse the XML
int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_DOCUMENT) {
Log.d("Rajdeol", "Start document");
} else if (eventType == XmlPullParser.START_TAG) {
tempVal = parser.getAttributeValue(null, "Menu");
subMenuVal = parser.getAttributeValue(null, "Submenu");
if (tempVal != null)
submenuFlag = false;
if (tempVal != null && tempVal.equalsIgnoreCase(selMenu)) {
submenuFlag = true;
}
if (submenuFlag && subMenuVal != null)
subMenuList.add(subMenuVal);
} else if (eventType == XmlPullParser.END_TAG) {
Log.d("Rajdeol", "End tag " + parser.getName());
} else if (eventType == XmlPullParser.TEXT) {
Log.d("Rajdeol", "Text " + parser.getText());
}
eventType = parser.next();
}
// display the data on screen
displayScannedData();
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}// EO function
private void displayScannedData() {
String str = "";
for (String model :
subMenuList) {
str += model;
}
//Toast.makeText(this, ""+ str, Toast.LENGTH_SHORT).show();
}
}
package com.techware.promode.carrefour.activity.merchandise;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.it.PrintLabelSelectedActivity;
public class PrintLabelActivity extends AppCompatActivity implements View.OnClickListener {
RadioGroup mPrintRadioGroup;
RadioButton mRadioButton;
Button mBackButton;
Button mModifyButton;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_print_label2);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mPrintRadioGroup = findViewById(R.id.radio_group_label);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
int selId = mPrintRadioGroup.getCheckedRadioButtonId();
mRadioButton = findViewById(selId);
String printType = mRadioButton.getText().toString();
Intent intent = new Intent(getApplicationContext(), com.techware.promode.carrefour.activity.merchandise.PrintLabelSelectedActivity.class);
intent.putExtra("print_type", printType);
startActivity(intent);
break;
}
}
}
package com.techware.promode.carrefour.activity.merchandise;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.TextView;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
public class PrintLabelSelectedActivity extends AppCompatActivity implements View.OnClickListener{
TextView mTitleTextView;
CheckBox mQtyCheckBox;
EditText mQtyEditText;
EditText mBarcodeEditText;
String selectedSubMenu;
Button mBackButton;
Button mModifyButton;
Button mDeleteButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_print_label_selected2);
mTitleTextView = findViewById(R.id.txt_title);
mQtyCheckBox = findViewById(R.id.check_qty);
mQtyEditText = findViewById(R.id.etxt_qty);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mDeleteButton = findViewById(R.id.btn_delete);
mBackButton.setOnClickListener(this);
mModifyButton.setOnClickListener(this);
mDeleteButton.setOnClickListener(this);
if (getIntent() != null && getIntent().getStringExtra("print_type") != null){
selectedSubMenu = getIntent().getStringExtra("print_type");
mTitleTextView.setText(selectedSubMenu);
}
mQtyCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mQtyEditText.setEnabled(isChecked);
}
});
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mQtyEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_back:
finish();
break;
case R.id.btn_modify:
break;
case R.id.btn_delete:
break;
}
}
}
package com.techware.promode.carrefour.activity.order;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
public class NewOrderActivity extends AppCompatActivity {
EditText avgEditText;
EditText qtyOrderedEditText;
EditText qtyDeliverEditText;
EditText ordDaysEditText;
EditText asstCodeEditText;
EditText incrementEditText;
EditText itemStatusEditText;
EditText minStockEditText;
EditText stkQtyEditText;
EditText itemDescEditText;
EditText qtyEditText;
EditText barcodeEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_order);
initViews();
handleKeyboard();
}
private void initViews() {
avgEditText = findViewById(R.id.etxt_avg_sales);
qtyOrderedEditText = findViewById(R.id.etxt_qty_order);
qtyDeliverEditText = findViewById(R.id.etxt_qty_deliver);
ordDaysEditText = findViewById(R.id.etxt_ord_days);
asstCodeEditText = findViewById(R.id.etxt_asst_code);
incrementEditText = findViewById(R.id.etxt_increment);
itemStatusEditText = findViewById(R.id.etxt_item_stat);
minStockEditText = findViewById(R.id.etxt_min_stk);
stkQtyEditText = findViewById(R.id.etxt_stk_qty);
itemDescEditText = findViewById(R.id.etxt_item_desc);
qtyEditText = findViewById(R.id.etxt_qty);
barcodeEditText = findViewById(R.id.etxt_barcode);
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
barcodeEditText.setFocusableInTouchMode(true);
qtyOrderedEditText.setFocusableInTouchMode(true);
qtyDeliverEditText.setFocusableInTouchMode(true);
ordDaysEditText.setFocusableInTouchMode(true);
asstCodeEditText.setFocusableInTouchMode(true);
incrementEditText.setFocusableInTouchMode(true);
itemStatusEditText.setFocusableInTouchMode(true);
minStockEditText.setFocusableInTouchMode(true);
stkQtyEditText.setFocusableInTouchMode(true);
itemDescEditText.setFocusableInTouchMode(true);
avgEditText.setFocusableInTouchMode(true);
}
}
public void onBackClicked(View v){
finish();
}
public void onModifyClicked(View v){
}
}
package com.techware.promode.carrefour.activity.order;
import android.content.Intent;
import android.content.res.AssetManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.ExitDialog;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.AuthenticateActivity;
import com.techware.promode.carrefour.activity.FileTransferActivity;
import com.techware.promode.carrefour.activity.HomeActivity;
import com.techware.promode.carrefour.activity.it.WasteActivity;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
public class OrderActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
RecyclerView mMenuRecyclerView;
private String selMenu;
ArrayList<String> subMenuList = new ArrayList<>();
RelativeLayout mBackLayout;
CustomDialog dialog;
ExitDialog exitDialog;
private String selectedSubMenu = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_order);
if (getIntent().getStringExtra("menu") != null)
selMenu = getIntent().getStringExtra("menu");
mBackLayout = findViewById(R.id.layout_back);
iniRecyclerView();
mBackLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
}
private void iniRecyclerView() {
mMenuRecyclerView = findViewById(R.id.rv_menu);
mMenuRecyclerView.setHasFixedSize(true);
mMenuRecyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
loadMenuList();
mMenuRecyclerView.setAdapter(new SubMenuAdapter(subMenuList));
}
public void showCustomDialog(String s) {
dialog = new CustomDialog(this);
dialog.setDescData(getResources().getString(R.string.new_order_data_message_label));
dialog.setListener(this);
dialog.show();
selectedSubMenu = s;
}
public void showExitDialog(){
exitDialog = new ExitDialog(this);
exitDialog.setListener(new ExitDialog.OnInteractionListener() {
@Override
public void onYesButtonClick() {
if (exitDialog != null)
exitDialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (exitDialog != null)
exitDialog.dismiss();
}
});
exitDialog.show();
}
private void loadMenuList() {
// Load XML for parsing.
AssetManager assetManager = getAssets();
InputStream inputStream = null;
try {
inputStream = assetManager.open("menu.xml");
} catch (IOException e) {
Log.e("tag", e.getMessage());
}
String s = readTextFile(inputStream);
//Toast.makeText(this, "" + s, Toast.LENGTH_SHORT).show();
processScannedData(s);
}
@Override
public void onYesButtonClick() {
if (dialog != null)
dialog.dismiss();
switch (selectedSubMenu) {
case "4 - Get Order":
Intent intent = new Intent(getApplicationContext(), HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
break;
}
}
@Override
public void onNoButtonClick() {
if (dialog != null)
dialog.dismiss();
switch (selectedSubMenu) {
case "4 - Get Order":
break;
}
}
private class SubMenuAdapter extends RecyclerView.Adapter<SubMenuAdapter.ViewHolder> {
private ArrayList<String> mList = new ArrayList<>();
public SubMenuAdapter(ArrayList<String> subMenuList) {
this.mList.clear();
this.mList.addAll(subMenuList);
}
@NonNull
@Override
public SubMenuAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sub_menu_row_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final SubMenuAdapter.ViewHolder holder, int position) {
holder.submenuTextView.setText(mList.get(position));
holder.submenuLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (holder.submenuTextView.getText().toString()) {
case "1 - New Order": {
Intent intent = new Intent(getApplicationContext(), NewOrderActivity.class);
intent.putExtra("submenu", "1 - New Order");
startActivity(intent);
} break;
case "2 - Restore": {
Intent intent = new Intent(getApplicationContext(), AuthenticateActivity.class);
intent.putExtra("submenu", "2 - Restore");
startActivity(intent);
} break;
case "3 - Exit": {
showExitDialog();
} break;
case "4 - Get Order": {
showCustomDialog("");
} break;
}
}
});
}
@Override
public int getItemCount() {
return mList.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout submenuLayout;
TextView submenuTextView;
public ViewHolder(View itemView) {
super(itemView);
submenuLayout = itemView.findViewById(R.id.layout_submenu);
submenuTextView = itemView.findViewById(R.id.txt_submenu);
}
}
}
private String readTextFile(InputStream inputStream) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte buf[] = new byte[1024];
int len;
try {
while ((len = inputStream.read(buf)) != -1) {
outputStream.write(buf, 0, len);
}
outputStream.close();
inputStream.close();
} catch (IOException e) {
}
return outputStream.toString();
}
protected void processScannedData(String scanData) {
XmlPullParserFactory pullParserFactory;
String tempVal = null, subMenuVal = null;
try {
// init the parserfactory
pullParserFactory = XmlPullParserFactory.newInstance();
// get the parser
XmlPullParser parser = pullParserFactory.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(new StringReader(scanData));
boolean submenuFlag = false;
// parse the XML
int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_DOCUMENT) {
Log.d("Rajdeol", "Start document");
} else if (eventType == XmlPullParser.START_TAG) {
tempVal = parser.getAttributeValue(null, "Menu");
subMenuVal = parser.getAttributeValue(null, "Submenu");
if (tempVal != null)
submenuFlag = false;
if (tempVal != null && tempVal.equalsIgnoreCase(selMenu)) {
submenuFlag = true;
}
if (submenuFlag && subMenuVal != null)
subMenuList.add(subMenuVal);
} else if (eventType == XmlPullParser.END_TAG) {
Log.d("Rajdeol", "End tag " + parser.getName());
} else if (eventType == XmlPullParser.TEXT) {
Log.d("Rajdeol", "Text " + parser.getText());
}
eventType = parser.next();
}
// display the data on screen
displayScannedData();
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}// EO function
private void displayScannedData() {
String str = "";
for (String model :
subMenuList) {
str += model;
}
//Toast.makeText(this, ""+ str, Toast.LENGTH_SHORT).show();
}
}
package com.techware.promode.carrefour.activity.order;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import com.techware.promode.carrefour.R;
public class RestoreActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_restore3);
}
public void clickNewOrder(View v){
}
public void clickExit(View v){
finish();
}
}
package com.techware.promode.carrefour.activity.receive;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
public class OffsiteToStoreActivity extends AppCompatActivity {
EditText qtyEditText;
EditText barcodeEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_offsite_to_store);
qtyEditText = findViewById(R.id.etxt_qty);
barcodeEditText = findViewById(R.id.etxt_barcode);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
barcodeEditText.setFocusableInTouchMode(true);
qtyEditText.setFocusableInTouchMode(true);
}
}
public void clickOnBack(View v){
finish();
}
public void clickOnModify(View v){
finish();
}
}
package com.techware.promode.carrefour.activity.receive;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class PriceSurveyActivity extends AppCompatActivity {
CheckBox mQtyCheckBox;
EditText mQtyEditText;
EditText mStoreEditText, mOriginEditText;
EditText priceEditText;
EditText barcodeEditText;
Button mChangeButton, mChangeSectionButton;
Button mBackButton;
Button mModifyButton;
Button mDeleteButton;
String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_price_survey);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
initViews();
handleKeyboard();
}
private void initViews() {
mQtyEditText = findViewById(R.id.etxt_qty);
mQtyCheckBox = findViewById(R.id.check_qty);
mStoreEditText = findViewById(R.id.etxt_waste_type);
mOriginEditText = findViewById(R.id.etxt_change_section);
mChangeButton = findViewById(R.id.btn_change);
mChangeSectionButton = findViewById(R.id.btn_change_section);
mBackButton = findViewById(R.id.btn_back);
mModifyButton = findViewById(R.id.btn_modify);
mDeleteButton = findViewById(R.id.btn_delete);
priceEditText = findViewById(R.id.etxt_price);
barcodeEditText = findViewById(R.id.etxt_barcode);
mQtyCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mQtyEditText.setEnabled(isChecked);
}
});
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
barcodeEditText.setFocusableInTouchMode(true);
mQtyEditText.setFocusableInTouchMode(true);
mStoreEditText.setFocusableInTouchMode(true);
mOriginEditText.setFocusableInTouchMode(true);
priceEditText.setFocusableInTouchMode(true);
barcodeEditText.setFocusableInTouchMode(true);
}
}
public void onChangeStoreClick(View v){
mStoreEditText.setEnabled(true);
}
public void onChangeOriginClick(View c){
mOriginEditText.setEnabled(true);
}
public void onBackButtonClick(View c){
finish();
}
public void onModifyButtonClick(View c){
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
}
}
package com.techware.promode.carrefour.activity.receive;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class ReceiveSelectedActivity extends AppCompatActivity implements View.OnClickListener {
private Button mGetOrdersButton;
private Button mBackButton;
private String selectedSubMenu;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_receive_selected);
mGetOrdersButton = findViewById(R.id.btn_get_orders);
mBackButton = findViewById(R.id.btn_back);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mGetOrdersButton.setOnClickListener(this);
mBackButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.btn_get_orders:
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
break;
case R.id.btn_back:
finish();
break;
}
}
}
package com.techware.promode.carrefour.activity.receive;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.HomeActivity;
public class ReceivingActivity extends AppCompatActivity {
EditText supplierEditText;
EditText orderNoEditText;
EditText barcodeEditText;
EditText descEditText;
EditText qtyTwoEditText;
EditText qtyOneEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_receiving);
initViews();
handleKeyboard();
}
private void initViews() {
supplierEditText = findViewById(R.id.etxt_supplier);
orderNoEditText = findViewById(R.id.etxt_order_no);
barcodeEditText = findViewById(R.id.etxt_barcode);
descEditText = findViewById(R.id.etxt_desc);
qtyOneEditText = findViewById(R.id.etxt_qty_one);
qtyTwoEditText = findViewById(R.id.etxt_qty_two);
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
barcodeEditText.setFocusableInTouchMode(true);
supplierEditText.setFocusableInTouchMode(true);
orderNoEditText.setFocusableInTouchMode(true);
descEditText.setFocusableInTouchMode(true);
qtyOneEditText.setFocusableInTouchMode(true);
qtyTwoEditText.setFocusableInTouchMode(true);
barcodeEditText.setFocusableInTouchMode(true);
}
}
public void clickBackButton(View v){
finish();
}
public void clickRejectButton(View v){
Intent intent = new Intent(getApplicationContext(), HomeActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
}
}
package com.techware.promode.carrefour.activity.receive;
import android.content.Intent;
import android.content.res.AssetManager;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.techware.promode.carrefour.CustomDialog;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.util.ArrayList;
public class RestoreActivity extends AppCompatActivity implements CustomDialog.OnInteractionListener {
RecyclerView mMenuRecyclerView;
private String selMenu;
ArrayList<String> subMenuList = new ArrayList<>();
CustomDialog dialog;
private String selectedSubMenu = "";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_restore);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
iniRecyclerView();
}
private void iniRecyclerView() {
mMenuRecyclerView = findViewById(R.id.rv_menu);
mMenuRecyclerView.setHasFixedSize(true);
mMenuRecyclerView.setLayoutManager(new GridLayoutManager(getApplicationContext(), 2));
loadMenuList();
mMenuRecyclerView.setAdapter(new SubMenuAdapter(subMenuList));
}
private void loadMenuList() {
// Load XML for parsing.
AssetManager assetManager = getAssets();
InputStream inputStream = null;
try {
inputStream = assetManager.open("menu.xml");
} catch (IOException e) {
Log.e("tag", e.getMessage());
}
String s = readTextFile(inputStream);
//Toast.makeText(this, "" + s, Toast.LENGTH_SHORT).show();
processScannedData(s);
}
public void showCustomDialog(String s) {
dialog = new CustomDialog(this);
dialog.setListener(this);
dialog.setDescData(getResources().getString(R.string.exit_message_label));
dialog.show();
selectedSubMenu = s;
}
@Override
public void onYesButtonClick() {
if (dialog != null)
dialog.dismiss();
finishAffinity();
}
@Override
public void onNoButtonClick() {
if (dialog != null)
dialog.dismiss();
}
private class SubMenuAdapter extends RecyclerView.Adapter<SubMenuAdapter.ViewHolder> {
private ArrayList<String> mList = new ArrayList<>();
public SubMenuAdapter(ArrayList<String> subMenuList) {
this.mList.clear();
this.mList.addAll(subMenuList);
}
@NonNull
@Override
public SubMenuAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.sub_menu_row_item, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull final SubMenuAdapter.ViewHolder holder, int position) {
holder.submenuTextView.setText(mList.get(position));
holder.submenuLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
switch (holder.submenuTextView.getText().toString()) {
case "Receiving": {
}break;
case "Return": {
}break;
case "Price Survey": {
}break;
case "Exit": {
showCustomDialog("");
}break;
}
}
});
}
@Override
public int getItemCount() {
return mList.size();
}
class ViewHolder extends RecyclerView.ViewHolder {
RelativeLayout submenuLayout;
TextView submenuTextView;
public ViewHolder(View itemView) {
super(itemView);
submenuLayout = itemView.findViewById(R.id.layout_submenu);
submenuTextView = itemView.findViewById(R.id.txt_submenu);
}
}
}
private String readTextFile(InputStream inputStream) {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
byte buf[] = new byte[1024];
int len;
try {
while ((len = inputStream.read(buf)) != -1) {
outputStream.write(buf, 0, len);
}
outputStream.close();
inputStream.close();
} catch (IOException e) {
}
return outputStream.toString();
}
protected void processScannedData(String scanData) {
XmlPullParserFactory pullParserFactory;
String tempVal = null, subMenuVal = null;
try {
// init the parserfactory
pullParserFactory = XmlPullParserFactory.newInstance();
// get the parser
XmlPullParser parser = pullParserFactory.newPullParser();
parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
parser.setInput(new StringReader(scanData));
boolean submenuFlag = false;
// parse the XML
int eventType = parser.getEventType();
while (eventType != XmlPullParser.END_DOCUMENT) {
if (eventType == XmlPullParser.START_DOCUMENT) {
Log.d("Rajdeol", "Start document");
} else if (eventType == XmlPullParser.START_TAG) {
tempVal = parser.getAttributeValue(null, "Menu");
subMenuVal = parser.getAttributeValue(null, "Submenu");
if (tempVal != null)
submenuFlag = false;
if (tempVal != null && tempVal.equalsIgnoreCase("2 - Receive")) {
submenuFlag = true;
}
if (submenuFlag && subMenuVal != null && !subMenuVal.equalsIgnoreCase("Restore"))
subMenuList.add(subMenuVal);
} else if (eventType == XmlPullParser.END_TAG) {
Log.d("Rajdeol", "End tag " + parser.getName());
} else if (eventType == XmlPullParser.TEXT) {
Log.d("Rajdeol", "Text " + parser.getText());
}
eventType = parser.next();
}
// display the data on screen
displayScannedData();
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}// EO function
private void displayScannedData() {
String str = "";
for (String model :
subMenuList) {
str += model;
}
//Toast.makeText(this, ""+ str, Toast.LENGTH_SHORT).show();
}
}
package com.techware.promode.carrefour.activity.receive;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
import com.techware.promode.carrefour.activity.FileTransferActivity;
public class ReturnActivity extends AppCompatActivity {
String selectedSubMenu;
CheckBox mQtyCheckBox;
EditText mQtyEditText;
EditText mBarcodeEditText;
EditText mSupplierEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_return);
mQtyCheckBox = findViewById(R.id.check_qty);
mQtyEditText = findViewById(R.id.etxt_qty);
mBarcodeEditText = findViewById(R.id.etxt_barcode);
mSupplierEditText = findViewById(R.id.etxt_supplier);
if (getIntent() != null && getIntent().getStringExtra("submenu") != null){
selectedSubMenu = getIntent().getStringExtra("submenu");
}
mQtyCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mQtyEditText.setEnabled(isChecked);
}
});
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
mQtyEditText.setFocusableInTouchMode(true);
mBarcodeEditText.setFocusableInTouchMode(true);
mSupplierEditText.setFocusableInTouchMode(true);
}
}
public void onBackClick(View view){
finish();
}
public void onModifyClick(View view){
Intent intent = new Intent(getApplicationContext(), FileTransferActivity.class);
intent.putExtra("submenu", selectedSubMenu);
startActivity(intent);
}
}
package com.techware.promode.carrefour.activity.receive;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import com.techware.promode.carrefour.Constants;
import com.techware.promode.carrefour.R;
public class StoreToOffsiteActivity extends AppCompatActivity {
EditText barcodeEditText;
EditText qtyEditText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_store_to_offsite);
barcodeEditText = findViewById(R.id.etxt_barcode);
qtyEditText = findViewById(R.id.etxt_qty);
handleKeyboard();
}
private void handleKeyboard() {
if (getSharedPreferences(Constants.PREF_FILE, 0).getBoolean(Constants.KEYBOARD_STATUS, false)){
barcodeEditText.setFocusableInTouchMode(true);
qtyEditText.setFocusableInTouchMode(true);
}
}
public void clickOnBack(View v){
finish();
}
public void clickOnModify(View v){
finish();
}
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeColor="#00000000"
android:strokeWidth="1">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeColor="#00000000"
android:strokeWidth="1" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/greyButtonColor" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<stroke android:width="1dp" android:color="@color/greyButtonColor" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<stroke android:width="4dp" android:color="@color/colorPrimary" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<stroke android:width="1dp" android:color="@color/redButtonColor" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorPrimary" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFFFFF"
android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportHeight="108"
android:viewportWidth="108">
<path
android:fillColor="#26A69A"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeColor="#33FFFFFF"
android:strokeWidth="0.8" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<stroke android:width="1dp" android:color="@color/greyInputBoxColor" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="4dp" />
<stroke android:width="1dp" android:color="@color/greyInputBoxColor" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/unselected_grid_bg" android:state_active="true" />
<item android:drawable="@drawable/unselected_grid_bg" android:state_activated="true" />
<item android:drawable="@drawable/selected_grid_bg" android:state_pressed="true" />
<item android:drawable="@drawable/unselected_grid_bg" />
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/selectedGridColor" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/greyButtonColor" />
<corners android:radius="4dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/gridUnselectedWhiteColor" />
<corners android:radius="8dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/appBgGreyColor"
tools:context="com.techware.promode.carrefour.activity.AuthenticateActivity">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:src="@drawable/bg_shade" />
<RelativeLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="28dp"
android:background="@color/colorPrimary"
android:orientation="vertical">
<TextView
android:id="@+id/txt_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/credential_title"
android:textColor="@color/whiteColor"
android:textSize="15dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar_layout"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="24dp">
<TextView
android:id="@+id/text_barcode"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:text="@string/username_label"
android:textColor="@color/textGreyColor"
android:textSize="14sp" />
<EditText
android:id="@+id/etxt_username"
android:layout_width="match_parent"
android:layout_height="22dp"
android:focusableInTouchMode="false"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@+id/text_barcode"
android:background="@drawable/input_control_small_bg_grey"
android:paddingLeft="8dp"
android:text="" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="20dp">
<TextView
android:id="@+id/check_qty"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/password_label"
android:textColor="@color/textGreyColor"
android:textSize="14sp" />
<EditText
android:id="@+id/etxt_pwd"
android:layout_width="match_parent"
android:layout_height="22dp"
android:focusableInTouchMode="false"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_toRightOf="@+id/check_qty"
android:background="@drawable/input_control_small_bg_grey"
android:paddingLeft="8dp"
android:text="" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:layout_marginTop="22dp">
<View
android:layout_width="90dp"
android:layout_height="1dp"
android:id="@+id/view_placeholder"
/>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/view_placeholder"
android:layout_marginBottom="12dp"
android:layout_marginLeft="10dp"
android:orientation="horizontal">
<Button
android:id="@+id/btn_back"
android:layout_width="73dp"
android:layout_height="29dp"
android:background="@drawable/button_bg_fill_grey"
android:text="@string/back_placeholder"
android:textAllCaps="false"
android:textColor="@color/whiteColor" />
<Button
android:id="@+id/btn_ok"
android:layout_width="73dp"
android:layout_height="29dp"
android:layout_marginLeft="16dp"
android:layout_alignParentRight="true"
android:background="@drawable/button_fill_bg"
android:text="@string/ok_placeholder"
android:textAllCaps="true"
android:textColor="@color/whiteColor" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/appBgGreyColor"
tools:context="com.techware.promode.carrefour.activity.it.CompetitionActivity">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:src="@drawable/bg_shade" />
<RelativeLayout
android:id="@+id/toolbar_layout"
android:layout_width="match_parent"
android:layout_height="28dp"
android:background="@color/colorPrimary"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="@string/competition_placeholder"
android:textColor="@color/whiteColor"
android:textSize="15dp" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar_layout"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp">
<TextView
android:layout_width="90dp"
android:layout_height="wrap_content"
android:id="@+id/text_section"
android:textColor="@color/textGreyColor"
android:textSize="14sp"
android:text="@string/store_label" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:orientation="horizontal"
android:layout_toRightOf="@+id/text_section"
android:layout_below="@+id/layout_spinner"
android:weightSum="2">
<EditText
android:layout_width="match_parent"
android:layout_height="21dp"
android:layout_marginRight="4dp"
android:paddingLeft="12dp"
android:maxLines="1"
android:singleLine="true"
android:textAllCaps="false"
android:textSize="12dp"
android:focusableInTouchMode="false"
android:textColor="@color/greyButtonColor"
android:background="@drawable/input_control_small_bg_grey"
android:layout_weight="1"
android:hint="@string/store_placeholder"
android:id="@+id/etxt_store"
android:enabled="false"
android:text="" />
<Button
android:layout_width="match_parent"
android:layout_height="21dp"
android:layout_marginLeft="4dp"
android:textAllCaps="false"
android:textSize="12dp"
android:textColor="@color/whiteColor"
android:background="@drawable/small_button_fill_grey"
android:layout_weight="1"
android:id="@+id/btn_change"
android:text="@string/change_label"/>
</LinearLayout>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp">
<TextView
android:layout_width="90dp"
android:layout_height="wrap_content"
android:id="@+id/text_barcode"
android:textColor="@color/textGreyColor"
android:textSize="14sp"
android:text="@string/barcode_label" />
<EditText
android:layout_width="match_parent"
android:layout_height="22dp"
android:layout_marginLeft="8dp"
android:paddingLeft="8dp"
android:background="@drawable/input_control_small_bg_grey"
android:text=""
android:focusableInTouchMode="false"
android:layout_toRightOf="@+id/text_barcode"
android:id="@+id/etxt_barcode"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="28dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp">
<TextView
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/price_label"
android:textSize="14sp"
android:id="@+id/check_qty"
android:textColor="@color/textGreyColor"/>
<EditText
android:layout_width="match_parent"
android:layout_height="22dp"
android:layout_marginLeft="8dp"
android:paddingLeft="8dp"
android:layout_centerVertical="true"
android:background="@drawable/input_control_small_bg_grey"
android:text=""
android:focusableInTouchMode="false"
android:layout_toRightOf="@+id/check_qty"
android:id="@+id/etxt_price"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginTop="30dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/layout_last_entry"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/textGreyColor"
android:text="@string/last_entry_label"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/textGreyColor"
android:textStyle="bold"
android:textSize="12sp"
android:text="@string/last_entry_value"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/layout_quantity"
android:layout_alignParentRight="true"
android:layout_marginRight="48dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="14sp"
android:textColor="@color/textGreyColor"
android:text="@string/comp_price_label"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/textGreyColor"
android:textStyle="bold"
android:textSize="12sp"
android:text="@string/Quantity_value"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="12dp"
android:orientation="horizontal">
<Button
android:id="@+id/btn_back"
android:layout_width="73dp"
android:layout_height="29dp"
android:background="@drawable/button_bg_fill_grey"
android:text="@string/back_placeholder"
android:textAllCaps="false"
android:textColor="@color/whiteColor" />
<Button
android:id="@+id/btn_modify"
android:layout_width="73dp"
android:layout_height="29dp"
android:layout_marginLeft="8dp"
android:background="@drawable/button_fill_bg"
android:text="@string/modify_placeholder"
android:textAllCaps="false"
android:textColor="@color/whiteColor" />
<Button
android:id="@+id/btn_delete"
android:layout_width="73dp"
android:layout_height="29dp"
android:layout_marginLeft="8dp"
android:background="@drawable/button_bg_red_outline"
android:text="@string/delete_placeholder"
android:textAllCaps="false"
android:textColor="@color/redButtonColor" />
</LinearLayout>
</RelativeLayout>
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment