Skip to content

Commit

Permalink
Pass proper views for snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
lloydtorres committed Jan 30, 2016
1 parent f2403bc commit 9b7ab6c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class IssuesFragment extends Fragment {

private Activity mActivity;
private View mView;
private View mainView;
private Toolbar toolbar;
private SwipeRefreshLayout mSwipeRefreshLayout;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
});

Expand All @@ -108,7 +110,7 @@ public void onRefresh() {
dialogClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dismissAllIssues(mView);
dismissAllIssues(mainView);
}
};

Expand Down Expand Up @@ -143,7 +145,7 @@ public void run() {
mSwipeRefreshLayout.setRefreshing(true);
}
});
queryIssues(mView);
queryIssues(mainView);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
public class AssemblyMainFragment extends Fragment {
private Activity mActivity;
private View mView;
private View mainView;
private Toolbar toolbar;
private SwipeRefreshLayout mSwipeRefreshLayout;

Expand Down Expand Up @@ -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);
Expand All @@ -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);
}
});

Expand All @@ -97,7 +99,7 @@ public void run() {
}
});

queryWorldAssembly(mView);
queryWorldAssembly(mainView);
return mView;
}

Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 9b7ab6c

Please sign in to comment.