Skip to content

Commit

Permalink
layout modified+show toast if no jobs available
Browse files Browse the repository at this point in the history
  • Loading branch information
Isratmity01 committed May 23, 2017
1 parent 1c765a8 commit 3b14c6c
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down Expand Up @@ -275,6 +275,9 @@ public void setJobModelList(List<JobModel> jobModelList) {
setupRecyclerView(job_expandable_list_adapter);

}
else {
showEmpty();
}
}

@Override
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/co/gobd/tracker/ui/view/TasksView.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface TasksView {
void setJobModelList(List<JobModel> jobModelList);
void startProgress();
void stopProgresswithmessage();

void showEmpty();
void stopProgress();

void showTaskUpdateSuccessfulMsg();
Expand Down
56 changes: 26 additions & 30 deletions app/src/main/res/layout/task_overview.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"

android:layout_weight="@integer/taskweighttop"
android:background="@drawable/shadow_drop_express">

<TextView
Expand All @@ -44,7 +43,7 @@
android:gravity="top|start"
android:padding="@dimen/paddingforsmalls"
android:text="এক্সপ্রেস ডেলিভারি"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Large"
android:textSize="@dimen/largetext"
android:textColor="#ffffff"
android:textStyle="bold" />

Expand All @@ -58,7 +57,7 @@

android:padding="@dimen/paddingforsmalls"
android:text="শেষ : "
android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
android:textSize="@dimen/smalltext"
android:textColor="#ffffff" />

<TextView
Expand All @@ -68,15 +67,15 @@

android:padding="@dimen/paddingforsmalls"
android:text="হয় নাই : "
android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
android:textSize="@dimen/smalltext"
android:textColor="#ffffff" />


</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:layout_weight="@integer/taskweightlow"
android:background="#fbfcf9"
android:padding="3dp"
android:gravity="end|center">
Expand Down Expand Up @@ -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">

Expand All @@ -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">

<TextView
Expand All @@ -132,7 +132,7 @@
android:gravity="top|start"
android:padding="@dimen/paddingforsmalls"
android:text="পিক আপ "
android:textAppearance="@style/Base.TextAppearance.AppCompat.Large"
android:textSize="@dimen/largetext"
android:textColor="#ffffff"
android:textStyle="bold" />

Expand All @@ -145,7 +145,7 @@

android:padding="@dimen/paddingforsmalls"
android:text="শেষ : "
android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
android:textSize="@dimen/smalltext"
android:textColor="#ffffff" />

<TextView
Expand All @@ -155,7 +155,7 @@
android:layout_below="@id/pickupattempted"
android:padding="@dimen/paddingforsmalls"
android:text="হয় নাই : "
android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
android:textSize="@dimen/smalltext"
android:textColor="#ffffff" />


Expand All @@ -168,7 +168,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:layout_weight="@integer/taskweightlow"
android:background="#fbfcf9"
android:gravity="end|center"
android:padding="5dp">
Expand Down Expand Up @@ -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">



<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/shadow_drop_delivery">
android:layout_weight="@integer/taskweighttop"
android:background="@drawable/shadow_drop_delivery"
android:orientation="vertical">

<TextView

android:id="@+id/deliverybtn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/deliverybtn"
android:background="#8BC34A"
android:textColor="#ffffff"
android:textStyle="bold"
android:gravity="top|start"
android:padding="@dimen/paddingforsmalls"
android:text="ডেলিভারি"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Large" />


android:textSize="@dimen/largetext"
android:textColor="#ffffff"
android:textStyle="bold" />


<TextView
Expand All @@ -239,7 +242,7 @@

android:padding="@dimen/paddingforsmalls"
android:text="শেষ : "
android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
android:textSize="@dimen/smalltext"
android:textColor="#ffffff" />

<TextView
Expand All @@ -249,21 +252,15 @@
android:layout_below="@id/deliveryattempted"
android:padding="@dimen/paddingforsmalls"
android:text="হয় নাই :"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
android:textSize="@dimen/smalltext"
android:textColor="#ffffff" />







</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:layout_weight="@integer/taskweightlow"
android:background="#fbfcf9"
android:gravity="end|center"
android:padding="5dp">
Expand Down Expand Up @@ -292,7 +289,6 @@
android:textAppearance="@style/Base.TextAppearance.AppCompat.Large"
android:text="-- " />
</LinearLayout>

</LinearLayout>


Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/values-large/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="smalltext">23sp</dimen>
<dimen name="largetext">45sp</dimen>
<dimen name="design_fab_size_normal">80dp</dimen>
<dimen name="design_fab_size_mini">60dp</dimen>
<dimen name="paddingforsmalls">8dp</dimen>
<dimen name="paddingforsmalls">15dp</dimen>
<dimen name="paddingforjobparenttitle">6dp</dimen>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values-large/integers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="quantity_length">12</integer>
<integer name="taskweightlow">2</integer>
<integer name="taskweighttop">1</integer>
</resources>
49 changes: 49 additions & 0 deletions app/src/main/res/values-large/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>

<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>

<style name="AppTheme.Dark" parent="Theme.AppCompat.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="android:windowBackground">@color/colorPrimary</item>
<item name="colorControlNormal">@color/material_white</item>
<item name="colorControlActivated">@color/material_white</item>
<item name="colorControlHighlight">@color/material_white</item>
<item name="android:textColorHint">@color/material_white</item>
<item name="colorButtonNormal">@color/colorPrimaryDark</item>
</style>

<style name="AppTheme.Dark.Dialog" parent="Theme.AppCompat.Dialog">
<item name="colorAccent">@color/material_white</item>
<item name="android:textColorPrimary">@color/material_grey_400</item>
<item name="android:background">@color/colorPrimaryDark</item>
</style>

<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

<style name="JobCardViewStyle" parent="Theme.AppCompat.Light">
<item name="cardCornerRadius">2dp</item>
<item name="cardElevation">2dp</item>
<item name="contentPaddingBottom">8dp</item>
<item name="contentPaddingTop">8dp</item>

</style>

<style name="MaterialCheckBox" parent="Theme.AppCompat.Light">
<item name="colorControlNormal">@color/colorPrimaryDark</item>
<item name="colorControlActivated">@color/colorAccent</item>
</style>

</resources>
2 changes: 2 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="smalltext">14sp</dimen>
<dimen name="largetext">22sp</dimen>
<dimen name="design_fab_size_normal">80dp</dimen>
<dimen name="design_fab_size_mini">60dp</dimen>
<dimen name="paddingforsmalls">8dp</dimen>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/integers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer name="quantity_length">12</integer>
<integer name="taskweightlow">2</integer>
<integer name="taskweighttop">1</integer>
</resources>

0 comments on commit 3b14c6c

Please sign in to comment.