hide headlines fragment fab on tablets in landscape
use shared articlelist if possible in both pager & fragment
This commit is contained in:
parent
657366879c
commit
c3a9241741
@ -81,7 +81,13 @@ public class ArticlePager extends Fragment {
|
||||
|
||||
if (savedInstanceState != null) {
|
||||
m_article = savedInstanceState.getParcelable("article");
|
||||
m_articles = ((DetailActivity)m_activity).m_articles;
|
||||
|
||||
if (! (m_activity instanceof DetailActivity)) {
|
||||
m_articles = savedInstanceState.getParcelable("articles");
|
||||
} else {
|
||||
m_articles = ((DetailActivity)m_activity).m_articles;
|
||||
}
|
||||
|
||||
m_feed = savedInstanceState.getParcelable("feed");
|
||||
m_firstId = savedInstanceState.getInt("firstId");
|
||||
}
|
||||
|
@ -434,13 +434,19 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener,
|
||||
m_list = (ListView)view.findViewById(R.id.headlines_list);
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.headlines_fab);
|
||||
m_list.setOnTouchListener(new ShowHideOnScroll(fab));
|
||||
fab.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
refresh(false);
|
||||
}
|
||||
});
|
||||
|
||||
if (! (getActivity() instanceof DetailActivity)) {
|
||||
|
||||
m_list.setOnTouchListener(new ShowHideOnScroll(fab));
|
||||
fab.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
refresh(false);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
fab.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
m_listLoadingView = inflater.inflate(R.layout.headlines_row_loadmore, m_list, false);
|
||||
m_list.addFooterView(m_listLoadingView, null, false);
|
||||
|
Loading…
Reference in New Issue
Block a user