Implement feedback

master
saad.siddiq 2024-11-15 15:36:08 +05:00
parent 99b3ea742b
commit bed085ee56
6 changed files with 31 additions and 14 deletions

View File

@ -23,6 +23,7 @@ import com.utopiaindustries.selftrucking.Activities.dashboardScreens.viewModels.
import com.utopiaindustries.selftrucking.Activities.loginScreens.SplashActivity; import com.utopiaindustries.selftrucking.Activities.loginScreens.SplashActivity;
import com.utopiaindustries.selftrucking.R; import com.utopiaindustries.selftrucking.R;
import com.utopiaindustries.selftrucking.helper.Helper; import com.utopiaindustries.selftrucking.helper.Helper;
import com.utopiaindustries.selftrucking.helper.Preference;
import com.utopiaindustries.selftrucking.models.ContainerWorkflow; import com.utopiaindustries.selftrucking.models.ContainerWorkflow;
import com.utopiaindustries.selftrucking.models.DriverResponse; import com.utopiaindustries.selftrucking.models.DriverResponse;
import com.utopiaindustries.selftrucking.models.PickResponse; import com.utopiaindustries.selftrucking.models.PickResponse;
@ -232,17 +233,17 @@ public class ContainerDetailActivity extends AppCompatActivity {
Log.e("containerToUpdate1-truckLoadId: ",""+containerWorkflow.getTruckLoadId());*/ Log.e("containerToUpdate1-truckLoadId: ",""+containerWorkflow.getTruckLoadId());*/
container_no.setText(Html.fromHtml("<b>Container No:</b> " + containerWorkflow.getContainerNo(), Html.FROM_HTML_MODE_LEGACY)); container_no.setText(Html.fromHtml("<b>Container No:</b> " + containerWorkflow.getContainerNo(), Html.FROM_HTML_MODE_LEGACY));
container_origin.setText(Html.fromHtml("<b>Container Origin:</b> " + containerWorkflow.getOrigin(), Html.FROM_HTML_MODE_LEGACY)); container_origin.setText(Html.fromHtml("<b>Terminal Info:</b> " + containerWorkflow.getOrigin(), Html.FROM_HTML_MODE_LEGACY));
containerDestination.setText(Html.fromHtml("<b>Container Destination:</b> " + containerWorkflow.getDestination(), Html.FROM_HTML_MODE_LEGACY)); containerDestination.setText(Html.fromHtml("<b>Destination:</b> " + containerWorkflow.getDestination(), Html.FROM_HTML_MODE_LEGACY));
driverId.setText(Html.fromHtml("<b>Driver Id:</b> " + truckerId, Html.FROM_HTML_MODE_LEGACY)); driverId.setText(Html.fromHtml("<b>Driver Id:</b> " + truckerId, Html.FROM_HTML_MODE_LEGACY));
driverName.setText(Html.fromHtml("<b>Driver Name:</b> " + truckerName, Html.FROM_HTML_MODE_LEGACY)); driverName.setText(Html.fromHtml("<b>Driver Name:</b> " + truckerName, Html.FROM_HTML_MODE_LEGACY));
currentStatus = containerWorkflow.getCurrentStatus(); currentStatus = containerWorkflow.getCurrentStatus();
if (containerWorkflow.getCurrentStatus() != null && !containerWorkflow.getCurrentStatus().equalsIgnoreCase("")) { if (containerWorkflow.getCurrentStatus() != null && !containerWorkflow.getCurrentStatus().equalsIgnoreCase("")) {
container_status.setText(Html.fromHtml("<b>Container Status:</b> " + containerWorkflow.getCurrentStatus(), Html.FROM_HTML_MODE_LEGACY)); container_status.setText(Html.fromHtml("<b>Status:</b> " + containerWorkflow.getCurrentStatus(), Html.FROM_HTML_MODE_LEGACY));
} }
else { else {
container_status.setText(Html.fromHtml("<b>Container Status:</b> " + "Assigned", Html.FROM_HTML_MODE_LEGACY)); container_status.setText(Html.fromHtml("<b>Status:</b> " + "Assigned", Html.FROM_HTML_MODE_LEGACY));
} }
if (containerWorkflow.getCurrentStatus() != null) { if (containerWorkflow.getCurrentStatus() != null) {
@ -251,12 +252,14 @@ public class ContainerDetailActivity extends AppCompatActivity {
case "PICKED": case "PICKED":
Preference.setMyIntPref(Helper.project_file, "CurrentPosition",this,3);
btnMarkPicked.setBackgroundColor(ContextCompat.getColor(this, R.color.picked_color)); btnMarkPicked.setBackgroundColor(ContextCompat.getColor(this, R.color.picked_color));
btnMarkPicked.setText("Mark it Dropped"); btnMarkPicked.setText("Mark it Dropped");
currentStatus = "DROPPED"; currentStatus = "DROPPED";
break; break;
case "DROPPED": case "DROPPED":
Preference.setMyIntPref(Helper.project_file, "CurrentPosition",this,4);
btnMarkPicked.setBackgroundColor(ContextCompat.getColor(this, R.color.dropped_color)); btnMarkPicked.setBackgroundColor(ContextCompat.getColor(this, R.color.dropped_color));
btnMarkPicked.setText("Mark it Completed"); btnMarkPicked.setText("Mark it Completed");
currentStatus = "COMPLETED"; currentStatus = "COMPLETED";
@ -264,6 +267,7 @@ public class ContainerDetailActivity extends AppCompatActivity {
case "COMPLETED": case "COMPLETED":
//btnMarkPicked.setBackgroundColor(ContextCompat.getColor(this, R.color.completed_color)); //btnMarkPicked.setBackgroundColor(ContextCompat.getColor(this, R.color.completed_color));
Preference.setMyIntPref(Helper.project_file, "CurrentPosition",this,0);
btnMarkPicked.setText("Mark it Picked"); btnMarkPicked.setText("Mark it Picked");
currentStatus = "PICKED"; currentStatus = "PICKED";

View File

@ -64,6 +64,7 @@ public class HomeActivity extends AppCompatActivity implements SelectListener {
DriverResponse driverResponse; DriverResponse driverResponse;
TextView txtDriverName, txtNoData; TextView txtDriverName, txtNoData;
ImageView imgLogout; ImageView imgLogout;
int currentPositionStatus = 0;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -114,9 +115,16 @@ public class HomeActivity extends AppCompatActivity implements SelectListener {
adapterItems = new ArrayAdapter<String>(this, R.layout.list_items, item); adapterItems = new ArrayAdapter<String>(this, R.layout.list_items, item);
autoCompleteTextView.setAdapter(adapterItems); autoCompleteTextView.setAdapter(adapterItems);
if (item.length > 0) { if (item.length > 0) {
autoCompleteTextView.setText(item[0], false); boolean keyExists = Preference.containsKey(Helper.project_file, "CurrentPosition", this);
if (keyExists) {
Log.e("Key-Exist: ", "True");
currentPositionStatus = Preference.getMyIntPref(Helper.project_file, "CurrentPosition", this);
autoCompleteTextView.setText(item[currentPositionStatus], false);
} else {
Log.e("Key-Exist: ", "False");
autoCompleteTextView.setText(item[0], false);
}
} }
} }
private void filterList(String status) { private void filterList(String status) {

View File

@ -40,6 +40,7 @@ public class SplashActivity extends AppCompatActivity {
txtVersion.setText(getResources().getString(R.string.app_version)); txtVersion.setText(getResources().getString(R.string.app_version));
isLoggedIn = Preference.getMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext()); isLoggedIn = Preference.getMyBooleanPref(Helper.project_file, "isLoggedIn", getApplicationContext());
//Preference.setMyIntPref(Helper.project_file, "CurrentPosition",this,0);
new Handler().postDelayed(new Runnable() { new Handler().postDelayed(new Runnable() {
public void run() { public void run() {

View File

@ -23,6 +23,10 @@ public class Preference {
return context.getSharedPreferences(nameOfFile, Context.MODE_PRIVATE); return context.getSharedPreferences(nameOfFile, Context.MODE_PRIVATE);
} }
public static boolean containsKey(String fileName, String key, Context context) {
return getPrefs(fileName, context).contains(key);
}
public static String getMyStringPref(String fileName, String key, Context context) { public static String getMyStringPref(String fileName, String key, Context context) {
return getPrefs(fileName,context).getString(key, "default"); return getPrefs(fileName,context).getString(key, "default");

View File

@ -73,7 +73,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:padding="5dp" android:padding="5dp"
android:textSize="@dimen/_13sdp" android:textSize="@dimen/_13sdp"
android:text="Origin: Warehouse" /> android:text="Terminal Info:: Warehouse" />
<TextView <TextView
android:id="@+id/container_destination" android:id="@+id/container_destination"

View File

@ -25,7 +25,7 @@
android:id="@+id/container_no_heading" android:id="@+id/container_no_heading"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="0.3" android:layout_weight="0.35"
android:padding="5dp" android:padding="5dp"
android:text="Container ID:" android:text="Container ID:"
android:textSize="@dimen/_13sdp" android:textSize="@dimen/_13sdp"
@ -36,7 +36,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="2dp" android:layout_marginStart="2dp"
android:layout_weight="0.7" android:layout_weight="0.65"
android:padding="5dp" android:padding="5dp"
android:text="Container ID" android:text="Container ID"
android:textSize="@dimen/_13sdp" /> android:textSize="@dimen/_13sdp" />
@ -54,9 +54,9 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/container_no" android:layout_below="@+id/container_no"
android:layout_weight="0.3" android:layout_weight="0.35"
android:padding="5dp" android:padding="5dp"
android:text="Origin: " android:text="Terminal Info:"
android:textSize="@dimen/_13sdp" android:textSize="@dimen/_13sdp"
android:textStyle="bold" /> android:textStyle="bold" />
@ -66,7 +66,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/container_no" android:layout_below="@+id/container_no"
android:layout_marginStart="2dp" android:layout_marginStart="2dp"
android:layout_weight="0.7" android:layout_weight="0.65"
android:padding="5dp" android:padding="5dp"
android:text="Origin" android:text="Origin"
android:textSize="@dimen/_13sdp" /> android:textSize="@dimen/_13sdp" />
@ -83,7 +83,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/container_origin" android:layout_below="@+id/container_origin"
android:layout_weight="0.3" android:layout_weight="0.35"
android:padding="5dp" android:padding="5dp"
android:text="Destination: " android:text="Destination: "
android:textSize="@dimen/_13sdp" android:textSize="@dimen/_13sdp"
@ -95,7 +95,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/container_origin" android:layout_below="@+id/container_origin"
android:layout_marginStart="2dp" android:layout_marginStart="2dp"
android:layout_weight="0.7" android:layout_weight="0.65"
android:padding="5dp" android:padding="5dp"
android:text="Destination" android:text="Destination"
android:textSize="@dimen/_13sdp" /> android:textSize="@dimen/_13sdp" />