本文整理汇总了Java中com.google.samples.apps.iosched.util.UIUtils.isTablet方法的典型用法代码示例。如果您正苦于以下问题:Java UIUtils.isTablet方法的具体用法?Java UIUtils.isTablet怎么用?Java UIUtils.isTablet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.samples.apps.iosched.util.UIUtils
的用法示例。
在下文中一共展示了UIUtils.isTablet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newInstace
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
/**
* Creates a new instance depending of the form factor of the device.
* For tablets, creates an {@link com.google.samples.apps.iosched.map.InlineInfoFragment},
* for other form factors a {@link com.google.samples.apps.iosched.map.SlideableInfoFragment}.
*
* @see com.google.samples.apps.iosched.util.UIUtils#isTablet(android.content.Context)
*/
public static MapInfoFragment newInstace(Context c) {
if (UIUtils.isTablet(c)) {
return InlineInfoFragment.newInstance();
} else {
return SlideableInfoFragment.newInstance();
}
}
示例2: newInstance
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
/**
* Creates a new instance depending of the form factor of the device.
* For tablets, creates an {@link com.google.samples.apps.iosched.map.InlineInfoFragment},
* for other form factors a {@link com.google.samples.apps.iosched.map.SlideableInfoFragment}.
*
* @see com.google.samples.apps.iosched.util.UIUtils#isTablet(android.content.Context)
*/
public static MapInfoFragment newInstance(@NonNull Context context) {
if (UIUtils.isTablet(context)) {
return InlineInfoFragment.newInstance();
} else {
return SlideableInfoFragment.newInstance();
}
}
示例3: onCreate
import com.google.samples.apps.iosched.util.UIUtils; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_session_livestream);
mIsTablet = UIUtils.isTablet(this);
// Set up YouTube player
mYouTubeFragment = (YouTubePlayerFragment)
getFragmentManager().findFragmentById(R.id.livestream_player);
mYouTubeFragment.initialize(Config.YOUTUBE_API_KEY, this);
// Views that are common over all layouts
mMainLayout = (LinearLayout) findViewById(R.id.livestream_mainlayout);
adjustMainLayoutForActionBar();
mPlayerContainer = (LinearLayout) findViewById(R.id.livestream_player_container);
mFullscreenCaptions = (FrameLayout) findViewById(R.id.fullscreen_captions);
final LayoutParams params = (LayoutParams) mFullscreenCaptions.getLayoutParams();
params.setMargins(0, getActionBarHeightPx(), 0, getActionBarHeightPx());
mFullscreenCaptions.setLayoutParams(params);
mTabsContentLayout = (LinearLayout) findViewById(R.id.livestream_tabs_layout);
// Set up ViewPager and adapter
ViewPager viewPager = (ViewPager) findViewById(R.id.livestream_pager);
viewPager.setOffscreenPageLimit(2);
viewPager.setPageMargin(getResources().getDimensionPixelSize(R.dimen.page_margin_width));
mTabsAdapter = new TabsAdapter(getFragmentManager());
viewPager.setAdapter(mTabsAdapter);
viewPager.setOnPageChangeListener(mTabsAdapter);
if (mIsTablet) {
// Tablet UI specific views
mVideoLayout = (LinearLayout) findViewById(R.id.livestream_video_layout);
}
mTabsAdapter.addTab(getString(R.string.session_livestream_info),
new SessionSummaryFragment(), TABNUM_SESSION_SUMMARY);
mTabsAdapter.addTab(getString(R.string.session_livestream_captions),
new SessionCaptionsFragment(), TABNUM_LIVE_CAPTIONS);
// Set up sliding tabs w/ViewPager
SlidingTabLayout slidingTabLayout =
(SlidingTabLayout) findViewById(R.id.livestream_sliding_tabs);
slidingTabLayout.setCustomTabView(R.layout.tab_indicator, android.R.id.text1);
Resources res = getResources();
slidingTabLayout.setSelectedIndicatorColors(
res.getColor(R.color.tab_selected_strip));
slidingTabLayout.setDistributeEvenly(true);
slidingTabLayout.setViewPager(viewPager);
// Reload all other data in this activity
reloadFromIntent(getIntent());
// Update layout based on current configuration
updateLayout(getResources().getConfiguration());
// Set up action bar
if (!mLoadFromExtras) {
// Start sessions query to populate action bar navigation spinner
getLoaderManager().initLoader(SessionsQuery._TOKEN, null, this);
mLivestreamAdapter = new LivestreamAdapter(getActionBar().getThemedContext());
}
}