Complete app requirements for 5S application
parent
8934c58ba6
commit
0a79e0db64
|
@ -26,6 +26,10 @@ android {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lintOptions {
|
||||||
|
checkReleaseBuilds false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
android:name="android.permission.READ_EXTERNAL_STORAGE"
|
||||||
android:maxSdkVersion="32" />
|
android:maxSdkVersion="32" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||||
|
@ -20,6 +19,7 @@
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
android:allowClearUserData="true"
|
||||||
android:dataExtractionRules="@xml/data_extraction_rules"
|
android:dataExtractionRules="@xml/data_extraction_rules"
|
||||||
android:fullBackupContent="@xml/backup_rules"
|
android:fullBackupContent="@xml/backup_rules"
|
||||||
android:icon="@drawable/search"
|
android:icon="@drawable/search"
|
||||||
|
@ -27,9 +27,11 @@
|
||||||
android:roundIcon="@drawable/search"
|
android:roundIcon="@drawable/search"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.QualityControlApp"
|
android:theme="@style/Theme.QualityControlApp"
|
||||||
android:allowClearUserData="true"
|
|
||||||
android:usesCleartextTraffic="true"
|
android:usesCleartextTraffic="true"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31">
|
||||||
|
<activity
|
||||||
|
android:name=".activities.LoginActivity"
|
||||||
|
android:exported="false" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.SummaryActivity"
|
android:name=".activities.SummaryActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
@ -45,7 +47,7 @@
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".activities.HomeActivity"
|
android:name=".activities.HomeActivity"
|
||||||
android:exported="true"/>
|
android:exported="true" />
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="androidx.core.content.FileProvider"
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
|
|
@ -1,13 +1,22 @@
|
||||||
package com.utopiaindustries.qualitycontrol.activities;
|
package com.utopiaindustries.qualitycontrol.activities;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Color;
|
||||||
|
import android.graphics.drawable.ColorDrawable;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
import androidx.core.graphics.Insets;
|
import androidx.core.graphics.Insets;
|
||||||
import androidx.core.view.ViewCompat;
|
import androidx.core.view.ViewCompat;
|
||||||
|
@ -24,6 +33,7 @@ import com.utopiaindustries.qualitycontrol.fragments.PackingFragment;
|
||||||
import com.utopiaindustries.qualitycontrol.fragments.StitchingFragment;
|
import com.utopiaindustries.qualitycontrol.fragments.StitchingFragment;
|
||||||
import com.utopiaindustries.qualitycontrol.fragments.SubStoreFragment;
|
import com.utopiaindustries.qualitycontrol.fragments.SubStoreFragment;
|
||||||
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
||||||
|
import com.utopiaindustries.qualitycontrol.helper.Preference;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
@ -37,6 +47,7 @@ public class HomeActivity extends AppCompatActivity {
|
||||||
private int currentFragmentIndex = 0;
|
private int currentFragmentIndex = 0;
|
||||||
private final List<Fragment> fragmentList = new ArrayList<>();
|
private final List<Fragment> fragmentList = new ArrayList<>();
|
||||||
//Button btnNext;
|
//Button btnNext;
|
||||||
|
ImageView imgLogout;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -53,6 +64,14 @@ public class HomeActivity extends AppCompatActivity {
|
||||||
Toast.makeText( this, "No Internet Connection", Toast.LENGTH_LONG ).show();
|
Toast.makeText( this, "No Internet Connection", Toast.LENGTH_LONG ).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
imgLogout = findViewById(R.id.img_logout);
|
||||||
|
|
||||||
|
imgLogout.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
alertLogOut(HomeActivity.this);
|
||||||
|
}
|
||||||
|
});
|
||||||
//btnNext = findViewById(R.id.btn_next);
|
//btnNext = findViewById(R.id.btn_next);
|
||||||
|
|
||||||
// Initialize fragments
|
// Initialize fragments
|
||||||
|
@ -87,6 +106,53 @@ public class HomeActivity extends AppCompatActivity {
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void alertLogOut(Context con) {
|
||||||
|
ViewGroup viewGroup = findViewById(android.R.id.content);
|
||||||
|
|
||||||
|
TextView dialogOkBtn, dialogCancelBtn;
|
||||||
|
|
||||||
|
AlertDialog.Builder builder = new AlertDialog.Builder(con);
|
||||||
|
View view1 = LayoutInflater.from(con).inflate(R.layout.custom_layout_for_logout, viewGroup, false);
|
||||||
|
builder.setCancelable(false);
|
||||||
|
builder.setView(view1);
|
||||||
|
|
||||||
|
dialogOkBtn = view1.findViewById(R.id.dialogOkBtn);
|
||||||
|
dialogCancelBtn = view1.findViewById(R.id.dialogCancelBtn);
|
||||||
|
|
||||||
|
AlertDialog alertDialog = builder.create();
|
||||||
|
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
|
||||||
|
|
||||||
|
dialogOkBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
alertDialog.dismiss();
|
||||||
|
|
||||||
|
Preference.setMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext(), false);
|
||||||
|
Preference.setMyStringPref(Helper.project_file, Helper.firstTimeApiCall, getApplicationContext(), "false");
|
||||||
|
|
||||||
|
finish();
|
||||||
|
Intent i = new Intent(HomeActivity.this, LoginActivity.class);
|
||||||
|
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
startActivity(i);
|
||||||
|
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogCancelBtn.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
|
||||||
|
alertDialog.dismiss();
|
||||||
|
//Toast.makeText(con, "Cancel", Toast.LENGTH_SHORT).show();
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
alertDialog.show();
|
||||||
|
}
|
||||||
|
|
||||||
// Method to navigate to a specific fragment
|
// Method to navigate to a specific fragment
|
||||||
/*public void navigateToFragment(Fragment fragment, boolean addToBackStack) {
|
/*public void navigateToFragment(Fragment fragment, boolean addToBackStack) {
|
||||||
androidx.fragment.app.FragmentTransaction transaction = getSupportFragmentManager()
|
androidx.fragment.app.FragmentTransaction transaction = getSupportFragmentManager()
|
||||||
|
|
|
@ -0,0 +1,154 @@
|
||||||
|
package com.utopiaindustries.qualitycontrol.activities;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.activity.EdgeToEdge;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.core.graphics.Insets;
|
||||||
|
import androidx.core.view.ViewCompat;
|
||||||
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
|
||||||
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
|
import com.utopiaindustries.qualitycontrol.apiservice.ApiService;
|
||||||
|
import com.utopiaindustries.qualitycontrol.apiservice.ApiServiceFactory;
|
||||||
|
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
||||||
|
import com.utopiaindustries.qualitycontrol.helper.Preference;
|
||||||
|
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
||||||
|
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
||||||
|
|
||||||
|
public class LoginActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
EditText tfEmail, tfPassword;
|
||||||
|
Button btnLogin;
|
||||||
|
LoginViewModel loginViewModel;
|
||||||
|
ApiService apiService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
EdgeToEdge.enable(this);
|
||||||
|
setContentView(R.layout.activity_login);
|
||||||
|
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main), (v, insets) -> {
|
||||||
|
Insets systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars());
|
||||||
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
|
return insets;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!Helper.isNetworkConnected(this)) {
|
||||||
|
Toast.makeText(this, "No Internet Connection", Toast.LENGTH_LONG).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
initializeLayout();
|
||||||
|
|
||||||
|
btnLogin.setOnClickListener(v -> {
|
||||||
|
if (isValidate()) {
|
||||||
|
loginViewModel.isUserAuthenticated(tfEmail.getText().toString(),
|
||||||
|
tfPassword.getText().toString(),
|
||||||
|
new String[]{"ROLE_UIM_QC_APP_ACCESS_YES"});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initializeLayout() {
|
||||||
|
tfEmail = findViewById(R.id.tf_email);
|
||||||
|
tfPassword = findViewById(R.id.tf_password);
|
||||||
|
btnLogin = findViewById(R.id.btn_login);
|
||||||
|
apiService = ApiServiceFactory.getApiService();
|
||||||
|
|
||||||
|
//tfEmail.setText("muhammad.mujtaba");
|
||||||
|
//tfPassword.setText("Utopia01");
|
||||||
|
|
||||||
|
loginViewModel = new ViewModelProvider(this).get(LoginViewModel.class);
|
||||||
|
|
||||||
|
loginViewModel.getLoadingState().observe(this, isLoading -> {
|
||||||
|
if (isLoading != null && isLoading) {
|
||||||
|
showProgressDialog();
|
||||||
|
} else {
|
||||||
|
dismissProgressDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
loginViewModel.getErrorMessage().observe(this, errorResponse -> {
|
||||||
|
if (errorResponse.isEmpty()) {
|
||||||
|
Toast.makeText(this, "Something went wrong", Toast.LENGTH_SHORT).show();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, errorResponse, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
loginViewModel.getLoginUser().observe(this, loginUser -> {
|
||||||
|
if (loginUser) {
|
||||||
|
Preference.setMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext(), true);
|
||||||
|
Preference.setMyStringPref(Helper.project_file,Helper.logInUser,this,tfEmail.getText().toString());
|
||||||
|
|
||||||
|
Intent intent = new Intent(this, HomeActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Toast.makeText(this, "Login Failed", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*loginViewModel.getUserLiveData().observe(this, user -> {
|
||||||
|
if (user != null) {
|
||||||
|
Preference.setMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext(), true);
|
||||||
|
Helper.setPreferenceObject(getApplicationContext(), user, "DriverResponse");
|
||||||
|
|
||||||
|
//Toast.makeText(this, "Welcome " + user.getTruckerName(), Toast.LENGTH_SHORT).show();
|
||||||
|
Intent intent = new Intent(this, HomeActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||||
|
finish();
|
||||||
|
} else {
|
||||||
|
Toast.makeText(this, "Login Failed", Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});*/
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isValidate() {
|
||||||
|
boolean returnValue = true;
|
||||||
|
String message = "";
|
||||||
|
|
||||||
|
if (tfPassword.getText().toString().isEmpty()) {
|
||||||
|
message = "Please enter password.";
|
||||||
|
returnValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*if (!Helper.isValidEmail(tfEmail.getText().toString())) {
|
||||||
|
message = "Please enter valid email.";
|
||||||
|
returnValue = false;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
if (tfEmail.getText().toString().isEmpty()) {
|
||||||
|
message = "Please enter user name.";
|
||||||
|
returnValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!returnValue) {
|
||||||
|
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void showProgressDialog() {
|
||||||
|
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
||||||
|
progressDialog.setCancelable(false);
|
||||||
|
progressDialog.show(getSupportFragmentManager(), "progressDialog");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dismissProgressDialog() {
|
||||||
|
ProgressDialogFragment progressDialog = (ProgressDialogFragment) getSupportFragmentManager().findFragmentByTag("progressDialog");
|
||||||
|
if (progressDialog != null) {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -40,13 +40,13 @@ public class SplashActivity extends AppCompatActivity {
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
Intent myIntent = new Intent(SplashActivity.this, HomeActivity.class);
|
/*Intent myIntent = new Intent(SplashActivity.this, HomeActivity.class);
|
||||||
startActivity(myIntent);
|
startActivity(myIntent);
|
||||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||||
finish();
|
finish();*/
|
||||||
|
|
||||||
/* if (isLoggedIn) {
|
if (isLoggedIn) {
|
||||||
Intent myIntent = new Intent(SplashActivity.this, MainActivity.class);
|
Intent myIntent = new Intent(SplashActivity.this, HomeActivity.class);
|
||||||
startActivity(myIntent);
|
startActivity(myIntent);
|
||||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||||
finish();
|
finish();
|
||||||
|
@ -55,7 +55,7 @@ public class SplashActivity extends AppCompatActivity {
|
||||||
startActivity(myIntent);
|
startActivity(myIntent);
|
||||||
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
|
||||||
finish();
|
finish();
|
||||||
}*/
|
}
|
||||||
}
|
}
|
||||||
}, TIMER);
|
}, TIMER);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
package com.utopiaindustries.qualitycontrol.activities;
|
package com.utopiaindustries.qualitycontrol.activities;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.activity.EdgeToEdge;
|
import androidx.activity.EdgeToEdge;
|
||||||
import androidx.appcompat.app.AppCompatActivity;
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
@ -9,9 +14,15 @@ import androidx.core.view.ViewCompat;
|
||||||
import androidx.core.view.WindowInsetsCompat;
|
import androidx.core.view.WindowInsetsCompat;
|
||||||
|
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
|
import com.utopiaindustries.qualitycontrol.models.QualitySaveResponse;
|
||||||
|
|
||||||
public class SummaryActivity extends AppCompatActivity {
|
public class SummaryActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
TextView txtPercentage, txtCutting, txtStitching, txtChecking, txtPacking, txtSubStore;
|
||||||
|
String overallPercentage;
|
||||||
|
ImageView img_back;
|
||||||
|
QualitySaveResponse qualitySaveResponse;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
@ -22,5 +33,44 @@ public class SummaryActivity extends AppCompatActivity {
|
||||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom);
|
||||||
return insets;
|
return insets;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
initialization();
|
||||||
|
|
||||||
|
txtPercentage.setText(overallPercentage);
|
||||||
|
txtCutting.setText(qualitySaveResponse.getCutting());
|
||||||
|
txtStitching.setText(qualitySaveResponse.getStiching());
|
||||||
|
txtChecking.setText(qualitySaveResponse.getChecking());
|
||||||
|
txtPacking.setText(qualitySaveResponse.getPacking());
|
||||||
|
txtSubStore.setText(qualitySaveResponse.getSub_Store());
|
||||||
|
|
||||||
|
img_back.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
finish();
|
||||||
|
Intent intent = new Intent(SummaryActivity.this, HomeActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initialization() {
|
||||||
|
qualitySaveResponse = (QualitySaveResponse) getIntent().getSerializableExtra("Summary");
|
||||||
|
overallPercentage = getIntent().getStringExtra("Percentage");
|
||||||
|
|
||||||
|
/*Log.e("Cutting: ",""+qualitySaveResponse.getCutting());
|
||||||
|
Log.e("Stitching: ",""+qualitySaveResponse.getStiching());
|
||||||
|
Log.e("Checking: ",""+qualitySaveResponse.getChecking());
|
||||||
|
Log.e("Packing: ",""+qualitySaveResponse.getPacking());
|
||||||
|
Log.e("Substore: ",""+qualitySaveResponse.getSub_Store());
|
||||||
|
Log.e("Overall: ",""+qualitySaveResponse.getOverAllPercentage());*/
|
||||||
|
|
||||||
|
img_back = findViewById(R.id.img_back);
|
||||||
|
txtPercentage = findViewById(R.id.txt_percentage);
|
||||||
|
txtCutting = findViewById(R.id.txt_cutting_percentage);
|
||||||
|
txtStitching = findViewById(R.id.txt_stitching_percentage);
|
||||||
|
txtChecking = findViewById(R.id.txt_checking_percentage);
|
||||||
|
txtPacking = findViewById(R.id.txt_packing_percentage);
|
||||||
|
txtSubStore = findViewById(R.id.txt_substore_percentage);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,11 +20,18 @@ public interface ApiService {
|
||||||
);*/
|
);*/
|
||||||
|
|
||||||
@GET("rest/uic/quality-control/get-quality-control-data")
|
@GET("rest/uic/quality-control/get-quality-control-data")
|
||||||
Call<QualityControlResponse> isUserAuthenticated();
|
Call<QualityControlResponse> getQualityControlData();
|
||||||
|
|
||||||
|
|
||||||
@POST("rest/uic/quality-control/save-quality-control")
|
@POST("rest/uic/quality-control/save-quality-control")
|
||||||
Call<QualitySaveResponse> saveQualityControlReport(
|
Call<QualitySaveResponse> saveQualityControlReport(
|
||||||
@Body QualityControl request
|
@Body QualityControl request
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@POST("rest/authentication/authenticate-user")
|
||||||
|
Call<Boolean> isUserAuthenticated(
|
||||||
|
@Query("username") String username,
|
||||||
|
@Query("password") String password,
|
||||||
|
@Query("roles") String[] roles
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,6 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
Button nextButton;
|
Button nextButton;
|
||||||
ImageButton imagePicker, deleteImage;
|
ImageButton imagePicker, deleteImage;
|
||||||
EditText etPercentage, etRemarks;
|
EditText etPercentage, etRemarks;
|
||||||
QualityControlViewModel viewModel;
|
|
||||||
List<ItemModel> itemModelList = new ArrayList<>();
|
List<ItemModel> itemModelList = new ArrayList<>();
|
||||||
ItemStepsAdapter adapter;
|
ItemStepsAdapter adapter;
|
||||||
private int selectedPosition = -1;
|
private int selectedPosition = -1;
|
||||||
|
@ -85,7 +84,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedPosition != -1 && selectedImage != null) {
|
if (selectedPosition != -1 && selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
|
|
||||||
uriToByteArrayAsync(
|
uriToByteArrayAsync(
|
||||||
getContext(),
|
getContext(),
|
||||||
|
@ -139,13 +138,13 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
Log.e("contentUri: ", "" + contentUri);
|
//Log.e("contentUri: ", "" + contentUri);
|
||||||
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
||||||
|
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedImage != null) {
|
if (selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -167,9 +166,9 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
itemList.add(new Item("Safety", 0));*/
|
itemList.add(new Item("Safety", 0));*/
|
||||||
|
|
||||||
//New Implemented------------------
|
//New Implemented------------------
|
||||||
if (Helper.getArrayList("ListChecking", getActivity()) != null) {
|
if (Helper.getArrayList(Helper.listChecking, getActivity()) != null) {
|
||||||
itemModelList.clear();
|
itemModelList.clear();
|
||||||
itemModelList.addAll(Helper.getArrayList("ListChecking", getActivity()));
|
itemModelList.addAll(Helper.getArrayList(Helper.listChecking, getActivity()));
|
||||||
Log.e("itemModelList-size: ",""+itemModelList.size());
|
Log.e("itemModelList-size: ",""+itemModelList.size());
|
||||||
|
|
||||||
if (itemModelList != null) {
|
if (itemModelList != null) {
|
||||||
|
@ -206,7 +205,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
|
|
||||||
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
||||||
|
|
||||||
for (ItemModel item : updatedItemList) {
|
/*for (ItemModel item : updatedItemList) {
|
||||||
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
||||||
", StepId: " + item.getStepId() +
|
", StepId: " + item.getStepId() +
|
||||||
", SpinnerSelection: " + item.getSelectedOption() +
|
", SpinnerSelection: " + item.getSelectedOption() +
|
||||||
|
@ -214,12 +213,11 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
", Percentage: " + item.getPercentage() +
|
", Percentage: " + item.getPercentage() +
|
||||||
", Remarks: " + item.getRemarks() +
|
", Remarks: " + item.getRemarks() +
|
||||||
", ImageList: " + item.getImageArrayList());
|
", ImageList: " + item.getImageArrayList());
|
||||||
}
|
}*/
|
||||||
|
|
||||||
Helper.saveArrayList(itemModelList, "ListChecking",getActivity());
|
Helper.saveArrayList(itemModelList, Helper.listChecking,getActivity());
|
||||||
viewModel.appendToQualityControlItemList(itemModelList);
|
|
||||||
|
|
||||||
List<ItemModel> updatedItemListP = new ArrayList<>(Helper.getArrayList("ListChecking", getActivity()));
|
//List<ItemModel> updatedItemListP = new ArrayList<>(Helper.getArrayList("ListChecking", getActivity()));
|
||||||
|
|
||||||
/* if (etRemarks.getText().toString().isEmpty()) {
|
/* if (etRemarks.getText().toString().isEmpty()) {
|
||||||
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
||||||
|
@ -258,8 +256,6 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
|
|
||||||
private void initializeLayout(View view) {
|
private void initializeLayout(View view) {
|
||||||
|
|
||||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
|
||||||
|
|
||||||
etPercentage = view.findViewById(R.id.et_percentage);
|
etPercentage = view.findViewById(R.id.et_percentage);
|
||||||
etRemarks = view.findViewById(R.id.et_remarks);
|
etRemarks = view.findViewById(R.id.et_remarks);
|
||||||
imagePicker = view.findViewById(R.id.image_picker);
|
imagePicker = view.findViewById(R.id.image_picker);
|
||||||
|
|
|
@ -74,8 +74,6 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
String filePath = "no_pic";
|
String filePath = "no_pic";
|
||||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||||
ArrayList<QualityControlProcessStep> qualityControlProcessStepList = new ArrayList<>();
|
ArrayList<QualityControlProcessStep> qualityControlProcessStepList = new ArrayList<>();
|
||||||
QualityControlResponse qualityControlResponse;
|
|
||||||
QualityControlViewModel viewModel;
|
|
||||||
EditText etPercentage, etRemarks;
|
EditText etPercentage, etRemarks;
|
||||||
List<ItemModel> itemModelList = new ArrayList<>();
|
List<ItemModel> itemModelList = new ArrayList<>();
|
||||||
ItemStepsAdapter adapter;
|
ItemStepsAdapter adapter;
|
||||||
|
@ -88,7 +86,7 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedPosition != -1 && selectedImage != null) {
|
if (selectedPosition != -1 && selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
|
|
||||||
uriToByteArrayAsync(
|
uriToByteArrayAsync(
|
||||||
getContext(),
|
getContext(),
|
||||||
|
@ -142,13 +140,13 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
Log.e("contentUri: ", "" + contentUri);
|
// Log.e("contentUri: ", "" + contentUri);
|
||||||
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
||||||
|
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedImage != null) {
|
if (selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -175,11 +173,11 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
|
|
||||||
//New Implemented------------------
|
//New Implemented------------------
|
||||||
|
|
||||||
Log.e("Check-Cut: ",""+Helper.getArrayList("ListCutting", getActivity()));
|
//Log.e("Check-Cut: ",""+Helper.getArrayList("ListCutting", getActivity()));
|
||||||
if (Helper.getArrayList("ListCutting", getActivity()) != null) {
|
if (Helper.getArrayList(Helper.listCutting, getActivity()) != null) {
|
||||||
itemModelList.clear();
|
itemModelList.clear();
|
||||||
itemModelList.addAll(Helper.getArrayList("ListCutting", getActivity()));
|
itemModelList.addAll(Helper.getArrayList(Helper.listCutting, getActivity()));
|
||||||
Log.e("itemModelList-size: ", "" + itemModelList.size());
|
//Log.e("itemModelList-size: ", "" + itemModelList.size());
|
||||||
|
|
||||||
if (itemModelList != null) {
|
if (itemModelList != null) {
|
||||||
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
||||||
|
@ -213,7 +211,7 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
|
|
||||||
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
||||||
|
|
||||||
for (ItemModel item : updatedItemList) {
|
/*for (ItemModel item : updatedItemList) {
|
||||||
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
||||||
", StepId: " + item.getStepId() +
|
", StepId: " + item.getStepId() +
|
||||||
", SpinnerSelection: " + item.getSelectedOption() +
|
", SpinnerSelection: " + item.getSelectedOption() +
|
||||||
|
@ -221,10 +219,9 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
", Percentage: " + item.getPercentage() +
|
", Percentage: " + item.getPercentage() +
|
||||||
", Remarks: " + item.getRemarks() +
|
", Remarks: " + item.getRemarks() +
|
||||||
", ImageList: " + item.getImageArrayList());
|
", ImageList: " + item.getImageArrayList());
|
||||||
}
|
}*/
|
||||||
|
|
||||||
Helper.saveArrayList(itemModelList, "ListCutting", getActivity());
|
Helper.saveArrayList(itemModelList, Helper.listCutting, getActivity());
|
||||||
viewModel.appendToQualityControlItemList(itemModelList);
|
|
||||||
|
|
||||||
/*Log.e("Cutting: ","----------------");
|
/*Log.e("Cutting: ","----------------");
|
||||||
Log.e("Sort: ",""+sharedViewModel.getCuttingSort());
|
Log.e("Sort: ",""+sharedViewModel.getCuttingSort());
|
||||||
|
@ -309,8 +306,6 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
|
|
||||||
private void initializeLayout(View view) {
|
private void initializeLayout(View view) {
|
||||||
|
|
||||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
|
||||||
|
|
||||||
etPercentage = view.findViewById(R.id.et_percentage);
|
etPercentage = view.findViewById(R.id.et_percentage);
|
||||||
etRemarks = view.findViewById(R.id.et_remarks);
|
etRemarks = view.findViewById(R.id.et_remarks);
|
||||||
imagePicker = view.findViewById(R.id.image_picker);
|
imagePicker = view.findViewById(R.id.image_picker);
|
||||||
|
@ -563,4 +558,40 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
.show();
|
.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isValidate(int rateCutting, int rateStitching, int rateChecking, int ratePacking, int rateSub) {
|
||||||
|
boolean returnValue = true;
|
||||||
|
String message = "";
|
||||||
|
|
||||||
|
if (rateSub == 0) {
|
||||||
|
message = "Please rate SubStore Process.";
|
||||||
|
returnValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ratePacking == 0) {
|
||||||
|
message = "Please rate Packing Process.";
|
||||||
|
returnValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rateChecking == 0) {
|
||||||
|
message = "Please rate Checking Process.";
|
||||||
|
returnValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rateStitching == 0) {
|
||||||
|
message = "Please rate Stitching Process.";
|
||||||
|
returnValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rateCutting == 0) {
|
||||||
|
message = "Please rate Cutting Process.";
|
||||||
|
returnValue = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!returnValue) {
|
||||||
|
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
return returnValue;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -34,9 +34,7 @@ import com.utopiaindustries.qualitycontrol.models.Department;
|
||||||
import com.utopiaindustries.qualitycontrol.models.LocationFloor;
|
import com.utopiaindustries.qualitycontrol.models.LocationFloor;
|
||||||
import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
||||||
import com.utopiaindustries.qualitycontrol.models.LocationUnit;
|
import com.utopiaindustries.qualitycontrol.models.LocationUnit;
|
||||||
import com.utopiaindustries.qualitycontrol.models.QualityControlProcess;
|
|
||||||
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
||||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
|
||||||
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
@ -47,7 +45,7 @@ import java.util.Locale;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnItemClickListener{
|
public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnItemClickListener {
|
||||||
|
|
||||||
AutoCompleteTextView locationSiteTextview, unitTextview, floorTextview;
|
AutoCompleteTextView locationSiteTextview, unitTextview, floorTextview;
|
||||||
TextView txtCurrentDate;
|
TextView txtCurrentDate;
|
||||||
|
@ -71,7 +69,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
List<Department> filteredList;
|
List<Department> filteredList;
|
||||||
private DepartmentItemAdapter departmentItemAdapter;
|
private DepartmentItemAdapter departmentItemAdapter;
|
||||||
QualityControlViewModel viewModel;
|
boolean isFromPrevious = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
@ -90,9 +88,9 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
unitTextview.setText("Select Unit");
|
unitTextview.setText("Select Unit");
|
||||||
floorTextview.setText("Select Floor");
|
floorTextview.setText("Select Floor");
|
||||||
|
|
||||||
viewModel.setLocation(String.valueOf(clickedItem.getId()));
|
//viewModel.setLocation(String.valueOf(clickedItem.getId()));
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.locationSiteId,getActivity(),String.valueOf(clickedItem.getId()));
|
Preference.setMyStringPref(Helper.project_file, Helper.locationSiteId, getActivity(), String.valueOf(clickedItem.getId()));
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.locationSiteName,getActivity(),String.valueOf(clickedItem.getTitle()));
|
Preference.setMyStringPref(Helper.project_file, Helper.locationSiteName, getActivity(), String.valueOf(clickedItem.getTitle()));
|
||||||
|
|
||||||
if (!locationUnitList.isEmpty()) {
|
if (!locationUnitList.isEmpty()) {
|
||||||
List<LocationUnit> filteredUnitItems = locationUnitList.stream()
|
List<LocationUnit> filteredUnitItems = locationUnitList.stream()
|
||||||
|
@ -116,10 +114,10 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
LocationUnit clickedItem = locationUnitListFiltered.get(position);
|
LocationUnit clickedItem = locationUnitListFiltered.get(position);
|
||||||
|
|
||||||
viewModel.setUnit(String.valueOf(clickedItem.getId()));
|
//viewModel.setUnit(String.valueOf(clickedItem.getId()));
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.unitId,getActivity(),String.valueOf(clickedItem.getId()));
|
Preference.setMyStringPref(Helper.project_file, Helper.unitId, getActivity(), String.valueOf(clickedItem.getId()));
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.unitName,getActivity(),String.valueOf(clickedItem.getTitle()));
|
Preference.setMyStringPref(Helper.project_file, Helper.unitName, getActivity(), String.valueOf(clickedItem.getTitle()));
|
||||||
int targetSiteId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file,Helper.locationSiteId,getActivity()));
|
int targetSiteId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file, Helper.locationSiteId, getActivity()));
|
||||||
//Log.e("SiteId: ",""+targetSiteId);
|
//Log.e("SiteId: ",""+targetSiteId);
|
||||||
//Log.e("UnitId: ",""+clickedItem.getId());
|
//Log.e("UnitId: ",""+clickedItem.getId());
|
||||||
|
|
||||||
|
@ -144,26 +142,25 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||||
LocationFloor clickedItem = locationFloorListFiltered.get(position);
|
LocationFloor clickedItem = locationFloorListFiltered.get(position);
|
||||||
viewModel.setFloor(String.valueOf(clickedItem.getId()));
|
//viewModel.setFloor(String.valueOf(clickedItem.getId()));
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.floorId,getActivity(),String.valueOf(clickedItem.getId()));
|
Preference.setMyStringPref(Helper.project_file, Helper.floorId, getActivity(), String.valueOf(clickedItem.getId()));
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.floorName,getActivity(),String.valueOf(clickedItem.getTitle()));
|
Preference.setMyStringPref(Helper.project_file, Helper.floorName, getActivity(), String.valueOf(clickedItem.getTitle()));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
nextButton.setOnClickListener(v -> {
|
nextButton.setOnClickListener(v -> {
|
||||||
if (getActivity() instanceof HomeActivity) {
|
if (getActivity() instanceof HomeActivity) {
|
||||||
viewModel.setFromViewModel(true);
|
//viewModel.setFromViewModel(true);
|
||||||
String siteID = Preference.getMyStringPref(Helper.project_file,Helper.locationSiteId,getActivity());
|
// Preference.setMyStringPref(Helper.project_file, Helper.InProcess, getActivity(), "true");
|
||||||
String unitId = Preference.getMyStringPref(Helper.project_file,Helper.unitId,getActivity());
|
String siteID = Preference.getMyStringPref(Helper.project_file, Helper.locationSiteId, getActivity());
|
||||||
String departId = Preference.getMyStringPref(Helper.project_file,Helper.departmentId,getActivity());
|
String unitId = Preference.getMyStringPref(Helper.project_file, Helper.unitId, getActivity());
|
||||||
String floorId = Preference.getMyStringPref(Helper.project_file,Helper.floorId,getActivity());
|
String departId = Preference.getMyStringPref(Helper.project_file, Helper.departmentId, getActivity());
|
||||||
Log.e("AdapterData", "siteID: " + siteID +
|
String floorId = Preference.getMyStringPref(Helper.project_file, Helper.floorId, getActivity());
|
||||||
", unitId: " + unitId +
|
Log.e("AdapterData", "siteID: " + siteID + ", unitId: " + unitId +
|
||||||
", departId: " + departId +
|
", departId: " + departId + ", floorId: " + floorId);
|
||||||
", floorId: " + floorId );
|
|
||||||
|
|
||||||
if (isValidate(departId,siteID,unitId,floorId)) {
|
if (isValidate(departId, siteID, unitId, floorId)) {
|
||||||
((HomeActivity) getActivity()).navigateToFragment(new CuttingFragment(), true);
|
((HomeActivity) getActivity()).navigateToFragment(new CuttingFragment(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,27 +171,20 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
Log.e("beforeTextChanged: ","------");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
Log.e("onTextChanged: ","------");
|
||||||
filterList(s.toString());
|
filterList(s.toString());
|
||||||
|
|
||||||
if (s.length() > 0) {
|
|
||||||
if (viewModel.isFromViewModel()) {
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
recyclerView.setVisibility(View.VISIBLE); // Show the list when typing
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
recyclerView.setVisibility(View.GONE); // Hide when no text is entered
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterTextChanged(Editable s) {
|
public void afterTextChanged(Editable s) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
|
Log.e("afterTextChanged: ","------");
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -208,7 +198,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
|
|
||||||
public void initializeLayout(View view) {
|
public void initializeLayout(View view) {
|
||||||
|
|
||||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
//viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||||
|
|
||||||
txtCurrentDate = view.findViewById(R.id.txt_current_date);
|
txtCurrentDate = view.findViewById(R.id.txt_current_date);
|
||||||
locationSiteTextview = view.findViewById(R.id.location_textview);
|
locationSiteTextview = view.findViewById(R.id.location_textview);
|
||||||
|
@ -218,6 +208,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
nextButton = view.findViewById(R.id.btn_next);
|
nextButton = view.findViewById(R.id.btn_next);
|
||||||
|
|
||||||
searchEditText = view.findViewById(R.id.searchEditText);
|
searchEditText = view.findViewById(R.id.searchEditText);
|
||||||
|
|
||||||
recyclerView = view.findViewById(R.id.recyclerView);
|
recyclerView = view.findViewById(R.id.recyclerView);
|
||||||
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
@ -225,9 +216,12 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
loginViewModel = new ViewModelProvider(getActivity()).get(LoginViewModel.class);
|
loginViewModel = new ViewModelProvider(getActivity()).get(LoginViewModel.class);
|
||||||
|
|
||||||
loginViewModel.getLoadingState().observe(getActivity(), isLoading -> {
|
loginViewModel.getLoadingState().observe(getActivity(), isLoading -> {
|
||||||
|
//Log.e("HomeFragment: ", "isLoading: ");
|
||||||
if (isLoading != null && isLoading) {
|
if (isLoading != null && isLoading) {
|
||||||
|
//Log.e("HomeFragment: ", "isLoading:show ");
|
||||||
showProgressDialog();
|
showProgressDialog();
|
||||||
} else {
|
} else {
|
||||||
|
//Log.e("HomeFragment: ", "isLoading: dismiss");
|
||||||
dismissProgressDialog();
|
dismissProgressDialog();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -240,16 +234,11 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
if (qcResponse != null) {
|
if (qcResponse != null) {
|
||||||
|
|
||||||
Helper.setPreferenceObject(getActivity().getApplicationContext(), qcResponse, "qcResponse");
|
Helper.setPreferenceObject(getActivity().getApplicationContext(), qcResponse, "qcResponse");
|
||||||
if (!Preference.getMyStringPref(Helper.project_file, Helper.departmentName, getActivity()).equalsIgnoreCase("default")) {
|
|
||||||
searchEditText.setText(Preference.getMyStringPref(Helper.project_file, Helper.departmentName, getActivity()));
|
|
||||||
locationSiteTextview.setText(Preference.getMyStringPref(Helper.project_file, Helper.locationSiteName,getActivity()));
|
|
||||||
unitTextview.setText(Preference.getMyStringPref(Helper.project_file, Helper.unitName, getActivity()));
|
|
||||||
floorTextview.setText(Preference.getMyStringPref(Helper.project_file, Helper.floorName, getActivity()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!qcResponse.getLocationSites().isEmpty()) {
|
if (!qcResponse.getLocationSites().isEmpty()) {
|
||||||
|
|
||||||
viewModel.setLocationSiteList(qcResponse.getLocationSites());
|
//viewModel.setLocationSiteList(qcResponse.getLocationSites());
|
||||||
|
Helper.saveList(qcResponse.getLocationSites(), Helper.homeSite, getActivity());
|
||||||
|
|
||||||
locationSiteList.addAll(qcResponse.getLocationSites());
|
locationSiteList.addAll(qcResponse.getLocationSites());
|
||||||
|
|
||||||
|
@ -260,7 +249,9 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
|
|
||||||
if (!qcResponse.getDepartments().isEmpty()) {
|
if (!qcResponse.getDepartments().isEmpty()) {
|
||||||
|
|
||||||
viewModel.setDepartmentList(qcResponse.getDepartments());
|
// viewModel.setDepartmentList(qcResponse.getDepartments());
|
||||||
|
Helper.saveList(qcResponse.getDepartments(), Helper.homeDepartment, getActivity());
|
||||||
|
|
||||||
departmentList.addAll(qcResponse.getDepartments());
|
departmentList.addAll(qcResponse.getDepartments());
|
||||||
filteredList = new ArrayList<>(departmentList);
|
filteredList = new ArrayList<>(departmentList);
|
||||||
|
|
||||||
|
@ -271,35 +262,55 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qcResponse.getLocationFloors().isEmpty()) {
|
if (!qcResponse.getLocationFloors().isEmpty()) {
|
||||||
viewModel.setFloorList(qcResponse.getLocationFloors());
|
// viewModel.setFloorList(qcResponse.getLocationFloors());
|
||||||
|
Helper.saveList(qcResponse.getLocationFloors(), Helper.homeFloor, getActivity());
|
||||||
locationFloorList.addAll(qcResponse.getLocationFloors());
|
locationFloorList.addAll(qcResponse.getLocationFloors());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qcResponse.getLocationUnits().isEmpty()) {
|
if (!qcResponse.getLocationUnits().isEmpty()) {
|
||||||
viewModel.setUnitList(qcResponse.getLocationUnits());
|
// viewModel.setUnitList(qcResponse.getLocationUnits());
|
||||||
|
Helper.saveList(qcResponse.getLocationUnits(), Helper.homeUnit, getActivity());
|
||||||
locationUnitList.addAll(qcResponse.getLocationUnits());
|
locationUnitList.addAll(qcResponse.getLocationUnits());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Preference.setMyStringPref(Helper.project_file, Helper.firstTimeApiCall, getActivity(), "true");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getActivity(), "Fetching Records Failed", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "Fetching Records Failed", Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*if (viewModel.getLocationSiteList().isEmpty()) {
|
if (Preference.getMyStringPref(Helper.project_file, Helper.firstTimeApiCall, getActivity()).equalsIgnoreCase("false") ||
|
||||||
|
Preference.getMyStringPref(Helper.project_file, Helper.firstTimeApiCall, getActivity()).equalsIgnoreCase("default")) {
|
||||||
|
|
||||||
loginViewModel.getQualityControlData();
|
loginViewModel.getQualityControlData();
|
||||||
}
|
} else {
|
||||||
else {
|
if (!Preference.getMyStringPref(Helper.project_file, Helper.departmentName, getActivity()).equalsIgnoreCase("default")) {
|
||||||
|
searchEditText.setText(Preference.getMyStringPref(Helper.project_file, Helper.departmentName, getActivity()));
|
||||||
|
isFromPrevious = true;
|
||||||
|
locationSiteTextview.setText(Preference.getMyStringPref(Helper.project_file, Helper.locationSiteName, getActivity()));
|
||||||
|
unitTextview.setText(Preference.getMyStringPref(Helper.project_file, Helper.unitName, getActivity()));
|
||||||
|
floorTextview.setText(Preference.getMyStringPref(Helper.project_file, Helper.floorName, getActivity()));
|
||||||
|
}
|
||||||
|
|
||||||
|
departmentList.clear();
|
||||||
|
locationSiteList.clear();
|
||||||
|
locationUnitList.clear();
|
||||||
|
locationFloorList.clear();
|
||||||
//location list
|
//location list
|
||||||
locationSiteList.addAll(viewModel.getLocationSiteList());
|
//locationSiteList.addAll(viewModel.getLocationSiteList());
|
||||||
Log.e("locationSiteList-size: ",""+locationSiteList.size());
|
locationSiteList.addAll(Helper.getList(Helper.homeSite, getActivity(), LocationSite.class));
|
||||||
|
Log.e("locationSiteList-size: ", "" + locationSiteList.size());
|
||||||
|
|
||||||
locationSitesAdapter = new LocationSitesAdapter(getActivity(), locationSiteList);
|
locationSitesAdapter = new LocationSitesAdapter(getActivity(), locationSiteList);
|
||||||
locationSiteTextview.setAdapter(locationSitesAdapter);
|
locationSiteTextview.setAdapter(locationSitesAdapter);
|
||||||
|
|
||||||
//department list
|
//department list
|
||||||
departmentList.addAll(viewModel.getDepartmentList());
|
//departmentList.addAll(viewModel.getDepartmentList());
|
||||||
Log.e("departmentList-size: ",""+departmentList.size());
|
departmentList.addAll(Helper.getList(Helper.homeDepartment, getActivity(), Department.class));
|
||||||
|
Log.e("departmentList-size: ", "" + departmentList.size());
|
||||||
|
|
||||||
//filteredList = new ArrayList<>(departmentList);
|
filteredList = new ArrayList<>(departmentList);
|
||||||
|
|
||||||
// Set up RecyclerView
|
// Set up RecyclerView
|
||||||
departmentItemAdapter = new DepartmentItemAdapter(filteredList, this, searchEditText, recyclerView);
|
departmentItemAdapter = new DepartmentItemAdapter(filteredList, this, searchEditText, recyclerView);
|
||||||
|
@ -307,40 +318,35 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
recyclerView.setAdapter(departmentItemAdapter);
|
recyclerView.setAdapter(departmentItemAdapter);
|
||||||
|
|
||||||
//unit list
|
//unit list
|
||||||
locationUnitList.addAll(viewModel.getUnitList());
|
//locationUnitList.addAll(viewModel.getUnitList());
|
||||||
Log.e("locationUnitList-size: ",""+locationUnitList.size());
|
locationUnitList.addAll(Helper.getList(Helper.homeUnit, getActivity(), LocationUnit.class));
|
||||||
|
Log.e("locationUnitList-size: ", "" + locationUnitList.size());
|
||||||
|
|
||||||
//floor list
|
//floor list
|
||||||
locationFloorList.addAll(viewModel.getFloorList());
|
//locationFloorList.addAll(viewModel.getFloorList());
|
||||||
Log.e("locationFloorList-size: ",""+locationFloorList.size());
|
locationFloorList.addAll(Helper.getList(Helper.homeFloor, getActivity(), LocationFloor.class));
|
||||||
|
Log.e("locationFloorList-size: ", "" + locationFloorList.size());
|
||||||
|
|
||||||
recyclerView.setVisibility(View.GONE);
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
|
||||||
}*/
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
Log.e("onResume: ","HomeFragment");
|
|
||||||
departmentList.clear();
|
|
||||||
locationSiteList.clear();
|
|
||||||
locationUnitList.clear();
|
|
||||||
locationFloorList.clear();
|
|
||||||
loginViewModel.getQualityControlData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showProgressDialog() {
|
public void showProgressDialog() {
|
||||||
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
||||||
progressDialog.setCancelable(false);
|
progressDialog.setCancelable(false);
|
||||||
progressDialog.show(getActivity().getSupportFragmentManager(), "progressDialog");
|
progressDialog.show(requireActivity().getSupportFragmentManager(), "progressDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismissProgressDialog() {
|
public void dismissProgressDialog() {
|
||||||
ProgressDialogFragment progressDialog = (ProgressDialogFragment)
|
ProgressDialogFragment progressDialog = (ProgressDialogFragment)
|
||||||
getActivity().getSupportFragmentManager().findFragmentByTag("progressDialog");
|
requireActivity().getSupportFragmentManager().findFragmentByTag("progressDialog");
|
||||||
if (progressDialog != null) {
|
if (progressDialog != null) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
@ -353,7 +359,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
// Hide the RecyclerView when there's no query
|
// Hide the RecyclerView when there's no query
|
||||||
recyclerView.setVisibility(View.GONE);
|
recyclerView.setVisibility(View.GONE);
|
||||||
} else {
|
} else {
|
||||||
// Show RecyclerView when there's a query
|
|
||||||
recyclerView.setVisibility(View.VISIBLE);
|
recyclerView.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
for (Department item : departmentList) {
|
for (Department item : departmentList) {
|
||||||
|
@ -363,16 +369,21 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
departmentItemAdapter.notifyDataSetChanged();
|
departmentItemAdapter.notifyDataSetChanged();
|
||||||
}
|
|
||||||
|
|
||||||
|
if (isFromPrevious) {
|
||||||
|
isFromPrevious = false;
|
||||||
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(Department item) {
|
public void onItemClick(Department item) {
|
||||||
//Toast.makeText(getActivity(), "Selected: " + item.getTitle(), Toast.LENGTH_SHORT).show();
|
//Toast.makeText(getActivity(), "Selected: " + item.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
viewModel.setDepartmentId(item.getId());
|
//viewModel.setDepartmentId(item.getId());
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.departmentId,getActivity(),String.valueOf(item.getId()));
|
Preference.setMyStringPref(Helper.project_file, Helper.departmentId, getActivity(), String.valueOf(item.getId()));
|
||||||
Preference.setMyStringPref(Helper.project_file,Helper.departmentName,getActivity(),String.valueOf(item.getTitle()));
|
Preference.setMyStringPref(Helper.project_file, Helper.departmentName, getActivity(), String.valueOf(item.getTitle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isValidate(String departId, String siteId, String unitId, String floorId) {
|
public boolean isValidate(String departId, String siteId, String unitId, String floorId) {
|
||||||
|
@ -400,7 +411,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!returnValue) {
|
if (!returnValue) {
|
||||||
Toast.makeText(getActivity(),message,Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), message, Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
return returnValue;
|
return returnValue;
|
||||||
|
|
|
@ -74,7 +74,6 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
|
|
||||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||||
EditText etPercentage, etRemarks;
|
EditText etPercentage, etRemarks;
|
||||||
QualityControlViewModel viewModel;
|
|
||||||
List<ItemModel> itemModelList = new ArrayList<>();
|
List<ItemModel> itemModelList = new ArrayList<>();
|
||||||
ItemStepsAdapter adapter;
|
ItemStepsAdapter adapter;
|
||||||
private int selectedPosition = -1;
|
private int selectedPosition = -1;
|
||||||
|
@ -86,7 +85,7 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedPosition != -1 && selectedImage != null) {
|
if (selectedPosition != -1 && selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
|
|
||||||
uriToByteArrayAsync(
|
uriToByteArrayAsync(
|
||||||
getContext(),
|
getContext(),
|
||||||
|
@ -140,13 +139,13 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
Log.e("contentUri: ", "" + contentUri);
|
//Log.e("contentUri: ", "" + contentUri);
|
||||||
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
||||||
|
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedImage != null) {
|
if (selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -168,10 +167,10 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
itemList.add(new Item("Safety", 0));*/
|
itemList.add(new Item("Safety", 0));*/
|
||||||
|
|
||||||
//New Implemented------------------
|
//New Implemented------------------
|
||||||
if (Helper.getArrayList("ListPacking", getActivity()) != null) {
|
if (Helper.getArrayList(Helper.listPacking, getActivity()) != null) {
|
||||||
itemModelList.clear();
|
itemModelList.clear();
|
||||||
itemModelList.addAll(Helper.getArrayList("ListPacking", getActivity()));
|
itemModelList.addAll(Helper.getArrayList(Helper.listPacking, getActivity()));
|
||||||
Log.e("itemModelList-size: ",""+itemModelList.size());
|
//Log.e("itemModelList-size: ",""+itemModelList.size());
|
||||||
|
|
||||||
if (itemModelList != null) {
|
if (itemModelList != null) {
|
||||||
adapter = new ItemStepsAdapter(getActivity(), itemModelList,this);
|
adapter = new ItemStepsAdapter(getActivity(), itemModelList,this);
|
||||||
|
@ -220,7 +219,7 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
|
|
||||||
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
||||||
|
|
||||||
for (ItemModel item : updatedItemList) {
|
/*for (ItemModel item : updatedItemList) {
|
||||||
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
||||||
", StepId: " + item.getStepId() +
|
", StepId: " + item.getStepId() +
|
||||||
", SpinnerSelection: " + item.getSelectedOption() +
|
", SpinnerSelection: " + item.getSelectedOption() +
|
||||||
|
@ -228,12 +227,11 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
", Percentage: " + item.getPercentage() +
|
", Percentage: " + item.getPercentage() +
|
||||||
", Remarks: " + item.getRemarks() +
|
", Remarks: " + item.getRemarks() +
|
||||||
", ImageList: " + item.getImageArrayList());
|
", ImageList: " + item.getImageArrayList());
|
||||||
}
|
}*/
|
||||||
|
|
||||||
Helper.saveArrayList(itemModelList, "ListPacking",getActivity());
|
Helper.saveArrayList(itemModelList, Helper.listPacking,getActivity());
|
||||||
viewModel.appendToQualityControlItemList(itemModelList);
|
|
||||||
|
|
||||||
List<ItemModel> updatedItemListP = new ArrayList<>(Helper.getArrayList("ListPacking", getActivity()));
|
//List<ItemModel> updatedItemListP = new ArrayList<>(Helper.getArrayList("ListPacking", getActivity()));
|
||||||
|
|
||||||
/*if (etRemarks.getText().toString().isEmpty()) {
|
/*if (etRemarks.getText().toString().isEmpty()) {
|
||||||
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
||||||
|
@ -259,8 +257,6 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
|
|
||||||
private void initializeLayout(View view) {
|
private void initializeLayout(View view) {
|
||||||
|
|
||||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
|
||||||
|
|
||||||
etPercentage = view.findViewById(R.id.et_percentage);
|
etPercentage = view.findViewById(R.id.et_percentage);
|
||||||
etRemarks = view.findViewById(R.id.et_remarks);
|
etRemarks = view.findViewById(R.id.et_remarks);
|
||||||
imagePicker = view.findViewById(R.id.image_picker);
|
imagePicker = view.findViewById(R.id.image_picker);
|
||||||
|
|
|
@ -76,7 +76,6 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
|
|
||||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||||
EditText etPercentage, etRemarks;
|
EditText etPercentage, etRemarks;
|
||||||
QualityControlViewModel viewModel;
|
|
||||||
List<ItemModel> itemModelList = new ArrayList<>();
|
List<ItemModel> itemModelList = new ArrayList<>();
|
||||||
ItemStepsAdapter adapter;
|
ItemStepsAdapter adapter;
|
||||||
private int selectedPosition = -1;
|
private int selectedPosition = -1;
|
||||||
|
@ -88,7 +87,7 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedPosition != -1 && selectedImage != null) {
|
if (selectedPosition != -1 && selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
|
|
||||||
uriToByteArrayAsync(
|
uriToByteArrayAsync(
|
||||||
getContext(),
|
getContext(),
|
||||||
|
@ -142,13 +141,13 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
Log.e("contentUri: ", "" + contentUri);
|
//Log.e("contentUri: ", "" + contentUri);
|
||||||
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
if (result.getResultCode() == requireActivity().RESULT_OK && result.getData() != null) {
|
||||||
|
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedImage != null) {
|
if (selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
//Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -167,10 +166,10 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
recyclerView.setAdapter(adapter);*/
|
recyclerView.setAdapter(adapter);*/
|
||||||
|
|
||||||
//New Implemented------------------
|
//New Implemented------------------
|
||||||
if (Helper.getArrayList("ListStitching", getActivity()) != null) {
|
if (Helper.getArrayList(Helper.listStitching, getActivity()) != null) {
|
||||||
itemModelList.clear();
|
itemModelList.clear();
|
||||||
itemModelList.addAll(Helper.getArrayList("ListStitching", getActivity()));
|
itemModelList.addAll(Helper.getArrayList(Helper.listStitching, getActivity()));
|
||||||
Log.e("itemModelList-size: ",""+itemModelList.size());
|
//Log.e("itemModelList-size: ",""+itemModelList.size());
|
||||||
|
|
||||||
if (itemModelList != null) {
|
if (itemModelList != null) {
|
||||||
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
||||||
|
@ -219,7 +218,7 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
|
|
||||||
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
||||||
|
|
||||||
for (ItemModel item : updatedItemList) {
|
/*for (ItemModel item : updatedItemList) {
|
||||||
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
||||||
", StepId: " + item.getStepId() +
|
", StepId: " + item.getStepId() +
|
||||||
", SpinnerSelection: " + item.getSelectedOption() +
|
", SpinnerSelection: " + item.getSelectedOption() +
|
||||||
|
@ -227,12 +226,11 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
", Percentage: " + item.getPercentage() +
|
", Percentage: " + item.getPercentage() +
|
||||||
", Remarks: " + item.getRemarks() +
|
", Remarks: " + item.getRemarks() +
|
||||||
", ImageList: " + item.getImageArrayList());
|
", ImageList: " + item.getImageArrayList());
|
||||||
}
|
}*/
|
||||||
|
|
||||||
Helper.saveArrayList(itemModelList, "ListStitching",getActivity());
|
Helper.saveArrayList(itemModelList, Helper.listStitching,getActivity());
|
||||||
viewModel.appendToQualityControlItemList(itemModelList);
|
|
||||||
|
|
||||||
List<ItemModel> updatedItemListP = new ArrayList<>(Helper.getArrayList("ListStitching", getActivity()));
|
//List<ItemModel> updatedItemListP = new ArrayList<>(Helper.getArrayList("ListStitching", getActivity()));
|
||||||
|
|
||||||
|
|
||||||
/*if (etRemarks.getText().toString().isEmpty()) {
|
/*if (etRemarks.getText().toString().isEmpty()) {
|
||||||
|
@ -259,7 +257,7 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
|
|
||||||
private void initializeLayout(View view) {
|
private void initializeLayout(View view) {
|
||||||
|
|
||||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
//viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||||
|
|
||||||
etPercentage = view.findViewById(R.id.et_percentage);
|
etPercentage = view.findViewById(R.id.et_percentage);
|
||||||
etRemarks = view.findViewById(R.id.et_remarks);
|
etRemarks = view.findViewById(R.id.et_remarks);
|
||||||
|
|
|
@ -43,10 +43,8 @@ import com.utopiaindustries.qualitycontrol.helper.Helper;
|
||||||
import com.utopiaindustries.qualitycontrol.helper.Preference;
|
import com.utopiaindustries.qualitycontrol.helper.Preference;
|
||||||
import com.utopiaindustries.qualitycontrol.utils.ImageSelectionListener;
|
import com.utopiaindustries.qualitycontrol.utils.ImageSelectionListener;
|
||||||
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
||||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
|
||||||
import com.utopiaindustries.qualitycontrol.viewmodels.HomeViewModel;
|
import com.utopiaindustries.qualitycontrol.viewmodels.HomeViewModel;
|
||||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||||
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
|
||||||
import com.utopiaindustries.qualitycontrol.viewmodels.QualityControl;
|
import com.utopiaindustries.qualitycontrol.viewmodels.QualityControl;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -55,7 +53,6 @@ import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
@ -80,7 +77,7 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
|
|
||||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||||
EditText etPercentage, etRemarks;
|
EditText etPercentage, etRemarks;
|
||||||
QualityControlViewModel viewModel;
|
//QualityControlViewModel viewModel;
|
||||||
List<ItemModel> itemModelList = new ArrayList<>();
|
List<ItemModel> itemModelList = new ArrayList<>();
|
||||||
ItemStepsAdapter adapter;
|
ItemStepsAdapter adapter;
|
||||||
private int selectedPosition = -1;
|
private int selectedPosition = -1;
|
||||||
|
@ -151,7 +148,7 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
Uri selectedImage = result.getData().getData();
|
Uri selectedImage = result.getData().getData();
|
||||||
if (selectedImage != null) {
|
if (selectedImage != null) {
|
||||||
//imageView.setImageURI(selectedImage);
|
//imageView.setImageURI(selectedImage);
|
||||||
Log.e("Selected-Image: ", "" + selectedImage);
|
// Log.e("Selected-Image: ", "" + selectedImage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -173,29 +170,27 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
itemList.add(new Item("Safety", 0));*/
|
itemList.add(new Item("Safety", 0));*/
|
||||||
|
|
||||||
//New Implemented------------------
|
//New Implemented------------------
|
||||||
if (Helper.getArrayList("ListSubStore", getActivity()) != null) {
|
if (Helper.getArrayList(Helper.listSubStore, getActivity()) != null) {
|
||||||
itemModelList.clear();
|
itemModelList.clear();
|
||||||
itemModelList.addAll(Helper.getArrayList("ListSubStore", getActivity()));
|
itemModelList.addAll(Helper.getArrayList(Helper.listSubStore, getActivity()));
|
||||||
Log.e("itemModelList-size: ",""+itemModelList.size());
|
//Log.e("itemModelList-size: ",""+itemModelList.size());
|
||||||
|
|
||||||
if (itemModelList != null) {
|
if (itemModelList != null) {
|
||||||
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (int i = 1; i < 7; i++) {
|
for (int i = 1; i < 7; i++) {
|
||||||
itemModelList.add(new ItemModel(5,i,0,"0","",0, null, null));
|
itemModelList.add(new ItemModel(5, i, 0, "0", "", 0, null, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
for (int i = 1; i < 7; i++) {
|
for (int i = 1; i < 7; i++) {
|
||||||
itemModelList.add(new ItemModel(5,i,0,"0","",0, null, null));
|
itemModelList.add(new ItemModel(5, i, 0, "0", "", 0, null, null));
|
||||||
}
|
}
|
||||||
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
adapter = new ItemStepsAdapter(getActivity(), itemModelList, this);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
@ -225,35 +220,6 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
getActivity().finish();*/
|
getActivity().finish();*/
|
||||||
|
|
||||||
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
|
||||||
|
|
||||||
for (ItemModel item : updatedItemList) {
|
|
||||||
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
|
||||||
", StepId: " + item.getStepId() +
|
|
||||||
", SpinnerSelection: " + item.getSelectedOption() +
|
|
||||||
", Rating: " + item.getRating() +
|
|
||||||
", Percentage: " + item.getPercentage() +
|
|
||||||
", Remarks: " + item.getRemarks() +
|
|
||||||
", ImageList: " + item.getImageArrayList());
|
|
||||||
}
|
|
||||||
|
|
||||||
Helper.saveArrayList(itemModelList, "ListSubStore",getActivity());
|
|
||||||
viewModel.appendToQualityControlItemList(itemModelList);
|
|
||||||
|
|
||||||
int siteID = Integer.parseInt(Preference.getMyStringPref(Helper.project_file,Helper.locationSiteId,getActivity()));
|
|
||||||
int unitId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file,Helper.unitId,getActivity()));
|
|
||||||
int departId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file,Helper.departmentId,getActivity()));
|
|
||||||
int floorId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file,Helper.floorId,getActivity()));
|
|
||||||
|
|
||||||
List<ItemModel> tempList = new ArrayList<>();
|
|
||||||
tempList.addAll(Helper.getArrayList("ListCutting",getActivity()));
|
|
||||||
tempList.addAll(Helper.getArrayList("ListStitching",getActivity()));
|
|
||||||
tempList.addAll(Helper.getArrayList("ListChecking",getActivity()));
|
|
||||||
tempList.addAll(Helper.getArrayList("ListPacking",getActivity()));
|
|
||||||
tempList.addAll(Helper.getArrayList("ListSubStore",getActivity()));
|
|
||||||
|
|
||||||
QualityControl qualityControl = new QualityControl(siteID,unitId,departId,floorId,tempList);
|
|
||||||
|
|
||||||
/*Log.e("AdapterData", "siteID: " + siteID +
|
/*Log.e("AdapterData", "siteID: " + siteID +
|
||||||
", unitId: " + unitId +
|
", unitId: " + unitId +
|
||||||
", departId: " + departId +
|
", departId: " + departId +
|
||||||
|
@ -272,7 +238,47 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
", Image: " + Arrays.toString(item.getImageUri()));
|
", Image: " + Arrays.toString(item.getImageUri()));
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
homeViewModel.saveQualityControlData(qualityControl);
|
AlertDialog.Builder builder = new AlertDialog.Builder(requireContext());
|
||||||
|
builder.setTitle("Are you sure to save Report?")
|
||||||
|
.setItems(new String[]{"Yes", "Cancel"}, (dialog, which) -> {
|
||||||
|
if (which == 0) {
|
||||||
|
|
||||||
|
List<ItemModel> updatedItemList = itemModelList; // Or adapter.getItemList()
|
||||||
|
|
||||||
|
/*for (ItemModel item : updatedItemList) {
|
||||||
|
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
||||||
|
", StepId: " + item.getStepId() +
|
||||||
|
", SpinnerSelection: " + item.getSelectedOption() +
|
||||||
|
", Rating: " + item.getRating() +
|
||||||
|
", Percentage: " + item.getPercentage() +
|
||||||
|
", Remarks: " + item.getRemarks() +
|
||||||
|
", ImageList: " + item.getImageArrayList());
|
||||||
|
}*/
|
||||||
|
|
||||||
|
Helper.saveArrayList(itemModelList, Helper.listSubStore, getActivity());
|
||||||
|
//viewModel.appendToQualityControlItemList(itemModelList);
|
||||||
|
|
||||||
|
int siteID = Integer.parseInt(Preference.getMyStringPref(Helper.project_file, Helper.locationSiteId, getActivity()));
|
||||||
|
int unitId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file, Helper.unitId, getActivity()));
|
||||||
|
int departId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file, Helper.departmentId, getActivity()));
|
||||||
|
int floorId = Integer.parseInt(Preference.getMyStringPref(Helper.project_file, Helper.floorId, getActivity()));
|
||||||
|
|
||||||
|
List<ItemModel> tempList = new ArrayList<>();
|
||||||
|
tempList.addAll(Helper.getArrayList(Helper.listCutting, getActivity()));
|
||||||
|
tempList.addAll(Helper.getArrayList(Helper.listStitching, getActivity()));
|
||||||
|
tempList.addAll(Helper.getArrayList(Helper.listChecking, getActivity()));
|
||||||
|
tempList.addAll(Helper.getArrayList(Helper.listPacking, getActivity()));
|
||||||
|
tempList.addAll(Helper.getArrayList(Helper.listSubStore, getActivity()));
|
||||||
|
String generatedBy = Preference.getMyStringPref(Helper.project_file,Helper.logInUser,getActivity());
|
||||||
|
|
||||||
|
QualityControl qualityControl = new QualityControl(generatedBy, siteID, unitId, departId, floorId, tempList);
|
||||||
|
|
||||||
|
homeViewModel.saveQualityControlData(qualityControl);
|
||||||
|
} else {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -286,7 +292,7 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
|
|
||||||
private void initializeLayout(View view) {
|
private void initializeLayout(View view) {
|
||||||
|
|
||||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
//viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||||
homeViewModel = new ViewModelProvider(requireActivity()).get(HomeViewModel.class);
|
homeViewModel = new ViewModelProvider(requireActivity()).get(HomeViewModel.class);
|
||||||
|
|
||||||
etPercentage = view.findViewById(R.id.et_percentage);
|
etPercentage = view.findViewById(R.id.et_percentage);
|
||||||
|
@ -317,11 +323,35 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
|
|
||||||
homeViewModel.getUserLiveData().observe(getActivity(), qcResponse -> {
|
homeViewModel.getUserLiveData().observe(getActivity(), qcResponse -> {
|
||||||
if (qcResponse != null) {
|
if (qcResponse != null) {
|
||||||
Log.e("qcResponse: ",""+qcResponse);
|
/*Log.e("qcResponse: ", "" + qcResponse);
|
||||||
Log.e("","Status: " + qcResponse.getStatus() + "Message: " + qcResponse.getMessage() + "Percentage: " + qcResponse.getOverAllPercentage());
|
Log.e("","Status: " + qcResponse.getStatus() + " Message: " + qcResponse.getMessage() + " Percentage: " + qcResponse.getOverAllPercentage());
|
||||||
/*getActivity().finish();
|
Log.e("","Cut: " + qcResponse.getCutting() + " Stitch: " + qcResponse.getStiching() + " Check: " + qcResponse.getChecking());
|
||||||
|
Log.e("","Pack: " + qcResponse.getPacking() + " Substore: " + qcResponse.getSub_Store());*/
|
||||||
|
Preference.remove(Helper.project_file, Helper.departmentId, getActivity());
|
||||||
|
Preference.remove(Helper.project_file, Helper.departmentName, getActivity());
|
||||||
|
|
||||||
|
Preference.remove(Helper.project_file, Helper.locationSiteId, getActivity());
|
||||||
|
Preference.remove(Helper.project_file, Helper.locationSiteName, getActivity());
|
||||||
|
|
||||||
|
Preference.remove(Helper.project_file, Helper.unitId, getActivity());
|
||||||
|
Preference.remove(Helper.project_file, Helper.unitName, getActivity());
|
||||||
|
|
||||||
|
Preference.remove(Helper.project_file, Helper.floorId, getActivity());
|
||||||
|
Preference.remove(Helper.project_file, Helper.floorName, getActivity());
|
||||||
|
|
||||||
|
Helper.RemoveArrayList(Helper.listCutting,getActivity());
|
||||||
|
Helper.RemoveArrayList(Helper.listStitching,getActivity());
|
||||||
|
Helper.RemoveArrayList(Helper.listChecking,getActivity());
|
||||||
|
Helper.RemoveArrayList(Helper.listPacking,getActivity());
|
||||||
|
Helper.RemoveArrayList(Helper.listSubStore,getActivity());
|
||||||
|
|
||||||
|
//Preference.setMyStringPref(Helper.project_file, Helper.InProcess, getActivity(), "false");
|
||||||
|
|
||||||
|
getActivity().finish();
|
||||||
Intent intent = new Intent(getActivity(), SummaryActivity.class);
|
Intent intent = new Intent(getActivity(), SummaryActivity.class);
|
||||||
startActivity(intent);*/
|
intent.putExtra("Percentage", qcResponse.getOverAllPercentage());
|
||||||
|
intent.putExtra("Summary", qcResponse);
|
||||||
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -560,11 +590,11 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
public void showProgressDialog() {
|
public void showProgressDialog() {
|
||||||
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
||||||
progressDialog.setCancelable(false);
|
progressDialog.setCancelable(false);
|
||||||
progressDialog.show(getActivity().getSupportFragmentManager(), "progressDialog");
|
progressDialog.show(requireActivity().getSupportFragmentManager(), "progressDialog");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dismissProgressDialog() {
|
public void dismissProgressDialog() {
|
||||||
ProgressDialogFragment progressDialog = (ProgressDialogFragment) getActivity().getSupportFragmentManager().findFragmentByTag("progressDialog");
|
ProgressDialogFragment progressDialog = (ProgressDialogFragment) requireActivity().getSupportFragmentManager().findFragmentByTag("progressDialog");
|
||||||
if (progressDialog != null) {
|
if (progressDialog != null) {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import android.net.ConnectivityManager;
|
||||||
import android.net.NetworkInfo;
|
import android.net.NetworkInfo;
|
||||||
import androidx.preference.PreferenceManager;
|
import androidx.preference.PreferenceManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.reflect.TypeToken;
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
@ -29,6 +30,22 @@ public class Helper {
|
||||||
public static final String floorId = "floorId";
|
public static final String floorId = "floorId";
|
||||||
public static final String floorName = "floorName";
|
public static final String floorName = "floorName";
|
||||||
|
|
||||||
|
public static final String listCutting = "ListCutting";
|
||||||
|
public static final String listStitching = "ListStitching";
|
||||||
|
public static final String listChecking = "ListChecking";
|
||||||
|
public static final String listPacking = "ListPacking";
|
||||||
|
public static final String listSubStore = "ListSubStore";
|
||||||
|
|
||||||
|
public static final String homeSite = "Sites";
|
||||||
|
public static final String homeDepartment = "Departments";
|
||||||
|
public static final String homeUnit = "Units";
|
||||||
|
public static final String homeFloor = "Floors";
|
||||||
|
|
||||||
|
public static final String firstTimeApiCall = "isFirstTimeApiCall";
|
||||||
|
public static final String InProcess = "InProcess";
|
||||||
|
|
||||||
|
public static final String logInUser = "LogInUser";
|
||||||
|
|
||||||
public static boolean isValidEmail(CharSequence target) {
|
public static boolean isValidEmail(CharSequence target) {
|
||||||
return !TextUtils.isEmpty(target) && android.util.Patterns.EMAIL_ADDRESS.matcher(target).matches();
|
return !TextUtils.isEmpty(target) && android.util.Patterns.EMAIL_ADDRESS.matcher(target).matches();
|
||||||
}
|
}
|
||||||
|
@ -83,4 +100,40 @@ public class Helper {
|
||||||
Type type = new TypeToken<ArrayList<ItemModel>>() {}.getType();
|
Type type = new TypeToken<ArrayList<ItemModel>>() {}.getType();
|
||||||
return gson.fromJson(json, type);
|
return gson.fromJson(json, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public void RemoveArrayList(String key, Context context) {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
if (prefs.contains(key)) { // Check if the key exists
|
||||||
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
editor.remove(key); // Remove the key-value pair
|
||||||
|
editor.apply(); // Apply changes
|
||||||
|
Log.e("SharedPreferences", "Key '" + key + "' removed successfully.");
|
||||||
|
} else {
|
||||||
|
Log.e("SharedPreferences", "Key '" + key + "' does not exist.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//for department, site, unit, floor
|
||||||
|
public static <T> void saveList(List<T> list, String key, Context context) {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String json = gson.toJson(list); // Convert the list to JSON
|
||||||
|
editor.putString(key, json);
|
||||||
|
editor.apply(); // Save to SharedPreferences
|
||||||
|
}
|
||||||
|
|
||||||
|
public static <T> List<T> getList(String key, Context context, Class<T> clazz) {
|
||||||
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
|
||||||
|
// Check if the key exists
|
||||||
|
if (!prefs.contains(key)) {
|
||||||
|
return new ArrayList<>(); // Return an empty list if the key doesn't exist
|
||||||
|
}
|
||||||
|
|
||||||
|
Gson gson = new Gson();
|
||||||
|
String json = prefs.getString(key, null);
|
||||||
|
Type type = TypeToken.getParameterized(ArrayList.class, clazz).getType(); // Use the provided class type
|
||||||
|
return gson.fromJson(json, type); // Convert JSON back to the list
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,10 @@ package com.utopiaindustries.qualitycontrol.models;
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class QualitySaveResponse {
|
public class QualitySaveResponse implements Serializable {
|
||||||
|
|
||||||
@SerializedName("overAllPercentage")
|
@SerializedName("overAllPercentage")
|
||||||
@Expose
|
@Expose
|
||||||
|
@ -19,6 +20,26 @@ public class QualitySaveResponse {
|
||||||
@Expose
|
@Expose
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
|
@SerializedName("Cutting")
|
||||||
|
@Expose
|
||||||
|
private String Cutting;
|
||||||
|
|
||||||
|
@SerializedName("Stiching")
|
||||||
|
@Expose
|
||||||
|
private String Stiching;
|
||||||
|
|
||||||
|
@SerializedName("Checking")
|
||||||
|
@Expose
|
||||||
|
private String Checking;
|
||||||
|
|
||||||
|
@SerializedName("Packing")
|
||||||
|
@Expose
|
||||||
|
private String Packing;
|
||||||
|
|
||||||
|
@SerializedName("Sub Store")
|
||||||
|
@Expose
|
||||||
|
private String Sub_Store;
|
||||||
|
|
||||||
public String getOverAllPercentage() {
|
public String getOverAllPercentage() {
|
||||||
return overAllPercentage;
|
return overAllPercentage;
|
||||||
}
|
}
|
||||||
|
@ -42,4 +63,44 @@ public class QualitySaveResponse {
|
||||||
public void setMessage(String message) {
|
public void setMessage(String message) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCutting() {
|
||||||
|
return Cutting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCutting(String cutting) {
|
||||||
|
Cutting = cutting;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getStiching() {
|
||||||
|
return Stiching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStiching(String stiching) {
|
||||||
|
Stiching = stiching;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChecking() {
|
||||||
|
return Checking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChecking(String checking) {
|
||||||
|
Checking = checking;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPacking() {
|
||||||
|
return Packing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPacking(String packing) {
|
||||||
|
Packing = packing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSub_Store() {
|
||||||
|
return Sub_Store;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSub_Store(String sub_Store) {
|
||||||
|
Sub_Store = sub_Store;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,10 +47,10 @@ public class HomeViewModel extends ViewModel {
|
||||||
apiService.saveQualityControlReport(qualityControl).enqueue(new Callback<QualitySaveResponse>() {
|
apiService.saveQualityControlReport(qualityControl).enqueue(new Callback<QualitySaveResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<QualitySaveResponse> call, Response<QualitySaveResponse> response) {
|
public void onResponse(Call<QualitySaveResponse> call, Response<QualitySaveResponse> response) {
|
||||||
Log.e("onResponse: ",""+response);
|
//Log.e("onResponse: ",""+response);
|
||||||
isLoading.setValue(false);
|
isLoading.setValue(false);
|
||||||
if (response.isSuccessful() && response.body() != null) {
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
Log.e("onResponse-success: ",""+response);
|
//Log.e("onResponse-success: ",""+response);
|
||||||
userLiveData.setValue(response.body());
|
userLiveData.setValue(response.body());
|
||||||
} else {
|
} else {
|
||||||
errorLiveData.setValue(response.message());
|
errorLiveData.setValue(response.message());
|
||||||
|
@ -59,7 +59,7 @@ public class HomeViewModel extends ViewModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<QualitySaveResponse> call, Throwable t) {
|
public void onFailure(Call<QualitySaveResponse> call, Throwable t) {
|
||||||
Log.e("onResponse-fail: ",""+t.getMessage());
|
//Log.e("onResponse-fail: ",""+t.getMessage());
|
||||||
isLoading.setValue(false);
|
isLoading.setValue(false);
|
||||||
errorLiveData.setValue(t.getMessage());
|
errorLiveData.setValue(t.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
package com.utopiaindustries.qualitycontrol.viewmodels;
|
package com.utopiaindustries.qualitycontrol.viewmodels;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
import androidx.lifecycle.LiveData;
|
import androidx.lifecycle.LiveData;
|
||||||
import androidx.lifecycle.MutableLiveData;
|
import androidx.lifecycle.MutableLiveData;
|
||||||
import androidx.lifecycle.ViewModel;
|
import androidx.lifecycle.ViewModel;
|
||||||
|
@ -15,6 +18,7 @@ import retrofit2.Response;
|
||||||
public class LoginViewModel extends ViewModel {
|
public class LoginViewModel extends ViewModel {
|
||||||
|
|
||||||
private MutableLiveData<QualityControlResponse> userLiveData;
|
private MutableLiveData<QualityControlResponse> userLiveData;
|
||||||
|
private MutableLiveData<Boolean> userLoginLiveData;
|
||||||
private MutableLiveData<String> errorLiveData;
|
private MutableLiveData<String> errorLiveData;
|
||||||
private MutableLiveData<Boolean> isLoading;
|
private MutableLiveData<Boolean> isLoading;
|
||||||
private ApiService apiService;
|
private ApiService apiService;
|
||||||
|
@ -22,6 +26,7 @@ public class LoginViewModel extends ViewModel {
|
||||||
public LoginViewModel() {
|
public LoginViewModel() {
|
||||||
apiService = ApiServiceFactory.getApiService();
|
apiService = ApiServiceFactory.getApiService();
|
||||||
userLiveData = new MutableLiveData<>();
|
userLiveData = new MutableLiveData<>();
|
||||||
|
userLoginLiveData = new MutableLiveData<>();
|
||||||
errorLiveData = new MutableLiveData<>();
|
errorLiveData = new MutableLiveData<>();
|
||||||
isLoading = new MutableLiveData<>();
|
isLoading = new MutableLiveData<>();
|
||||||
}
|
}
|
||||||
|
@ -41,11 +46,13 @@ public class LoginViewModel extends ViewModel {
|
||||||
|
|
||||||
public void getQualityControlData() {
|
public void getQualityControlData() {
|
||||||
isLoading.setValue(true);
|
isLoading.setValue(true);
|
||||||
apiService.isUserAuthenticated().enqueue(new Callback<QualityControlResponse>() {
|
apiService.getQualityControlData().enqueue(new Callback<QualityControlResponse>() {
|
||||||
@Override
|
@Override
|
||||||
public void onResponse(Call<QualityControlResponse> call, Response<QualityControlResponse> response) {
|
public void onResponse(Call<QualityControlResponse> call, Response<QualityControlResponse> response) {
|
||||||
|
|
||||||
isLoading.setValue(false);
|
isLoading.setValue(false);
|
||||||
if (response.isSuccessful() && response.body() != null) {
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
|
Log.e("onResponse: ", "Successful");
|
||||||
userLiveData.setValue(response.body());
|
userLiveData.setValue(response.body());
|
||||||
} else {
|
} else {
|
||||||
errorLiveData.setValue(response.message());
|
errorLiveData.setValue(response.message());
|
||||||
|
@ -54,12 +61,41 @@ public class LoginViewModel extends ViewModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(Call<QualityControlResponse> call, Throwable t) {
|
public void onFailure(Call<QualityControlResponse> call, Throwable t) {
|
||||||
|
Log.e("onResponse: ", "Fail");
|
||||||
isLoading.setValue(false);
|
isLoading.setValue(false);
|
||||||
errorLiveData.setValue(t.getMessage());
|
errorLiveData.setValue(t.getMessage());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void isUserAuthenticated(String username, String password, String[] roles) {
|
||||||
|
isLoading.setValue(true);
|
||||||
|
apiService.isUserAuthenticated(username, password, roles).enqueue(new Callback<Boolean>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(@NonNull Call<Boolean> call, @NonNull Response<Boolean> response) {
|
||||||
|
isLoading.setValue(false);
|
||||||
|
Log.e("onResponse-1: ", "Successful: "+response);
|
||||||
|
if (response.isSuccessful() && response.body() != null) {
|
||||||
|
Log.e("onResponse-2: ", "Successful: "+response);
|
||||||
|
userLoginLiveData.setValue(response.body());
|
||||||
|
} else {
|
||||||
|
userLoginLiveData.setValue(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull Call<Boolean> call, @NonNull Throwable t) {
|
||||||
|
Log.e("onResponse-2: ", "failed"+t.getMessage());
|
||||||
|
isLoading.setValue(false);
|
||||||
|
errorLiveData.setValue(t.getMessage());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public LiveData<Boolean> getLoginUser() {
|
||||||
|
return userLoginLiveData;
|
||||||
|
}
|
||||||
|
|
||||||
public LiveData<QualityControlResponse> getUser() {
|
public LiveData<QualityControlResponse> getUser() {
|
||||||
return userLiveData;
|
return userLiveData;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,13 +4,15 @@ import java.util.List;
|
||||||
|
|
||||||
public class QualityControl {
|
public class QualityControl {
|
||||||
|
|
||||||
|
private String generatedBy;
|
||||||
private int siteId;
|
private int siteId;
|
||||||
private int unitId;
|
private int unitId;
|
||||||
private int departmentId;
|
private int departmentId;
|
||||||
private int floorId;
|
private int floorId;
|
||||||
private List<ItemModel> qualityControlItemList;
|
private List<ItemModel> qualityControlItemList;
|
||||||
|
|
||||||
public QualityControl(int siteId, int floorId, int departmentId, int unitId, List<ItemModel> qualityControlItemList) {
|
public QualityControl(String generatedBy, int siteId, int floorId, int departmentId, int unitId, List<ItemModel> qualityControlItemList) {
|
||||||
|
this.generatedBy = generatedBy;
|
||||||
this.siteId = siteId;
|
this.siteId = siteId;
|
||||||
this.qualityControlItemList = qualityControlItemList;
|
this.qualityControlItemList = qualityControlItemList;
|
||||||
this.floorId = floorId;
|
this.floorId = floorId;
|
||||||
|
@ -21,6 +23,14 @@ public class QualityControl {
|
||||||
public QualityControl() {
|
public QualityControl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getGeneratedBy() {
|
||||||
|
return generatedBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGeneratedBy(String generatedBy) {
|
||||||
|
this.generatedBy = generatedBy;
|
||||||
|
}
|
||||||
|
|
||||||
public int getSiteId() {
|
public int getSiteId() {
|
||||||
return siteId;
|
return siteId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#D3D3D3" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M20,4L4,4c-1.1,0 -1.99,0.9 -1.99,2L2,18c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,8l-8,5 -8,-5L4,6l8,5 8,-5v2z"/>
|
||||||
|
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:autoMirrored="true" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M17,7l-1.41,1.41L18.17,11H8v2h10.17l-2.58,2.58L17,17l5,-5zM4,5h8V3H4c-1.1,0 -2,0.9 -2,2v14c0,1.1 0.9,2 2,2h8v-2H4V5z"/>
|
||||||
|
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#000000" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
|
||||||
|
|
||||||
|
<path android:fillColor="@android:color/white" android:pathData="M18,8h-1L17,6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2L6,8c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,10c0,-1.1 -0.9,-2 -2,-2zM12,17c-1.1,0 -2,-0.9 -2,-2s0.9,-2 2,-2 2,0.9 2,2 -0.9,2 -2,2zM15.1,8L8.9,8L8.9,6c0,-1.71 1.39,-3.1 3.1,-3.1 1.71,0 3.1,1.39 3.1,3.1v2z"/>
|
||||||
|
|
||||||
|
</vector>
|
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="@color/white" />
|
||||||
|
<corners android:radius="10dp" />
|
||||||
|
<padding
|
||||||
|
android:bottom="0dp"
|
||||||
|
android:left="0dp"
|
||||||
|
android:right="0dp"
|
||||||
|
android:top="0dp" />
|
||||||
|
</shape>
|
|
@ -5,6 +5,7 @@
|
||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".activities.HomeActivity">
|
tools:context=".activities.HomeActivity">
|
||||||
|
|
||||||
<androidx.appcompat.widget.Toolbar
|
<androidx.appcompat.widget.Toolbar
|
||||||
|
@ -22,7 +23,7 @@
|
||||||
android:id="@+id/textView"
|
android:id="@+id/textView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="Quality Control"
|
android:text="5S App"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="@dimen/_15sdp"
|
android:textSize="@dimen/_15sdp"
|
||||||
app:layout_constraintBottom_toBottomOf="@+id/toolbar"
|
app:layout_constraintBottom_toBottomOf="@+id/toolbar"
|
||||||
|
@ -60,4 +61,14 @@
|
||||||
android:text="Next" />-->
|
android:text="Next" />-->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/img_logout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@+id/toolbar"
|
||||||
|
app:layout_constraintEnd_toEndOf="@+id/toolbar"
|
||||||
|
app:layout_constraintTop_toTopOf="@+id/toolbar"
|
||||||
|
app:srcCompat="@drawable/ic_logout" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -0,0 +1,91 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/main"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".activities.LoginActivity">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="1dp"
|
||||||
|
android:layout_marginTop="50dp"
|
||||||
|
android:layout_marginEnd="1dp"
|
||||||
|
android:background="@color/grey_100"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="150dp"
|
||||||
|
android:layout_height="100dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:src="@drawable/search" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="Login Now to Continue"
|
||||||
|
android:textSize="@dimen/_17sdp" />
|
||||||
|
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
|
android:layout_width="300dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/tf_email"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:drawableStart="@drawable/ic_email"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:drawableTint="@color/grey_700"
|
||||||
|
android:hint="User"
|
||||||
|
android:inputType="text" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
<com.google.android.material.textfield.TextInputLayout
|
||||||
|
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||||
|
android:layout_width="300dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="5dp">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/tf_password"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@null"
|
||||||
|
android:drawableStart="@drawable/ic_password"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:drawableTint="@color/grey_700"
|
||||||
|
android:hint="Password"
|
||||||
|
android:inputType="textPassword" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_login"
|
||||||
|
android:layout_width="300dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:background="@drawable/rounded_btn_login"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:text="Login"
|
||||||
|
android:textSize="@dimen/_15sdp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -5,6 +5,7 @@
|
||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".activities.SplashActivity">
|
tools:context=".activities.SplashActivity">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/main"
|
android:id="@+id/main"
|
||||||
|
android:background="@color/white"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context=".activities.SummaryActivity">
|
tools:context=".activities.SummaryActivity">
|
||||||
|
@ -41,4 +42,158 @@
|
||||||
app:layout_constraintTop_toTopOf="@+id/toolbar"
|
app:layout_constraintTop_toTopOf="@+id/toolbar"
|
||||||
app:srcCompat="@drawable/arrow_back" />
|
app:srcCompat="@drawable/arrow_back" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="Overall Percentage"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView12" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_percentage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="TextView"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txt_substore_percentage" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:text="Cutting %"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_cutting_percentage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:text="TextView"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/toolbar" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView5"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="Stitching %"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView3" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_stitching_percentage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:text="TextView"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txt_cutting_percentage" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="Checking %"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView5" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_checking_percentage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:text="TextView"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txt_stitching_percentage" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView10"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:text="Packing %"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txt" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_packing_percentage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:text="TextView"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txt_checking_percentage" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/textView12"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="SubStore %"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView10" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/txt_substore_percentage"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:textSize="@dimen/_13sdp"
|
||||||
|
android:layout_marginEnd="15dp"
|
||||||
|
android:text="TextView"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txt_packing_percentage" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/divider"
|
||||||
|
android:layout_width="409dp"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginTop="21dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:background="?android:attr/listDivider"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/textView2"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/textView12" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -2,7 +2,7 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
android:layout_gravity="center">
|
android:layout_gravity="center">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginLeft="20dp"
|
||||||
|
android:layout_marginRight="20dp"
|
||||||
|
android:background="@drawable/rounded_white"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingTop="15dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/message"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="15dp"
|
||||||
|
android:layout_marginBottom="15dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp"
|
||||||
|
android:text="Are you sure you want to sign out?"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="15sp"
|
||||||
|
android:textStyle="normal" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1px"
|
||||||
|
android:layout_marginTop="7dp"
|
||||||
|
android:background="@color/grey_400" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:weightSum="3">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/dialogCancelBtn"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.495"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="15dp"
|
||||||
|
android:paddingBottom="15dp"
|
||||||
|
android:text="No"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="@color/theme_color"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="normal" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="0.009"
|
||||||
|
android:background="@color/grey_400"
|
||||||
|
android:paddingTop="15dp"
|
||||||
|
android:paddingBottom="15dp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/dialogOkBtn"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.495"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingTop="15dp"
|
||||||
|
android:paddingBottom="15dp"
|
||||||
|
android:text="Yes"
|
||||||
|
android:textAllCaps="false"
|
||||||
|
android:textColor="@color/theme_color"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="normal" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
|
@ -3,6 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".fragments.CheckingFragment">
|
tools:context=".fragments.CheckingFragment">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -133,6 +134,7 @@
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/rounded_btn_login"
|
android:background="@drawable/rounded_btn_login"
|
||||||
android:text="Next"/>
|
android:text="Next"/>
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".fragments.CuttingFragment">
|
tools:context=".fragments.CuttingFragment">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -135,6 +136,7 @@
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/rounded_btn_login"
|
android:background="@drawable/rounded_btn_login"
|
||||||
android:text="Next"/>
|
android:text="Next"/>
|
||||||
</FrameLayout>
|
</FrameLayout>
|
|
@ -4,6 +4,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".fragments.HomeFragment">
|
tools:context=".fragments.HomeFragment">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -161,6 +162,7 @@
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/rounded_btn_login"
|
android:background="@drawable/rounded_btn_login"
|
||||||
android:text="Next" />
|
android:text="Next" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
|
@ -3,6 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".fragments.PackingFragment">
|
tools:context=".fragments.PackingFragment">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -133,6 +134,7 @@
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/rounded_btn_login"
|
android:background="@drawable/rounded_btn_login"
|
||||||
android:text="Next"/>
|
android:text="Next"/>
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".fragments.StitchingFragment">
|
tools:context=".fragments.StitchingFragment">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -133,6 +134,7 @@
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/rounded_btn_login"
|
android:background="@drawable/rounded_btn_login"
|
||||||
android:text="Next"/>
|
android:text="Next"/>
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
tools:context=".fragments.SubStoreFragment">
|
tools:context=".fragments.SubStoreFragment">
|
||||||
|
|
||||||
<ScrollView
|
<ScrollView
|
||||||
|
@ -133,6 +134,7 @@
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:layout_gravity="bottom"
|
android:layout_gravity="bottom"
|
||||||
|
android:textColor="@color/white"
|
||||||
android:background="@drawable/rounded_btn_login"
|
android:background="@drawable/rounded_btn_login"
|
||||||
android:text="Finish"/>
|
android:text="Finish"/>
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,27 @@
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Base.Theme.QualityControlApp" parent="Theme.Material3.DayNight.NoActionBar">
|
<style name="Base.Theme.QualityControlApp" parent="Theme.Material3.Light.NoActionBar">
|
||||||
<!-- Customize your dark theme here. -->
|
<!-- Customize your dark theme here. -->
|
||||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||||
|
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/theme_color</item>
|
||||||
|
<item name="colorPrimaryVariant">@color/theme_color</item>
|
||||||
|
<item name="colorOnPrimary">@color/theme_color</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<item name="colorSecondary">@color/theme_color</item>
|
||||||
|
<item name="colorSecondaryVariant">@color/theme_color</item>
|
||||||
|
<item name="colorOnSecondary">@color/black</item>
|
||||||
|
<!-- Status bar color. -->
|
||||||
|
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
|
||||||
|
<!--<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="windowActionBar">false</item>-->
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="Theme.QualityControlApp" parent="Base.Theme.QualityControlApp" />
|
||||||
</resources>
|
</resources>
|
|
@ -1,5 +1,5 @@
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">QualityControl</string>
|
<string name="app_name">5S App</string>
|
||||||
<string name="app_version">Version 1.0</string>
|
<string name="app_version">Version 1.0</string>
|
||||||
<!-- TODO: Remove or change this placeholder text -->
|
<!-- TODO: Remove or change this placeholder text -->
|
||||||
<string name="hello_blank_fragment">Hello blank fragment</string>
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
|
|
|
@ -1,8 +1,25 @@
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Base.Theme.QualityControlApp" parent="Theme.Material3.DayNight.NoActionBar">
|
<style name="Base.Theme.QualityControlApp" parent="Theme.Material3.Light.NoActionBar">
|
||||||
<!-- Customize your light theme here. -->
|
<!-- Customize your light theme here. -->
|
||||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||||
|
|
||||||
|
<!-- Primary brand color. -->
|
||||||
|
<item name="colorPrimary">@color/theme_color</item>
|
||||||
|
<item name="colorPrimaryVariant">@color/theme_color</item>
|
||||||
|
<item name="colorOnPrimary">@color/theme_color</item>
|
||||||
|
<!-- Secondary brand color. -->
|
||||||
|
<item name="colorSecondary">@color/theme_color</item>
|
||||||
|
<item name="colorSecondaryVariant">@color/theme_color</item>
|
||||||
|
<item name="colorOnSecondary">@color/black</item>
|
||||||
|
<!-- Status bar color. -->
|
||||||
|
<item name="android:statusBarColor" tools:targetApi="l">?attr/colorPrimaryVariant</item>
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
|
||||||
|
<!--<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowBackground">@android:color/transparent</item>
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<item name="windowActionBar">false</item>-->
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="Theme.QualityControlApp" parent="Base.Theme.QualityControlApp" />
|
<style name="Theme.QualityControlApp" parent="Base.Theme.QualityControlApp" />
|
||||||
|
|
Loading…
Reference in New Issue