Example usage for android.content.res Configuration ORIENTATION_LANDSCAPE

List of usage examples for android.content.res Configuration ORIENTATION_LANDSCAPE

Introduction

In this page you can find the example usage for android.content.res Configuration ORIENTATION_LANDSCAPE.

Prototype

int ORIENTATION_LANDSCAPE

To view the source code for android.content.res Configuration ORIENTATION_LANDSCAPE.

Click Source Link

Document

Constant for #orientation , value corresponding to the land resource qualifier.

Usage

From source file:dev.ronlemire.commoncontrols.MainActivity.java

    public void StartListView2Fragment() {
   if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE
         && isTablet()) {/*from  w w w  .  j a  va2 s  . c o m*/
      Fragment listView2Fragment = (Fragment) fm
            .findFragmentById(R.id.sample_replacer);
      listView2Fragment = ListView2Fragment.newInstance("ListView2");

      fm.beginTransaction()
         .replace(R.id.sample_replacer, listView2Fragment)
         .commit();
   } else {
      ListView2Fragment listView2Fragment = ListView2Fragment
            .newInstance("ListView2");
      getSupportFragmentManager().beginTransaction()
            .replace(MainActivity.sampleListView.getId(), listView2Fragment)
            .commit();
   }
}

From source file:dev.ronlemire.commoncontrols.MainActivity.java

public void StartListView3Fragment() {
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE && isTablet()) {
        Fragment listView3Fragment = (Fragment) fm.findFragmentById(R.id.sample_replacer);
        listView3Fragment = ListView3Fragment.newInstance("ListView3");

        fm.beginTransaction().replace(R.id.sample_replacer, listView3Fragment).commit();
    } else {/*from   w  ww  . j  a va2 s.com*/
        ListView3Fragment listView3Fragment = ListView3Fragment.newInstance("ListView3");
        getSupportFragmentManager().beginTransaction()
                .replace(MainActivity.sampleListView.getId(), listView3Fragment).commit();
    }
}

From source file:dev.ronlemire.commoncontrols.MainActivity.java

    public void StartListView3Fragment() {
   if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE
         && isTablet()) {/*from www .  ja  v  a  2s.  co  m*/
      Fragment listView3Fragment = (Fragment) fm
            .findFragmentById(R.id.sample_replacer);
      listView3Fragment = ListView3Fragment.newInstance("ListView3");

      fm.beginTransaction()
         .replace(R.id.sample_replacer, listView3Fragment)
         .commit();
   } else {
      ListView3Fragment listView3Fragment = ListView3Fragment
            .newInstance("ListView3");
      getSupportFragmentManager().beginTransaction()
            .replace(MainActivity.sampleListView.getId(), listView3Fragment)
            .commit();
   }
}

From source file:com.lewa.crazychapter11.MainActivity.java

private void ChangeOrientation() {
    Configuration cfg = getResources().getConfiguration();
    if (cfg.orientation == Configuration.ORIENTATION_LANDSCAPE) {
        MainActivity.this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }//  w w  w . j a va2s . c  o  m

    if (cfg.orientation == Configuration.ORIENTATION_PORTRAIT) {
        MainActivity.this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
    }
}

From source file:dev.ronlemire.commoncontrols.MainActivity.java

public void StartListView4Fragment() {
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE && isTablet()) {
        Fragment listView4Fragment = (Fragment) fm.findFragmentById(R.id.sample_replacer);
        listView4Fragment = ListView4Fragment.newInstance("ListView4");

        fm.beginTransaction().replace(R.id.sample_replacer, listView4Fragment).commit();
    } else {/*from w  ww.  jav  a 2s .  c o  m*/
        ListView4Fragment listView4Fragment = ListView4Fragment.newInstance("ListView4");
        getSupportFragmentManager().beginTransaction()
                .replace(MainActivity.sampleListView.getId(), listView4Fragment).commit();
    }
}

