further tweaks for tablets
This commit is contained in:
parent
3cbae613a5
commit
a5ee43a4e6
@ -93,18 +93,6 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe
|
||||
item.setTitle(R.string.menu_unread_feeds);
|
||||
}
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||
ShareActionProvider shareProvider = (ShareActionProvider) m_menu.findItem(R.id.share_article).getActionProvider();
|
||||
|
||||
if (af != null && af.getSelectedArticle() != null) {
|
||||
Log.d(TAG, "setting up share provider");
|
||||
shareProvider.setShareIntent(getShareIntent(af.getSelectedArticle()));
|
||||
|
||||
if (!isSmallScreen()) {
|
||||
m_menu.findItem(R.id.share_article).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,8 +45,6 @@ private final String TAG = this.getClass().getSimpleName();
|
||||
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
|
||||
Intent i = getIntent();
|
||||
|
||||
if (i.getExtras() != null) {
|
||||
@ -61,15 +59,16 @@ private final String TAG = this.getClass().getSimpleName();
|
||||
articles.add(a);
|
||||
|
||||
HeadlinesFragment hf = new HeadlinesFragment(feed, activeArticle, articles);
|
||||
ArticlePager af = new ArticlePager(hf.getArticleById(article.id), hf.getAllArticles());
|
||||
|
||||
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
|
||||
|
||||
ft.replace(R.id.headlines_fragment, hf, FRAG_HEADLINES);
|
||||
|
||||
ArticlePager af = new ArticlePager(article, hf.getAllArticles());
|
||||
|
||||
ft.replace(R.id.article_fragment, af, FRAG_ARTICLE);
|
||||
}
|
||||
|
||||
ft.commit();
|
||||
ft.commit();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.widget.EditText;
|
||||
import android.widget.SearchView;
|
||||
import android.widget.ShareActionProvider;
|
||||
|
||||
public class OnlineActivity extends CommonActivity {
|
||||
private final String TAG = this.getClass().getSimpleName();
|
||||
@ -759,6 +760,21 @@ public class OnlineActivity extends CommonActivity {
|
||||
MenuItem search = m_menu.findItem(R.id.search);
|
||||
search.setEnabled(m_apiLevel >= 2);
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||
ShareActionProvider shareProvider = (ShareActionProvider) m_menu.findItem(R.id.share_article).getActionProvider();
|
||||
|
||||
ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE);
|
||||
|
||||
if (af != null && af.getSelectedArticle() != null) {
|
||||
Log.d(TAG, "setting up share provider");
|
||||
shareProvider.setShareIntent(getShareIntent(af.getSelectedArticle()));
|
||||
|
||||
if (!isSmallScreen()) {
|
||||
m_menu.findItem(R.id.share_article).setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!isCompatMode()) {
|
||||
SearchView searchView = (SearchView) search.getActionView();
|
||||
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
|
Loading…
Reference in New Issue
Block a user