本文整理汇总了Java中android.content.res.Configuration.ORIENTATION_LANDSCAPE属性的典型用法代码示例。如果您正苦于以下问题:Java Configuration.ORIENTATION_LANDSCAPE属性的具体用法?Java Configuration.ORIENTATION_LANDSCAPE怎么用?Java Configuration.ORIENTATION_LANDSCAPE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.content.res.Configuration
的用法示例。
在下文中一共展示了Configuration.ORIENTATION_LANDSCAPE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fixLayoutInternal
private boolean fixLayoutInternal() {
if (!AndroidUtilities.isTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
selectedMessagesCountTextView.setTextSize(18);
} else {
selectedMessagesCountTextView.setTextSize(20);
}
if (AndroidUtilities.isTablet()) {
if (AndroidUtilities.isSmallTablet() && ApplicationLoader.applicationContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
actionBar.setBackButtonDrawable(getBackDrawable(false));
if (playerView != null && playerView.getParent() == null) {
((ViewGroup) fragmentView).addView(playerView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, 39, Gravity.TOP | Gravity.LEFT, 0, -36, 0, 0));
}
} else {
actionBar.setBackButtonDrawable(new BackDrawable(parentLayout == null || parentLayout.fragmentsStack.isEmpty() || parentLayout.fragmentsStack.get(0) == ChatActivity.this || parentLayout.fragmentsStack.size() == 1));
if (playerView != null && playerView.getParent() != null) {
fragmentView.setPadding(0, 0, 0, 0);
((ViewGroup) fragmentView).removeView(playerView);
}
}
return false;
}
return true;
}
示例2: getTargetSize
public static ImageSize getTargetSize(@NonNull Context context) {
Point point = WindowHelper.getScreenSize(context);
int targetHeight = point.y;
int targetWidth = point.x;
if (context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
targetHeight = point.x;
targetWidth = point.y;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
int statusBarHeight = WindowHelper.getStatusBarHeight(context);
int navBarHeight = WindowHelper.getNavigationBarHeight(context);
targetHeight += (statusBarHeight + navBarHeight);
}
return new ImageSize(targetWidth, targetHeight);
}
示例3: onConfigurationChanged
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
if(getView() == null)
return;
LinearLayout playerContainer = getView().findViewById(R.id.player_container);
LinearLayout chatContainer = getView().findViewById(R.id.chat_container);
// Checks the orientation of the screen
if(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
oldPlayerLayoutParams = playerContainer.getLayoutParams();
oldChatLayoutParams = chatContainer.getLayoutParams();
chatContainer.setVisibility(View.GONE);
playerContainer.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));
hideSystemUi();
} else if(newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
showSystemUi();
chatContainer.setVisibility(View.VISIBLE);
playerContainer.setLayoutParams(oldPlayerLayoutParams);
chatContainer.setLayoutParams(oldChatLayoutParams);
}
}
示例4: onConfigurationChanged
@Override
public void onConfigurationChanged(Configuration newConfig)
{
super.onConfigurationChanged(newConfig);
if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
{
// land do nothing is ok
}
else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
{
// port do nothing is ok
}
}
示例5: initData
private void initData() {
mTabDatasAdapter = null;
boolean isVertical = true;
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
isVertical = false;
mRecycleView.setMinimumWidth(FeViewUtils.getScreenHeight(this));
} else if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT) {
isVertical = true;
mRecycleView.setMinimumWidth(FeViewUtils.getScreenWidth(this));
}
switch (dataSource) {
case SqlConstant.TABLE_DATAS_NORMAL:
mTabDatasAdapter = new TabDatasAdapter(mWidthList, mTitles, this, SqlConstant.TABLE_DATAS_NORMAL, isVertical);
break;
case SqlConstant.TABLE_DATAS_SQL:
mTabDatasAdapter = new TabDatasAdapter(mWidthList, mTitles, this, SqlConstant.TABLE_DATAS_SQL, true);
break;
case SqlConstant.TABLE_DATAS_FILTER:
mTabDatasAdapter = new TabDatasAdapter(mWidthList, mTitles, this, SqlConstant.TABLE_DATAS_FILTER, true);
break;
}
mRecycleView.setAdapter(mTabDatasAdapter);
mTabDatasAdapter.setDatas(tablesData);
if (mClickPosition > 0) {
mLinearLayoutManager.scrollToPositionWithOffset(mClickPosition, FeViewUtils.dpToPx(55));
mTabDatasAdapter.setClickPosition(mClickPosition);
mTabDatasAdapter.notifyDataSetChanged();
}
}
示例6: onConfigurationChanged
@Override
public void onConfigurationChanged (Configuration newConfig) {
super.onConfigurationChanged(newConfig);
Log.d(TAG, "onConfigurationChanged() entry.");
// Checks the orientation of the screen
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
} else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT){
}
// Save current genre and track
int savedTrackIndex = displayTrackIndex;
int savedGenreIndex = displayGenreId;
setupDisplay();
// Put genre and track back to saved
if (savedGenreIndex >= 0) {
setDisplayGenre(savedGenreIndex);
if (genreSpinner != null)
genreSpinner.setSelection(savedGenreIndex);
if (savedTrackIndex >= 0) {
selectDisplayAlbum(savedTrackIndex);
if (songView != null)
songView.setSelection(savedTrackIndex);
}
}
if ((musicSrv != null) && musicSrv.hasTrack())
controller.show();
}
示例7: onLayoutResumed
public void onLayoutResumed() {
if (onLayoutResumed != null) onLayoutResumed.onResume();
if (isSetFullScreen) {
//if (baseAct != null)
// if (baseAct.getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
// baseAct.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
this.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN);
this.getResources().getConfiguration().orientation = Configuration.ORIENTATION_LANDSCAPE;
}
}
示例8: getNumColumns
public static int getNumColumns(final int orientation) {
final int numColumns;
if (orientation == Configuration.ORIENTATION_LANDSCAPE && SettingValues.tabletUI) {
numColumns = MainActivity.dpWidth;
} else if (orientation == Configuration.ORIENTATION_PORTRAIT
&& SettingValues.dualPortrait) {
numColumns = 2;
} else {
numColumns = 1;
}
return numColumns;
}
示例9: needLayout
public void needLayout() {
if (AndroidUtilities.isTablet()) {
RelativeLayout.LayoutParams relativeLayoutParams = (RelativeLayout.LayoutParams)layersActionBarLayout.getLayoutParams();
relativeLayoutParams.leftMargin = (AndroidUtilities.displaySize.x - relativeLayoutParams.width) / 2;
int y = (Build.VERSION.SDK_INT >= 21 ? AndroidUtilities.statusBarHeight : 0);
relativeLayoutParams.topMargin = y + (AndroidUtilities.displaySize.y - relativeLayoutParams.height - y) / 2;
layersActionBarLayout.setLayoutParams(relativeLayoutParams);
if (!AndroidUtilities.isSmallTablet() || getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
int leftWidth = AndroidUtilities.displaySize.x / 100 * 35;
if (leftWidth < AndroidUtilities.dp(320)) {
leftWidth = AndroidUtilities.dp(320);
}
relativeLayoutParams = (RelativeLayout.LayoutParams) actionBarLayout.getLayoutParams();
relativeLayoutParams.width = leftWidth;
relativeLayoutParams.height = LayoutHelper.MATCH_PARENT;
actionBarLayout.setLayoutParams(relativeLayoutParams);
if (AndroidUtilities.isSmallTablet() && actionBarLayout.fragmentsStack.size() == 2) {
BaseFragment chatFragment = actionBarLayout.fragmentsStack.get(1);
chatFragment.onPause();
actionBarLayout.fragmentsStack.remove(1);
actionBarLayout.showLastFragment();
}
} else {
relativeLayoutParams = (RelativeLayout.LayoutParams) actionBarLayout.getLayoutParams();
relativeLayoutParams.width = LayoutHelper.MATCH_PARENT;
relativeLayoutParams.height = LayoutHelper.MATCH_PARENT;
actionBarLayout.setLayoutParams(relativeLayoutParams);
}
}
}
示例10: hideKeyboardVisibleMode
public void hideKeyboardVisibleMode() {
boolean isOrientationLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
//contactPicture.setVisibility(View.VISIBLE);
if (isOrientationLandscape && topBar != null) {
//topBar.setVisibility(View.VISIBLE);
}
LinphoneActivity.instance().hideTabBar(false);
}
示例11: isPortraitMode
private boolean isPortraitMode() {
int orientation = mContext.getResources().getConfiguration().orientation;
if (orientation == Configuration.ORIENTATION_LANDSCAPE) {
return false;
}
if (orientation == Configuration.ORIENTATION_PORTRAIT) {
return true;
}
Log.d(TAG, "isPortraitMode returning false by default");
return false;
}
示例12: calcInputKeyBtnHeight
@Override
public int calcInputKeyBtnHeight() {
int nScreenSizeCategory = getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK;
int nScreenOrientation = getResources().getConfiguration().orientation;
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int nScreenShortSideInPx = Math.min(metrics.heightPixels, metrics.widthPixels);
int nScreenLongSideInPx = Math.max(metrics.heightPixels, metrics.widthPixels);
int nBtnHeight;
if (nScreenOrientation == Configuration.ORIENTATION_LANDSCAPE) {
nBtnHeight = nScreenShortSideInPx;
if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_SMALL) {
nBtnHeight /= 6;
} else if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_NORMAL) {
nBtnHeight /= 8;
} else {
// large and xlarge
nBtnHeight /= 12; // because the ads are on top
}
} else {
nBtnHeight = nScreenLongSideInPx;
if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_SMALL) {
nBtnHeight /= 9;
} else if (nScreenSizeCategory == Configuration.SCREENLAYOUT_SIZE_NORMAL) {
nBtnHeight /= 12;
} else {
// large and xlarge
nBtnHeight /= 18;
}
}
return nBtnHeight;
}
示例13: onConfigurationChanged
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
mIsLandscape = newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE;
if (mLayoutType == LAYOUT_TYPE_DEFAULT) {
switchToDefaultVideoView();
} else if (mSmallVideoViewAdapter != null) {
switchToSmallVideoView(mSmallVideoViewAdapter.getExceptedUid());
}
}
示例14: isLandscape
public boolean isLandscape() {
return mAppContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
}
示例15: isLandscape
private boolean isLandscape() {
return getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
}