|
@@ -4,6 +4,7 @@ import android.app.Activity;
|
|
|
import android.app.ProgressDialog;
|
|
import android.app.ProgressDialog;
|
|
|
import android.content.BroadcastReceiver;
|
|
import android.content.BroadcastReceiver;
|
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
|
|
|
+import android.content.DialogInterface;
|
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
|
import android.content.IntentFilter;
|
|
import android.content.IntentFilter;
|
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
@@ -32,6 +33,7 @@ import com.usai.ratradefiling.R;
|
|
|
//import com.usai.ratradefiling.SaveInstanceHelper;
|
|
//import com.usai.ratradefiling.SaveInstanceHelper;
|
|
|
//import com.usai.ratradefiling.badgeview.BadgeView;
|
|
//import com.usai.ratradefiling.badgeview.BadgeView;
|
|
|
import com.usai.ratradefiling.RootActivity;
|
|
import com.usai.ratradefiling.RootActivity;
|
|
|
|
|
+import com.usai.ratradefiling.TradeFilingApplication;
|
|
|
import com.usai.ratradefiling.base.ResultBaseModel;
|
|
import com.usai.ratradefiling.base.ResultBaseModel;
|
|
|
import com.usai.ratradefiling.dataprovider.RADataProvider;
|
|
import com.usai.ratradefiling.dataprovider.RADataProvider;
|
|
|
//import com.usai.ratradefiling.message.MessageActivity;
|
|
//import com.usai.ratradefiling.message.MessageActivity;
|
|
@@ -53,6 +55,7 @@ import com.usai.ratradefiling.home.dashmodel.pending.HomeDashACEM1ModelP;
|
|
|
import com.usai.ratradefiling.home.dashmodel.pending.HomeDashACIModelP;
|
|
import com.usai.ratradefiling.home.dashmodel.pending.HomeDashACIModelP;
|
|
|
import com.usai.ratradefiling.home.dashmodel.pending.HomeDashISFModelP;
|
|
import com.usai.ratradefiling.home.dashmodel.pending.HomeDashISFModelP;
|
|
|
import com.usai.ratradefiling.home.dashmodel.pending.HomeDasheManifestModelP;
|
|
import com.usai.ratradefiling.home.dashmodel.pending.HomeDasheManifestModelP;
|
|
|
|
|
+import com.usai.ratradefiling.login.RetrievePasswordActivity;
|
|
|
import com.usai.redant.rautils.actionsheet.ActionSheet;
|
|
import com.usai.redant.rautils.actionsheet.ActionSheet;
|
|
|
import com.usai.redant.rautils.utils.Network;
|
|
import com.usai.redant.rautils.utils.Network;
|
|
|
|
|
|
|
@@ -213,6 +216,9 @@ public class HomeFragment extends Fragment
|
|
|
}
|
|
}
|
|
|
private void handleRowAction(final HomeSectionModel sectionModel,ResultBaseModel rowModel) {
|
|
private void handleRowAction(final HomeSectionModel sectionModel,ResultBaseModel rowModel) {
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(rowModel.type==DashResultTypeEmpty.ordinal())
|
|
|
|
|
+ return;
|
|
|
JSONArray rowActions = sectionModel.row_actions;
|
|
JSONArray rowActions = sectionModel.row_actions;
|
|
|
if (rowActions != null) {
|
|
if (rowActions != null) {
|
|
|
|
|
|
|
@@ -413,6 +419,9 @@ public class HomeFragment extends Fragment
|
|
|
loadData();
|
|
loadData();
|
|
|
}
|
|
}
|
|
|
} // initial
|
|
} // initial
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ checkActivation();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -530,6 +539,34 @@ public class HomeFragment extends Fragment
|
|
|
// mHeaderView.setExistNewMessage(mHeaderModel.message_count > 0);
|
|
// mHeaderView.setExistNewMessage(mHeaderModel.message_count > 0);
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
+ void checkActivation()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ if(!TradeFilingApplication.getInstance().userActive())
|
|
|
|
|
+ {
|
|
|
|
|
+ android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(
|
|
|
|
|
+ getActivity());
|
|
|
|
|
+ builder.setMessage(getString(R.string.inactive_message));
|
|
|
|
|
+
|
|
|
|
|
+ builder.setTitle(getString(R.string.message));
|
|
|
|
|
+
|
|
|
|
|
+ builder.setPositiveButton(getString(android.R.string.ok), new DialogInterface.OnClickListener()
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(DialogInterface dialog, int which)
|
|
|
|
|
+ {
|
|
|
|
|
+ dialog.dismiss();
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ builder.create().show();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void registBroadcastReceiver()
|
|
private void registBroadcastReceiver()
|
|
|
{
|
|
{
|
|
|
IntentFilter intentFilter = new IntentFilter();
|
|
IntentFilter intentFilter = new IntentFilter();
|
|
@@ -648,6 +685,8 @@ public class HomeFragment extends Fragment
|
|
|
|
|
|
|
|
String headertext = "<center><font size=5 color=white><b>In 30 Days</b>";
|
|
String headertext = "<center><font size=5 color=white><b>In 30 Days</b>";
|
|
|
|
|
|
|
|
|
|
+ if(totaljson== null)
|
|
|
|
|
+ totaljson = new JSONObject();
|
|
|
if(totaljson.has("acem1"))
|
|
if(totaljson.has("acem1"))
|
|
|
{
|
|
{
|
|
|
|
|
|
|
@@ -1520,9 +1559,10 @@ public class HomeFragment extends Fragment
|
|
|
{
|
|
{
|
|
|
if (orders == null)
|
|
if (orders == null)
|
|
|
{
|
|
{
|
|
|
- return 0;
|
|
|
|
|
|
|
+ return 1;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ if(orders.size()==0)
|
|
|
|
|
+ return 1;
|
|
|
return orders.size();
|
|
return orders.size();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -1627,6 +1667,14 @@ public class HomeFragment extends Fragment
|
|
|
|
|
|
|
|
ResultBaseModel orderModelForIndex(int index)
|
|
ResultBaseModel orderModelForIndex(int index)
|
|
|
{
|
|
{
|
|
|
|
|
+ if(orders.size()==0)
|
|
|
|
|
+ {
|
|
|
|
|
+ ResultBaseModel model = new ResultBaseModel();
|
|
|
|
|
+ model.type = DashResultTypeEmpty.ordinal();
|
|
|
|
|
+ return model;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
if (index >= orders.size())
|
|
if (index >= orders.size())
|
|
|
{
|
|
{
|
|
|
return null;
|
|
return null;
|