當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。