Commit 9dde565e by Kunj Gupta

Fixed - We need to get updated data from server each time.

parent 254ec802
...@@ -86,15 +86,15 @@ public class CatalogueItemScreen extends AppCompatActivity { ...@@ -86,15 +86,15 @@ public class CatalogueItemScreen extends AppCompatActivity {
// Send initial screen view hit. // Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString()); Util.sendScreenName(tracker, actionBar.getTitle().toString());
List<CatalogueItem> catalogueItemList = CatalogueItemManager.getAllCatalogueItems(mCatalogue.getId()); if(application.isNetConnected()) {
if(catalogueItemList.isEmpty()) { new FetchCatalogueItem().execute();
if(application.isNetConnected()) { } else {
new FetchCatalogueItem().execute(); List<CatalogueItem> catalogueItemList = CatalogueItemManager.getAllCatalogueItems(mCatalogue.getId());
} else { if(catalogueItemList.isEmpty()) {
DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueItemScreen.this); DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueItemScreen.this);
} else {
setData(catalogueItemList);
} }
} else {
setData(catalogueItemList);
} }
} }
......
...@@ -67,15 +67,15 @@ public class CatalogueScreen extends AppCompatActivity { ...@@ -67,15 +67,15 @@ public class CatalogueScreen extends AppCompatActivity {
// Send initial screen view hit. // Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString()); Util.sendScreenName(tracker, actionBar.getTitle().toString());
List<Catalogue> catalogueList = CatalogueManager.getAllCatalogues(); if(application.isNetConnected()) {
if(catalogueList.isEmpty()) { new FetchCatalogue().execute();
if(application.isNetConnected()) { } else {
new FetchCatalogue().execute(); List<Catalogue> catalogueList = CatalogueManager.getAllCatalogues();
if(!catalogueList.isEmpty()) {
setData(catalogueList);
} else { } else {
DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueScreen.this); DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueScreen.this);
} }
} else {
setData(catalogueList);
} }
} }
......
...@@ -171,17 +171,17 @@ public class CatalogueVariableScreen extends AppCompatActivity { ...@@ -171,17 +171,17 @@ public class CatalogueVariableScreen extends AppCompatActivity {
// Send initial screen view hit. // Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString()); Util.sendScreenName(tracker, actionBar.getTitle().toString());
mCatalogueVariableList = CatalogueVariableManager.getAllVariable(mCatalogueItem.getId()); if (mApplication.isNetConnected()) {
setVariableChoices(); new FetchCatalogueVariable().execute();
if (mCatalogueVariableList.isEmpty()) { } else {
if (mApplication.isNetConnected()) { mCatalogueVariableList = CatalogueVariableManager.getAllVariable(mCatalogueItem.getId());
new FetchCatalogueVariable().execute(); if (mCatalogueVariableList.isEmpty()) {
} else {
DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueVariableScreen.this); DialogUtils.showNoConnectionDialogWithCloseActivity(CatalogueVariableScreen.this);
} else {
setVariableChoices();
createView();
runUIPolicyActions(null);
} }
} else {
createView();
runUIPolicyActions(null);
} }
} }
......
...@@ -67,15 +67,15 @@ public class MyIncidentScreen extends AppCompatActivity { ...@@ -67,15 +67,15 @@ public class MyIncidentScreen extends AppCompatActivity {
// Send initial screen view hit. // Send initial screen view hit.
Util.sendScreenName(tracker, actionBar.getTitle().toString()); Util.sendScreenName(tracker, actionBar.getTitle().toString());
mIncidentList = MyIncidentsManager.getAllIncidents(); if (application.isNetConnected()) {
if(mIncidentList.isEmpty()) { new FetchIncident().execute();
if (application.isNetConnected()) { } else {
new FetchIncident().execute(); mIncidentList = MyIncidentsManager.getAllIncidents();
} else { if(mIncidentList.isEmpty()) {
DialogUtils.showNoConnectionDialogWithCloseActivity(MyIncidentScreen.this); DialogUtils.showNoConnectionDialogWithCloseActivity(MyIncidentScreen.this);
} else {
setData(mIncidentList);
} }
} else {
setData(mIncidentList);
} }
} }
......
...@@ -68,15 +68,15 @@ public class MyRequestActivity extends AppCompatActivity { ...@@ -68,15 +68,15 @@ public class MyRequestActivity extends AppCompatActivity {
mAdapter = new MyRequestAdapter(MyRequestActivity.this); mAdapter = new MyRequestAdapter(MyRequestActivity.this);
mListView.setAdapter(mAdapter); mListView.setAdapter(mAdapter);
List<MyRequest> myRequestList = MyRequestsManager.getAllRequests(); if(application.isNetConnected()) {
if(myRequestList.isEmpty()) { new FetchMyRequestData().execute();
if(application.isNetConnected()) { } else {
new FetchMyRequestData().execute(); List<MyRequest> myRequestList = MyRequestsManager.getAllRequests();
} else { if(myRequestList.isEmpty()) {
DialogUtils.showNoConnectionDialogWithCloseActivity(MyRequestActivity.this); DialogUtils.showNoConnectionDialogWithCloseActivity(MyRequestActivity.this);
} else {
setData(myRequestList);
} }
} else {
setData(myRequestList);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment