Note that there are some explanatory texts on larger screens.

plurals
  1. PODialog activity to wrap content
    primarykey
    data
    text
    <p>There have been similar questions to this related to dialog activities and how to make these full screen, but I have a slightly different problem. I want these dialogs to wrap the activity content.</p> <p>Now, the "dialog activities" all inherit the following theme,</p> <pre><code>&lt;style name="tabDialog" parent="@android:Theme.Dialog"&gt; &lt;item name="android:windowBackground"&gt;@drawable/panel_background&lt;/item&gt; &lt;item name="android:windowNoTitle"&gt;true&lt;/item&gt; &lt;item name="android:windowFullscreen"&gt;false&lt;/item&gt; &lt;/style&gt; </code></pre> <p>Example of activity definition in manifest,</p> <pre><code>&lt;activity android:name=".TabSettingsActivity" android:theme="@style/tabDialog" android:excludeFromRecents="true" android:configChanges="keyboardHidden" /&gt; </code></pre> <p>The content view parent view is defined like this,</p> <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@layout/dialog_rounded_background" android:orientation="vertical"&gt; </code></pre> <p>and all the child views in the layout also specify wrap_content for both dimensions. I have tried using a RelativeLayout as the parent as well, but same same.</p> <p>After the content view has been set in onCreate of the activity, I do this</p> <pre><code> getWindow().setLayout(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); </code></pre> <p>None of these things actually seem to make any difference at all. The problem is mostly related to the dialog height, which is about 50% bigger than necessary. Half of the dialog is just dead space. Setting the root view dimensions to hardcoded dp units solves the problem, but this seems like a workaround rather than a solution.</p> <p>Any ideas anyone?</p> <p>Thanks in advance.</p> <p>Cheers</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload