当前位置: 首页>>代码示例>>Java>>正文


Java Configuration.ORIENTATION_LANDSCAPE属性代码示例

本文整理汇总了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;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:24,代码来源:ChatActivity.java

示例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);
}
 
开发者ID:danimahardhika,项目名称:wallpaperboard,代码行数:17,代码来源:WallpaperHelper.java

示例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);
    }
}
 
开发者ID:invghost,项目名称:NeoStream,代码行数:29,代码来源:PlayerFragment.java

示例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
}
   }
 
开发者ID:stytooldex,项目名称:pius1,代码行数:13,代码来源:ListShower.java

示例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();
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:30,代码来源:SqlTabDatasActivity.java

示例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();
}
 
开发者ID:n76,项目名称:Symphony,代码行数:31,代码来源:MainActivity.java

示例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;
    }
}
 
开发者ID:JakeSteam,项目名称:Vidsta,代码行数:10,代码来源:VidstaPlayer.java

示例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;
}
 
开发者ID:ccrama,项目名称:Slide-RSS,代码行数:12,代码来源:SearchFragment.java

示例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);
        }
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:34,代码来源:ManageSpaceActivity.java

示例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);
}
 
开发者ID:treasure-lau,项目名称:Linphone4Android,代码行数:8,代码来源:ChatFragment.java

示例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;
}
 
开发者ID:dvdciri,项目名称:DeepImagePreview-Project,代码行数:12,代码来源:CameraSourcePreview.java

示例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;
}
 
开发者ID:woshiwpa,项目名称:SmartMath,代码行数:33,代码来源:ScriptEditorActivity.java

示例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());
    }
}
 
开发者ID:AgoraIO,项目名称:OpenVideoCall-Android,代码行数:10,代码来源:ChatActivity.java

示例14: isLandscape

public boolean isLandscape() {
    return mAppContext.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
}
 
开发者ID:jiajunhui,项目名称:PlayerBase,代码行数:3,代码来源:BasePlayer.java

示例15: isLandscape

private boolean isLandscape() {
  return getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:3,代码来源:ComposeText.java


注:本文中的android.content.res.Configuration.ORIENTATION_LANDSCAPE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。