Location search, department spinner, floor spinner
parent
4b54fa3ba3
commit
60569fb5a5
|
@ -0,0 +1,75 @@
|
||||||
|
package com.utopiaindustries.qualitycontrol.adapters;
|
||||||
|
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.utopiaindustries.qualitycontrol.models.Department;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class DepartmentItemAdapter extends RecyclerView.Adapter<DepartmentItemAdapter.ItemViewHolder> {
|
||||||
|
|
||||||
|
private final List<Department> items;
|
||||||
|
private OnItemClickListener onItemClickListener;
|
||||||
|
private EditText editText;
|
||||||
|
private RecyclerView recyclerView;
|
||||||
|
|
||||||
|
public DepartmentItemAdapter(List<Department> items, OnItemClickListener listener, EditText editText, RecyclerView recyclerView) {
|
||||||
|
this.items = items;
|
||||||
|
this.onItemClickListener = listener;
|
||||||
|
this.editText = editText;
|
||||||
|
this.recyclerView = recyclerView;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemClickListener {
|
||||||
|
void onItemClick(Department item);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
View view = LayoutInflater.from(parent.getContext())
|
||||||
|
.inflate(android.R.layout.simple_list_item_1, parent, false);
|
||||||
|
return new ItemViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ItemViewHolder holder, int position) {
|
||||||
|
Department item = items.get(position);
|
||||||
|
holder.textView.setText(item.getTitle());
|
||||||
|
|
||||||
|
// Set the click listener on the item view
|
||||||
|
holder.itemView.setOnClickListener(v -> {
|
||||||
|
editText.setText(item.getTitle());
|
||||||
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (onItemClickListener != null) {
|
||||||
|
onItemClickListener.onItemClick(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/*holder.itemView.setOnClickListener(v -> {
|
||||||
|
// Handle item selection
|
||||||
|
System.out.println("Selected: " + item);
|
||||||
|
});*/
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return items.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
static class ItemViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
TextView textView;
|
||||||
|
|
||||||
|
public ItemViewHolder(@NonNull View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
textView = itemView.findViewById(android.R.id.text1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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.LocationSite;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class FloorAdapter extends ArrayAdapter<LocationFloor> {
|
||||||
|
|
||||||
|
private final Context context;
|
||||||
|
private final List<LocationFloor> items;
|
||||||
|
|
||||||
|
public FloorAdapter(Context context, List<LocationFloor> 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
LocationFloor item = items.get(position);
|
||||||
|
|
||||||
|
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||||
|
|
||||||
|
titleTextView.setText(item.getTitle());
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
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,6 +1,7 @@
|
||||||
package com.utopiaindustries.qualitycontrol.adapters;
|
package com.utopiaindustries.qualitycontrol.adapters;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -13,18 +14,21 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||||
|
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.ItemViewHolder> {
|
public class ItemCuttingAdapter extends RecyclerView.Adapter<ItemCuttingAdapter.ItemViewHolder> {
|
||||||
|
|
||||||
private final Context context;
|
private final Context context;
|
||||||
private final List<Item> items;
|
private final List<Item> items;
|
||||||
private final String[] dropdownOptions = {"1", "2", "3", "4", "5"};
|
private final String[] dropdownOptions = {"1", "2", "3", "4", "5"};
|
||||||
|
SharedViewModel viewModel;
|
||||||
|
|
||||||
public ItemAdapter(Context context, List<Item> items) {
|
public ItemCuttingAdapter(Context context, List<Item> items, SharedViewModel viewModel) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.items = items;
|
this.items = items;
|
||||||
|
this.viewModel = viewModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
|
@ -52,11 +56,39 @@ public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.ItemViewHolder
|
||||||
// Save selected option when user selects one
|
// Save selected option when user selects one
|
||||||
holder.spinnerOptions.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
holder.spinnerOptions.setOnItemSelectedListener(new android.widget.AdapterView.OnItemSelectedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int position, long id) {
|
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int sub_position, long id) {
|
||||||
currentItem.setSelectedOption(position); // Save the selected option
|
//currentItem.setSelectedOption(position); // Save the selected option
|
||||||
|
|
||||||
if (currentItem.getSelectedOption() != position) { // Avoid unnecessary updates
|
if (currentItem.getSelectedOption() != sub_position) { // Avoid unnecessary updates
|
||||||
currentItem.setSelectedOption(position); // Save the selected option
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,117 @@
|
||||||
|
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,117 @@
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,117 @@
|
||||||
|
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 LocationSitesAdapter extends ArrayAdapter<LocationSite> {
|
||||||
|
|
||||||
|
private final Context context;
|
||||||
|
private final List<LocationSite> items;
|
||||||
|
|
||||||
|
public LocationSitesAdapter(Context context, List<LocationSite> 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);
|
||||||
|
}
|
||||||
|
|
||||||
|
LocationSite item = items.get(position);
|
||||||
|
|
||||||
|
TextView titleTextView = convertView.findViewById(R.id.item_text);
|
||||||
|
|
||||||
|
titleTextView.setText(item.getTitle());
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,6 +19,7 @@ import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
@ -36,8 +37,10 @@ import android.widget.Toast;
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ItemAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ItemCheckingAdapter;
|
||||||
|
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||||
|
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -65,6 +68,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||||
Button nextButton;
|
Button nextButton;
|
||||||
ImageButton imagePicker, deleteImage;
|
ImageButton imagePicker, deleteImage;
|
||||||
|
SharedViewModel sharedViewModel;
|
||||||
|
|
||||||
// Activity Result Launcher for Gallery
|
// Activity Result Launcher for Gallery
|
||||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||||
|
@ -151,7 +155,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
itemList.add(new Item("Safety", 0));
|
itemList.add(new Item("Safety", 0));
|
||||||
|
|
||||||
// Set up RecyclerView
|
// Set up RecyclerView
|
||||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
ItemCheckingAdapter adapter = new ItemCheckingAdapter(getActivity(), itemList, sharedViewModel);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
@ -187,6 +191,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
||||||
|
|
||||||
private void initializeLayout(View view) {
|
private void initializeLayout(View view) {
|
||||||
|
|
||||||
|
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||||
imagePicker = view.findViewById(R.id.image_picker);
|
imagePicker = view.findViewById(R.id.image_picker);
|
||||||
deleteImage = view.findViewById(R.id.delete_image);
|
deleteImage = view.findViewById(R.id.delete_image);
|
||||||
nextButton = view.findViewById(R.id.btn_next);
|
nextButton = view.findViewById(R.id.btn_next);
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.utopiaindustries.qualitycontrol.fragments;
|
package com.utopiaindustries.qualitycontrol.fragments;
|
||||||
|
|
||||||
import static android.app.Activity.RESULT_OK;
|
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -21,6 +19,7 @@ import androidx.annotation.Nullable;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
import androidx.core.content.FileProvider;
|
import androidx.core.content.FileProvider;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
@ -38,22 +37,21 @@ import android.widget.Toast;
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ItemAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
||||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||||
import com.utopiaindustries.qualitycontrol.models.QualityControlProcessStep;
|
import com.utopiaindustries.qualitycontrol.models.QualityControlProcessStep;
|
||||||
import com.utopiaindustries.qualitycontrol.models.QualityControlResponse;
|
import com.utopiaindustries.qualitycontrol.models.QualityControlResponse;
|
||||||
|
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.lang.reflect.Array;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
@ -73,6 +71,7 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
ArrayList<byte[]> imageList = new ArrayList<>();
|
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||||
ArrayList<QualityControlProcessStep> qualityControlProcessStepList = new ArrayList<>();
|
ArrayList<QualityControlProcessStep> qualityControlProcessStepList = new ArrayList<>();
|
||||||
QualityControlResponse qualityControlResponse;
|
QualityControlResponse qualityControlResponse;
|
||||||
|
SharedViewModel sharedViewModel;
|
||||||
|
|
||||||
// Activity Result Launcher for Gallery
|
// Activity Result Launcher for Gallery
|
||||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||||
|
@ -158,7 +157,7 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
itemList.add(new Item("Safety", 0));
|
itemList.add(new Item("Safety", 0));
|
||||||
|
|
||||||
// Set up RecyclerView
|
// Set up RecyclerView
|
||||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList, sharedViewModel);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
@ -189,6 +188,8 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
|
|
||||||
private void initializeLayout(View view) {
|
private void initializeLayout(View view) {
|
||||||
|
|
||||||
|
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||||
|
|
||||||
imagePicker = view.findViewById(R.id.image_picker);
|
imagePicker = view.findViewById(R.id.image_picker);
|
||||||
deleteImage = view.findViewById(R.id.delete_image);
|
deleteImage = view.findViewById(R.id.delete_image);
|
||||||
nextButton = view.findViewById(R.id.btn_next);
|
nextButton = view.findViewById(R.id.btn_next);
|
||||||
|
|
|
@ -7,19 +7,28 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.lifecycle.ViewModelProvider;
|
import androidx.lifecycle.ViewModelProvider;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.AutoCompleteTextView;
|
import android.widget.AutoCompleteTextView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.EditText;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
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.helper.Helper;
|
import com.utopiaindustries.qualitycontrol.helper.Helper;
|
||||||
import com.utopiaindustries.qualitycontrol.helper.Preference;
|
import com.utopiaindustries.qualitycontrol.helper.Preference;
|
||||||
import com.utopiaindustries.qualitycontrol.models.Department;
|
import com.utopiaindustries.qualitycontrol.models.Department;
|
||||||
|
@ -28,30 +37,47 @@ import com.utopiaindustries.qualitycontrol.models.LocationSite;
|
||||||
import com.utopiaindustries.qualitycontrol.models.QualityControlProcess;
|
import com.utopiaindustries.qualitycontrol.models.QualityControlProcess;
|
||||||
import com.utopiaindustries.qualitycontrol.models.QualityControlProcessStep;
|
import com.utopiaindustries.qualitycontrol.models.QualityControlProcessStep;
|
||||||
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
||||||
|
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||||
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class HomeFragment extends Fragment {
|
public class HomeFragment extends Fragment implements DepartmentItemAdapter.OnItemClickListener{
|
||||||
|
|
||||||
AutoCompleteTextView locationTextview, departmentTextView, floorTextview;
|
AutoCompleteTextView locationTextview, departmentTextView, floorTextview;
|
||||||
TextView txtCurrentDate;
|
TextView txtCurrentDate;
|
||||||
LoginViewModel loginViewModel;
|
LoginViewModel loginViewModel;
|
||||||
|
Button nextButton;
|
||||||
|
|
||||||
|
LocationSitesAdapter locationSitesAdapter;
|
||||||
|
FloorAdapter floorAdapter;
|
||||||
|
|
||||||
ArrayList<LocationFloor> locationFloorList = new ArrayList<>();
|
ArrayList<LocationFloor> locationFloorList = new ArrayList<>();
|
||||||
ArrayList<LocationSite> locationSiteList = new ArrayList<>();
|
ArrayList<LocationSite> locationSiteList = new ArrayList<>();
|
||||||
ArrayList<Department> departmentList = new ArrayList<>();
|
ArrayList<Department> departmentList = new ArrayList<>();
|
||||||
ArrayList<QualityControlProcess> qualityControlProcessList = new ArrayList<>();
|
ArrayList<QualityControlProcess> qualityControlProcessList = new ArrayList<>();
|
||||||
|
|
||||||
|
EditText searchEditText;
|
||||||
|
RecyclerView recyclerView;
|
||||||
|
List<Department> itemList, filteredList;
|
||||||
|
private DepartmentItemAdapter departmentItemAdapter;
|
||||||
|
|
||||||
|
SharedViewModel sharedViewModel;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||||
|
|
||||||
|
Log.e("onCreateView: ","====================");
|
||||||
|
|
||||||
initializeLayout(view);
|
initializeLayout(view);
|
||||||
|
|
||||||
String date = new SimpleDateFormat("EEEE, MMM d, yyyy", Locale.getDefault()).format(new Date());
|
String date = new SimpleDateFormat("EEEE, MMM d, yyyy", Locale.getDefault()).format(new Date());
|
||||||
|
@ -60,14 +86,30 @@ public class HomeFragment extends Fragment {
|
||||||
locationTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
locationTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||||
String item = adapterView.getItemAtPosition(position).toString();
|
LocationSite clickedItem = locationSiteList.get(position);
|
||||||
Log.e("Item-----------: ", "" + item);
|
Log.e("Item-----------: ", clickedItem.getTitle());
|
||||||
|
floorTextview.setText("Select Floor");
|
||||||
|
//floorTextview.clearListSelection();
|
||||||
|
|
||||||
|
if (!locationFloorList.isEmpty()) {
|
||||||
|
List<LocationFloor> filteredItems = locationFloorList.stream()
|
||||||
|
.filter(item -> Objects.equals(item.getSiteId(), clickedItem.getId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
Log.e("Filtered-size: ",""+filteredItems.size());
|
||||||
|
|
||||||
|
floorAdapter = new FloorAdapter(getActivity(), filteredItems);
|
||||||
|
floorTextview.setAdapter(floorAdapter);
|
||||||
|
|
||||||
|
// Print filtered items
|
||||||
|
for (LocationFloor item : filteredItems) {
|
||||||
|
Log.e("Floor-Title: ", item.getTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
departmentTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
/* departmentTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||||
String item = adapterView.getItemAtPosition(position).toString();
|
String item = adapterView.getItemAtPosition(position).toString();
|
||||||
|
@ -75,25 +117,57 @@ public class HomeFragment extends Fragment {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
|
|
||||||
floorTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
floorTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||||
String item = adapterView.getItemAtPosition(position).toString();
|
LocationFloor clickedItem = locationFloorList.get(position);
|
||||||
Log.e("Item-----------: ", "" + item);
|
Log.e("Item-----------: ", clickedItem.getTitle());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Button nextButton = view.findViewById(R.id.btn_next);
|
|
||||||
nextButton.setOnClickListener(v -> {
|
nextButton.setOnClickListener(v -> {
|
||||||
if (getActivity() instanceof HomeActivity) {
|
if (getActivity() instanceof HomeActivity) {
|
||||||
|
sharedViewModel.setFromViewModel(true);
|
||||||
((HomeActivity) getActivity()).navigateToFragment(new CuttingFragment(), true);
|
((HomeActivity) getActivity()).navigateToFragment(new CuttingFragment(), true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
searchEditText.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) {
|
||||||
|
filterList(s.toString());
|
||||||
|
|
||||||
|
|
||||||
|
if (s.length() > 0) {
|
||||||
|
Log.e("filterList","0.1");
|
||||||
|
if (sharedViewModel.isFromViewModel()) {
|
||||||
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
recyclerView.setVisibility(View.VISIBLE); // Show the list when typing
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Log.e("filterList","0.21");
|
||||||
|
recyclerView.setVisibility(View.GONE); // Hide when no text is entered
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,10 +177,18 @@ public class HomeFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initializeLayout(View view) {
|
public void initializeLayout(View view) {
|
||||||
|
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||||
|
|
||||||
txtCurrentDate = view.findViewById(R.id.txt_current_date);
|
txtCurrentDate = view.findViewById(R.id.txt_current_date);
|
||||||
locationTextview = view.findViewById(R.id.location_textview);
|
locationTextview = view.findViewById(R.id.location_textview);
|
||||||
departmentTextView = view.findViewById(R.id.department_textview);
|
//departmentTextView = view.findViewById(R.id.department_textview);
|
||||||
floorTextview = view.findViewById(R.id.floor_textview);
|
floorTextview = view.findViewById(R.id.floor_textview);
|
||||||
|
nextButton = view.findViewById(R.id.btn_next);
|
||||||
|
|
||||||
|
searchEditText = view.findViewById(R.id.searchEditText);
|
||||||
|
recyclerView = view.findViewById(R.id.recyclerView);
|
||||||
|
|
||||||
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
|
||||||
loginViewModel = new ViewModelProvider(getActivity()).get(LoginViewModel.class);
|
loginViewModel = new ViewModelProvider(getActivity()).get(LoginViewModel.class);
|
||||||
|
|
||||||
|
@ -127,17 +209,38 @@ public class HomeFragment extends Fragment {
|
||||||
|
|
||||||
Helper.setPreferenceObject(getActivity().getApplicationContext(), qcResponse, "qcResponse");
|
Helper.setPreferenceObject(getActivity().getApplicationContext(), qcResponse, "qcResponse");
|
||||||
|
|
||||||
|
|
||||||
if (!qcResponse.getLocationSites().isEmpty()) {
|
if (!qcResponse.getLocationSites().isEmpty()) {
|
||||||
|
|
||||||
|
sharedViewModel.setLocationSiteList(qcResponse.getLocationSites());
|
||||||
|
|
||||||
locationSiteList.addAll(qcResponse.getLocationSites());
|
locationSiteList.addAll(qcResponse.getLocationSites());
|
||||||
Log.e("locationSiteList-size: ",""+locationSiteList.size());
|
Log.e("locationSiteList-size: ",""+locationSiteList.size());
|
||||||
|
|
||||||
|
locationSitesAdapter = new LocationSitesAdapter(getActivity(), locationSiteList);
|
||||||
|
locationTextview.setAdapter(locationSitesAdapter);
|
||||||
|
//locationSitesAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qcResponse.getDepartments().isEmpty()) {
|
if (!qcResponse.getDepartments().isEmpty()) {
|
||||||
|
|
||||||
|
sharedViewModel.setDepartmentList(qcResponse.getDepartments());
|
||||||
|
|
||||||
departmentList.addAll(qcResponse.getDepartments());
|
departmentList.addAll(qcResponse.getDepartments());
|
||||||
Log.e("departmentList-size: ",""+departmentList.size());
|
Log.e("departmentList-size: ",""+departmentList.size());
|
||||||
|
|
||||||
|
filteredList = new ArrayList<>(departmentList);
|
||||||
|
|
||||||
|
// Set up RecyclerView
|
||||||
|
departmentItemAdapter = new DepartmentItemAdapter(filteredList, this, searchEditText, recyclerView);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
recyclerView.setAdapter(departmentItemAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qcResponse.getLocationFloors().isEmpty()) {
|
if (!qcResponse.getLocationFloors().isEmpty()) {
|
||||||
|
|
||||||
|
sharedViewModel.setFloorList(qcResponse.getLocationFloors());
|
||||||
|
|
||||||
locationFloorList.addAll(qcResponse.getLocationFloors());
|
locationFloorList.addAll(qcResponse.getLocationFloors());
|
||||||
Log.e("locationFloorList-size: ",""+locationFloorList.size());
|
Log.e("locationFloorList-size: ",""+locationFloorList.size());
|
||||||
}
|
}
|
||||||
|
@ -147,7 +250,37 @@ public class HomeFragment extends Fragment {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
loginViewModel.getQualityControlData();
|
if (sharedViewModel.getLocationSiteList().isEmpty()) {
|
||||||
|
loginViewModel.getQualityControlData();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
//location list
|
||||||
|
locationSiteList.addAll(sharedViewModel.getLocationSiteList());
|
||||||
|
Log.e("locationSiteList-size: ",""+locationSiteList.size());
|
||||||
|
|
||||||
|
locationSitesAdapter = new LocationSitesAdapter(getActivity(), locationSiteList);
|
||||||
|
locationTextview.setAdapter(locationSitesAdapter);
|
||||||
|
|
||||||
|
//department list
|
||||||
|
departmentList.addAll(sharedViewModel.getDepartmentList());
|
||||||
|
Log.e("departmentList-size: ",""+departmentList.size());
|
||||||
|
|
||||||
|
//filteredList = new ArrayList<>(departmentList);
|
||||||
|
|
||||||
|
// Set up RecyclerView
|
||||||
|
departmentItemAdapter = new DepartmentItemAdapter(filteredList, this, searchEditText, recyclerView);
|
||||||
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
|
recyclerView.setAdapter(departmentItemAdapter);
|
||||||
|
|
||||||
|
//floor list
|
||||||
|
locationFloorList.addAll(sharedViewModel.getFloorList());
|
||||||
|
Log.e("locationFloorList-size: ",""+locationFloorList.size());
|
||||||
|
|
||||||
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showProgressDialog() {
|
public void showProgressDialog() {
|
||||||
|
@ -163,4 +296,30 @@ public class HomeFragment extends Fragment {
|
||||||
progressDialog.dismiss();
|
progressDialog.dismiss();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void filterList(String query) {
|
||||||
|
Log.e("filterList","1");
|
||||||
|
filteredList.clear();
|
||||||
|
if (query.isEmpty()) {
|
||||||
|
// Hide the RecyclerView when there's no query
|
||||||
|
recyclerView.setVisibility(View.GONE);
|
||||||
|
Log.e("filterList","2");
|
||||||
|
} else {
|
||||||
|
// Show RecyclerView when there's a query
|
||||||
|
recyclerView.setVisibility(View.VISIBLE);
|
||||||
|
Log.e("filterList","3");
|
||||||
|
|
||||||
|
for (Department item : departmentList) {
|
||||||
|
if (item.getTitle().toLowerCase().contains(query.toLowerCase())) {
|
||||||
|
filteredList.add(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
departmentItemAdapter.notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onItemClick(Department item) {
|
||||||
|
Toast.makeText(getActivity(), "Selected: " + item.getTitle(), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -36,7 +36,7 @@ import android.widget.Toast;
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ItemAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -152,7 +152,7 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
||||||
itemList.add(new Item("Safety", 0));
|
itemList.add(new Item("Safety", 0));
|
||||||
|
|
||||||
// Set up RecyclerView
|
// Set up RecyclerView
|
||||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ import android.widget.Toast;
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ItemAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -153,7 +153,7 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
||||||
itemList.add(new Item("Safety", 0));
|
itemList.add(new Item("Safety", 0));
|
||||||
|
|
||||||
// Set up RecyclerView
|
// Set up RecyclerView
|
||||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,9 @@ import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.utopiaindustries.qualitycontrol.R;
|
import com.utopiaindustries.qualitycontrol.R;
|
||||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
|
||||||
import com.utopiaindustries.qualitycontrol.activities.SummaryActivity;
|
import com.utopiaindustries.qualitycontrol.activities.SummaryActivity;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ImageAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.adapters.ItemAdapter;
|
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||||
|
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
@ -152,7 +151,7 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
||||||
itemList.add(new Item("Safety", 0));
|
itemList.add(new Item("Safety", 0));
|
||||||
|
|
||||||
// Set up RecyclerView
|
// Set up RecyclerView
|
||||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
|
|
|
@ -62,4 +62,8 @@ public class LocationFloor {
|
||||||
this.stores = stores;
|
this.stores = stores;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,4 +73,8 @@ public class LocationSite {
|
||||||
this.units = units;
|
this.units = units;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,75 +2,99 @@ package com.utopiaindustries.qualitycontrol.utils;
|
||||||
|
|
||||||
import androidx.lifecycle.ViewModel;
|
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.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class SharedViewModel extends ViewModel {
|
public class SharedViewModel extends ViewModel {
|
||||||
private String currentDate;
|
private String currentDate;
|
||||||
|
|
||||||
|
private List<LocationSite> locationSiteList;
|
||||||
|
private List<Department> departmentList;
|
||||||
|
private List<LocationFloor> floorList;
|
||||||
|
|
||||||
private String location;
|
private String location;
|
||||||
private String department;
|
private String department;
|
||||||
private String floor;
|
private String floor;
|
||||||
|
|
||||||
//Cutting
|
//Cutting
|
||||||
private String cuttingSort;
|
private int cuttingSort;
|
||||||
private String cuttingSetInOrder;
|
private int cuttingSetInOrder;
|
||||||
private String cuttingShine;
|
private int cuttingShine;
|
||||||
private String cuttingStandardize;
|
private int cuttingStandardize;
|
||||||
private String cuttingSustain;
|
private int cuttingSustain;
|
||||||
private String cuttingSafety;
|
private int cuttingSafety;
|
||||||
private String cuttingPercentage;
|
private String cuttingPercentage;
|
||||||
private String cuttingRemarks;
|
private String cuttingRemarks;
|
||||||
private ArrayList<byte[]> cuttingImageList;
|
private ArrayList<byte[]> cuttingImageList;
|
||||||
|
|
||||||
//Stitching
|
//Stitching
|
||||||
private String stitchingSort;
|
private int stitchingSort;
|
||||||
private String stitchingSetInOrder;
|
private int stitchingSetInOrder;
|
||||||
private String stitchingShine;
|
private int stitchingShine;
|
||||||
private String stitchingStandardize;
|
private int stitchingStandardize;
|
||||||
private String stitchingSustain;
|
private int stitchingSustain;
|
||||||
private String stitchingSafety;
|
private int stitchingSafety;
|
||||||
private String stitchingPercentage;
|
private String stitchingPercentage;
|
||||||
private String stitchingRemarks;
|
private String stitchingRemarks;
|
||||||
private ArrayList<byte[]> stitchingImageList;
|
private ArrayList<byte[]> stitchingImageList;
|
||||||
|
|
||||||
//Checking
|
//Checking
|
||||||
private String checkingSort;
|
private int checkingSort;
|
||||||
private String checkingSetInOrder;
|
private int checkingSetInOrder;
|
||||||
private String checkingShine;
|
private int checkingShine;
|
||||||
private String checkingStandardize;
|
private int checkingStandardize;
|
||||||
private String checkingSustain;
|
private int checkingSustain;
|
||||||
private String checkingSafety;
|
private int checkingSafety;
|
||||||
private String checkingPercentage;
|
private String checkingPercentage;
|
||||||
private String checkingRemarks;
|
private String checkingRemarks;
|
||||||
private ArrayList<byte[]> checkingImageList;
|
private ArrayList<byte[]> checkingImageList;
|
||||||
|
|
||||||
//Packing
|
//Packing
|
||||||
private String packingSort;
|
private int packingSort;
|
||||||
private String packingSetInOrder;
|
private int packingSetInOrder;
|
||||||
private String packingShine;
|
private int packingShine;
|
||||||
private String packingStandardize;
|
private int packingStandardize;
|
||||||
private String packingSustain;
|
private int packingSustain;
|
||||||
private String packingSafety;
|
private int packingSafety;
|
||||||
private String packingPercentage;
|
private String packingPercentage;
|
||||||
private String packingRemarks;
|
private String packingRemarks;
|
||||||
private ArrayList<byte[]> packingImageList;
|
private ArrayList<byte[]> packingImageList;
|
||||||
|
|
||||||
//Sub Store
|
//Sub Store
|
||||||
private String subStoreSort;
|
private int subStoreSort;
|
||||||
private String subStoreSetInOrder;
|
private int subStoreSetInOrder;
|
||||||
private String subStoreShine;
|
private int subStoreShine;
|
||||||
private String subStoreStandardize;
|
private int subStoreStandardize;
|
||||||
private String subStoreSustain;
|
private int subStoreSustain;
|
||||||
private String subStoreSafety;
|
private int subStoreSafety;
|
||||||
private String subStorePercentage;
|
private String subStorePercentage;
|
||||||
private String subStoreRemarks;
|
private String subStoreRemarks;
|
||||||
private ArrayList<byte[]> subStoreImageList;
|
private ArrayList<byte[]> subStoreImageList;
|
||||||
|
|
||||||
|
private boolean fromViewModel;
|
||||||
|
|
||||||
|
public boolean isFromViewModel() {
|
||||||
|
return fromViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFromViewModel(boolean fromViewModel) {
|
||||||
|
this.fromViewModel = fromViewModel;
|
||||||
|
}
|
||||||
|
|
||||||
public SharedViewModel() {
|
public SharedViewModel() {
|
||||||
cuttingImageList = new ArrayList<>();
|
cuttingImageList = new ArrayList<>();
|
||||||
stitchingImageList = new ArrayList<>();
|
stitchingImageList = new ArrayList<>();
|
||||||
checkingImageList = new ArrayList<>();
|
checkingImageList = new ArrayList<>();
|
||||||
packingImageList = new ArrayList<>();
|
packingImageList = new ArrayList<>();
|
||||||
subStoreImageList = new ArrayList<>();
|
subStoreImageList = new ArrayList<>();
|
||||||
|
|
||||||
|
locationSiteList = new ArrayList<>();
|
||||||
|
departmentList = new ArrayList<>();
|
||||||
|
floorList = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCurrentDate() {
|
public String getCurrentDate() {
|
||||||
|
@ -105,51 +129,51 @@ public class SharedViewModel extends ViewModel {
|
||||||
this.floor = floor;
|
this.floor = floor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingSort() {
|
public int getCuttingSort() {
|
||||||
return cuttingSort;
|
return cuttingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingSort(String cuttingSort) {
|
public void setCuttingSort(int cuttingSort) {
|
||||||
this.cuttingSort = cuttingSort;
|
this.cuttingSort = cuttingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingSetInOrder() {
|
public int getCuttingSetInOrder() {
|
||||||
return cuttingSetInOrder;
|
return cuttingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingSetInOrder(String cuttingSetInOrder) {
|
public void setCuttingSetInOrder(int cuttingSetInOrder) {
|
||||||
this.cuttingSetInOrder = cuttingSetInOrder;
|
this.cuttingSetInOrder = cuttingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingShine() {
|
public int getCuttingShine() {
|
||||||
return cuttingShine;
|
return cuttingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingShine(String cuttingShine) {
|
public void setCuttingShine(int cuttingShine) {
|
||||||
this.cuttingShine = cuttingShine;
|
this.cuttingShine = cuttingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingStandardize() {
|
public int getCuttingStandardize() {
|
||||||
return cuttingStandardize;
|
return cuttingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingStandardize(String cuttingStandardize) {
|
public void setCuttingStandardize(int cuttingStandardize) {
|
||||||
this.cuttingStandardize = cuttingStandardize;
|
this.cuttingStandardize = cuttingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingSustain() {
|
public int getCuttingSustain() {
|
||||||
return cuttingSustain;
|
return cuttingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingSustain(String cuttingSustain) {
|
public void setCuttingSustain(int cuttingSustain) {
|
||||||
this.cuttingSustain = cuttingSustain;
|
this.cuttingSustain = cuttingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCuttingSafety() {
|
public int getCuttingSafety() {
|
||||||
return cuttingSafety;
|
return cuttingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCuttingSafety(String cuttingSafety) {
|
public void setCuttingSafety(int cuttingSafety) {
|
||||||
this.cuttingSafety = cuttingSafety;
|
this.cuttingSafety = cuttingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,51 +201,51 @@ public class SharedViewModel extends ViewModel {
|
||||||
this.cuttingImageList = cuttingImageList;
|
this.cuttingImageList = cuttingImageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStitchingSort() {
|
public int getStitchingSort() {
|
||||||
return stitchingSort;
|
return stitchingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStitchingSort(String stitchingSort) {
|
public void setStitchingSort(int stitchingSort) {
|
||||||
this.stitchingSort = stitchingSort;
|
this.stitchingSort = stitchingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStitchingSetInOrder() {
|
public int getStitchingSetInOrder() {
|
||||||
return stitchingSetInOrder;
|
return stitchingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStitchingSetInOrder(String stitchingSetInOrder) {
|
public void setStitchingSetInOrder(int stitchingSetInOrder) {
|
||||||
this.stitchingSetInOrder = stitchingSetInOrder;
|
this.stitchingSetInOrder = stitchingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStitchingShine() {
|
public int getStitchingShine() {
|
||||||
return stitchingShine;
|
return stitchingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStitchingShine(String stitchingShine) {
|
public void setStitchingShine(int stitchingShine) {
|
||||||
this.stitchingShine = stitchingShine;
|
this.stitchingShine = stitchingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStitchingStandardize() {
|
public int getStitchingStandardize() {
|
||||||
return stitchingStandardize;
|
return stitchingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStitchingStandardize(String stitchingStandardize) {
|
public void setStitchingStandardize(int stitchingStandardize) {
|
||||||
this.stitchingStandardize = stitchingStandardize;
|
this.stitchingStandardize = stitchingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStitchingSustain() {
|
public int getStitchingSustain() {
|
||||||
return stitchingSustain;
|
return stitchingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStitchingSustain(String stitchingSustain) {
|
public void setStitchingSustain(int stitchingSustain) {
|
||||||
this.stitchingSustain = stitchingSustain;
|
this.stitchingSustain = stitchingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getStitchingSafety() {
|
public int getStitchingSafety() {
|
||||||
return stitchingSafety;
|
return stitchingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setStitchingSafety(String stitchingSafety) {
|
public void setStitchingSafety(int stitchingSafety) {
|
||||||
this.stitchingSafety = stitchingSafety;
|
this.stitchingSafety = stitchingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,51 +273,51 @@ public class SharedViewModel extends ViewModel {
|
||||||
this.stitchingImageList = stitchingImageList;
|
this.stitchingImageList = stitchingImageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCheckingSort() {
|
public int getCheckingSort() {
|
||||||
return checkingSort;
|
return checkingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckingSort(String checkingSort) {
|
public void setCheckingSort(int checkingSort) {
|
||||||
this.checkingSort = checkingSort;
|
this.checkingSort = checkingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCheckingSetInOrder() {
|
public int getCheckingSetInOrder() {
|
||||||
return checkingSetInOrder;
|
return checkingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckingSetInOrder(String checkingSetInOrder) {
|
public void setCheckingSetInOrder(int checkingSetInOrder) {
|
||||||
this.checkingSetInOrder = checkingSetInOrder;
|
this.checkingSetInOrder = checkingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCheckingShine() {
|
public int getCheckingShine() {
|
||||||
return checkingShine;
|
return checkingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckingShine(String checkingShine) {
|
public void setCheckingShine(int checkingShine) {
|
||||||
this.checkingShine = checkingShine;
|
this.checkingShine = checkingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCheckingStandardize() {
|
public int getCheckingStandardize() {
|
||||||
return checkingStandardize;
|
return checkingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckingStandardize(String checkingStandardize) {
|
public void setCheckingStandardize(int checkingStandardize) {
|
||||||
this.checkingStandardize = checkingStandardize;
|
this.checkingStandardize = checkingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCheckingSustain() {
|
public int getCheckingSustain() {
|
||||||
return checkingSustain;
|
return checkingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckingSustain(String checkingSustain) {
|
public void setCheckingSustain(int checkingSustain) {
|
||||||
this.checkingSustain = checkingSustain;
|
this.checkingSustain = checkingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCheckingSafety() {
|
public int getCheckingSafety() {
|
||||||
return checkingSafety;
|
return checkingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCheckingSafety(String checkingSafety) {
|
public void setCheckingSafety(int checkingSafety) {
|
||||||
this.checkingSafety = checkingSafety;
|
this.checkingSafety = checkingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -321,51 +345,51 @@ public class SharedViewModel extends ViewModel {
|
||||||
this.checkingImageList = checkingImageList;
|
this.checkingImageList = checkingImageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackingSort() {
|
public int getPackingSort() {
|
||||||
return packingSort;
|
return packingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackingSort(String packingSort) {
|
public void setPackingSort(int packingSort) {
|
||||||
this.packingSort = packingSort;
|
this.packingSort = packingSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackingSetInOrder() {
|
public int getPackingSetInOrder() {
|
||||||
return packingSetInOrder;
|
return packingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackingSetInOrder(String packingSetInOrder) {
|
public void setPackingSetInOrder(int packingSetInOrder) {
|
||||||
this.packingSetInOrder = packingSetInOrder;
|
this.packingSetInOrder = packingSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackingShine() {
|
public int getPackingShine() {
|
||||||
return packingShine;
|
return packingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackingShine(String packingShine) {
|
public void setPackingShine(int packingShine) {
|
||||||
this.packingShine = packingShine;
|
this.packingShine = packingShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackingStandardize() {
|
public int getPackingStandardize() {
|
||||||
return packingStandardize;
|
return packingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackingStandardize(String packingStandardize) {
|
public void setPackingStandardize(int packingStandardize) {
|
||||||
this.packingStandardize = packingStandardize;
|
this.packingStandardize = packingStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackingSustain() {
|
public int getPackingSustain() {
|
||||||
return packingSustain;
|
return packingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackingSustain(String packingSustain) {
|
public void setPackingSustain(int packingSustain) {
|
||||||
this.packingSustain = packingSustain;
|
this.packingSustain = packingSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPackingSafety() {
|
public int getPackingSafety() {
|
||||||
return packingSafety;
|
return packingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPackingSafety(String packingSafety) {
|
public void setPackingSafety(int packingSafety) {
|
||||||
this.packingSafety = packingSafety;
|
this.packingSafety = packingSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,51 +417,51 @@ public class SharedViewModel extends ViewModel {
|
||||||
this.packingImageList = packingImageList;
|
this.packingImageList = packingImageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubStoreSort() {
|
public int getSubStoreSort() {
|
||||||
return subStoreSort;
|
return subStoreSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubStoreSort(String subStoreSort) {
|
public void setSubStoreSort(int subStoreSort) {
|
||||||
this.subStoreSort = subStoreSort;
|
this.subStoreSort = subStoreSort;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubStoreSetInOrder() {
|
public int getSubStoreSetInOrder() {
|
||||||
return subStoreSetInOrder;
|
return subStoreSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubStoreSetInOrder(String subStoreSetInOrder) {
|
public void setSubStoreSetInOrder(int subStoreSetInOrder) {
|
||||||
this.subStoreSetInOrder = subStoreSetInOrder;
|
this.subStoreSetInOrder = subStoreSetInOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubStoreShine() {
|
public int getSubStoreShine() {
|
||||||
return subStoreShine;
|
return subStoreShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubStoreShine(String subStoreShine) {
|
public void setSubStoreShine(int subStoreShine) {
|
||||||
this.subStoreShine = subStoreShine;
|
this.subStoreShine = subStoreShine;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubStoreStandardize() {
|
public int getSubStoreStandardize() {
|
||||||
return subStoreStandardize;
|
return subStoreStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubStoreStandardize(String subStoreStandardize) {
|
public void setSubStoreStandardize(int subStoreStandardize) {
|
||||||
this.subStoreStandardize = subStoreStandardize;
|
this.subStoreStandardize = subStoreStandardize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubStoreSustain() {
|
public int getSubStoreSustain() {
|
||||||
return subStoreSustain;
|
return subStoreSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubStoreSustain(String subStoreSustain) {
|
public void setSubStoreSustain(int subStoreSustain) {
|
||||||
this.subStoreSustain = subStoreSustain;
|
this.subStoreSustain = subStoreSustain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSubStoreSafety() {
|
public int getSubStoreSafety() {
|
||||||
return subStoreSafety;
|
return subStoreSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSubStoreSafety(String subStoreSafety) {
|
public void setSubStoreSafety(int subStoreSafety) {
|
||||||
this.subStoreSafety = subStoreSafety;
|
this.subStoreSafety = subStoreSafety;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -464,4 +488,28 @@ public class SharedViewModel extends ViewModel {
|
||||||
public void setSubStoreImageList(ArrayList<byte[]> subStoreImageList) {
|
public void setSubStoreImageList(ArrayList<byte[]> subStoreImageList) {
|
||||||
this.subStoreImageList = 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,17 @@
|
||||||
|
<!-- res/drawable/dropdown_item_bg.xml -->
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- Pressed state -->
|
||||||
|
<item android:state_pressed="true">
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#E0E0E0" /> <!-- Light gray background for pressed state -->
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<!-- Default state -->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="#FFFFFF" /> <!-- White background for default state -->
|
||||||
|
<stroke android:width="1dp" android:color="#BDBDBD" /> <!-- Optional border -->
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
|
@ -0,0 +1,8 @@
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<stroke
|
||||||
|
android:width="0.5dp"
|
||||||
|
android:color="@color/grey_600" />
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:radius="5dp"/>
|
||||||
|
</shape>
|
|
@ -16,9 +16,57 @@
|
||||||
android:id="@+id/txt_current_date"
|
android:id="@+id/txt_current_date"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="@dimen/_16sdp"
|
|
||||||
android:layout_margin="5dp"
|
android:layout_margin="5dp"
|
||||||
android:padding="5dp" />
|
android:padding="5dp"
|
||||||
|
android:textSize="@dimen/_16sdp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:text="Department: "
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/_16sdp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<!-- Search Bar -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/searchEditText"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="Search"
|
||||||
|
android:padding="10dp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:background="@drawable/et_border"
|
||||||
|
android:inputType="text" />
|
||||||
|
|
||||||
|
<!-- Filtered List -->
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/recyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_margin="5dp" />
|
||||||
|
|
||||||
|
<!--<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_department"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/txt_driver_name">
|
||||||
|
|
||||||
|
<AutoCompleteTextView
|
||||||
|
android:id="@+id/department_textview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="none"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</com.google.android.material.textfield.TextInputLayout>-->
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -48,34 +96,6 @@
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
</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="Department: "
|
|
||||||
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_department"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/txt_driver_name">
|
|
||||||
|
|
||||||
<AutoCompleteTextView
|
|
||||||
android:id="@+id/department_textview"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="none"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
</com.google.android.material.textfield.TextInputLayout>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -109,10 +129,10 @@
|
||||||
android:id="@+id/btn_next"
|
android:id="@+id/btn_next"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="bottom"
|
||||||
android:layout_marginStart="15dp"
|
android:layout_marginStart="15dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:layout_marginBottom="5dp"
|
android:layout_marginBottom="5dp"
|
||||||
android:layout_gravity="bottom"
|
|
||||||
android:background="@drawable/rounded_btn_login"
|
android:background="@drawable/rounded_btn_login"
|
||||||
android:text="Next"/>
|
android:text="Next" />
|
||||||
</FrameLayout>
|
</FrameLayout>
|
|
@ -4,7 +4,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:weightSum="1"
|
android:weightSum="1"
|
||||||
android:padding="8dp">
|
android:background="@drawable/et_border_dropdown"
|
||||||
|
android:padding="10dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_item_name"
|
android:id="@+id/tv_item_name"
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?><!--<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:padding="5dp"
|
||||||
|
android:layout_margin="5dp"
|
||||||
|
android:id="@+id/item_text"
|
||||||
|
android:background="@drawable/et_border_dropdown"
|
||||||
|
android:textAppearance="?attr/textAppearanceSubtitle1">
|
||||||
|
|
||||||
|
</TextView>-->
|
||||||
|
|
||||||
|
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/item_text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/dropdown_item_bg"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/_13sdp" />
|
Loading…
Reference in New Issue