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

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

View File

@ -291,8 +291,6 @@ public class OfflineActivity extends CommonActivity implements
setContentView(R.layout.main);
setSmallScreen(findViewById(R.id.headlines_fragment) == null);
setupSmallTabletFlag();
if (!isCompatMode()) {
if (!isSmallScreen()) {