From source file:dev.ronlemire.commoncontrols.MainActivity.java

    public void StartListView4Fragment() {
   if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE
         && isTablet()) {/*from  w w  w  .  j a  v  a  2s.c o  m*/
      Fragment listView4Fragment = (Fragment) fm
            .findFragmentById(R.id.sample_replacer);
      listView4Fragment = ListView4Fragment.newInstance("ListView4");

      fm.beginTransaction()
         .replace(R.id.sample_replacer, listView4Fragment)
         .commit();
   } else {
      ListView4Fragment listView4Fragment = ListView4Fragment
            .newInstance("ListView4");
      getSupportFragmentManager().beginTransaction()
            .replace(MainActivity.sampleListView.getId(), listView4Fragment)
            .commit();
   }
}

From source file:dev.ronlemire.commoncontrols.MainActivity.java

public void StartRadioButtonFragment() {
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE && isTablet()) {
        Fragment radioButtonFragment = (Fragment) fm.findFragmentById(R.id.sample_replacer);
        radioButtonFragment = RadioButtonFragment.newInstance("RadioButton");

        fm.beginTransaction().replace(R.id.sample_replacer, radioButtonFragment).commit();
    } else {//from www .java  2 s.  c o m
        RadioButtonFragment radioButtonFragment = RadioButtonFragment.newInstance("RadioButton");
        getSupportFragmentManager().beginTransaction()
                .replace(MainActivity.sampleListView.getId(), radioButtonFragment).commit();
    }
}

From source file:com.sim2dial.dialer.InCallActivity.java

private void hideOrDisplayCallOptions() {
    boolean isOrientationLandscape = getResources()
            .getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;

    if (addCall.getVisibility() == View.VISIBLE) {
        // options.setBackgroundResource(R.drawable.options);
        if (isAnimationDisabled) {
            if (isTransferAllowed) {
                // transfer.setVisibility(View.INVISIBLE);
            }//from ww  w.  j  a v  a  2 s .  c  o m
            // addCall.setVisibility(View.INVISIBLE);
        } else {
            if (isOrientationLandscape) {
                hideAnimatedLandscapeCallOptions();
            } else {
                hideAnimatedPortraitCallOptions();
            }
        }
    } else {
        if (isAnimationDisabled) {
            if (isTransferAllowed) {
                // transfer.setVisibility(View.VISIBLE);
            }
            // addCall.setVisibility(View.VISIBLE);
            // options.setBackgroundResource(R.drawable.options_alt);
        } else {
            if (isOrientationLandscape) {
                showAnimatedLandscapeCallOptions();
            } else {
                showAnimatedPortraitCallOptions();
            }
        }
        transfer.setEnabled(LinphoneManager.getLc().getCurrentCall() != null);
    }
}

From source file:dev.ronlemire.commoncontrols.MainActivity.java

    public void StartRadioButtonFragment() {
   if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE
         && isTablet()) {//from ww w .  j a v  a2s.  co  m
      Fragment radioButtonFragment = (Fragment) fm
            .findFragmentById(R.id.sample_replacer);
      radioButtonFragment = RadioButtonFragment.newInstance("RadioButton");

      fm.beginTransaction()
         .replace(R.id.sample_replacer, radioButtonFragment)
         .commit();
   } else {
      RadioButtonFragment radioButtonFragment = RadioButtonFragment
            .newInstance("RadioButton");
      getSupportFragmentManager().beginTransaction()
            .replace(MainActivity.sampleListView.getId(), radioButtonFragment)
            .commit();
   }
}

From source file:dev.ronlemire.commoncontrols.MainActivity.java

public void StartSpinnerFragment() {
    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE && isTablet()) {
        Fragment spinnerFragment = (Fragment) fm.findFragmentById(R.id.sample_replacer);
        spinnerFragment = SpinnerFragment.newInstance("Spinner");

        fm.beginTransaction().replace(R.id.sample_replacer, spinnerFragment).commit();
    } else {/*from  ww w  .j av a  2s.c  om*/
        SpinnerFragment spinnerFragment = SpinnerFragment.newInstance("Spinner");
        getSupportFragmentManager().beginTransaction()
                .replace(MainActivity.sampleListView.getId(), spinnerFragment).commit();
    }
}