Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 3 additions & 30 deletions app/res/layout/view_job_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_job_title" />

<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="@+id/tv_job_discrepation"
app:layout_constraintTop_toBottomOf="@+id/tv_job_discrepation">

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:id="@+id/connect_job_pay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="100"
android:textColor="@color/connect_blue_color"
android:textSize="14sp" />

<org.commcare.views.connect.connecttextview.ConnectRegularTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@string/connect_job_info_per_visit"
android:textColor="@color/connect_subtext_color"
android:textSize="14sp" />
</LinearLayout>

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:id="@+id/tv_view_more"
android:layout_width="0dp"
Expand All @@ -70,7 +44,7 @@
android:textColor="@color/connect_dark_blue_color"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout6" />
app:layout_constraintTop_toBottomOf="@+id/tv_job_discrepation" />


<org.commcare.views.connect.connecttextview.ConnectBoldTextView
Expand All @@ -81,20 +55,19 @@
android:textColor="@color/connect_grey"
android:textSize="12sp"
android:visibility="visible"
app:layout_constraintBottom_toTopOf="@+id/tv_job_time"
app:layout_constraintTop_toBottomOf="@+id/tv_job_discrepation"
app:layout_constraintEnd_toEndOf="parent"
tools:visibility="visible" />

<org.commcare.views.connect.connecttextview.ConnectBoldTextView
android:id="@+id/tv_job_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="8:00 AM - 5:00 PM"
android:textColor="@color/connect_dark_blue_color"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="@+id/tv_view_more" />
app:layout_constraintTop_toBottomOf="@+id/tvDailyVisitTitle" />


<org.commcare.views.connect.connecttextview.ConnectRegularTextView
Expand Down
31 changes: 2 additions & 29 deletions app/res/layout/view_progress_job_card.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_job_title" />

<LinearLayout
android:id="@+id/linearLayout6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="horizontal"
app:layout_constraintStart_toStartOf="@+id/tv_job_discrepation"
app:layout_constraintTop_toBottomOf="@+id/tv_job_discrepation">

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:id="@+id/connect_job_pay"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="100"
android:textColor="@color/connect_blue_color"
android:textSize="14sp" />

<org.commcare.views.connect.connecttextview.ConnectRegularTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="@string/connect_job_info_per_visit"
android:textColor="@color/connect_subtext_color"
android:textSize="14sp" />
</LinearLayout>

<org.commcare.views.connect.connecttextview.ConnectMediumTextView
android:id="@+id/tv_view_more"
android:layout_width="0dp"
Expand All @@ -71,7 +45,7 @@
android:textColor="@color/connect_dark_blue_color"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/linearLayout6" />
app:layout_constraintTop_toBottomOf="@+id/tv_job_discrepation" />

<org.commcare.views.connect.connecttextview.ConnectBoldTextView
android:id="@+id/tvDailyVisitTitle"
Expand All @@ -81,9 +55,8 @@
android:textColor="@color/connect_grey"
android:textSize="12sp"
android:visibility="visible"
app:layout_constraintBottom_toBottomOf="@+id/linearLayout6"
app:layout_constraintTop_toBottomOf="@+id/tv_job_discrepation"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/linearLayout6"
tools:visibility="visible" />

