Android Time Picker shows in portrait and is cut off in landscape
<p>I am trying to get the time picker to display the full clock in landscape. The <code>TimePicker</code> is in a <code>GridLayout</code>. It does not overlay the screen as a <code>DialogFragment</code> or a <code>TimePickerDialog</code>.</p>

<p>Currently, this is what it shows in landscape:</p>

<p><a href="https://i.stack.imgur.com/LhpqP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LhpqP.png" alt="Only time from time picker shown"></a></p>

<p>As you can see, there is nothing you can pick the time with, only the default time. I am trying to get it to show the clock as well just like in portrait (which works):</p>

<p><a href="https://i.stack.imgur.com/IyZCd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IyZCd.png" alt="Full time picker shown"></a></p>

<p>The layout of the time picker:</p>

<pre><code>&lt;package.name.ScrollableTimePicker
                android:id="@+id/time_picker"
                android:layout_height="wrap_content"
                android:layout_width="match_parent" /&gt;
</code></pre>

<p>The class that extends <code>TimePicker</code>:</p>

<pre><code>public class ScrollableTimePicker extends TimePicker {

    public ScrollableTimePicker(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }

    public ScrollableTimePicker(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public ScrollableTimePicker(Context context) {
        super(context);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        // Keeps events to time picker
        if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
            ViewParent p = getParent();
            if (p != null) {
                p.requestDisallowInterceptTouchEvent(true);
            }
        }

        return false;
    }
}
</code></pre>

<p>I looked around the internet and found these posts that <em>did not</em> help me:</p>

<ol>
<li><a href="https://stackoverflow.com/questions/35494234/android-timepicker-not-displayed-well-on-landscape-mode">Android TimePicker not displayed well on landscape mode</a></li>
</ol>

<p>I do not have a title for my time picker.</p>

<ol start="2">
<li><a href="https://stackoverflow.com/questions/14354006/scrollview-fighting-with-scroll-of-timepicker-timepicker-not-scrolling-as-a-res">ScrollView fighting with scroll of TimePicker, Timepicker not scrolling as a result</a></li>
</ol>

<p>It has already been implemented</p>

<ol start="3">
<li><a href="https://code.google.com/p/android/issues/detail?id=201766" rel="nofollow noreferrer">https://code.google.com/p/android/issues/detail?id=201766</a></li>
</ol>

<p>Tried the code in manifest but still did not work.</p>

<p><strong>UPDATE</strong>
As siddesh has suggested, setting <code>layout_height</code> of the <code>TimePicker</code> to <code>200dp</code> works but it cuts off the portrait. Now, the portrait is <code>200dp</code> tall but is cut off and the landscape is shown fully:</p>

<p><a href="https://i.stack.imgur.com/8rqN2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8rqN2.png" alt="Landscape TimePicker with height 200dp fully shown"></a></p>

<p><a href="https://i.stack.imgur.com/gp61x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gp61x.png" alt="Portrait TimePicker with height 200dp, with half cut off."></a></p>