diff options
author | Andrew Dolgov <[email protected]> | 2011-11-30 13:43:02 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-11-30 13:43:02 +0300 |
commit | 918235592ada25cab9da734b109921dcd7e87a85 (patch) | |
tree | fa6162da18f8a6859ff9a70bd5ce601a2cdfb1ae /src | |
parent | 450deb1756350a4a099eb90dc3c826be751469bf (diff) |
handle layout selection by android means
Diffstat (limited to 'src')
-rw-r--r-- | src/org/fox/ttrss/MainActivity.java | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/org/fox/ttrss/MainActivity.java b/src/org/fox/ttrss/MainActivity.java index f51ef307..ab2f59b1 100644 --- a/src/org/fox/ttrss/MainActivity.java +++ b/src/org/fox/ttrss/MainActivity.java @@ -310,22 +310,17 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe m_enableCats = m_prefs.getBoolean("enable_cats", false); Display display = getWindowManager().getDefaultDisplay(); - int orientation = display.getOrientation(); - int minWidth = orientation % 2 == 0 ? 1024 : 600; - int minHeight = orientation % 2 == 0 ? 600 : 1024; - if (display.getWidth() > minWidth && display.getHeight() >= minHeight) { - m_smallScreenMode = false; - - setContentView(R.layout.main); - } else { - m_smallScreenMode = true; + int width = display.getWidth(); + int height = display.getHeight(); + + if (height > width) { int tmp = height; width = tmp; height = width; } + + m_smallScreenMode = width < 960 || height < 720; + + setContentView(R.layout.main); - setContentView(R.layout.main_small); - } - Log.d(TAG, "m_smallScreenMode=" + m_smallScreenMode); - Log.d(TAG, "orientation=" + display.getOrientation()); Log.d(TAG, "m_compatMode=" + m_compatMode); if (!m_compatMode) { @@ -1291,8 +1286,4 @@ public class MainActivity extends FragmentActivity implements FeedsFragment.OnFe Log.d(TAG, "onCatSelected"); viewCategory(cat, m_prefs.getBoolean("browse_cats_like_feeds", false)); } - - public boolean getSmallScreenMode() { - return m_smallScreenMode; - } }
\ No newline at end of file |