<org.commcare.views.connect.connecttextview.ConnectBoldTextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ private void updateJobTileDetails() {
ConnectMediumTextView tvJobDiscrepation = viewJobCard.findViewById(R.id.tv_job_discrepation);
ConnectBoldTextView hoursTitle = viewJobCard.findViewById(R.id.tvDailyVisitTitle);
ConnectBoldTextView tv_job_time = viewJobCard.findViewById(R.id.tv_job_time);
ConnectMediumTextView connectJobPay = viewJobCard.findViewById(R.id.connect_job_pay);
ConnectRegularTextView connectJobEndDate = viewJobCard.findViewById(R.id.connect_job_end_date);

tvJobTitle.setText(job.getTitle());
tvViewMore.setVisibility(View.GONE);
tvJobDiscrepation.setText(job.getDescription());
connectJobPay.setText(job.getMoneyString(job.getBudgetPerVisit()));
connectJobEndDate.setText(activity.getString(R.string.connect_learn_complete_by, ConnectManager.formatDate(job.getProjectEndDate())));

String workingHours = job.getWorkingHours();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import org.commcare.dalvik.R;
import org.commcare.google.services.analytics.FirebaseAnalyticsUtil;
import org.commcare.utils.MultipleAppsUtil;
import org.commcare.views.connect.connecttextview.ConnectBoldTextView;
import org.commcare.views.connect.connecttextview.ConnectMediumTextView;
import org.commcare.views.connect.connecttextview.ConnectRegularTextView;

import java.io.IOException;
Expand Down Expand Up @@ -89,14 +87,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

textView.setText(paymentText);

// boolean expired = daysRemaining < 0;
// textView = view.findViewById(R.id.connect_delivery_action_title);
// textView.setText(expired ? R.string.connect_delivery_expired : R.string.connect_delivery_ready_to_claim);

// textView = view.findViewById(R.id.connect_delivery_action_details);
// textView.setText(expired ? R.string.connect_delivery_expired_detailed :
// R.string.connect_delivery_ready_to_claim_detailed);

boolean jobClaimed = job.getStatus() == ConnectJobRecord.STATUS_DELIVERING;
boolean installed = false;
for (ApplicationRecord app : MultipleAppsUtil.appRecordArray()) {
Expand All @@ -114,7 +104,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

Button button = view.findViewById(R.id.connect_delivery_button);
button.setText(buttonTextId);
// button.setEnabled(!expired);
button.setOnClickListener(v -> {
if (jobClaimed) {
proceedAfterJobClaimed(button, job, appInstalled);
Expand Down Expand Up @@ -148,38 +137,9 @@ public void processOldApiError() {
}
});

// jobCardDataHandle(view, job);
return view;
}

private void jobCardDataHandle(View view, ConnectJobRecord job) {
View viewJobCard = view.findViewById(R.id.viewJobCard);
ConnectMediumTextView viewMore = viewJobCard.findViewById(R.id.tv_view_more);
ConnectBoldTextView tvJobTitle = viewJobCard.findViewById(R.id.tv_job_title);
ConnectBoldTextView hoursTitle = viewJobCard.findViewById(R.id.tvDailyVisitTitle);
ConnectBoldTextView tv_job_time = viewJobCard.findViewById(R.id.tv_job_time);
ConnectMediumTextView tvJobDiscrepation = viewJobCard.findViewById(R.id.tv_job_discrepation);
ConnectMediumTextView connect_job_pay = viewJobCard.findViewById(R.id.connect_job_pay);
ConnectRegularTextView connectJobEndDate = viewJobCard.findViewById(R.id.connect_job_end_date);

viewMore.setOnClickListener(view1 -> {
Navigation.findNavController(viewMore).navigate(ConnectDeliveryProgressFragmentDirections.actionConnectJobDeliveryProgressFragmentToConnectJobDetailBottomSheetDialogFragment());
});

tvJobTitle.setText(job.getTitle());
tvJobDiscrepation.setText(job.getDescription());
connect_job_pay.setText(job.getMoneyString(job.getBudgetPerVisit()));
connectJobEndDate.setText(getString(R.string.connect_learn_complete_by, ConnectManager.formatDate(job.getProjectEndDate())));

String workingHours = job.getWorkingHours();
boolean showHours = workingHours != null;
tv_job_time.setVisibility(showHours ? View.VISIBLE : View.GONE);
hoursTitle.setVisibility(showHours ? View.VISIBLE : View.GONE);
if(showHours) {
tv_job_time.setText(workingHours);
}
}

private void reportApiCall(boolean success) {
FirebaseAnalyticsUtil.reportCccApiClaimJob(success);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ private void jobCardDataHandle(View view, ConnectJobRecord job) {
ConnectBoldTextView hoursTitle = viewJobCard.findViewById(R.id.tvDailyVisitTitle);
ConnectBoldTextView tv_job_time = viewJobCard.findViewById(R.id.tv_job_time);
ConnectMediumTextView tvJobDiscrepation = viewJobCard.findViewById(R.id.tv_job_discrepation);
ConnectMediumTextView connect_job_pay = viewJobCard.findViewById(R.id.connect_job_pay);
ConnectRegularTextView connectJobEndDate = viewJobCard.findViewById(R.id.connect_job_end_date);

viewMore.setOnClickListener(view1 -> {
Expand All @@ -181,7 +180,6 @@ private void jobCardDataHandle(View view, ConnectJobRecord job) {

tvJobTitle.setText(job.getTitle());
tvJobDiscrepation.setText(job.getDescription());
connect_job_pay.setText(job.getMoneyString(job.getBudgetPerVisit()));
connectJobEndDate.setText(getString(R.string.connect_learn_complete_by, ConnectManager.formatDate(job.getProjectEndDate())));

String workingHours = job.getWorkingHours();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ private void jobCardDataHandle(View view, ConnectJobRecord job) {
ConnectBoldTextView hoursTitle = viewJobCard.findViewById(R.id.tvDailyVisitTitle);
ConnectBoldTextView tv_job_time = viewJobCard.findViewById(R.id.tv_job_time);
ConnectMediumTextView tvJobDiscrepation = viewJobCard.findViewById(R.id.tv_job_discrepation);
ConnectMediumTextView connect_job_pay = viewJobCard.findViewById(R.id.connect_job_pay);
ConnectRegularTextView connectJobEndDate = viewJobCard.findViewById(R.id.connect_job_end_date);

viewMore.setOnClickListener(view1 -> {
Expand All @@ -146,7 +145,6 @@ private void jobCardDataHandle(View view, ConnectJobRecord job) {

tvJobTitle.setText(job.getTitle());
tvJobDiscrepation.setText(job.getDescription());
connect_job_pay.setText(job.getMoneyString(job.getBudgetPerVisit()));
connectJobEndDate.setText(getString(R.string.connect_learn_complete_by, ConnectManager.formatDate(job.getProjectEndDate())));

String workingHours = job.getWorkingHours();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,12 @@ private void jobCardDataHandle(View view, ConnectJobRecord job) {
ConnectBoldTextView hoursTitle = viewJobCard.findViewById(R.id.tvDailyVisitTitle);
ConnectBoldTextView tv_job_time = viewJobCard.findViewById(R.id.tv_job_time);
ConnectMediumTextView tvJobDiscrepation = viewJobCard.findViewById(R.id.tv_job_discrepation);
ConnectMediumTextView connect_job_pay = viewJobCard.findViewById(R.id.connect_job_pay);
ConnectRegularTextView connectJobEndDate = viewJobCard.findViewById(R.id.connect_job_end_date);

viewMore.setVisibility(View.GONE);

tvJobTitle.setText(job.getTitle());
tvJobDiscrepation.setText(job.getDescription());
connect_job_pay.setText(job.getMoneyString(job.getBudgetPerVisit()));
connectJobEndDate.setText(getString(R.string.connect_learn_complete_by, ConnectManager.formatDate(job.getProjectEndDate())));

String workingHours = job.getWorkingHours();
Expand Down