|
|
@@ -113,8 +113,13 @@ public class KPIFragment extends Fragment implements KPICell.KPIListener {
|
|
|
// Inflate the layout for this fragment
|
|
|
View root = inflater.inflate(R.layout.fragment_kpi, container, false);
|
|
|
|
|
|
- mWidth = container.getMeasuredWidth();
|
|
|
- mHeight = container.getMeasuredHeight();
|
|
|
+ if (savedInstanceState != null) {
|
|
|
+ mWidth = savedInstanceState.getInt("width");
|
|
|
+ mHeight = savedInstanceState.getInt("height");
|
|
|
+ } else {
|
|
|
+ mWidth = container.getMeasuredWidth();
|
|
|
+ mHeight = container.getMeasuredHeight();
|
|
|
+ }
|
|
|
|
|
|
mContext = getContext();
|
|
|
self = this;
|
|
|
@@ -170,21 +175,21 @@ public class KPIFragment extends Fragment implements KPICell.KPIListener {
|
|
|
|
|
|
mSwipeRefresh.setEnabled(true);
|
|
|
|
|
|
- if (savedInstanceState != null) {
|
|
|
- String kpiString = savedInstanceState.getString("KPIData");
|
|
|
- if (kpiString != null) {
|
|
|
- try {
|
|
|
- mData = new JSONObject(kpiString);
|
|
|
- prepareData();
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (mKPIArr == null || mKPIArr.size() == 0) {
|
|
|
- loadKPIData();
|
|
|
- }
|
|
|
+// if (savedInstanceState != null) {
|
|
|
+// String kpiString = savedInstanceState.getString("KPIData");
|
|
|
+// if (kpiString != null) {
|
|
|
+// try {
|
|
|
+// mData = new JSONObject(kpiString);
|
|
|
+// prepareData();
|
|
|
+// } catch (JSONException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (mKPIArr == null || mKPIArr.size() == 0) {
|
|
|
+// loadKPIData();
|
|
|
+// }
|
|
|
|
|
|
return root;
|
|
|
}
|
|
|
@@ -232,6 +237,8 @@ public class KPIFragment extends Fragment implements KPICell.KPIListener {
|
|
|
if (mData != null) {
|
|
|
outState.putString("KPIData",mData.toString());
|
|
|
outState.putInt("currentKPI",currentKPI);
|
|
|
+ outState.putInt("width",mWidth);
|
|
|
+ outState.putInt("height",mHeight);
|
|
|
}
|
|
|
mKPIArr.clear();
|
|
|
mAdapter.notifyDataSetChanged();
|