diff --git a/Stately/app/src/main/java/com/lloydtorres/stately/issues/IssuesFragment.java b/Stately/app/src/main/java/com/lloydtorres/stately/issues/IssuesFragment.java index 004d4552..25c70e65 100644 --- a/Stately/app/src/main/java/com/lloydtorres/stately/issues/IssuesFragment.java +++ b/Stately/app/src/main/java/com/lloydtorres/stately/issues/IssuesFragment.java @@ -53,6 +53,7 @@ public class IssuesFragment extends Fragment { private Activity mActivity; private View mView; + private View mainView; private Toolbar toolbar; private SwipeRefreshLayout mSwipeRefreshLayout; @@ -83,6 +84,7 @@ public void onCreate(Bundle savedInstanceState) public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mView = inflater.inflate(R.layout.fragment_issues, container, false); + mainView = mView.findViewById(R.id.refreshview_main); SparkleHelper.initAd(mView, R.id.ad_issues_fragment); toolbar = (Toolbar) mView.findViewById(R.id.refreshview_toolbar); @@ -99,7 +101,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { - queryIssues(mView); + queryIssues(mainView); } }); @@ -108,7 +110,7 @@ public void onRefresh() { dialogClickListener = new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - dismissAllIssues(mView); + dismissAllIssues(mainView); } }; @@ -143,7 +145,7 @@ public void run() { mSwipeRefreshLayout.setRefreshing(true); } }); - queryIssues(mView); + queryIssues(mainView); } /** diff --git a/Stately/app/src/main/java/com/lloydtorres/stately/region/RegionFragment.java b/Stately/app/src/main/java/com/lloydtorres/stately/region/RegionFragment.java index 90cb25ac..2b3afab2 100644 --- a/Stately/app/src/main/java/com/lloydtorres/stately/region/RegionFragment.java +++ b/Stately/app/src/main/java/com/lloydtorres/stately/region/RegionFragment.java @@ -108,6 +108,7 @@ public void onCreate(Bundle savedInstanceState) public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_region, container, false); + View mainView = view.findViewById(R.id.coordinator_region); SparkleHelper.initAd(view, R.id.ad_region_fragment); initToolbar(view); @@ -122,11 +123,11 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa if (mRegion != null) { mRegionName = mRegion.name; - getAllRegionViews(view); + getAllRegionViews(mainView); } else { - updateRegion(view); + updateRegion(mainView); } return view; diff --git a/Stately/app/src/main/java/com/lloydtorres/stately/wa/AssemblyMainFragment.java b/Stately/app/src/main/java/com/lloydtorres/stately/wa/AssemblyMainFragment.java index 489cd98a..cdf23404 100644 --- a/Stately/app/src/main/java/com/lloydtorres/stately/wa/AssemblyMainFragment.java +++ b/Stately/app/src/main/java/com/lloydtorres/stately/wa/AssemblyMainFragment.java @@ -36,6 +36,7 @@ public class AssemblyMainFragment extends Fragment { private Activity mActivity; private View mView; + private View mainView; private Toolbar toolbar; private SwipeRefreshLayout mSwipeRefreshLayout; @@ -63,6 +64,7 @@ public void onCreate(Bundle savedInstanceState) public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { mView = inflater.inflate(R.layout.fragment_wa_main, container, false); + mainView = mView.findViewById(R.id.refreshview_main); SparkleHelper.initAd(mView, R.id.ad_wa_fragment); toolbar = (Toolbar) mView.findViewById(R.id.refreshview_toolbar); @@ -79,7 +81,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { - queryWorldAssembly(mView); + queryWorldAssembly(mainView); } }); @@ -97,7 +99,7 @@ public void run() { } }); - queryWorldAssembly(mView); + queryWorldAssembly(mainView); return mView; } @@ -140,7 +142,7 @@ public void onResponse(String response) { // Once a response is obtained for the General Assembly, // start querying for the Security Council setGeneralAssembly(waResponse); - queryWorldAssemblyHeavy(mView, Assembly.SECURITY_COUNCIL); + queryWorldAssemblyHeavy(view, Assembly.SECURITY_COUNCIL); } else if (chamberId == Assembly.SECURITY_COUNCIL) {