I need to make my dialog activity when the device is a tablet, wider and use more of the screen than it currently is.
Please see screen shot:
I need it to be about 70% of the screen width?
Is there a way to specify the width of this dialog.
To achieve this I have the following:
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="DialogTheme" parent="AppTheme"/>
</resources>
styles.xml (sw600dp)
<resources>
<style name="DialogTheme" parent="Theme.AppCompat.DialogWhenLarge"/>
</resources>
Manifest:
<manifest package="stillie.co.za.dialogwhenlarge"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".DialogWhenLargeActivity"
android:label="@string/title_activity_dialog_when_large"
android:theme="@style/DialogTheme"> <-----------notice this-----------
</activity>
</application>
</manifest>
Does anyone know how to make the screen width wider only when its on a tablet. How I have it set up at the moment, it works fine when the device is a phone its full screen like it should be but the only issue I have is when its a tablet, the dialog theme is too narrow.