move small tablet stuff detection to CommonActivity

use small tablet UI on screens up to 9"
This commit is contained in:
Andrew Dolgov 2012-09-02 19:48:48 +04:00
parent 1f831645ee
commit bcd4b562a4
3 changed files with 4 additions and 6 deletions

View File

@ -31,7 +31,7 @@ public class CommonActivity extends FragmentActivity {
m_smallScreenMode = smallScreen;
}
protected void setupSmallTabletFlag() {
protected void detectSmallTablet() {
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
@ -45,7 +45,7 @@ public class CommonActivity extends FragmentActivity {
m_smallTablet = true;
}
Log.d(TAG, "m_smallTabletMode=" + m_smallTablet);
Log.d(TAG, "m_smallTabletMode=" + m_smallTablet + " " + inDiag);
}
private void initDatabase() {
@ -80,6 +80,8 @@ public class CommonActivity extends FragmentActivity {
Log.d(TAG, "m_compatMode=" + m_compatMode);
detectSmallTablet();
super.onCreate(savedInstanceState);
}

View File

@ -646,8 +646,6 @@ public class MainActivity extends CommonActivity implements OnlineServices {
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
setupSmallTabletFlag();
IntentFilter filter = new IntentFilter();
filter.addAction(OfflineDownloadService.INTENT_ACTION_SUCCESS);
filter.addAction(OfflineUploadService.INTENT_ACTION_SUCCESS);

View File

@ -292,8 +292,6 @@ public class OfflineActivity extends CommonActivity implements
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
setupSmallTabletFlag();
if (!isCompatMode()) {
if (!isSmallScreen()) {
findViewById(R.id.feeds_fragment).setVisibility(m_selectedArticleId != 0 && (isPortrait() || isSmallTablet()) ? View.GONE : View.VISIBLE);