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;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
@ -13,18 +14,21 @@ 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 ItemAdapter extends RecyclerView.Adapter<ItemAdapter.ItemViewHolder> {
|
||||
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 ItemAdapter(Context context, List<Item> items) {
|
||||
public ItemCuttingAdapter(Context context, List<Item> items, SharedViewModel viewModel) {
|
||||
this.context = context;
|
||||
this.items = items;
|
||||
this.viewModel = viewModel;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
|
@ -52,11 +56,39 @@ public class ItemAdapter extends RecyclerView.Adapter<ItemAdapter.ItemViewHolder
|
|||
// 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 position, long id) {
|
||||
currentItem.setSelectedOption(position); // Save the selected option
|
||||
public void onItemSelected(android.widget.AdapterView<?> parent, View view, int sub_position, long id) {
|
||||
//currentItem.setSelectedOption(position); // Save the selected option
|
||||
|
||||
if (currentItem.getSelectedOption() != position) { // Avoid unnecessary updates
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -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.core.content.FileProvider;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
|
@ -36,8 +37,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.ItemAdapter;
|
||||
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 java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
|
@ -65,6 +68,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
|||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
Button nextButton;
|
||||
ImageButton imagePicker, deleteImage;
|
||||
SharedViewModel sharedViewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -151,7 +155,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
|||
itemList.add(new Item("Safety", 0));
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
||||
ItemCheckingAdapter adapter = new ItemCheckingAdapter(getActivity(), itemList, sharedViewModel);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -187,6 +191,7 @@ public class CheckingFragment extends Fragment implements EasyPermissions.Permis
|
|||
|
||||
private void initializeLayout(View view) {
|
||||
|
||||
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||
imagePicker = view.findViewById(R.id.image_picker);
|
||||
deleteImage = view.findViewById(R.id.delete_image);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.utopiaindustries.qualitycontrol.fragments;
|
||||
|
||||
import static android.app.Activity.RESULT_OK;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
|
@ -21,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;
|
||||
|
||||
|
@ -38,22 +37,21 @@ 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.ItemAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||
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 java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Array;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
@ -73,6 +71,7 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
ArrayList<byte[]> imageList = new ArrayList<>();
|
||||
ArrayList<QualityControlProcessStep> qualityControlProcessStepList = new ArrayList<>();
|
||||
QualityControlResponse qualityControlResponse;
|
||||
SharedViewModel sharedViewModel;
|
||||
|
||||
// Activity Result Launcher for Gallery
|
||||
private final ActivityResultLauncher<Intent> imagePickerLauncher =
|
||||
|
@ -158,7 +157,7 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
itemList.add(new Item("Safety", 0));
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList, sharedViewModel);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
|
@ -189,6 +188,8 @@ public class CuttingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
|
||||
private void initializeLayout(View view) {
|
||||
|
||||
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||
|
||||
imagePicker = view.findViewById(R.id.image_picker);
|
||||
deleteImage = view.findViewById(R.id.delete_image);
|
||||
nextButton = view.findViewById(R.id.btn_next);
|
||||
|
|
|
@ -7,19 +7,28 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
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.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;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
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.Preference;
|
||||
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.QualityControlProcessStep;
|
||||
import com.utopiaindustries.qualitycontrol.utils.ProgressDialogFragment;
|
||||
import com.utopiaindustries.qualitycontrol.utils.SharedViewModel;
|
||||
import com.utopiaindustries.qualitycontrol.viewmodels.LoginViewModel;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
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;
|
||||
TextView txtCurrentDate;
|
||||
LoginViewModel loginViewModel;
|
||||
Button nextButton;
|
||||
|
||||
LocationSitesAdapter locationSitesAdapter;
|
||||
FloorAdapter floorAdapter;
|
||||
|
||||
ArrayList<LocationFloor> locationFloorList = new ArrayList<>();
|
||||
ArrayList<LocationSite> locationSiteList = new ArrayList<>();
|
||||
ArrayList<Department> departmentList = new ArrayList<>();
|
||||
ArrayList<QualityControlProcess> qualityControlProcessList = new ArrayList<>();
|
||||
|
||||
EditText searchEditText;
|
||||
RecyclerView recyclerView;
|
||||
List<Department> itemList, filteredList;
|
||||
private DepartmentItemAdapter departmentItemAdapter;
|
||||
|
||||
SharedViewModel sharedViewModel;
|
||||
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_home, container, false);
|
||||
|
||||
Log.e("onCreateView: ","====================");
|
||||
|
||||
initializeLayout(view);
|
||||
|
||||
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() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||
String item = adapterView.getItemAtPosition(position).toString();
|
||||
Log.e("Item-----------: ", "" + item);
|
||||
LocationSite clickedItem = locationSiteList.get(position);
|
||||
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
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||
String item = adapterView.getItemAtPosition(position).toString();
|
||||
|
@ -75,25 +117,57 @@ public class HomeFragment extends Fragment {
|
|||
|
||||
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
floorTextview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {
|
||||
String item = adapterView.getItemAtPosition(position).toString();
|
||||
Log.e("Item-----------: ", "" + item);
|
||||
LocationFloor clickedItem = locationFloorList.get(position);
|
||||
Log.e("Item-----------: ", clickedItem.getTitle());
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
Button nextButton = view.findViewById(R.id.btn_next);
|
||||
nextButton.setOnClickListener(v -> {
|
||||
if (getActivity() instanceof HomeActivity) {
|
||||
sharedViewModel.setFromViewModel(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;
|
||||
}
|
||||
|
||||
|
@ -103,10 +177,18 @@ public class HomeFragment extends Fragment {
|
|||
}
|
||||
|
||||
public void initializeLayout(View view) {
|
||||
sharedViewModel = new ViewModelProvider(requireActivity()).get(SharedViewModel.class);
|
||||
|
||||
txtCurrentDate = view.findViewById(R.id.txt_current_date);
|
||||
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);
|
||||
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);
|
||||
|
||||
|
@ -127,17 +209,38 @@ public class HomeFragment extends Fragment {
|
|||
|
||||
Helper.setPreferenceObject(getActivity().getApplicationContext(), qcResponse, "qcResponse");
|
||||
|
||||
|
||||
if (!qcResponse.getLocationSites().isEmpty()) {
|
||||
|
||||
sharedViewModel.setLocationSiteList(qcResponse.getLocationSites());
|
||||
|
||||
locationSiteList.addAll(qcResponse.getLocationSites());
|
||||
Log.e("locationSiteList-size: ",""+locationSiteList.size());
|
||||
|
||||
locationSitesAdapter = new LocationSitesAdapter(getActivity(), locationSiteList);
|
||||
locationTextview.setAdapter(locationSitesAdapter);
|
||||
//locationSitesAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
if (!qcResponse.getDepartments().isEmpty()) {
|
||||
|
||||
sharedViewModel.setDepartmentList(qcResponse.getDepartments());
|
||||
|
||||
departmentList.addAll(qcResponse.getDepartments());
|
||||
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()) {
|
||||
|
||||
sharedViewModel.setFloorList(qcResponse.getLocationFloors());
|
||||
|
||||
locationFloorList.addAll(qcResponse.getLocationFloors());
|
||||
Log.e("locationFloorList-size: ",""+locationFloorList.size());
|
||||
}
|
||||
|
@ -147,8 +250,38 @@ public class HomeFragment extends Fragment {
|
|||
}
|
||||
});
|
||||
|
||||
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() {
|
||||
ProgressDialogFragment progressDialog = new ProgressDialogFragment();
|
||||
|
@ -163,4 +296,30 @@ public class HomeFragment extends Fragment {
|
|||
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.activities.HomeActivity;
|
||||
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 java.io.ByteArrayOutputStream;
|
||||
|
@ -152,7 +152,7 @@ public class PackingFragment extends Fragment implements EasyPermissions.Permiss
|
|||
itemList.add(new Item("Safety", 0));
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ 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.ItemAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.adapters.ItemCuttingAdapter;
|
||||
import com.utopiaindustries.qualitycontrol.models.Item;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
@ -153,7 +153,7 @@ public class StitchingFragment extends Fragment implements EasyPermissions.Permi
|
|||
itemList.add(new Item("Safety", 0));
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
|
|
|
@ -34,10 +34,9 @@ import android.widget.TextView;
|
|||
import android.widget.Toast;
|
||||
|
||||
import com.utopiaindustries.qualitycontrol.R;
|
||||
import com.utopiaindustries.qualitycontrol.activities.HomeActivity;
|
||||
import com.utopiaindustries.qualitycontrol.activities.SummaryActivity;
|
||||
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 java.io.ByteArrayOutputStream;
|
||||
|
@ -152,7 +151,7 @@ public class SubStoreFragment extends Fragment implements EasyPermissions.Permis
|
|||
itemList.add(new Item("Safety", 0));
|
||||
|
||||
// Set up RecyclerView
|
||||
ItemAdapter adapter = new ItemAdapter(getActivity(), itemList);
|
||||
ItemCuttingAdapter adapter = new ItemCuttingAdapter(getActivity(), itemList);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
|
||||
recyclerView.setAdapter(adapter);
|
||||
|
||||
|
|
|
@ -62,4 +62,8 @@ public class LocationFloor {
|
|||
this.stores = stores;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -73,4 +73,8 @@ public class LocationSite {
|
|||
this.units = units;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,75 +2,99 @@ 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 String cuttingSort;
|
||||
private String cuttingSetInOrder;
|
||||
private String cuttingShine;
|
||||
private String cuttingStandardize;
|
||||
private String cuttingSustain;
|
||||
private String cuttingSafety;
|
||||
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 String stitchingSort;
|
||||
private String stitchingSetInOrder;
|
||||
private String stitchingShine;
|
||||
private String stitchingStandardize;
|
||||
private String stitchingSustain;
|
||||
private String stitchingSafety;
|
||||
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 String checkingSort;
|
||||
private String checkingSetInOrder;
|
||||
private String checkingShine;
|
||||
private String checkingStandardize;
|
||||
private String checkingSustain;
|
||||
private String checkingSafety;
|
||||
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 String packingSort;
|
||||
private String packingSetInOrder;
|
||||
private String packingShine;
|
||||
private String packingStandardize;
|
||||
private String packingSustain;
|
||||
private String packingSafety;
|
||||
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 String subStoreSort;
|
||||
private String subStoreSetInOrder;
|
||||
private String subStoreShine;
|
||||
private String subStoreStandardize;
|
||||
private String subStoreSustain;
|
||||
private String subStoreSafety;
|
||||
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() {
|
||||
|
@ -105,51 +129,51 @@ public class SharedViewModel extends ViewModel {
|
|||
this.floor = floor;
|
||||
}
|
||||
|
||||
public String getCuttingSort() {
|
||||
public int getCuttingSort() {
|
||||
return cuttingSort;
|
||||
}
|
||||
|
||||
public void setCuttingSort(String cuttingSort) {
|
||||
public void setCuttingSort(int cuttingSort) {
|
||||
this.cuttingSort = cuttingSort;
|
||||
}
|
||||
|
||||
public String getCuttingSetInOrder() {
|
||||
public int getCuttingSetInOrder() {
|
||||
return cuttingSetInOrder;
|
||||
}
|
||||
|
||||
public void setCuttingSetInOrder(String cuttingSetInOrder) {
|
||||
public void setCuttingSetInOrder(int cuttingSetInOrder) {
|
||||
this.cuttingSetInOrder = cuttingSetInOrder;
|
||||
}
|
||||
|
||||
public String getCuttingShine() {
|
||||
public int getCuttingShine() {
|
||||
return cuttingShine;
|
||||
}
|
||||
|
||||
public void setCuttingShine(String cuttingShine) {
|
||||
public void setCuttingShine(int cuttingShine) {
|
||||
this.cuttingShine = cuttingShine;
|
||||
}
|
||||
|
||||
public String getCuttingStandardize() {
|
||||
public int getCuttingStandardize() {
|
||||
return cuttingStandardize;
|
||||
}
|
||||
|
||||
public void setCuttingStandardize(String cuttingStandardize) {
|
||||
public void setCuttingStandardize(int cuttingStandardize) {
|
||||
this.cuttingStandardize = cuttingStandardize;
|
||||
}
|
||||
|
||||
public String getCuttingSustain() {
|
||||
public int getCuttingSustain() {
|
||||
return cuttingSustain;
|
||||
}
|
||||
|
||||
public void setCuttingSustain(String cuttingSustain) {
|
||||
public void setCuttingSustain(int cuttingSustain) {
|
||||
this.cuttingSustain = cuttingSustain;
|
||||
}
|
||||
|
||||
public String getCuttingSafety() {
|
||||
public int getCuttingSafety() {
|
||||
return cuttingSafety;
|
||||
}
|
||||
|
||||
public void setCuttingSafety(String cuttingSafety) {
|
||||
public void setCuttingSafety(int cuttingSafety) {
|
||||
this.cuttingSafety = cuttingSafety;
|
||||
}
|
||||
|
||||
|
@ -177,51 +201,51 @@ public class SharedViewModel extends ViewModel {
|
|||
this.cuttingImageList = cuttingImageList;
|
||||
}
|
||||
|
||||
public String getStitchingSort() {
|
||||
public int getStitchingSort() {
|
||||
return stitchingSort;
|
||||
}
|
||||
|
||||
public void setStitchingSort(String stitchingSort) {
|
||||
public void setStitchingSort(int stitchingSort) {
|
||||
this.stitchingSort = stitchingSort;
|
||||
}
|
||||
|
||||
public String getStitchingSetInOrder() {
|
||||
public int getStitchingSetInOrder() {
|
||||
return stitchingSetInOrder;
|
||||
}
|
||||
|
||||
public void setStitchingSetInOrder(String stitchingSetInOrder) {
|
||||
public void setStitchingSetInOrder(int stitchingSetInOrder) {
|
||||
this.stitchingSetInOrder = stitchingSetInOrder;
|
||||
}
|
||||
|
||||
public String getStitchingShine() {
|
||||
public int getStitchingShine() {
|
||||
return stitchingShine;
|
||||
}
|
||||
|
||||
public void setStitchingShine(String stitchingShine) {
|
||||
public void setStitchingShine(int stitchingShine) {
|
||||
this.stitchingShine = stitchingShine;
|
||||
}
|
||||
|
||||
public String getStitchingStandardize() {
|
||||
public int getStitchingStandardize() {
|
||||
return stitchingStandardize;
|
||||
}
|
||||
|
||||
public void setStitchingStandardize(String stitchingStandardize) {
|
||||
public void setStitchingStandardize(int stitchingStandardize) {
|
||||
this.stitchingStandardize = stitchingStandardize;
|
||||
}
|
||||
|
||||
public String getStitchingSustain() {
|
||||
public int getStitchingSustain() {
|
||||
return stitchingSustain;
|
||||
}
|
||||
|
||||
public void setStitchingSustain(String stitchingSustain) {
|
||||
public void setStitchingSustain(int stitchingSustain) {
|
||||
this.stitchingSustain = stitchingSustain;
|
||||
}
|
||||
|
||||
public String getStitchingSafety() {
|
||||
public int getStitchingSafety() {
|
||||
return stitchingSafety;
|
||||
}
|
||||
|
||||
public void setStitchingSafety(String stitchingSafety) {
|
||||
public void setStitchingSafety(int stitchingSafety) {
|
||||
this.stitchingSafety = stitchingSafety;
|
||||
}
|
||||
|
||||
|
@ -249,51 +273,51 @@ public class SharedViewModel extends ViewModel {
|
|||
this.stitchingImageList = stitchingImageList;
|
||||
}
|
||||
|
||||
public String getCheckingSort() {
|
||||
public int getCheckingSort() {
|
||||
return checkingSort;
|
||||
}
|
||||
|
||||
public void setCheckingSort(String checkingSort) {
|
||||
public void setCheckingSort(int checkingSort) {
|
||||
this.checkingSort = checkingSort;
|
||||
}
|
||||
|
||||
public String getCheckingSetInOrder() {
|
||||
public int getCheckingSetInOrder() {
|
||||
return checkingSetInOrder;
|
||||
}
|
||||
|
||||
public void setCheckingSetInOrder(String checkingSetInOrder) {
|
||||
public void setCheckingSetInOrder(int checkingSetInOrder) {
|
||||
this.checkingSetInOrder = checkingSetInOrder;
|
||||
}
|
||||
|
||||
public String getCheckingShine() {
|
||||
public int getCheckingShine() {
|
||||
return checkingShine;
|
||||
}
|
||||
|
||||
public void setCheckingShine(String checkingShine) {
|
||||
public void setCheckingShine(int checkingShine) {
|
||||
this.checkingShine = checkingShine;
|
||||
}
|
||||
|
||||
public String getCheckingStandardize() {
|
||||
public int getCheckingStandardize() {
|
||||
return checkingStandardize;
|
||||
}
|
||||
|
||||
public void setCheckingStandardize(String checkingStandardize) {
|
||||
public void setCheckingStandardize(int checkingStandardize) {
|
||||
this.checkingStandardize = checkingStandardize;
|
||||
}
|
||||
|
||||
public String getCheckingSustain() {
|
||||
public int getCheckingSustain() {
|
||||
return checkingSustain;
|
||||
}
|
||||
|
||||
public void setCheckingSustain(String checkingSustain) {
|
||||
public void setCheckingSustain(int checkingSustain) {
|
||||
this.checkingSustain = checkingSustain;
|
||||
}
|
||||
|
||||
public String getCheckingSafety() {
|
||||
public int getCheckingSafety() {
|
||||
return checkingSafety;
|
||||
}
|
||||
|
||||
public void setCheckingSafety(String checkingSafety) {
|
||||
public void setCheckingSafety(int checkingSafety) {
|
||||
this.checkingSafety = checkingSafety;
|
||||
}
|
||||
|
||||
|
@ -321,51 +345,51 @@ public class SharedViewModel extends ViewModel {
|
|||
this.checkingImageList = checkingImageList;
|
||||
}
|
||||
|
||||
public String getPackingSort() {
|
||||
public int getPackingSort() {
|
||||
return packingSort;
|
||||
}
|
||||
|
||||
public void setPackingSort(String packingSort) {
|
||||
public void setPackingSort(int packingSort) {
|
||||
this.packingSort = packingSort;
|
||||
}
|
||||
|
||||
public String getPackingSetInOrder() {
|
||||
public int getPackingSetInOrder() {
|
||||
return packingSetInOrder;
|
||||
}
|
||||
|
||||
public void setPackingSetInOrder(String packingSetInOrder) {
|
||||
public void setPackingSetInOrder(int packingSetInOrder) {
|
||||
this.packingSetInOrder = packingSetInOrder;
|
||||
}
|
||||
|
||||
public String getPackingShine() {
|
||||
public int getPackingShine() {
|
||||
return packingShine;
|
||||
}
|
||||
|
||||
public void setPackingShine(String packingShine) {
|
||||
public void setPackingShine(int packingShine) {
|
||||
this.packingShine = packingShine;
|
||||
}
|
||||
|
||||
public String getPackingStandardize() {
|
||||
public int getPackingStandardize() {
|
||||
return packingStandardize;
|
||||
}
|
||||
|
||||
public void setPackingStandardize(String packingStandardize) {
|
||||
public void setPackingStandardize(int packingStandardize) {
|
||||
this.packingStandardize = packingStandardize;
|
||||
}
|
||||
|
||||
public String getPackingSustain() {
|
||||
public int getPackingSustain() {
|
||||
return packingSustain;
|
||||
}
|
||||
|
||||
public void setPackingSustain(String packingSustain) {
|
||||
public void setPackingSustain(int packingSustain) {
|
||||
this.packingSustain = packingSustain;
|
||||
}
|
||||
|
||||
public String getPackingSafety() {
|
||||
public int getPackingSafety() {
|
||||
return packingSafety;
|
||||
}
|
||||
|
||||
public void setPackingSafety(String packingSafety) {
|
||||
public void setPackingSafety(int packingSafety) {
|
||||
this.packingSafety = packingSafety;
|
||||
}
|
||||
|
||||
|
@ -393,51 +417,51 @@ public class SharedViewModel extends ViewModel {
|
|||
this.packingImageList = packingImageList;
|
||||
}
|
||||
|
||||
public String getSubStoreSort() {
|
||||
public int getSubStoreSort() {
|
||||
return subStoreSort;
|
||||
}
|
||||
|
||||
public void setSubStoreSort(String subStoreSort) {
|
||||
public void setSubStoreSort(int subStoreSort) {
|
||||
this.subStoreSort = subStoreSort;
|
||||
}
|
||||
|
||||
public String getSubStoreSetInOrder() {
|
||||
public int getSubStoreSetInOrder() {
|
||||
return subStoreSetInOrder;
|
||||
}
|
||||
|
||||
public void setSubStoreSetInOrder(String subStoreSetInOrder) {
|
||||
public void setSubStoreSetInOrder(int subStoreSetInOrder) {
|
||||
this.subStoreSetInOrder = subStoreSetInOrder;
|
||||
}
|
||||
|
||||
public String getSubStoreShine() {
|
||||
public int getSubStoreShine() {
|
||||
return subStoreShine;
|
||||
}
|
||||
|
||||
public void setSubStoreShine(String subStoreShine) {
|
||||
public void setSubStoreShine(int subStoreShine) {
|
||||
this.subStoreShine = subStoreShine;
|
||||
}
|
||||
|
||||
public String getSubStoreStandardize() {
|
||||
public int getSubStoreStandardize() {
|
||||
return subStoreStandardize;
|
||||
}
|
||||
|
||||
public void setSubStoreStandardize(String subStoreStandardize) {
|
||||
public void setSubStoreStandardize(int subStoreStandardize) {
|
||||
this.subStoreStandardize = subStoreStandardize;
|
||||
}
|
||||
|
||||
public String getSubStoreSustain() {
|
||||
public int getSubStoreSustain() {
|
||||
return subStoreSustain;
|
||||
}
|
||||
|
||||
public void setSubStoreSustain(String subStoreSustain) {
|
||||
public void setSubStoreSustain(int subStoreSustain) {
|
||||
this.subStoreSustain = subStoreSustain;
|
||||
}
|
||||
|
||||
public String getSubStoreSafety() {
|
||||
public int getSubStoreSafety() {
|
||||
return subStoreSafety;
|
||||
}
|
||||
|
||||
public void setSubStoreSafety(String subStoreSafety) {
|
||||
public void setSubStoreSafety(int subStoreSafety) {
|
||||
this.subStoreSafety = subStoreSafety;
|
||||
}
|
||||
|
||||
|
@ -464,4 +488,28 @@ public class SharedViewModel extends ViewModel {
|
|||
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,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:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/_16sdp"
|
||||
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
|
||||
android:layout_width="match_parent"
|
||||
|
@ -48,34 +96,6 @@
|
|||
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="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
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -109,10 +129,10 @@
|
|||
android:id="@+id/btn_next"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/rounded_btn_login"
|
||||
android:text="Next"/>
|
||||
android:text="Next" />
|
||||
</FrameLayout>
|
|
@ -4,7 +4,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="1"
|
||||
android:padding="8dp">
|
||||
android:background="@drawable/et_border_dropdown"
|
||||
android:padding="10dp">
|
||||
|
||||
<TextView
|
||||
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