title: Control Aspect Ratio of Theme Background (Android)
body: <p>I have set up a loading screen (splash) for my app by following some advice that explains the "proper way" to do it:</p>
  
  <p>styles.xml:</p>
  
  <pre><code>&lt;style name="SplashTheme" parent="Theme.AppCompat.NoActionBar"&gt;
      &lt;item name="android:windowBackground"&gt;@drawable/splash_vector_drawable&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>manifest:</p>
  
  <pre><code>&lt;activity
          android:name="com.tba.versionc.SplashActivity"
          android:theme="@style/SplashTheme"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN"/&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER"/&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  
  <p>java:</p>
  
  <pre><code>public class SplashActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          Intent intent = new Intent(this, MainActivity.class);
          startActivity(intent);
          finish();
      }
  }
  </code></pre>
  
  <p>When I designed the vector drawable for the splash screen, I set its aspect ratio to match my phone (16:9), and it seems to work fine, but I am concerned about what will happen to the aspect ratio when running on devices with screen ratios that are different.</p>
  
  <p>To eliminate the chance that it will "stretch to fit" the wrong size screen, I would prefer if it was center cropped, but since it is not an ImageView, or even part of a layout file, I don't know of any way set the center crop attribute.</p>
  
  <p>Anyone?</p>