Location search, department spinner, floor spinner, steps objects
parent
60569fb5a5
commit
0d3b90ffd8
|
@ -7,4 +7,11 @@
|
|||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
<component name="VisualizationToolProject">
|
||||
<option name="state">
|
||||
<ProjectState>
|
||||
<option name="scale" value="0.22142535338436625" />
|
||||
</ProjectState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
|
@ -1,117 +0,0 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCheckingAdapter extends RecyclerView.Adapter<ItemCheckingAdapter.ItemViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final List<Item> items;
|
||||
private final String[] dropdownOptions = {"1", "2", "3", "4", "5"};
|
||||
SharedViewModel viewModel;
|
||||
|
||||
public ItemCheckingAdapter(Context context, List<Item> items, SharedViewModel viewModel) {
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
this.viewModel = viewModel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_recycler_view, parent, false);
|
||||
return new ItemViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||
Item currentItem = items.get(position);
|
||||
holder.tvItemName.setText(currentItem.getName());
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context,R.layout.spinner_style,dropdownOptions);
|
||||
adapter.setDropDownViewResource(R.layout.spinner_style);
|
||||
// Set up the Spinner (Dropdown)
|
||||
/*ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, dropdownOptions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);*/
|
||||
holder.spinnerOptions.setAdapter(adapter);
|
||||
|
||||
// Preselect an option if needed
|
||||
holder.spinnerOptions.setSelection(currentItem.getSelectedOption());
|
||||
|
||||
// Save selected option when user selects one
|
||||
holder.spinnerOptions.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int sub_position, long id) {
|
||||
//currentItem.setSelectedOption(position); // Save the selected option
|
||||
|
||||
if (currentItem.getSelectedOption() != sub_position) { // Avoid unnecessary updates
|
||||
currentItem.setSelectedOption(sub_position); // Save the selected option
|
||||
Log.e("Position: ",""+holder.getAdapterPosition());
|
||||
Log.e("Sub-Position: ",""+sub_position);
|
||||
|
||||
switch (holder.getAdapterPosition()) {
|
||||
case 0:
|
||||
viewModel.setCheckingSort(sub_position);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
viewModel.setCheckingSetInOrder(sub_position);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
viewModel.setCheckingShine(sub_position);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
viewModel.setCheckingStandardize(sub_position);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
viewModel.setCheckingSustain(sub_position);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
viewModel.setCheckingSafety(sub_position);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(android.widget.AdapterView<?> parent) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public static class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvItemName;
|
||||
Spinner spinnerOptions;
|
||||
|
||||
public ItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvItemName = itemView.findViewById(R.id.tv_item_name);
|
||||
spinnerOptions = itemView.findViewById(R.id.spinner_item_options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemCuttingAdapter extends RecyclerView.Adapter<ItemCuttingAdapter.ItemViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final List<Item> items;
|
||||
private final String[] dropdownOptions = {"1", "2", "3", "4", "5"};
|
||||
SharedViewModel viewModel;
|
||||
|
||||
public ItemCuttingAdapter(Context context, List<Item> items, SharedViewModel viewModel) {
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
this.viewModel = viewModel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_recycler_view, parent, false);
|
||||
return new ItemViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||
Item currentItem = items.get(position);
|
||||
holder.tvItemName.setText(currentItem.getName());
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context,R.layout.spinner_style,dropdownOptions);
|
||||
adapter.setDropDownViewResource(R.layout.spinner_style);
|
||||
// Set up the Spinner (Dropdown)
|
||||
/*ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, dropdownOptions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);*/
|
||||
holder.spinnerOptions.setAdapter(adapter);
|
||||
|
||||
// Preselect an option if needed
|
||||
holder.spinnerOptions.setSelection(currentItem.getSelectedOption());
|
||||
|
||||
// Save selected option when user selects one
|
||||
holder.spinnerOptions.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int sub_position, long id) {
|
||||
//currentItem.setSelectedOption(position); // Save the selected option
|
||||
|
||||
if (currentItem.getSelectedOption() != sub_position) { // Avoid unnecessary updates
|
||||
currentItem.setSelectedOption(sub_position); // Save the selected option
|
||||
Log.e("Position: ",""+holder.getAdapterPosition());
|
||||
Log.e("Sub-Position: ",""+sub_position);
|
||||
|
||||
switch (holder.getAdapterPosition()) {
|
||||
case 0:
|
||||
viewModel.setCuttingSort(sub_position);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
viewModel.setCuttingSetInOrder(sub_position);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
viewModel.setCuttingShine(sub_position);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
viewModel.setCuttingStandardize(sub_position);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
viewModel.setCuttingSustain(sub_position);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
viewModel.setCuttingSafety(sub_position);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(android.widget.AdapterView<?> parent) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public static class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvItemName;
|
||||
Spinner spinnerOptions;
|
||||
|
||||
public ItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvItemName = itemView.findViewById(R.id.tv_item_name);
|
||||
spinnerOptions = itemView.findViewById(R.id.spinner_item_options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemPackingAdapter extends RecyclerView.Adapter<ItemPackingAdapter.ItemViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final List<Item> items;
|
||||
private final String[] dropdownOptions = {"1", "2", "3", "4", "5"};
|
||||
SharedViewModel viewModel;
|
||||
|
||||
public ItemPackingAdapter(Context context, List<Item> items, SharedViewModel viewModel) {
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
this.viewModel = viewModel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_recycler_view, parent, false);
|
||||
return new ItemViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||
Item currentItem = items.get(position);
|
||||
holder.tvItemName.setText(currentItem.getName());
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context,R.layout.spinner_style,dropdownOptions);
|
||||
adapter.setDropDownViewResource(R.layout.spinner_style);
|
||||
// Set up the Spinner (Dropdown)
|
||||
/*ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, dropdownOptions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);*/
|
||||
holder.spinnerOptions.setAdapter(adapter);
|
||||
|
||||
// Preselect an option if needed
|
||||
holder.spinnerOptions.setSelection(currentItem.getSelectedOption());
|
||||
|
||||
// Save selected option when user selects one
|
||||
holder.spinnerOptions.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int sub_position, long id) {
|
||||
//currentItem.setSelectedOption(position); // Save the selected option
|
||||
|
||||
if (currentItem.getSelectedOption() != sub_position) { // Avoid unnecessary updates
|
||||
currentItem.setSelectedOption(sub_position); // Save the selected option
|
||||
Log.e("Position: ",""+holder.getAdapterPosition());
|
||||
Log.e("Sub-Position: ",""+sub_position);
|
||||
|
||||
switch (holder.getAdapterPosition()) {
|
||||
case 0:
|
||||
viewModel.setPackingSort(sub_position);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
viewModel.setPackingSetInOrder(sub_position);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
viewModel.setPackingShine(sub_position);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
viewModel.setPackingStandardize(sub_position);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
viewModel.setPackingSustain(sub_position);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
viewModel.setPackingSafety(sub_position);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(android.widget.AdapterView<?> parent) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public static class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvItemName;
|
||||
Spinner spinnerOptions;
|
||||
|
||||
public ItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvItemName = itemView.findViewById(R.id.tv_item_name);
|
||||
spinnerOptions = itemView.findViewById(R.id.spinner_item_options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,134 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ItemStepsAdapter extends RecyclerView.Adapter<ItemStepsAdapter.ItemViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final List<ItemModel> items;
|
||||
private final List<String> dropdownOptions = new ArrayList<>();
|
||||
double percentage = 0.0, selectedValue = 0.0;
|
||||
|
||||
public ItemStepsAdapter(Context context, List<ItemModel> items) {
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
|
||||
dropdownOptions.add("1");
|
||||
dropdownOptions.add("2");
|
||||
dropdownOptions.add("3");
|
||||
dropdownOptions.add("4");
|
||||
dropdownOptions.add("5");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_recycler_view, parent, false);
|
||||
return new ItemViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||
ItemModel currentItem = items.get(position);
|
||||
|
||||
currentItem.setStepId(position + 1);
|
||||
switch (position) {
|
||||
case 0:
|
||||
holder.tvItemName.setText("Sort");
|
||||
break;
|
||||
|
||||
case 1:
|
||||
holder.tvItemName.setText("Set In Order");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
holder.tvItemName.setText("Shine");
|
||||
break;
|
||||
|
||||
case 3:
|
||||
holder.tvItemName.setText("Standardize");
|
||||
break;
|
||||
|
||||
case 4:
|
||||
holder.tvItemName.setText("Sustain");
|
||||
break;
|
||||
|
||||
case 5:
|
||||
holder.tvItemName.setText("Safety");
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
holder.et_remarks.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
currentItem.setRemarks(s.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
|
||||
ScoreSpinnerAdapter scoreSpinnerAdapter = new ScoreSpinnerAdapter(context, dropdownOptions);
|
||||
holder.scoreTextview.setAdapter(scoreSpinnerAdapter);
|
||||
|
||||
holder.scoreTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int sub_position, long id) {
|
||||
|
||||
currentItem.setSelectedOption(sub_position + 1);
|
||||
currentItem.setRating(sub_position + 1);
|
||||
|
||||
selectedValue = Double.parseDouble(parent.getItemAtPosition(sub_position).toString());
|
||||
percentage = (selectedValue / 5) * 100;
|
||||
holder.tvPercentage.setText(String.valueOf(percentage) + " %");
|
||||
currentItem.setPercentage(String.valueOf(percentage));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public static class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvItemName, tvPercentage;
|
||||
AutoCompleteTextView scoreTextview;
|
||||
EditText et_remarks;
|
||||
|
||||
public ItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvItemName = itemView.findViewById(R.id.tv_item_name);
|
||||
scoreTextview = itemView.findViewById(R.id.score_textview);
|
||||
tvPercentage = itemView.findViewById(R.id.tv_percentage);
|
||||
et_remarks = itemView.findViewById(R.id.et_remarks);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemStitchingAdapter extends RecyclerView.Adapter<ItemStitchingAdapter.ItemViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final List<Item> items;
|
||||
private final String[] dropdownOptions = {"1", "2", "3", "4", "5"};
|
||||
SharedViewModel viewModel;
|
||||
|
||||
public ItemStitchingAdapter(Context context, List<Item> items, SharedViewModel viewModel) {
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
this.viewModel = viewModel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_recycler_view, parent, false);
|
||||
return new ItemViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||
Item currentItem = items.get(position);
|
||||
holder.tvItemName.setText(currentItem.getName());
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context,R.layout.spinner_style,dropdownOptions);
|
||||
adapter.setDropDownViewResource(R.layout.spinner_style);
|
||||
// Set up the Spinner (Dropdown)
|
||||
/*ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, dropdownOptions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);*/
|
||||
holder.spinnerOptions.setAdapter(adapter);
|
||||
|
||||
// Preselect an option if needed
|
||||
holder.spinnerOptions.setSelection(currentItem.getSelectedOption());
|
||||
|
||||
// Save selected option when user selects one
|
||||
holder.spinnerOptions.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int sub_position, long id) {
|
||||
//currentItem.setSelectedOption(position); // Save the selected option
|
||||
|
||||
if (currentItem.getSelectedOption() != sub_position) { // Avoid unnecessary updates
|
||||
currentItem.setSelectedOption(sub_position); // Save the selected option
|
||||
Log.e("Position: ",""+holder.getAdapterPosition());
|
||||
Log.e("Sub-Position: ",""+sub_position);
|
||||
|
||||
switch (holder.getAdapterPosition()) {
|
||||
case 0:
|
||||
viewModel.setStitchingSort(sub_position);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
viewModel.setStitchingSetInOrder(sub_position);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
viewModel.setStitchingShine(sub_position);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
viewModel.setStitchingStandardize(sub_position);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
viewModel.setStitchingSustain(sub_position);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
viewModel.setStitchingSafety(sub_position);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(android.widget.AdapterView<?> parent) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public static class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvItemName;
|
||||
Spinner spinnerOptions;
|
||||
|
||||
public ItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvItemName = itemView.findViewById(R.id.tv_item_name);
|
||||
spinnerOptions = itemView.findViewById(R.id.spinner_item_options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,117 +0,0 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ItemSubstoreAdapter extends RecyclerView.Adapter<ItemSubstoreAdapter.ItemViewHolder> {
|
||||
|
||||
private final Context context;
|
||||
private final List<Item> items;
|
||||
private final String[] dropdownOptions = {"1", "2", "3", "4", "5"};
|
||||
SharedViewModel viewModel;
|
||||
|
||||
public ItemSubstoreAdapter(Context context, List<Item> items, SharedViewModel viewModel) {
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
this.viewModel = viewModel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(context).inflate(R.layout.item_recycler_view, parent, false);
|
||||
return new ItemViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||
Item currentItem = items.get(position);
|
||||
holder.tvItemName.setText(currentItem.getName());
|
||||
|
||||
ArrayAdapter<String> adapter = new ArrayAdapter<>(context,R.layout.spinner_style,dropdownOptions);
|
||||
adapter.setDropDownViewResource(R.layout.spinner_style);
|
||||
// Set up the Spinner (Dropdown)
|
||||
/*ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, dropdownOptions);
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);*/
|
||||
holder.spinnerOptions.setAdapter(adapter);
|
||||
|
||||
// Preselect an option if needed
|
||||
holder.spinnerOptions.setSelection(currentItem.getSelectedOption());
|
||||
|
||||
// Save selected option when user selects one
|
||||
holder.spinnerOptions.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int sub_position, long id) {
|
||||
//currentItem.setSelectedOption(position); // Save the selected option
|
||||
|
||||
if (currentItem.getSelectedOption() != sub_position) { // Avoid unnecessary updates
|
||||
currentItem.setSelectedOption(sub_position); // Save the selected option
|
||||
Log.e("Position: ",""+holder.getAdapterPosition());
|
||||
Log.e("Sub-Position: ",""+sub_position);
|
||||
|
||||
switch (holder.getAdapterPosition()) {
|
||||
case 0:
|
||||
viewModel.setCuttingSort(sub_position);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
viewModel.setSubStoreSetInOrder(sub_position);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
viewModel.setSubStoreShine(sub_position);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
viewModel.setSubStoreStandardize(sub_position);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
viewModel.setSubStoreSustain(sub_position);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
viewModel.setSubStoreSafety(sub_position);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(android.widget.AdapterView<?> parent) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return items.size();
|
||||
}
|
||||
|
||||
public static class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||
TextView tvItemName;
|
||||
Spinner spinnerOptions;
|
||||
|
||||
public ItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
tvItemName = itemView.findViewById(R.id.tv_item_name);
|
||||
spinnerOptions = itemView.findViewById(R.id.spinner_item_options);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ScoreSpinnerAdapter extends ArrayAdapter<String> {
|
||||
|
||||
private final Context context;
|
||||
private final List<String> items;
|
||||
|
||||
public ScoreSpinnerAdapter(Context context, List<String> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
String item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item);
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.utopiaindustries.qualitycontrol.adapters;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationFloor;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationUnit;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class UnitAdapter extends ArrayAdapter<LocationUnit> {
|
||||
|
||||
private final Context context;
|
||||
private final List<LocationUnit> items;
|
||||
|
||||
public UnitAdapter(Context context, List<LocationUnit> items) {
|
||||
super(context, 0, items);
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
if (convertView == null) {
|
||||
convertView = LayoutInflater.from(context).inflate(R.layout.list_items, parent, false);
|
||||
}
|
||||
|
||||
LocationUnit item = items.get(position);
|
||||
|
||||
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||
|
||||
titleTextView.setText(item.getTitle());
|
||||
|
||||
return convertView;
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -37,10 +38,9 @@ import android.widget.Toast;
|
|||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCheckingAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemStepsAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -68,7 +68,8 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
|||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
Button nextButton;
|
||||
ImageButton imagePicker, deleteImage;
|
||||
SharedViewModel sharedViewModel;
|
||||
EditText etPercentage, etRemarks;
|
||||
QualityControlViewModel viewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -146,25 +147,55 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
|||
|
||||
initializeLayout(view);
|
||||
|
||||
List<Item> itemList = new ArrayList<>();
|
||||
/* List<Item> itemList = new ArrayList<>();
|
||||
itemList.add(new Item("Sort", 0));
|
||||
itemList.add(new Item("Set in Order", 0));
|
||||
itemList.add(new Item("Shine", 0));
|
||||
itemList.add(new Item("Standardize", 0));
|
||||
itemList.add(new Item("Sustain", 0));
|
||||
itemList.add(new Item("Safety", 0));
|
||||
itemList.add(new Item("Safety", 0));*/
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemCheckingAdapter adapter = new ItemCheckingAdapter(getActivity(), itemList, sharedViewModel);
|
||||
//New Implemented------------------
|
||||
List<ItemModel> itemModelList = new ArrayList<>();
|
||||
for (int i = 1; i < 7; i++) {
|
||||
itemModelList.add(new ItemModel(3,i,0,"0","",0));
|
||||
}
|
||||
|
||||
ItemStepsAdapter adapter = new ItemStepsAdapter(getActivity(), itemModelList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
//----------------------------------
|
||||
|
||||
imageAdapter = new ImageAdapter(imageList, getActivity());
|
||||
imageRecyclerView.setAdapter(imageAdapter);
|
||||
|
||||
nextButton.setOnClickListener(v -> {
|
||||
if (getActivity() instanceof HomeActivity) {
|
||||
((HomeActivity) getActivity()).navigateToFragment(new PackingFragment(), true);
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
viewModel.appendToQualityControlItemList(itemModelList);
|
||||
|
||||
/* if (etRemarks.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else {*/
|
||||
/*sharedViewModel.setCheckingPercentage(etPercentage.getText().toString());
|
||||
sharedViewModel.setCheckingRemarks(etRemarks.getText().toString());
|
||||
if (!imageList.isEmpty()) {
|
||||
sharedViewModel.setCheckingImageList(imageList);
|
||||
}*/
|
||||
((HomeActivity) getActivity()).navigateToFragment(new PackingFragment(), true);
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -191,7 +222,10 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
|||
|
||||
private void initializeLayout(View view) {
|
||||
|
||||
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||
|
||||
etPercentage = view.findViewById(R.id.et_percentage);
|
||||
etRemarks = view.findViewById(R.id.et_remarks);
|
||||
imagePicker = view.findViewById(R.id.image_picker);
|
||||
deleteImage = view.findViewById(R.id.delete_image);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
|
|
@ -30,6 +30,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -37,12 +38,12 @@ import android.widget.Toast;
|
|||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemStepsAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.models.QualityControlProcessStep;
|
||||
import com.utopiaindustries.qualitycontrol.models.QualityControlResponse;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -71,7 +72,8 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
ArrayList<QualityControlProcessStep> qualityControlProcessStepList = new ArrayList<>();
|
||||
QualityControlResponse qualityControlResponse;
|
||||
SharedViewModel sharedViewModel;
|
||||
QualityControlViewModel viewModel;
|
||||
EditText etPercentage, etRemarks;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -148,25 +150,113 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
|
||||
initializeLayout(view);
|
||||
|
||||
List<Item> itemList = new ArrayList<>();
|
||||
/* List<Item> itemList = new ArrayList<>();
|
||||
itemList.add(new Item("Sort", 0));
|
||||
itemList.add(new Item("Set in Order", 0));
|
||||
itemList.add(new Item("Shine", 0));
|
||||
itemList.add(new Item("Standardize", 0));
|
||||
itemList.add(new Item("Sustain", 0));
|
||||
itemList.add(new Item("Safety", 0));
|
||||
itemList.add(new Item("Safety", 0));*/
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList, sharedViewModel);
|
||||
/*ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList, sharedViewModel);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);*/
|
||||
|
||||
//New Implemented------------------
|
||||
List<ItemModel> itemModelList = new ArrayList<>();
|
||||
for (int i = 1; i < 7; i++) {
|
||||
itemModelList.add(new ItemModel(1,i,0,"0","",0));
|
||||
}
|
||||
|
||||
ItemStepsAdapter adapter = new ItemStepsAdapter(getActivity(), itemModelList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
//----------------------------------
|
||||
|
||||
imageAdapter = new ImageAdapter(imageList, getActivity());
|
||||
imageRecyclerView.setAdapter(imageAdapter);
|
||||
|
||||
nextButton.setOnClickListener(v -> {
|
||||
if (getActivity() instanceof HomeActivity) {
|
||||
((HomeActivity) getActivity()).navigateToFragment(new StitchingFragment(), true);
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
viewModel.appendToQualityControlItemList(itemModelList);
|
||||
|
||||
|
||||
|
||||
/*Log.e("Cutting: ","----------------");
|
||||
Log.e("Sort: ",""+sharedViewModel.getCuttingSort());
|
||||
Log.e("Set-Order: ",""+sharedViewModel.getCuttingSetInOrder());
|
||||
Log.e("Shine: ",""+sharedViewModel.getCuttingShine());
|
||||
Log.e("Standardize: ",""+sharedViewModel.getCuttingStandardize());
|
||||
Log.e("Sustain: ",""+sharedViewModel.getCuttingSustain());
|
||||
Log.e("Safety: ",""+sharedViewModel.getCuttingSafety());
|
||||
Log.e("Cutting-Remarks: ",""+sharedViewModel.getCuttingRemarks());
|
||||
List<ItemModel> tempList = new ArrayList<>();
|
||||
for (int i = 1 ; i < 6 ; i++) {
|
||||
ItemModel itemModel = new ItemModel();
|
||||
itemModel.setProcessId(1);
|
||||
itemModel.setStepId(i);
|
||||
switch (i) {
|
||||
case 1:
|
||||
itemModel.setSort(sharedViewModel.getCuttingSort());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
itemModel.setSetInOrder(sharedViewModel.getCuttingSetInOrder());
|
||||
break;
|
||||
|
||||
case 3:
|
||||
itemModel.setShine(sharedViewModel.getCuttingShine());
|
||||
break;
|
||||
|
||||
case 4:
|
||||
itemModel.setStandardize(sharedViewModel.getCuttingStandardize());
|
||||
break;
|
||||
|
||||
case 5:
|
||||
itemModel.setSustain(sharedViewModel.getCuttingSustain());
|
||||
break;
|
||||
|
||||
case 6:
|
||||
itemModel.setSafety(sharedViewModel.getCuttingSafety());
|
||||
break;
|
||||
}
|
||||
itemModel.setPercentage(sharedViewModel.getCuttingPercentage());
|
||||
itemModel.setRemarks(sharedViewModel.getCuttingRemarks());
|
||||
|
||||
tempList.add(itemModel);
|
||||
}
|
||||
|
||||
sharedViewModel.setItemList(tempList);*/
|
||||
|
||||
/*if (etRemarks.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else {*/
|
||||
//sharedViewModel.setCuttingPercentage(etPercentage.getText().toString());
|
||||
//sharedViewModel.setCuttingRemarks(etRemarks.getText().toString());
|
||||
|
||||
//click to next fragment
|
||||
/*if (imageList.size() > 0) {
|
||||
sharedViewModel.setCuttingImageList(imageList);
|
||||
}*/
|
||||
|
||||
((HomeActivity) getActivity()).navigateToFragment(new StitchingFragment(), true);
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -188,8 +278,10 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
|
||||
private void initializeLayout(View view) {
|
||||
|
||||
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||
|
||||
etPercentage = view.findViewById(R.id.et_percentage);
|
||||
etRemarks = view.findViewById(R.id.et_remarks);
|
||||
imagePicker = view.findViewById(R.id.image_picker);
|
||||
deleteImage = view.findViewById(R.id.delete_image);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.utopiaindustries.qualitycontrol.fragments;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -17,7 +16,6 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.AutoCompleteTextView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
|
@ -29,15 +27,15 @@ import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
|||
import com.utopiaindustries.qualitycontrol.adapters.DepartmentItemAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.FloorAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.LocationSitesAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.UnitAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
||||
import com.utopiaindustries.qualitycontrol.helper.Preference;
|
||||
import com.utopiaindustries.qualitycontrol.models.Department;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationFloor;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationUnit;
|
||||
import com.utopiaindustries.qualitycontrol.models.QualityControlProcess;
|
||||
import com.utopiaindustries.qualitycontrol.models.QualityControlProcessStep;
|
||||
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
@ -50,14 +48,16 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnItemClickListener{
|
||||
|
||||
AutoCompleteTextView locationTextview, departmentTextView, floorTextview;
|
||||
AutoCompleteTextView locationSiteTextview, departmentTextView, unitTextview, floorTextview;
|
||||
TextView txtCurrentDate;
|
||||
LoginViewModel loginViewModel;
|
||||
Button nextButton;
|
||||
|
||||
LocationSitesAdapter locationSitesAdapter;
|
||||
UnitAdapter unitAdapter;
|
||||
FloorAdapter floorAdapter;
|
||||
|
||||
ArrayList<LocationUnit> locationUnitList = new ArrayList<>();
|
||||
ArrayList<LocationFloor> locationFloorList = new ArrayList<>();
|
||||
ArrayList<LocationSite> locationSiteList = new ArrayList<>();
|
||||
ArrayList<Department> departmentList = new ArrayList<>();
|
||||
|
@ -67,31 +67,48 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
RecyclerView recyclerView;
|
||||
List<Department> itemList, filteredList;
|
||||
private DepartmentItemAdapter departmentItemAdapter;
|
||||
|
||||
SharedViewModel sharedViewModel;
|
||||
|
||||
QualityControlViewModel viewModel;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||
|
||||
Log.e("onCreateView: ","====================");
|
||||
//Log.e("onCreateView: ","====================");
|
||||
|
||||
initializeLayout(view);
|
||||
|
||||
String date = new SimpleDateFormat("EEEE, MMM d, yyyy", Locale.getDefault()).format(new Date());
|
||||
txtCurrentDate.setText(date);
|
||||
|
||||
locationTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
locationSiteTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||
LocationSite clickedItem = locationSiteList.get(position);
|
||||
Log.e("Item-----------: ", clickedItem.getTitle());
|
||||
floorTextview.setText("Select Floor");
|
||||
//Log.e("Item-----------: ", clickedItem.getTitle());
|
||||
unitTextview.setText("Select Unit");
|
||||
//floorTextview.clearListSelection();
|
||||
viewModel.setLocation(String.valueOf(clickedItem.getId()));
|
||||
|
||||
if (!locationFloorList.isEmpty()) {
|
||||
if (!locationUnitList.isEmpty()) {
|
||||
List<LocationUnit> filteredUnitItems = locationUnitList.stream()
|
||||
.filter(item -> Objects.equals(item.getSiteId(), clickedItem.getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
//Log.e("Filtered-size: ",""+filteredUnitItems.size());
|
||||
|
||||
locationUnitList.clear();
|
||||
locationUnitList.addAll(filteredUnitItems);
|
||||
unitAdapter = new UnitAdapter(getActivity(), filteredUnitItems);
|
||||
unitTextview.setAdapter(unitAdapter);
|
||||
|
||||
// Print filtered items
|
||||
for (LocationUnit item : filteredUnitItems) {
|
||||
//Log.e("Unit-Title: ", item.getTitle());
|
||||
}
|
||||
}
|
||||
|
||||
/*if (!locationFloorList.isEmpty()) {
|
||||
List<LocationFloor> filteredItems = locationFloorList.stream()
|
||||
.filter(item -> Objects.equals(item.getSiteId(), clickedItem.getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
@ -105,6 +122,33 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
for (LocationFloor item : filteredItems) {
|
||||
Log.e("Floor-Title: ", item.getTitle());
|
||||
}
|
||||
}*/
|
||||
}
|
||||
});
|
||||
|
||||
unitTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||
LocationUnit clickedItem = locationUnitList.get(position);
|
||||
//Log.e("Item--unit-----: ", clickedItem.getTitle());
|
||||
viewModel.setUnit(String.valueOf(clickedItem.getId()));
|
||||
int targetSiteId = Integer.parseInt(viewModel.getLocation());
|
||||
Log.e("SiteId: ",""+targetSiteId);
|
||||
Log.e("UnitId: ",""+clickedItem.getId());
|
||||
Log.e("location-floor-list-size: ",""+locationFloorList.size());
|
||||
|
||||
if (!locationFloorList.isEmpty()) {
|
||||
List<LocationFloor> filteredList = locationFloorList.stream()
|
||||
.filter(floor -> floor.getSiteId() == targetSiteId && Objects.equals(floor.getUnitId(), clickedItem.getId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
floorAdapter = new FloorAdapter(getActivity(), filteredList);
|
||||
floorTextview.setAdapter(floorAdapter);
|
||||
|
||||
// Print filtered list
|
||||
for (LocationFloor floor : filteredList) {
|
||||
Log.e("floor: ", floor.getTitle());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -124,6 +168,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||
LocationFloor clickedItem = locationFloorList.get(position);
|
||||
Log.e("Item-----------: ", clickedItem.getTitle());
|
||||
viewModel.setFloor(String.valueOf(clickedItem.getId()));
|
||||
|
||||
|
||||
}
|
||||
|
@ -131,7 +176,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
|
||||
nextButton.setOnClickListener(v -> {
|
||||
if (getActivity() instanceof HomeActivity) {
|
||||
sharedViewModel.setFromViewModel(true);
|
||||
viewModel.setFromViewModel(true);
|
||||
((HomeActivity) getActivity()).navigateToFragment(new CuttingFragment(), true);
|
||||
}
|
||||
});
|
||||
|
@ -149,7 +194,7 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
|
||||
if (s.length() > 0) {
|
||||
Log.e("filterList","0.1");
|
||||
if (sharedViewModel.isFromViewModel()) {
|
||||
if (viewModel.isFromViewModel()) {
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
|
@ -177,11 +222,13 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
}
|
||||
|
||||
public void initializeLayout(View view) {
|
||||
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||
|
||||
txtCurrentDate = view.findViewById(R.id.txt_current_date);
|
||||
locationTextview = view.findViewById(R.id.location_textview);
|
||||
locationSiteTextview = view.findViewById(R.id.location_textview);
|
||||
//departmentTextView = view.findViewById(R.id.department_textview);
|
||||
unitTextview = view.findViewById(R.id.unit_textview);
|
||||
floorTextview = view.findViewById(R.id.floor_textview);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
||||
|
@ -212,19 +259,19 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
|
||||
if (!qcResponse.getLocationSites().isEmpty()) {
|
||||
|
||||
sharedViewModel.setLocationSiteList(qcResponse.getLocationSites());
|
||||
viewModel.setLocationSiteList(qcResponse.getLocationSites());
|
||||
|
||||
locationSiteList.addAll(qcResponse.getLocationSites());
|
||||
Log.e("locationSiteList-size: ",""+locationSiteList.size());
|
||||
|
||||
locationSitesAdapter = new LocationSitesAdapter(getActivity(), locationSiteList);
|
||||
locationTextview.setAdapter(locationSitesAdapter);
|
||||
locationSiteTextview.setAdapter(locationSitesAdapter);
|
||||
//locationSitesAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
if (!qcResponse.getDepartments().isEmpty()) {
|
||||
|
||||
sharedViewModel.setDepartmentList(qcResponse.getDepartments());
|
||||
viewModel.setDepartmentList(qcResponse.getDepartments());
|
||||
|
||||
departmentList.addAll(qcResponse.getDepartments());
|
||||
Log.e("departmentList-size: ",""+departmentList.size());
|
||||
|
@ -239,31 +286,41 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
|
||||
if (!qcResponse.getLocationFloors().isEmpty()) {
|
||||
|
||||
sharedViewModel.setFloorList(qcResponse.getLocationFloors());
|
||||
viewModel.setFloorList(qcResponse.getLocationFloors());
|
||||
|
||||
locationFloorList.addAll(qcResponse.getLocationFloors());
|
||||
Log.e("locationFloorList-size: ",""+locationFloorList.size());
|
||||
}
|
||||
|
||||
if (!qcResponse.getLocationUnits().isEmpty()) {
|
||||
|
||||
viewModel.setUnitList(qcResponse.getLocationUnits());
|
||||
|
||||
locationUnitList.addAll(qcResponse.getLocationUnits());
|
||||
Log.e("locationUnitList-size: ",""+locationUnitList.size());
|
||||
}
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(getActivity(), "Login Failed", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
|
||||
if (sharedViewModel.getLocationSiteList().isEmpty()) {
|
||||
if (viewModel.getLocationSiteList().isEmpty()) {
|
||||
loginViewModel.getQualityControlData();
|
||||
}
|
||||
else {
|
||||
|
||||
//location list
|
||||
locationSiteList.addAll(sharedViewModel.getLocationSiteList());
|
||||
locationSiteList.addAll(viewModel.getLocationSiteList());
|
||||
Log.e("locationSiteList-size: ",""+locationSiteList.size());
|
||||
|
||||
locationSitesAdapter = new LocationSitesAdapter(getActivity(), locationSiteList);
|
||||
locationTextview.setAdapter(locationSitesAdapter);
|
||||
locationSiteTextview.setAdapter(locationSitesAdapter);
|
||||
|
||||
//department list
|
||||
departmentList.addAll(sharedViewModel.getDepartmentList());
|
||||
departmentList.addAll(viewModel.getDepartmentList());
|
||||
Log.e("departmentList-size: ",""+departmentList.size());
|
||||
|
||||
//filteredList = new ArrayList<>(departmentList);
|
||||
|
@ -273,8 +330,12 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(departmentItemAdapter);
|
||||
|
||||
//unit list
|
||||
locationUnitList.addAll(viewModel.getUnitList());
|
||||
Log.e("locationUnitList-size: ",""+locationUnitList.size());
|
||||
|
||||
//floor list
|
||||
locationFloorList.addAll(sharedViewModel.getFloorList());
|
||||
locationFloorList.addAll(viewModel.getFloorList());
|
||||
Log.e("locationFloorList-size: ",""+locationFloorList.size());
|
||||
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
|
@ -321,5 +382,6 @@ public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnIt
|
|||
@Override
|
||||
public void onItemClick(Department item) {
|
||||
Toast.makeText(getActivity(), "Selected: " + item.getTitle(), Toast.LENGTH_SHORT).show();
|
||||
viewModel.setDepartmentId(item.getId());
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
@ -29,6 +30,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -36,8 +38,9 @@ import android.widget.Toast;
|
|||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemStepsAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -66,6 +69,8 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
ImageButton imagePicker, deleteImage;
|
||||
|
||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
EditText etPercentage, etRemarks;
|
||||
QualityControlViewModel viewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -143,18 +148,24 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
|
||||
initializeLayout(view);
|
||||
|
||||
List<Item> itemList = new ArrayList<>();
|
||||
/*List<Item> itemList = new ArrayList<>();
|
||||
itemList.add(new Item("Sort", 0));
|
||||
itemList.add(new Item("Set in Order", 0));
|
||||
itemList.add(new Item("Shine", 0));
|
||||
itemList.add(new Item("Standardize", 0));
|
||||
itemList.add(new Item("Sustain", 0));
|
||||
itemList.add(new Item("Safety", 0));
|
||||
itemList.add(new Item("Safety", 0));*/
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||
//New Implemented------------------
|
||||
List<ItemModel> itemModelList = new ArrayList<>();
|
||||
for (int i = 1; i < 7; i++) {
|
||||
itemModelList.add(new ItemModel(4,i,0,"0","",0));
|
||||
}
|
||||
|
||||
ItemStepsAdapter adapter = new ItemStepsAdapter(getActivity(), itemModelList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
//----------------------------------
|
||||
|
||||
imageAdapter = new ImageAdapter(imageList, getActivity());
|
||||
imageRecyclerView.setAdapter(imageAdapter);
|
||||
|
@ -174,7 +185,31 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
|
||||
nextButton.setOnClickListener(v -> {
|
||||
if (getActivity() instanceof HomeActivity) {
|
||||
((HomeActivity) getActivity()).navigateToFragment(new SubStoreFragment(), true);
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
viewModel.appendToQualityControlItemList(itemModelList);
|
||||
|
||||
/*if (etRemarks.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else {*/
|
||||
/*sharedViewModel.setPackingPercentage(etPercentage.getText().toString());
|
||||
sharedViewModel.setPackingRemarks(etRemarks.getText().toString());
|
||||
if (!imageList.isEmpty()) {
|
||||
sharedViewModel.setPackingImageList(imageList);
|
||||
}*/
|
||||
((HomeActivity) getActivity()).navigateToFragment(new SubStoreFragment(), true);
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -188,6 +223,10 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
|
||||
private void initializeLayout(View view) {
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||
|
||||
etPercentage = view.findViewById(R.id.et_percentage);
|
||||
etRemarks = view.findViewById(R.id.et_remarks);
|
||||
imagePicker = view.findViewById(R.id.image_picker);
|
||||
deleteImage = view.findViewById(R.id.delete_image);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
|
|
@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
@ -29,6 +30,7 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
@ -36,8 +38,10 @@ import android.widget.Toast;
|
|||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemStepsAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -67,6 +71,8 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
|||
ImageButton imagePicker, deleteImage;
|
||||
|
||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
EditText etPercentage, etRemarks;
|
||||
QualityControlViewModel viewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -153,9 +159,20 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
|||
itemList.add(new Item("Safety", 0));
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||
/*ItemStitchingAdapter adapter = new ItemStitchingAdapter(getActivity(), itemList, sharedViewModel);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);*/
|
||||
|
||||
//New Implemented------------------
|
||||
List<ItemModel> itemModelList = new ArrayList<>();
|
||||
for (int i = 1; i < 7; i++) {
|
||||
itemModelList.add(new ItemModel(2,i,0,"0","",0));
|
||||
}
|
||||
|
||||
ItemStepsAdapter adapter = new ItemStepsAdapter(getActivity(), itemModelList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
//----------------------------------
|
||||
|
||||
imageAdapter = new ImageAdapter(imageList, getActivity());
|
||||
imageRecyclerView.setAdapter(imageAdapter);
|
||||
|
@ -175,7 +192,31 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
|||
|
||||
nextButton.setOnClickListener(v -> {
|
||||
if (getActivity() instanceof HomeActivity) {
|
||||
((HomeActivity) getActivity()).navigateToFragment(new CheckingFragment(), true);
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
viewModel.appendToQualityControlItemList(itemModelList);
|
||||
|
||||
/*if (etRemarks.getText().toString().isEmpty()) {
|
||||
Toast.makeText(getActivity(), "Please enter remarks", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
else {*/
|
||||
/* sharedViewModel.setStitchingPercentage(etPercentage.getText().toString());
|
||||
sharedViewModel.setStitchingRemarks(etRemarks.getText().toString());
|
||||
if (!imageList.isEmpty()) {
|
||||
sharedViewModel.setStitchingImageList(imageList);
|
||||
}*/
|
||||
((HomeActivity) getActivity()).navigateToFragment(new CheckingFragment(), true);
|
||||
// }
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -189,6 +230,10 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
|||
|
||||
private void initializeLayout(View view) {
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||
|
||||
etPercentage = view.findViewById(R.id.et_percentage);
|
||||
etRemarks = view.findViewById(R.id.et_remarks);
|
||||
imagePicker = view.findViewById(R.id.image_picker);
|
||||
deleteImage = view.findViewById(R.id.delete_image);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
|
|
@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
|
|||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.content.FileProvider;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
@ -29,15 +30,16 @@ import android.view.LayoutInflater;
|
|||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.activities.SummaryActivity;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemStepsAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.utils.QualityControlViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -67,6 +69,8 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
|||
ImageButton imagePicker, deleteImage;
|
||||
|
||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
EditText etPercentage, etRemarks;
|
||||
QualityControlViewModel viewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -142,18 +146,24 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
|||
|
||||
initializeLayout(view);
|
||||
|
||||
List<Item> itemList = new ArrayList<>();
|
||||
/*List<Item> itemList = new ArrayList<>();
|
||||
itemList.add(new Item("Sort", 0));
|
||||
itemList.add(new Item("Set in Order", 0));
|
||||
itemList.add(new Item("Shine", 0));
|
||||
itemList.add(new Item("Standardize", 0));
|
||||
itemList.add(new Item("Sustain", 0));
|
||||
itemList.add(new Item("Safety", 0));
|
||||
itemList.add(new Item("Safety", 0));*/
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||
//New Implemented------------------
|
||||
List<ItemModel> itemModelList = new ArrayList<>();
|
||||
for (int i = 1; i < 7; i++) {
|
||||
itemModelList.add(new ItemModel(5,i,0,"0","",0));
|
||||
}
|
||||
|
||||
ItemStepsAdapter adapter = new ItemStepsAdapter(getActivity(), itemModelList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
//----------------------------------
|
||||
|
||||
imageAdapter = new ImageAdapter(imageList, getActivity());
|
||||
imageRecyclerView.setAdapter(imageAdapter);
|
||||
|
@ -172,9 +182,36 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
|||
});
|
||||
|
||||
nextButton.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(getActivity(), SummaryActivity.class);
|
||||
/*Intent intent = new Intent(getActivity(), SummaryActivity.class);
|
||||
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());
|
||||
}
|
||||
|
||||
viewModel.appendToQualityControlItemList(itemModelList);
|
||||
|
||||
List<ItemModel> finalList = viewModel.getQualityControlItemList();
|
||||
for (ItemModel item : finalList) {
|
||||
Log.e("AdapterData", "ProcessId: " + item.getProcessId() +
|
||||
", StepId: " + item.getStepId() +
|
||||
", SpinnerSelection: " + item.getSelectedOption() +
|
||||
", Rating: " + item.getRating() +
|
||||
", Percentage: " + item.getPercentage() +
|
||||
", Remarks: " + item.getRemarks());
|
||||
|
||||
Log.e("------------------","---------------------");
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return view;
|
||||
|
@ -187,6 +224,10 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
|||
|
||||
private void initializeLayout(View view) {
|
||||
|
||||
viewModel = new ViewModelProvider(requireActivity()).get(QualityControlViewModel.class);
|
||||
|
||||
etPercentage = view.findViewById(R.id.et_percentage);
|
||||
etRemarks = view.findViewById(R.id.et_remarks);
|
||||
imagePicker = view.findViewById(R.id.image_picker);
|
||||
deleteImage = view.findViewById(R.id.delete_image);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
|
|
@ -33,7 +33,6 @@ public class Helper {
|
|||
String jsonObject = gson.toJson(modal);
|
||||
prefsEditor.putString(key, jsonObject);
|
||||
prefsEditor.commit();
|
||||
|
||||
}
|
||||
|
||||
static public QualityControlResponse getPreferenceObjectJson(Context c, String key) {
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
|
||||
package com.utopiaindustries.qualitycontrol.models;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class LocationUnit {
|
||||
|
||||
@SerializedName("id")
|
||||
@Expose
|
||||
private Integer id;
|
||||
@SerializedName("title")
|
||||
@Expose
|
||||
private String title;
|
||||
@SerializedName("siteId")
|
||||
@Expose
|
||||
private Integer siteId;
|
||||
@SerializedName("floors")
|
||||
@Expose
|
||||
private Object floors;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(Integer siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public Object getFloors() {
|
||||
return floors;
|
||||
}
|
||||
|
||||
public void setFloors(Object floors) {
|
||||
this.floors = floors;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
|
||||
}
|
|
@ -7,6 +7,9 @@ import java.util.List;
|
|||
|
||||
public class QualityControlResponse {
|
||||
|
||||
@SerializedName("locationUnits")
|
||||
@Expose
|
||||
private List<LocationUnit> locationUnits;
|
||||
@SerializedName("locationFloors")
|
||||
@Expose
|
||||
private List<LocationFloor> locationFloors;
|
||||
|
@ -23,6 +26,15 @@ public class QualityControlResponse {
|
|||
@Expose
|
||||
private List<QualityControlProcess> qualityControlProcessList;
|
||||
|
||||
public List<LocationUnit> getLocationUnits() {
|
||||
return locationUnits;
|
||||
}
|
||||
|
||||
public void setLocationUnits(List<LocationUnit> locationUnits) {
|
||||
this.locationUnits = locationUnits;
|
||||
}
|
||||
|
||||
|
||||
public List<LocationFloor> getLocationFloors() {
|
||||
return locationFloors;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,168 @@
|
|||
package com.utopiaindustries.qualitycontrol.utils;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.models.Department;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationFloor;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationUnit;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.ItemModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class QualityControlViewModel extends ViewModel {
|
||||
|
||||
private String currentDate;
|
||||
private int siteId;
|
||||
private int unitId;
|
||||
private int departmentId;
|
||||
private int floorId;
|
||||
private List<ItemModel> qualityControlItemList;
|
||||
|
||||
private List<LocationSite> locationSiteList;
|
||||
private List<Department> departmentList;
|
||||
private List<LocationFloor> floorList;
|
||||
private List<LocationUnit> unitList;
|
||||
|
||||
private boolean fromViewModel;
|
||||
private String location;
|
||||
private String department;
|
||||
private String unit;
|
||||
private String floor;
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
public void setFloor(String floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
public boolean isFromViewModel() {
|
||||
return fromViewModel;
|
||||
}
|
||||
|
||||
public void setFromViewModel(boolean fromViewModel) {
|
||||
this.fromViewModel = fromViewModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public QualityControlViewModel() {
|
||||
// Initialize the list to avoid NullPointerException
|
||||
qualityControlItemList = new ArrayList<>();
|
||||
locationSiteList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public String getCurrentDate() {
|
||||
return currentDate;
|
||||
}
|
||||
|
||||
public void setCurrentDate(String currentDate) {
|
||||
this.currentDate = currentDate;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public int getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(int unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public int getDepartmentId() {
|
||||
return departmentId;
|
||||
}
|
||||
|
||||
public void setDepartmentId(int departmentId) {
|
||||
this.departmentId = departmentId;
|
||||
}
|
||||
|
||||
public int getFloorId() {
|
||||
return floorId;
|
||||
}
|
||||
|
||||
public void setFloorId(int floorId) {
|
||||
this.floorId = floorId;
|
||||
}
|
||||
|
||||
public List<ItemModel> getQualityControlItemList() {
|
||||
return qualityControlItemList;
|
||||
}
|
||||
|
||||
/*public void setQualityControlItemList(List<ItemModel> qualityControlItemList) {
|
||||
this.qualityControlItemList = qualityControlItemList;
|
||||
}*/
|
||||
|
||||
// Method to append data to the list
|
||||
public void appendToQualityControlItemList(List<ItemModel> items) {
|
||||
if (items != null) {
|
||||
qualityControlItemList.addAll(items);
|
||||
}
|
||||
}
|
||||
|
||||
public List<LocationSite> getLocationSiteList() {
|
||||
return locationSiteList;
|
||||
}
|
||||
|
||||
public void setLocationSiteList(List<LocationSite> locationSiteList) {
|
||||
this.locationSiteList = locationSiteList;
|
||||
}
|
||||
|
||||
public List<Department> getDepartmentList() {
|
||||
return departmentList;
|
||||
}
|
||||
|
||||
public void setDepartmentList(List<Department> departmentList) {
|
||||
this.departmentList = departmentList;
|
||||
}
|
||||
|
||||
public List<LocationFloor> getFloorList() {
|
||||
return floorList;
|
||||
}
|
||||
|
||||
public void setFloorList(List<LocationFloor> floorList) {
|
||||
this.floorList = floorList;
|
||||
}
|
||||
|
||||
public List<LocationUnit> getUnitList() {
|
||||
return unitList;
|
||||
}
|
||||
|
||||
public void setUnitList(List<LocationUnit> unitList) {
|
||||
this.unitList = unitList;
|
||||
}
|
||||
}
|
|
@ -1,515 +0,0 @@
|
|||
package com.utopiaindustries.qualitycontrol.utils;
|
||||
|
||||
import androidx.lifecycle.ViewModel;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.models.Department;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationFloor;
|
||||
import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class SharedViewModel extends ViewModel {
|
||||
private String currentDate;
|
||||
|
||||
private List<LocationSite> locationSiteList;
|
||||
private List<Department> departmentList;
|
||||
private List<LocationFloor> floorList;
|
||||
|
||||
private String location;
|
||||
private String department;
|
||||
private String floor;
|
||||
|
||||
//Cutting
|
||||
private int cuttingSort;
|
||||
private int cuttingSetInOrder;
|
||||
private int cuttingShine;
|
||||
private int cuttingStandardize;
|
||||
private int cuttingSustain;
|
||||
private int cuttingSafety;
|
||||
private String cuttingPercentage;
|
||||
private String cuttingRemarks;
|
||||
private ArrayList<byte[]> cuttingImageList;
|
||||
|
||||
//Stitching
|
||||
private int stitchingSort;
|
||||
private int stitchingSetInOrder;
|
||||
private int stitchingShine;
|
||||
private int stitchingStandardize;
|
||||
private int stitchingSustain;
|
||||
private int stitchingSafety;
|
||||
private String stitchingPercentage;
|
||||
private String stitchingRemarks;
|
||||
private ArrayList<byte[]> stitchingImageList;
|
||||
|
||||
//Checking
|
||||
private int checkingSort;
|
||||
private int checkingSetInOrder;
|
||||
private int checkingShine;
|
||||
private int checkingStandardize;
|
||||
private int checkingSustain;
|
||||
private int checkingSafety;
|
||||
private String checkingPercentage;
|
||||
private String checkingRemarks;
|
||||
private ArrayList<byte[]> checkingImageList;
|
||||
|
||||
//Packing
|
||||
private int packingSort;
|
||||
private int packingSetInOrder;
|
||||
private int packingShine;
|
||||
private int packingStandardize;
|
||||
private int packingSustain;
|
||||
private int packingSafety;
|
||||
private String packingPercentage;
|
||||
private String packingRemarks;
|
||||
private ArrayList<byte[]> packingImageList;
|
||||
|
||||
//Sub Store
|
||||
private int subStoreSort;
|
||||
private int subStoreSetInOrder;
|
||||
private int subStoreShine;
|
||||
private int subStoreStandardize;
|
||||
private int subStoreSustain;
|
||||
private int subStoreSafety;
|
||||
private String subStorePercentage;
|
||||
private String subStoreRemarks;
|
||||
private ArrayList<byte[]> subStoreImageList;
|
||||
|
||||
private boolean fromViewModel;
|
||||
|
||||
public boolean isFromViewModel() {
|
||||
return fromViewModel;
|
||||
}
|
||||
|
||||
public void setFromViewModel(boolean fromViewModel) {
|
||||
this.fromViewModel = fromViewModel;
|
||||
}
|
||||
|
||||
public SharedViewModel() {
|
||||
cuttingImageList = new ArrayList<>();
|
||||
stitchingImageList = new ArrayList<>();
|
||||
checkingImageList = new ArrayList<>();
|
||||
packingImageList = new ArrayList<>();
|
||||
subStoreImageList = new ArrayList<>();
|
||||
|
||||
locationSiteList = new ArrayList<>();
|
||||
departmentList = new ArrayList<>();
|
||||
floorList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public String getCurrentDate() {
|
||||
return currentDate;
|
||||
}
|
||||
|
||||
public void setCurrentDate(String currentDate) {
|
||||
this.currentDate = currentDate;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
public void setFloor(String floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
public int getCuttingSort() {
|
||||
return cuttingSort;
|
||||
}
|
||||
|
||||
public void setCuttingSort(int cuttingSort) {
|
||||
this.cuttingSort = cuttingSort;
|
||||
}
|
||||
|
||||
public int getCuttingSetInOrder() {
|
||||
return cuttingSetInOrder;
|
||||
}
|
||||
|
||||
public void setCuttingSetInOrder(int cuttingSetInOrder) {
|
||||
this.cuttingSetInOrder = cuttingSetInOrder;
|
||||
}
|
||||
|
||||
public int getCuttingShine() {
|
||||
return cuttingShine;
|
||||
}
|
||||
|
||||
public void setCuttingShine(int cuttingShine) {
|
||||
this.cuttingShine = cuttingShine;
|
||||
}
|
||||
|
||||
public int getCuttingStandardize() {
|
||||
return cuttingStandardize;
|
||||
}
|
||||
|
||||
public void setCuttingStandardize(int cuttingStandardize) {
|
||||
this.cuttingStandardize = cuttingStandardize;
|
||||
}
|
||||
|
||||
public int getCuttingSustain() {
|
||||
return cuttingSustain;
|
||||
}
|
||||
|
||||
public void setCuttingSustain(int cuttingSustain) {
|
||||
this.cuttingSustain = cuttingSustain;
|
||||
}
|
||||
|
||||
public int getCuttingSafety() {
|
||||
return cuttingSafety;
|
||||
}
|
||||
|
||||
public void setCuttingSafety(int cuttingSafety) {
|
||||
this.cuttingSafety = cuttingSafety;
|
||||
}
|
||||
|
||||
public String getCuttingPercentage() {
|
||||
return cuttingPercentage;
|
||||
}
|
||||
|
||||
public void setCuttingPercentage(String cuttingPercentage) {
|
||||
this.cuttingPercentage = cuttingPercentage;
|
||||
}
|
||||
|
||||
public String getCuttingRemarks() {
|
||||
return cuttingRemarks;
|
||||
}
|
||||
|
||||
public void setCuttingRemarks(String cuttingRemarks) {
|
||||
this.cuttingRemarks = cuttingRemarks;
|
||||
}
|
||||
|
||||
public ArrayList<byte[]> getCuttingImageList() {
|
||||
return cuttingImageList;
|
||||
}
|
||||
|
||||
public void setCuttingImageList(ArrayList<byte[]> cuttingImageList) {
|
||||
this.cuttingImageList = cuttingImageList;
|
||||
}
|
||||
|
||||
public int getStitchingSort() {
|
||||
return stitchingSort;
|
||||
}
|
||||
|
||||
public void setStitchingSort(int stitchingSort) {
|
||||
this.stitchingSort = stitchingSort;
|
||||
}
|
||||
|
||||
public int getStitchingSetInOrder() {
|
||||
return stitchingSetInOrder;
|
||||
}
|
||||
|
||||
public void setStitchingSetInOrder(int stitchingSetInOrder) {
|
||||
this.stitchingSetInOrder = stitchingSetInOrder;
|
||||
}
|
||||
|
||||
public int getStitchingShine() {
|
||||
return stitchingShine;
|
||||
}
|
||||
|
||||
public void setStitchingShine(int stitchingShine) {
|
||||
this.stitchingShine = stitchingShine;
|
||||
}
|
||||
|
||||
public int getStitchingStandardize() {
|
||||
return stitchingStandardize;
|
||||
}
|
||||
|
||||
public void setStitchingStandardize(int stitchingStandardize) {
|
||||
this.stitchingStandardize = stitchingStandardize;
|
||||
}
|
||||
|
||||
public int getStitchingSustain() {
|
||||
return stitchingSustain;
|
||||
}
|
||||
|
||||
public void setStitchingSustain(int stitchingSustain) {
|
||||
this.stitchingSustain = stitchingSustain;
|
||||
}
|
||||
|
||||
public int getStitchingSafety() {
|
||||
return stitchingSafety;
|
||||
}
|
||||
|
||||
public void setStitchingSafety(int stitchingSafety) {
|
||||
this.stitchingSafety = stitchingSafety;
|
||||
}
|
||||
|
||||
public String getStitchingPercentage() {
|
||||
return stitchingPercentage;
|
||||
}
|
||||
|
||||
public void setStitchingPercentage(String stitchingPercentage) {
|
||||
this.stitchingPercentage = stitchingPercentage;
|
||||
}
|
||||
|
||||
public String getStitchingRemarks() {
|
||||
return stitchingRemarks;
|
||||
}
|
||||
|
||||
public void setStitchingRemarks(String stitchingRemarks) {
|
||||
this.stitchingRemarks = stitchingRemarks;
|
||||
}
|
||||
|
||||
public ArrayList<byte[]> getStitchingImageList() {
|
||||
return stitchingImageList;
|
||||
}
|
||||
|
||||
public void setStitchingImageList(ArrayList<byte[]> stitchingImageList) {
|
||||
this.stitchingImageList = stitchingImageList;
|
||||
}
|
||||
|
||||
public int getCheckingSort() {
|
||||
return checkingSort;
|
||||
}
|
||||
|
||||
public void setCheckingSort(int checkingSort) {
|
||||
this.checkingSort = checkingSort;
|
||||
}
|
||||
|
||||
public int getCheckingSetInOrder() {
|
||||
return checkingSetInOrder;
|
||||
}
|
||||
|
||||
public void setCheckingSetInOrder(int checkingSetInOrder) {
|
||||
this.checkingSetInOrder = checkingSetInOrder;
|
||||
}
|
||||
|
||||
public int getCheckingShine() {
|
||||
return checkingShine;
|
||||
}
|
||||
|
||||
public void setCheckingShine(int checkingShine) {
|
||||
this.checkingShine = checkingShine;
|
||||
}
|
||||
|
||||
public int getCheckingStandardize() {
|
||||
return checkingStandardize;
|
||||
}
|
||||
|
||||
public void setCheckingStandardize(int checkingStandardize) {
|
||||
this.checkingStandardize = checkingStandardize;
|
||||
}
|
||||
|
||||
public int getCheckingSustain() {
|
||||
return checkingSustain;
|
||||
}
|
||||
|
||||
public void setCheckingSustain(int checkingSustain) {
|
||||
this.checkingSustain = checkingSustain;
|
||||
}
|
||||
|
||||
public int getCheckingSafety() {
|
||||
return checkingSafety;
|
||||
}
|
||||
|
||||
public void setCheckingSafety(int checkingSafety) {
|
||||
this.checkingSafety = checkingSafety;
|
||||
}
|
||||
|
||||
public String getCheckingPercentage() {
|
||||
return checkingPercentage;
|
||||
}
|
||||
|
||||
public void setCheckingPercentage(String checkingPercentage) {
|
||||
this.checkingPercentage = checkingPercentage;
|
||||
}
|
||||
|
||||
public String getCheckingRemarks() {
|
||||
return checkingRemarks;
|
||||
}
|
||||
|
||||
public void setCheckingRemarks(String checkingRemarks) {
|
||||
this.checkingRemarks = checkingRemarks;
|
||||
}
|
||||
|
||||
public ArrayList<byte[]> getCheckingImageList() {
|
||||
return checkingImageList;
|
||||
}
|
||||
|
||||
public void setCheckingImageList(ArrayList<byte[]> checkingImageList) {
|
||||
this.checkingImageList = checkingImageList;
|
||||
}
|
||||
|
||||
public int getPackingSort() {
|
||||
return packingSort;
|
||||
}
|
||||
|
||||
public void setPackingSort(int packingSort) {
|
||||
this.packingSort = packingSort;
|
||||
}
|
||||
|
||||
public int getPackingSetInOrder() {
|
||||
return packingSetInOrder;
|
||||
}
|
||||
|
||||
public void setPackingSetInOrder(int packingSetInOrder) {
|
||||
this.packingSetInOrder = packingSetInOrder;
|
||||
}
|
||||
|
||||
public int getPackingShine() {
|
||||
return packingShine;
|
||||
}
|
||||
|
||||
public void setPackingShine(int packingShine) {
|
||||
this.packingShine = packingShine;
|
||||
}
|
||||
|
||||
public int getPackingStandardize() {
|
||||
return packingStandardize;
|
||||
}
|
||||
|
||||
public void setPackingStandardize(int packingStandardize) {
|
||||
this.packingStandardize = packingStandardize;
|
||||
}
|
||||
|
||||
public int getPackingSustain() {
|
||||
return packingSustain;
|
||||
}
|
||||
|
||||
public void setPackingSustain(int packingSustain) {
|
||||
this.packingSustain = packingSustain;
|
||||
}
|
||||
|
||||
public int getPackingSafety() {
|
||||
return packingSafety;
|
||||
}
|
||||
|
||||
public void setPackingSafety(int packingSafety) {
|
||||
this.packingSafety = packingSafety;
|
||||
}
|
||||
|
||||
public String getPackingPercentage() {
|
||||
return packingPercentage;
|
||||
}
|
||||
|
||||
public void setPackingPercentage(String packingPercentage) {
|
||||
this.packingPercentage = packingPercentage;
|
||||
}
|
||||
|
||||
public String getPackingRemarks() {
|
||||
return packingRemarks;
|
||||
}
|
||||
|
||||
public void setPackingRemarks(String packingRemarks) {
|
||||
this.packingRemarks = packingRemarks;
|
||||
}
|
||||
|
||||
public ArrayList<byte[]> getPackingImageList() {
|
||||
return packingImageList;
|
||||
}
|
||||
|
||||
public void setPackingImageList(ArrayList<byte[]> packingImageList) {
|
||||
this.packingImageList = packingImageList;
|
||||
}
|
||||
|
||||
public int getSubStoreSort() {
|
||||
return subStoreSort;
|
||||
}
|
||||
|
||||
public void setSubStoreSort(int subStoreSort) {
|
||||
this.subStoreSort = subStoreSort;
|
||||
}
|
||||
|
||||
public int getSubStoreSetInOrder() {
|
||||
return subStoreSetInOrder;
|
||||
}
|
||||
|
||||
public void setSubStoreSetInOrder(int subStoreSetInOrder) {
|
||||
this.subStoreSetInOrder = subStoreSetInOrder;
|
||||
}
|
||||
|
||||
public int getSubStoreShine() {
|
||||
return subStoreShine;
|
||||
}
|
||||
|
||||
public void setSubStoreShine(int subStoreShine) {
|
||||
this.subStoreShine = subStoreShine;
|
||||
}
|
||||
|
||||
public int getSubStoreStandardize() {
|
||||
return subStoreStandardize;
|
||||
}
|
||||
|
||||
public void setSubStoreStandardize(int subStoreStandardize) {
|
||||
this.subStoreStandardize = subStoreStandardize;
|
||||
}
|
||||
|
||||
public int getSubStoreSustain() {
|
||||
return subStoreSustain;
|
||||
}
|
||||
|
||||
public void setSubStoreSustain(int subStoreSustain) {
|
||||
this.subStoreSustain = subStoreSustain;
|
||||
}
|
||||
|
||||
public int getSubStoreSafety() {
|
||||
return subStoreSafety;
|
||||
}
|
||||
|
||||
public void setSubStoreSafety(int subStoreSafety) {
|
||||
this.subStoreSafety = subStoreSafety;
|
||||
}
|
||||
|
||||
public String getSubStorePercentage() {
|
||||
return subStorePercentage;
|
||||
}
|
||||
|
||||
public void setSubStorePercentage(String subStorePercentage) {
|
||||
this.subStorePercentage = subStorePercentage;
|
||||
}
|
||||
|
||||
public String getSubStoreRemarks() {
|
||||
return subStoreRemarks;
|
||||
}
|
||||
|
||||
public void setSubStoreRemarks(String subStoreRemarks) {
|
||||
this.subStoreRemarks = subStoreRemarks;
|
||||
}
|
||||
|
||||
public ArrayList<byte[]> getSubStoreImageList() {
|
||||
return subStoreImageList;
|
||||
}
|
||||
|
||||
public void setSubStoreImageList(ArrayList<byte[]> subStoreImageList) {
|
||||
this.subStoreImageList = subStoreImageList;
|
||||
}
|
||||
|
||||
public List<LocationSite> getLocationSiteList() {
|
||||
return locationSiteList;
|
||||
}
|
||||
|
||||
public void setLocationSiteList(List<LocationSite> locationSiteList) {
|
||||
this.locationSiteList = locationSiteList;
|
||||
}
|
||||
|
||||
public List<Department> getDepartmentList() {
|
||||
return departmentList;
|
||||
}
|
||||
|
||||
public void setDepartmentList(List<Department> departmentList) {
|
||||
this.departmentList = departmentList;
|
||||
}
|
||||
|
||||
public List<LocationFloor> getFloorList() {
|
||||
return floorList;
|
||||
}
|
||||
|
||||
public void setFloorList(List<LocationFloor> floorList) {
|
||||
this.floorList = floorList;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.utopiaindustries.qualitycontrol.viewmodels;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ItemModel {
|
||||
|
||||
private int processId;
|
||||
private int stepId;
|
||||
private int rating;
|
||||
private String percentage;
|
||||
private String remarks;
|
||||
private int selectedOption;
|
||||
//private ArrayList<byte[]> cuttingImageList;
|
||||
|
||||
public ItemModel() {
|
||||
}
|
||||
|
||||
public ItemModel(int processId, int stepId, int rating, String percentage, String remarks, int selectedOption) {
|
||||
this.processId = processId;
|
||||
this.stepId = stepId;
|
||||
this.rating = rating;
|
||||
this.percentage = percentage;
|
||||
this.remarks = remarks;
|
||||
this.selectedOption = selectedOption;
|
||||
}
|
||||
|
||||
public int getProcessId() {
|
||||
return processId;
|
||||
}
|
||||
|
||||
public void setProcessId(int processId) {
|
||||
this.processId = processId;
|
||||
}
|
||||
|
||||
public int getStepId() {
|
||||
return stepId;
|
||||
}
|
||||
|
||||
public void setStepId(int stepId) {
|
||||
this.stepId = stepId;
|
||||
}
|
||||
|
||||
public String getPercentage() {
|
||||
return percentage;
|
||||
}
|
||||
|
||||
public void setPercentage(String percentage) {
|
||||
this.percentage = percentage;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public int getSelectedOption() {
|
||||
return selectedOption;
|
||||
}
|
||||
|
||||
public void setSelectedOption(int selectedOption) {
|
||||
this.selectedOption = selectedOption;
|
||||
}
|
||||
|
||||
public int getRating() {
|
||||
return rating;
|
||||
}
|
||||
|
||||
public void setRating(int rating) {
|
||||
this.rating = rating;
|
||||
}
|
||||
}
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
|
@ -62,6 +62,7 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:text="Remarks: "
|
||||
android:textSize="@dimen/_14sdp" />
|
||||
|
||||
|
@ -69,7 +70,7 @@
|
|||
android:id="@+id/et_remarks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:maxLines="3"
|
||||
|
@ -78,6 +79,7 @@
|
|||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
|
@ -114,6 +116,7 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/imageRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="150dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="5dp"/>
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
|
@ -62,6 +62,7 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:text="Remarks: "
|
||||
android:textSize="@dimen/_14sdp" />
|
||||
|
||||
|
@ -69,7 +70,8 @@
|
|||
android:id="@+id/et_remarks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:visibility="gone"
|
||||
android:enabled="true"
|
||||
android:padding="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
|
@ -79,6 +81,7 @@
|
|||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
|
@ -116,6 +119,7 @@
|
|||
android:id="@+id/imageRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="150dp"
|
||||
android:visibility="gone"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="5dp"/>
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
android:id="@+id/searchEditText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="Search"
|
||||
android:hint="Search Department"
|
||||
android:padding="10dp"
|
||||
android:layout_margin="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
|
@ -73,7 +73,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:padding="5dp"
|
||||
android:text="Location: "
|
||||
android:text="Site: "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_16sdp"
|
||||
android:textStyle="bold" />
|
||||
|
@ -96,6 +96,34 @@
|
|||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:padding="5dp"
|
||||
android:text="Unit: "
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/_16sdp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:hint="@string/select_units"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/txt_driver_name">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/unit_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:inputType="none"
|
||||
android:textSize="16sp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
|
@ -62,6 +62,7 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:text="Remarks: "
|
||||
android:textSize="@dimen/_14sdp" />
|
||||
|
||||
|
@ -69,7 +70,7 @@
|
|||
android:id="@+id/et_remarks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:maxLines="3"
|
||||
|
@ -78,6 +79,7 @@
|
|||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
|
@ -114,6 +116,7 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/imageRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="150dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="5dp"/>
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
|
@ -62,6 +62,7 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:text="Remarks: "
|
||||
android:textSize="@dimen/_14sdp" />
|
||||
|
||||
|
@ -69,7 +70,7 @@
|
|||
android:id="@+id/et_remarks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:maxLines="3"
|
||||
|
@ -78,6 +79,7 @@
|
|||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
|
@ -114,6 +116,7 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/imageRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="150dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="5dp"/>
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="5dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:orientation="vertical"
|
||||
android:padding="5dp">
|
||||
|
||||
|
@ -62,6 +62,7 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:text="Remarks: "
|
||||
android:textSize="@dimen/_14sdp" />
|
||||
|
||||
|
@ -69,7 +70,7 @@
|
|||
android:id="@+id/et_remarks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:enabled="false"
|
||||
android:visibility="gone"
|
||||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/et_border"
|
||||
android:maxLines="3"
|
||||
|
@ -78,6 +79,7 @@
|
|||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
android:padding="5dp">
|
||||
|
||||
<TextView
|
||||
|
@ -114,6 +116,7 @@
|
|||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/imageRecyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="150dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_margin="5dp"/>
|
||||
|
|
|
@ -2,26 +2,96 @@
|
|||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1"
|
||||
android:background="@drawable/et_border_dropdown"
|
||||
android:padding="10dp">
|
||||
android:padding="5dp"
|
||||
android:weightSum="1">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_item_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="0.7"
|
||||
android:text="Item Name"
|
||||
android:textSize="@dimen/_14sdp"
|
||||
android:padding="8dp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_item_options"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.3"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:ellipsize="end"
|
||||
android:maxLength="20"
|
||||
android:maxLines="1"
|
||||
android:padding="8dp"
|
||||
android:text="Set in Order"
|
||||
android:textSize="@dimen/_10sdp" />
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:spinnerMode="dropdown" />
|
||||
android:layout_margin="2dp"
|
||||
android:fadeScrollbars="false"
|
||||
android:fillViewport="true"
|
||||
android:padding="2dp"
|
||||
android:scrollbarFadeDuration="0"
|
||||
android:scrollbarSize="1dp"
|
||||
android:scrollbarThumbVertical="@android:color/darker_gray"
|
||||
android:scrollbars="horizontal">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="5dp"
|
||||
android:weightSum="5">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/spinner"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_alignParentStart="true"
|
||||
android:hint="Rate">
|
||||
|
||||
<AutoCompleteTextView
|
||||
android:id="@+id/score_textview"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="start|left"
|
||||
android:gravity="center"
|
||||
android:inputType="none"
|
||||
android:textSize="@dimen/_10sdp" />
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_percentage"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_toEndOf="@+id/spinner"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:gravity="center"
|
||||
android:padding="8dp"
|
||||
android:text="0%"
|
||||
android:textSize="@dimen/_13sdp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_remarks"
|
||||
android:layout_width="150dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:maxLines="1"
|
||||
android:hint="Remarks"
|
||||
android:layout_toEndOf="@+id/tv_percentage"
|
||||
android:background="@drawable/et_border"
|
||||
android:padding="5dp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img1"
|
||||
android:layout_width="60dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_toEndOf="@+id/et_remarks"
|
||||
android:src="@drawable/image_picker" />
|
||||
|
||||
</RelativeLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
</LinearLayout>
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
<string name="select_location">Select Location</string>
|
||||
<string name="select_department">Select Department</string>
|
||||
<string name="select_units">Select Unit</string>
|
||||
<string name="select_floor">Select Floor</string>
|
||||
|
||||
<string name="rationale_camera">This app require permission for camera.</string>
|
||||
|
|
Loading…
Reference in New Issue