title: Different layout for "Landscape" and "Landscape-reverse" orientation
body: <h1>My problem:</h1>
  
  <p>For some requirements i need two different xml layouts for my activity:</p>
  
  <ul>
  <li>One for <strong>Landscape</strong> mode.</li>
  <li>And another one for <strong>Landscape-reverse</strong> mode (upside-down of Landscape).</li>
  </ul>
  
  <p>Unfortunately Android doesn't allow creating a separate layout for landscape-reverse (like we can do for portrait and landscape with <code>layout-land</code> and <code>layout-port</code>). </p>
  
  <p>AFAIK, the only way is to change the activity-xml from java code. </p>
  
  <h1>What i've tried:</h1>
  
  <p>1) Override <code>onConfigurationChanged()</code> method to detect orientation changes, but i can't figure out if it's Landscape or Landscape-reverse:</p>
  
  <pre><code>@Override
  public void onConfigurationChanged(Configuration newConfig) {
       super.onConfigurationChanged(newConfig);
  
       if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
           Log.d("TEST","Landscape");
       }
  
  }
  </code></pre>
  
  <p>( Whith <code>android:configChanges="keyboardHidden|orientation|screenSize|layoutDirection"</code> in my activity tag in manifest) </p>
  
  <p>2) Use an <code>OrientationEventListener</code> with <code>SENSOR_DELAY_NORMAL</code> as suggested in <a href="https://stackoverflow.com/a/18052073/4224337">this answer</a> but the device orientation changes before entering my <code>if</code> blocks, so i get a delayed update of the view:</p>
  
  <pre><code>mOrientationEventListener = new OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL){
  
              @Override
              public void onOrientationChanged(int orientation) {
  
                  if (orientation==0){
                      Log.e("TEST", "orientation-Portrait  = "+orientation);
                  } else if (orientation==90){
                      Log.e("TEST", "orientation-Landscape = "+orientation);
                  } else if(orientation==180){
                      Log.e("TEST", "orientation-Portrait-rev = "+orientation);
                  }else if (orientation==270){
                      Log.e("TEST", "orientation-Landscape-rev = "+orientation);
                  } else if (orientation==360){
                      Log.e("TEST", "orientation-Portrait= "+orientation);
                  }
  
              }};
  </code></pre>
  
  <h1>My question:</h1>
  
  <p>Is there a better solution to change activity-layout between <code>"Landscape"</code> and <code>"Landscape-reverse"</code> orientation?</p>
  
  <p>Any suggestions are highly appreciated.</p>