diff options
author | Andrew Dolgov <[email protected]> | 2014-10-31 14:11:47 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2014-10-31 14:11:47 +0300 |
commit | acdcf759a028d36d1af09639619410e392baf14c (patch) | |
tree | ebdc430fd7a4b904030811d7205653c895909823 /org.fox.ttrss/src/main | |
parent | 8a15540c6134adf6fa6f0244f432adbf9abc1acf (diff) |
implement drawer navigation for headlines activity instead of old hideable sidebar
Diffstat (limited to 'org.fox.ttrss/src/main')
16 files changed, 208 insertions, 177 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java index 2b19daba..87aeaff9 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/ArticleImagesPagerActivity.java @@ -291,6 +291,9 @@ public class ArticleImagesPagerActivity extends CommonActivity { } switch (item.getItemId()) { + case android.R.id.home: + finish(); + return true; case R.id.article_img_open: if (url != null) { try { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java index de9e07df..415e60da 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/FeedsActivity.java @@ -35,11 +35,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe protected SharedPreferences m_prefs; protected long m_lastRefresh = 0; - //private boolean m_actionbarUpEnabled = false; - //private int m_actionbarRevertDepth = 0; - //private SlidingMenu m_slidingMenu; private boolean m_feedIsSelected = false; - //private boolean m_feedWasSelected = false; private ActionBarDrawerToggle m_drawerToggle; private DrawerLayout m_drawerLayout; @@ -189,7 +185,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe m_menu.findItem(R.id.update_headlines).setVisible(false); } - m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false); + //m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false); MenuItem item = m_menu.findItem(R.id.show_feeds); @@ -229,15 +225,7 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe //m_feedWasSelected = true; if (m_drawerLayout != null) { - /* if (findViewById(R.id.sw600dp_port_anchor) != null) { - m_slidingMenu.setBehindWidth(getScreenWidthInPixel() * 2/3); - } */ - m_drawerLayout.closeDrawers(); - - //getSupportActionBar().setDisplayHomeAsUpEnabled(true); - //m_actionbarUpEnabled = true; - } } }, 10); @@ -336,14 +324,8 @@ public class FeedsActivity extends OnlineActivity implements HeadlinesEventListe public void onSaveInstanceState(Bundle out) { super.onSaveInstanceState(out); - //out.putBoolean("actionbarUpEnabled", m_actionbarUpEnabled); - //out.putInt("actionbarRevertDepth", m_actionbarRevertDepth); out.putBoolean("feedIsSelected", m_feedIsSelected); - //out.putBoolean("feedWasSelected", m_feedWasSelected); - - //if (m_slidingMenu != null ) - // out.putBoolean("slidingMenuVisible", m_slidingMenu.isMenuShowing()); - + GlobalState.getInstance().save(out); } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java index f788eebe..4a04526f 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesActivity.java @@ -7,6 +7,8 @@ import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; import android.support.v4.app.FragmentTransaction; +import android.support.v4.widget.DrawerLayout; +import android.support.v7.app.ActionBarDrawerToggle; import android.util.Log; import android.view.MenuItem; import android.view.View; @@ -19,7 +21,10 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL private final String TAG = this.getClass().getSimpleName(); protected SharedPreferences m_prefs; - + + private ActionBarDrawerToggle m_drawerToggle; + private DrawerLayout m_drawerLayout; + @SuppressLint("NewApi") @Override public void onCreate(Bundle savedInstanceState) { @@ -31,17 +36,43 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL super.onCreate(savedInstanceState); setContentView(R.layout.headlines_articles); - - getSupportActionBar().setDisplayHomeAsUpEnabled(true); + + m_drawerLayout = (DrawerLayout) findViewById(R.id.headlines_drawer); + + if (m_drawerLayout != null) { + + m_drawerToggle = new ActionBarDrawerToggle(this, m_drawerLayout, R.string.blank, R.string.blank) { + @Override + public void onDrawerOpened(View drawerView) { + super.onDrawerOpened(drawerView); + + invalidateOptionsMenu(); + } + + @Override + public void onDrawerClosed(View drawerView) { + super.onDrawerClosed(drawerView); + + invalidateOptionsMenu(); + } + }; + + m_drawerLayout.setDrawerListener(m_drawerToggle); + m_drawerToggle.setDrawerIndicatorEnabled(true); + + } + + getSupportActionBar().setDisplayHomeAsUpEnabled(true); + getSupportActionBar().setHomeButtonEnabled(true); setStatusBarTint(); setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); GlobalState.getInstance().load(savedInstanceState); - if (isPortrait() || m_prefs.getBoolean("headlines_hide_sidebar", false)) { + /* if (isPortrait() || m_prefs.getBoolean("headlines_hide_sidebar", false)) { findViewById(R.id.headlines_fragment).setVisibility(View.GONE); - } + } */ if (savedInstanceState == null) { Intent i = getIntent(); @@ -85,7 +116,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); HeadlinesFragment hf = new HeadlinesFragment(); - hf.initialize(feed, article); + hf.initialize(feed, article, true); hf.setSearchQuery(searchQuery); ArticlePager af = new ArticlePager(); @@ -101,13 +132,14 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL } } - - /* if (!isCompatMode()) { - ((ViewGroup)findViewById(R.id.headlines_fragment)).setLayoutTransition(new LayoutTransition()); - ((ViewGroup)findViewById(R.id.article_fragment)).setLayoutTransition(new LayoutTransition()); - } */ } - + + protected void onPostCreate(Bundle savedInstanceState) { + super.onPostCreate(savedInstanceState); + // Sync the toggle state after onRestoreInstanceState has occurred. + if (m_drawerToggle != null) m_drawerToggle.syncState(); + } + @Override protected void refresh() { super.refresh(); @@ -133,7 +165,11 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { + if (m_drawerToggle != null && m_drawerToggle.onOptionsItemSelected(item)) { + return true; + } + + switch (item.getItemId()) { case android.R.id.home: finish(); overridePendingTransition(0, R.anim.right_slide_out); @@ -159,7 +195,7 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL //HeadlinesFragment hf = (HeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); m_menu.setGroupVisible(R.id.menu_group_headlines, !isPortrait() && !isSmallScreen()); - m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(!isPortrait() && !isSmallScreen()); + //m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(!isPortrait() && !isSmallScreen()); ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); @@ -210,7 +246,11 @@ public class HeadlinesActivity extends OnlineActivity implements HeadlinesEventL new Handler().postDelayed(new Runnable() { @Override public void run() { - ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); + if (m_drawerLayout != null) { + m_drawerLayout.closeDrawers(); + } + + ArticlePager af = (ArticlePager) getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); if (af != null) { af.setActiveArticle(fArticle); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index f48dd529..3b0d9d5e 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -91,6 +91,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, private OnlineActivity m_activity; private SwipeRefreshLayout m_swipeLayout; private int m_maxImageSize = 0; + private boolean m_compactLayoutMode = false; public ArticleList getSelectedArticles() { return m_selectedArticles; @@ -100,8 +101,9 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, m_feed = feed; } - public void initialize(Feed feed, Article activeArticle) { + public void initialize(Feed feed, Article activeArticle, boolean compactMode) { m_feed = feed; + m_compactLayoutMode = compactMode; if (activeArticle != null) { m_activeArticle = getArticleById(activeArticle.id); @@ -293,6 +295,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, m_activeArticle = savedInstanceState.getParcelable("activeArticle"); m_selectedArticles = savedInstanceState.getParcelable("selectedArticles"); m_searchQuery = (String) savedInstanceState.getCharSequence("searchQuery"); + m_compactLayoutMode = savedInstanceState.getBoolean("compactLayoutMode"); } DisplayMetrics metrics = new DisplayMetrics(); @@ -570,6 +573,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, out.putParcelable("activeArticle", m_activeArticle); out.putParcelable("selectedArticles", m_selectedArticles); out.putCharSequence("searchQuery", m_searchQuery); + out.putBoolean("compactLayoutMode", m_compactLayoutMode); } static class HeadlineViewHolder { @@ -586,7 +590,8 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, public ViewGroup flavorImageHolder; public ProgressBar flavorImageLoadingBar; public View flavorImageArrow; - } + public View headlineFooter; + } private class ArticleListAdapter extends ArrayAdapter<Article> { private ArrayList<Article> items; @@ -680,6 +685,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, holder.flavorImageHolder = (ViewGroup) v.findViewById(R.id.flavorImageHolder); holder.flavorImageLoadingBar = (ProgressBar) v.findViewById(R.id.flavorImageLoadingBar); holder.flavorImageArrow = v.findViewById(R.id.flavorImageArrow); + holder.headlineFooter = v.findViewById(R.id.headline_footer); v.setTag(holder); @@ -762,7 +768,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, String articleContent = article.content != null ? article.content : ""; if (holder.excerptView != null) { - if (!m_prefs.getBoolean("headlines_show_content", true)) { + if ((m_compactLayoutMode && m_activity.isSmallScreen()) || !m_prefs.getBoolean("headlines_show_content", true)) { holder.excerptView.setVisibility(View.GONE); } else { String excerpt = Jsoup.parse(articleContent).text(); @@ -775,129 +781,133 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, } } - if (holder.flavorImageView != null && m_prefs.getBoolean("headlines_show_flavor_image", true)) { - holder.flavorImageArrow.setVisibility(View.GONE); + if (!m_compactLayoutMode) { + if (holder.flavorImageView != null && m_prefs.getBoolean("headlines_show_flavor_image", true)) { + holder.flavorImageArrow.setVisibility(View.GONE); - Document doc = Jsoup.parse(articleContent); + Document doc = Jsoup.parse(articleContent); - boolean loadableImageFound = false; - - if (doc != null) { - //Element img = doc.select("img").first(); + boolean loadableImageFound = false; - final Elements imgs = doc.select("img"); - Element img = imgs.first(); + if (doc != null) { + //Element img = doc.select("img").first(); - if (img != null) { - String imgSrc = img.attr("src"); - - // retarded schema-less urls - if (imgSrc.indexOf("//") == 0) - imgSrc = "http:" + imgSrc; - - DisplayImageOptions options = new DisplayImageOptions.Builder() - .cacheInMemory(true) - .resetViewBeforeLoading(true) - .cacheOnDisk(true) - .build(); + final Elements imgs = doc.select("img"); + Element img = imgs.first(); - holder.flavorImageView.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View view) { - ArrayList<String> imgsList = new ArrayList<String>(); + if (img != null) { + String imgSrc = img.attr("src"); - for (Element img : imgs) { - String imgSrc = img.attr("src"); + // retarded schema-less urls + if (imgSrc.indexOf("//") == 0) + imgSrc = "http:" + imgSrc; - if (imgSrc.indexOf("//") == 0) - imgSrc = "http:" + imgSrc; + DisplayImageOptions options = new DisplayImageOptions.Builder() + .cacheInMemory(true) + .resetViewBeforeLoading(true) + .cacheOnDisk(true) + .build(); - imgsList.add(imgSrc); - } + holder.flavorImageView.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View view) { + ArrayList<String> imgsList = new ArrayList<String>(); - Intent intent = new Intent(m_activity, ArticleImagesPagerActivity.class); - intent.putExtra("urls", imgsList); - intent.putExtra("title", article.title); + for (Element img : imgs) { + String imgSrc = img.attr("src"); - startActivityForResult(intent, 0); - //m_activity.overridePendingTransition(android.R.anim.fade_in, 0); + if (imgSrc.indexOf("//") == 0) + imgSrc = "http:" + imgSrc; + imgsList.add(imgSrc); + } - } - }); + Intent intent = new Intent(m_activity, ArticleImagesPagerActivity.class); + intent.putExtra("urls", imgsList); + intent.putExtra("title", article.title); - final ViewGroup flavorImageHolder = holder.flavorImageHolder; - final ImageView flavorImageView = holder.flavorImageView; - final ProgressBar flavorImageLoadingBar = holder.flavorImageLoadingBar; + startActivityForResult(intent, 0); + //m_activity.overridePendingTransition(android.R.anim.fade_in, 0); - ImageAware imageAware = new ImageViewAware(holder.flavorImageView, false); - flavorImageHolder.setVisibility(View.VISIBLE); + } + }); - if (imgs.size() > 1 && holder.flavorImageArrow != null) { - holder.flavorImageArrow.setVisibility(View.VISIBLE); - } + final ViewGroup flavorImageHolder = holder.flavorImageHolder; + final ImageView flavorImageView = holder.flavorImageView; + final ProgressBar flavorImageLoadingBar = holder.flavorImageLoadingBar; - final boolean weNeedAnimation = MemoryCacheUtils.findCachedBitmapsForImageUri(imgSrc, ImageLoader.getInstance().getMemoryCache()).size() == 0; + ImageAware imageAware = new ImageViewAware(holder.flavorImageView, false); - loadableImageFound = true; - ImageLoader.getInstance().displayImage(imgSrc, imageAware, options, new ImageLoadingListener() { + flavorImageHolder.setVisibility(View.VISIBLE); + + if (imgs.size() > 1 && holder.flavorImageArrow != null) { + holder.flavorImageArrow.setVisibility(View.VISIBLE); + } - @Override - public void onLoadingCancelled(String arg0, - View arg1) { - // TODO Auto-generated method stub - - } + final boolean weNeedAnimation = MemoryCacheUtils.findCachedBitmapsForImageUri(imgSrc, ImageLoader.getInstance().getMemoryCache()).size() == 0; - @TargetApi(Build.VERSION_CODES.HONEYCOMB) - @Override - public void onLoadingComplete(String arg0, - View arg1, Bitmap arg2) { - // TODO Auto-generated method stub - - if (!isAdded() || arg2 == null) return; + loadableImageFound = true; + ImageLoader.getInstance().displayImage(imgSrc, imageAware, options, new ImageLoadingListener() { + + @Override + public void onLoadingCancelled(String arg0, + View arg1) { + // TODO Auto-generated method stub + + } - flavorImageLoadingBar.setVisibility(View.INVISIBLE); + @TargetApi(Build.VERSION_CODES.HONEYCOMB) + @Override + public void onLoadingComplete(String arg0, + View arg1, Bitmap arg2) { + // TODO Auto-generated method stub - if (arg2.getWidth() > 128 && arg2.getHeight() > 128) { - if (!m_activity.isCompatMode() && weNeedAnimation) { + if (!isAdded() || arg2 == null) return; - ObjectAnimator anim = ObjectAnimator.ofFloat(flavorImageView, "alpha", 0f, 1f); - anim.setDuration(200); - anim.start(); + flavorImageLoadingBar.setVisibility(View.INVISIBLE); + if (arg2.getWidth() > 128 && arg2.getHeight() > 128) { + if (!m_activity.isCompatMode() && weNeedAnimation) { + + ObjectAnimator anim = ObjectAnimator.ofFloat(flavorImageView, "alpha", 0f, 1f); + anim.setDuration(200); + anim.start(); + + } + //flavorImageHolder.setVisibility(View.VISIBLE); + } else { + flavorImageHolder.setVisibility(View.GONE); } - //flavorImageHolder.setVisibility(View.VISIBLE); - } else { + } + + @Override + public void onLoadingFailed(String arg0, + View arg1, FailReason arg2) { + // TODO Auto-generated method stub flavorImageHolder.setVisibility(View.GONE); } - } - @Override - public void onLoadingFailed(String arg0, - View arg1, FailReason arg2) { - // TODO Auto-generated method stub - flavorImageHolder.setVisibility(View.GONE); - } + @Override + public void onLoadingStarted(String arg0, + View arg1) { + // TODO Auto-generated method stub + + } - @Override - public void onLoadingStarted(String arg0, - View arg1) { - // TODO Auto-generated method stub - - } - - }); + }); + } } - } - if (!loadableImageFound && holder.flavorImageHolder != null) { + if (!loadableImageFound && holder.flavorImageHolder != null) { + holder.flavorImageHolder.setVisibility(View.GONE); + } + } else if (holder.flavorImageHolder != null) { holder.flavorImageHolder.setVisibility(View.GONE); } - } else if (holder.flavorImageHolder != null) { - holder.flavorImageHolder.setVisibility(View.GONE); - } + } else { + holder.flavorImageHolder.setVisibility(View.GONE); + } String articleAuthor = article.author != null ? article.author : ""; @@ -955,6 +965,12 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, } }); } + + if (m_compactLayoutMode && m_activity.isSmallScreen()) { + if (holder.headlineFooter != null) { + holder.headlineFooter.setVisibility(View.GONE); + } + } return v; } diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java index b92b072e..a590f006 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java @@ -651,7 +651,7 @@ public class OnlineActivity extends CommonActivity { /* case android.R.id.home: finish(); return true; */ - case R.id.headlines_toggle_sidebar: + /* case R.id.headlines_toggle_sidebar: if (true && !isSmallScreen()) { View v = findViewById(R.id.headlines_fragment); @@ -663,7 +663,7 @@ public class OnlineActivity extends CommonActivity { v.setVisibility(m_prefs.getBoolean("headlines_hide_sidebar", false) ? View.GONE : View.VISIBLE); } } - return true; + return true; */ case R.id.subscribe_to_feed: Intent subscribe = new Intent(OnlineActivity.this, SubscribeActivity.class); startActivityForResult(subscribe, 0); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java index e4450902..6059bf2f 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineActivity.java @@ -20,7 +20,6 @@ import android.view.KeyEvent; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; -import android.view.View; import android.widget.EditText; import android.widget.TextView; @@ -257,7 +256,7 @@ public class OfflineActivity extends CommonActivity { /* case android.R.id.home: finish(); return true; */ - case R.id.headlines_toggle_sidebar: + /* case R.id.headlines_toggle_sidebar: if (true && !isSmallScreen()) { SharedPreferences.Editor editor = m_prefs.edit(); editor.putBoolean("headlines_hide_sidebar", !m_prefs.getBoolean("headlines_hide_sidebar", false)); @@ -267,7 +266,7 @@ public class OfflineActivity extends CommonActivity { ohf.getView().setVisibility(m_prefs.getBoolean("headlines_hide_sidebar", false) ? View.GONE : View.VISIBLE); } } - return true; + return true; */ case R.id.go_online: switchOnline(); return true; diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java index 28db6ab9..8f85bd7d 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineFeedsActivity.java @@ -155,15 +155,8 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead public void onSaveInstanceState(Bundle out) { super.onSaveInstanceState(out); - //out.putBoolean("actionbarUpEnabled", m_actionbarUpEnabled); - //out.putInt("actionbarRevertDepth", m_actionbarRevertDepth); out.putBoolean("feedIsSelected", m_feedIsSelected); - //out.putBoolean("feedWasSelected", m_feedWasSelected); - - //if (m_slidingMenu != null ) - // out.putBoolean("slidingMenuVisible", m_slidingMenu.isMenuShowing()); - GlobalState.getInstance().save(out); } @@ -185,7 +178,7 @@ public class OfflineFeedsActivity extends OfflineActivity implements OfflineHead m_menu.setGroupVisible(R.id.menu_group_headlines, hf != null && hf.isAdded()); } - m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false); + //m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(false); MenuItem item = m_menu.findItem(R.id.show_feeds); diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java index 1cd795b3..b77221ff 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineHeadlinesActivity.java @@ -12,7 +12,6 @@ import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.util.Log; import android.view.MenuItem; -import android.view.View; import org.fox.ttrss.GlobalState; import org.fox.ttrss.R; @@ -39,9 +38,9 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline setStatusBarTint(); setSmallScreen(findViewById(R.id.sw600dp_anchor) == null); - if (isPortrait() || m_prefs.getBoolean("headlines_hide_sidebar", false)) { + /* if (isPortrait() || m_prefs.getBoolean("headlines_hide_sidebar", false)) { findViewById(R.id.headlines_fragment).setVisibility(View.GONE); - } + } */ if (savedInstanceState == null) { Intent i = getIntent(); @@ -141,7 +140,7 @@ public class OfflineHeadlinesActivity extends OfflineActivity implements Offline //OfflineHeadlinesFragment hf = (OfflineHeadlinesFragment)getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES); m_menu.setGroupVisible(R.id.menu_group_headlines, !isPortrait() && !isSmallScreen()); - m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(!isPortrait() && !isSmallScreen()); + //m_menu.findItem(R.id.headlines_toggle_sidebar).setVisible(!isPortrait() && !isSmallScreen()); Fragment af = getSupportFragmentManager().findFragmentByTag(FRAG_ARTICLE); diff --git a/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines_articles.xml b/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines_articles.xml index 4809a230..02be7e49 100644 --- a/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines_articles.xml +++ b/org.fox.ttrss/src/main/res/layout-sw600dp-port/headlines_articles.xml @@ -12,27 +12,25 @@ android:visibility="gone" > </FrameLayout> - <LinearLayout - android:id="@+id/fragment_container" + <android.support.v4.widget.DrawerLayout + android:id="@+id/headlines_drawer" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" > + android:layout_height="match_parent"> <FrameLayout - android:id="@+id/headlines_fragment" + android:id="@+id/article_fragment" android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="0.3" - android:background="?headlinesBackgroundSolid" > + android:layout_height="match_parent" + android:background="?articleBackground"> </FrameLayout> <FrameLayout - android:id="@+id/article_fragment" - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="0.7" - android:background="?articleBackground" > + android:id="@+id/headlines_fragment" + android:layout_height="match_parent" + android:layout_width="300dp" + android:layout_gravity="start" + android:background="?headlinesBackgroundSolid"> </FrameLayout> - </LinearLayout> + </android.support.v4.widget.DrawerLayout> </LinearLayout>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout/headlines_articles.xml b/org.fox.ttrss/src/main/res/layout/headlines_articles.xml index f49214cd..09dfb852 100644 --- a/org.fox.ttrss/src/main/res/layout/headlines_articles.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_articles.xml @@ -4,28 +4,25 @@ android:layout_width="fill_parent" android:layout_height="fill_parent"> - <LinearLayout - android:id="@+id/fragment_container" + <android.support.v4.widget.DrawerLayout + android:id="@+id/headlines_drawer" android:layout_width="match_parent" - android:layout_height="match_parent" - android:baselineAligned="false" - android:orientation="horizontal" > + android:layout_height="match_parent"> <FrameLayout - android:id="@+id/headlines_fragment" - android:layout_width="0dp" + android:id="@+id/article_fragment" + android:layout_width="match_parent" android:layout_height="match_parent" - android:layout_weight="0" - android:background="?feedlistBackground" > + android:background="?articleBackground"> </FrameLayout> <FrameLayout - android:id="@+id/article_fragment" - android:layout_width="0dp" + android:id="@+id/headlines_fragment" android:layout_height="match_parent" - android:layout_weight="1" - android:background="?articleBackground" > + android:layout_width="240dp" + android:layout_gravity="start" + android:background="?headlinesBackgroundSolid"> </FrameLayout> - </LinearLayout> + </android.support.v4.widget.DrawerLayout> </FrameLayout>
\ No newline at end of file diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row.xml b/org.fox.ttrss/src/main/res/layout/headlines_row.xml index 5163550a..99b27501 100644 --- a/org.fox.ttrss/src/main/res/layout/headlines_row.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row.xml @@ -125,6 +125,7 @@ android:layout_height="wrap_content"> <LinearLayout + android:id="@+id/headline_footer" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_selected.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_selected.xml index 23756682..1762e0bd 100644 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_selected.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_selected.xml @@ -126,6 +126,7 @@ android:layout_height="wrap_content"> <LinearLayout + android:id="@+id/headline_footer" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread.xml index e84badd7..22a6318e 100644 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_selected_unread.xml @@ -127,6 +127,7 @@ android:layout_height="wrap_content"> <LinearLayout + android:id="@+id/headline_footer" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml index 5f505bd4..f032438b 100644 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml @@ -126,6 +126,7 @@ android:layout_height="wrap_content"> <LinearLayout + android:id="@+id/headline_footer" android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" diff --git a/org.fox.ttrss/src/main/res/menu/main_menu.xml b/org.fox.ttrss/src/main/res/menu/main_menu.xml index 15391862..ee4a925d 100644 --- a/org.fox.ttrss/src/main/res/menu/main_menu.xml +++ b/org.fox.ttrss/src/main/res/menu/main_menu.xml @@ -64,10 +64,10 @@ app:showAsAction="" android:title="@string/headlines_view_mode"/> - <item + <!-- <item android:id="@+id/headlines_toggle_sidebar" app:showAsAction="" - android:title="@string/toggle_sidebar"/> + android:title="@string/toggle_sidebar"/> --> <!-- <item diff --git a/org.fox.ttrss/src/main/res/menu/offline_menu.xml b/org.fox.ttrss/src/main/res/menu/offline_menu.xml index 5f20f869..0325b553 100644 --- a/org.fox.ttrss/src/main/res/menu/offline_menu.xml +++ b/org.fox.ttrss/src/main/res/menu/offline_menu.xml @@ -33,10 +33,10 @@ app:showAsAction="" android:title="@string/headlines_view_mode"/> - <item + <!-- <item android:id="@+id/headlines_toggle_sidebar" app:showAsAction="" - android:title="@string/toggle_sidebar"/> + android:title="@string/toggle_sidebar"/> --> </group> <!-- <group android:id="@+id/menu_group_headlines_selection" > |