diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2012-06-22 17:16:43 +0400 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2012-06-22 17:16:43 +0400 |
| commit | fbb131fa0c4665d63375173a3d4b810b755e6d14 (patch) | |
| tree | f73a5007b3517b5f2b2e71fd6e7fe83473a5a952 /src/org/fox/ttrss/MainActivity.java | |
| parent | fafdd4120ae03da71ea1ee849eb6a8bb8102660e (diff) | |
adjust headlines left padding in vertical mode on tablets
add getOrientation()
Diffstat (limited to 'src/org/fox/ttrss/MainActivity.java')
| -rw-r--r-- | src/org/fox/ttrss/MainActivity.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index 9760deb0..e8b8adc4 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -445,6 +445,11 @@ public class MainActivity extends FragmentActivity implements OnlineServices { } @Override + public int getOrientation() { + return getWindowManager().getDefaultDisplay().getOrientation(); + } + + @Override public void onCreate(Bundle savedInstanceState) { initDatabase(); @@ -509,10 +514,8 @@ public class MainActivity extends FragmentActivity implements OnlineServices { if (!m_compatMode) { - if (!m_smallScreenMode) { - int orientation = getWindowManager().getDefaultDisplay().getOrientation(); - - findViewById(R.id.feeds_fragment).setVisibility(m_selectedArticle != null && orientation % 2 != 0 ? View.GONE : View.VISIBLE); + if (!m_smallScreenMode) { + findViewById(R.id.feeds_fragment).setVisibility(m_selectedArticle != null && getOrientation() % 2 != 0 ? View.GONE : View.VISIBLE); findViewById(R.id.article_fragment).setVisibility(m_selectedArticle != null ? View.VISIBLE : View.GONE); } @@ -1730,13 +1733,11 @@ public class MainActivity extends FragmentActivity implements OnlineServices { ft.hide(getSupportFragmentManager().findFragmentByTag(FRAG_HEADLINES)); ft.add(R.id.fragment_container, frag, FRAG_ARTICLE); } else { - int orientation = getWindowManager().getDefaultDisplay().getOrientation(); - - findViewById(R.id.feeds_fragment).setVisibility(orientation % 2 != 0 ? View.GONE : View.VISIBLE); + findViewById(R.id.feeds_fragment).setVisibility(getOrientation() % 2 != 0 ? View.GONE : View.VISIBLE); findViewById(R.id.article_fragment).setVisibility(View.VISIBLE); ft.replace(R.id.article_fragment, frag, FRAG_ARTICLE); - if (orientation % 2 == 0) refresh(); + if (getOrientation() % 2 == 0) refresh(); } ft.commit(); } |