From 3b14c6ce7f6e742db9a7f52c128716f750c37a8d Mon Sep 17 00:00:00 2001 From: isratmity Date: Tue, 23 May 2017 17:19:22 +0600 Subject: [PATCH] layout modified+show toast if no jobs available --- .../tracker/ui/activity/TasksActivity.java | 9 ++- .../co/gobd/tracker/ui/view/TasksView.java | 2 +- app/src/main/res/layout/task_overview.xml | 56 +++++++++---------- app/src/main/res/values-large/dimens.xml | 4 +- app/src/main/res/values-large/integers.xml | 6 ++ app/src/main/res/values-large/styles.xml | 49 ++++++++++++++++ app/src/main/res/values/dimens.xml | 2 + app/src/main/res/values/integers.xml | 6 ++ 8 files changed, 101 insertions(+), 33 deletions(-) create mode 100644 app/src/main/res/values-large/integers.xml create mode 100644 app/src/main/res/values-large/styles.xml create mode 100644 app/src/main/res/values/integers.xml diff --git a/app/src/main/java/co/gobd/tracker/ui/activity/TasksActivity.java b/app/src/main/java/co/gobd/tracker/ui/activity/TasksActivity.java index 9d6f076..e1acf67 100644 --- a/app/src/main/java/co/gobd/tracker/ui/activity/TasksActivity.java +++ b/app/src/main/java/co/gobd/tracker/ui/activity/TasksActivity.java @@ -189,7 +189,7 @@ public void onClick(DialogInterface dialog, int whichButton) { position=tm.getPosition(); jobModelsingle=job_expandable_list_adapter.getAdapterData(); JobId=tm.getJobid(); - int count=jobModelsingle.get(position).getTasks().size(); + String serverstring=getStatus(); tasksPresenter.updateTaskStateToCompleted(JobId,tm.getTask(), serverstring); if(serverstring.equals("RETURNED")) @@ -275,6 +275,9 @@ public void setJobModelList(List jobModelList) { setupRecyclerView(job_expandable_list_adapter); } + else { + showEmpty(); + } } @Override @@ -310,6 +313,10 @@ public void stopProgress() { } @Override + public void showEmpty() { + Toast.makeText(getApplicationContext(),"No jobs available for you this time!",Toast.LENGTH_SHORT).show(); + } + @Override public void stopProgresswithmessage() { progressDialog.dismiss(); Toast.makeText(getApplicationContext(),"Please try again",Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/co/gobd/tracker/ui/view/TasksView.java b/app/src/main/java/co/gobd/tracker/ui/view/TasksView.java index 12ddae4..5f82e7f 100644 --- a/app/src/main/java/co/gobd/tracker/ui/view/TasksView.java +++ b/app/src/main/java/co/gobd/tracker/ui/view/TasksView.java @@ -12,7 +12,7 @@ public interface TasksView { void setJobModelList(List jobModelList); void startProgress(); void stopProgresswithmessage(); - + void showEmpty(); void stopProgress(); void showTaskUpdateSuccessfulMsg(); diff --git a/app/src/main/res/layout/task_overview.xml b/app/src/main/res/layout/task_overview.xml index c908037..fbf93d8 100644 --- a/app/src/main/res/layout/task_overview.xml +++ b/app/src/main/res/layout/task_overview.xml @@ -24,14 +24,13 @@ android:layout_width="match_parent" android:orientation="vertical" android:layout_weight="1" - android:weightSum="2" android:paddingBottom="10dp" android:layout_height="fill_parent"> @@ -58,7 +57,7 @@ android:padding="@dimen/paddingforsmalls" android:text="শেষ : " - android:textAppearance="@style/Base.TextAppearance.AppCompat.Small" + android:textSize="@dimen/smalltext" android:textColor="#ffffff" /> @@ -76,7 +75,7 @@ @@ -112,7 +111,7 @@ android:layout_width="match_parent" android:orientation="vertical" android:layout_weight="1" - android:weightSum="2" + android:weightSum="3" android:paddingBottom="10dp" android:layout_height="fill_parent"> @@ -121,6 +120,7 @@ android:id="@+id/pickuplayout" android:layout_height="wrap_content" android:orientation="vertical" + android:layout_weight="@integer/taskweighttop" android:background="@drawable/shadow_drop"> @@ -145,7 +145,7 @@ android:padding="@dimen/paddingforsmalls" android:text="শেষ : " - android:textAppearance="@style/Base.TextAppearance.AppCompat.Small" + android:textSize="@dimen/smalltext" android:textColor="#ffffff" /> @@ -168,7 +168,7 @@ @@ -206,28 +206,31 @@ android:orientation="vertical" android:layout_weight="1" android:paddingBottom="10dp" - android:weightSum="2" + android:weightSum="3" android:layout_height="fill_parent"> + + + + android:layout_weight="@integer/taskweighttop" + android:background="@drawable/shadow_drop_delivery" + android:orientation="vertical"> + - - + android:textSize="@dimen/largetext" + android:textColor="#ffffff" + android:textStyle="bold" /> - - - - - - @@ -292,7 +289,6 @@ android:textAppearance="@style/Base.TextAppearance.AppCompat.Large" android:text="-- " /> - diff --git a/app/src/main/res/values-large/dimens.xml b/app/src/main/res/values-large/dimens.xml index ea9691f..35e2fe2 100644 --- a/app/src/main/res/values-large/dimens.xml +++ b/app/src/main/res/values-large/dimens.xml @@ -3,8 +3,10 @@ 16dp 16dp 16dp + 23sp + 45sp 80dp 60dp - 8dp + 15dp 6dp diff --git a/app/src/main/res/values-large/integers.xml b/app/src/main/res/values-large/integers.xml new file mode 100644 index 0000000..766c5b1 --- /dev/null +++ b/app/src/main/res/values-large/integers.xml @@ -0,0 +1,6 @@ + + + 12 + 2 + 1 + \ No newline at end of file diff --git a/app/src/main/res/values-large/styles.xml b/app/src/main/res/values-large/styles.xml new file mode 100644 index 0000000..30de1e0 --- /dev/null +++ b/app/src/main/res/values-large/styles.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index ea9691f..638fd3c 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -3,6 +3,8 @@ 16dp 16dp 16dp + 14sp + 22sp 80dp 60dp 8dp diff --git a/app/src/main/res/values/integers.xml b/app/src/main/res/values/integers.xml new file mode 100644 index 0000000..766c5b1 --- /dev/null +++ b/app/src/main/res/values/integers.xml @@ -0,0 +1,6 @@ + + + 12 + 2 + 1 + \ No newline at end of file