{"action":"created","issue":{"url":"https://api.github.com/repos/jjobes/SlideDateTimePicker/issues/16","labels_url":"https://api.github.com/repos/jjobes/SlideDateTimePicker/issues/16/labels{/name}","comments_url":"https://api.github.com/repos/jjobes/SlideDateTimePicker/issues/16/comments","events_url":"https://api.github.com/repos/jjobes/SlideDateTimePicker/issues/16/events","html_url":"https://github.com/jjobes/SlideDateTimePicker/issues/16","id":125846963,"number":16,"title":"Wrong way of setting ViewPager height","user":{"login":"alexrainman","id":3793554,"avatar_url":"https://avatars.githubusercontent.com/u/3793554?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrainman","html_url":"https://github.com/alexrainman","followers_url":"https://api.github.com/users/alexrainman/followers","following_url":"https://api.github.com/users/alexrainman/following{/other_user}","gists_url":"https://api.github.com/users/alexrainman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrainman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrainman/subscriptions","organizations_url":"https://api.github.com/users/alexrainman/orgs","repos_url":"https://api.github.com/users/alexrainman/repos","events_url":"https://api.github.com/users/alexrainman/events{/privacy}","received_events_url":"https://api.github.com/users/alexrainman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-01-10T21:24:49Z","updated_at":"2016-01-11T23:57:55Z","closed_at":null,"body":"The way you set the ViewPager height OnMeasure makes the DatePicker move to the left when you touch it.\r\n\r\nReplace it with this code:\r\n\r\n```\r\nint height = 0;\r\nfor(int i = 0; i < getChildCount(); i++) {\r\n    View child = getChildAt(i);\r\n    child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));\r\n    int h = child.getMeasuredHeight();\r\n    if(h > height) height = h;\r\n}\r\n\r\nheightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);\r\n\r\nsuper.onMeasure(widthMeasureSpec, heightMeasureSpec);\r\n```\r\n\r\nAnd problem fixed!"},"comment":{"url":"https://api.github.com/repos/jjobes/SlideDateTimePicker/issues/comments/170736741","html_url":"https://github.com/jjobes/SlideDateTimePicker/issues/16#issuecomment-170736741","issue_url":"https://api.github.com/repos/jjobes/SlideDateTimePicker/issues/16","id":170736741,"user":{"login":"alexrainman","id":3793554,"avatar_url":"https://avatars.githubusercontent.com/u/3793554?v=3","gravatar_id":"","url":"https://api.github.com/users/alexrainman","html_url":"https://github.com/alexrainman","followers_url":"https://api.github.com/users/alexrainman/followers","following_url":"https://api.github.com/users/alexrainman/following{/other_user}","gists_url":"https://api.github.com/users/alexrainman/gists{/gist_id}","starred_url":"https://api.github.com/users/alexrainman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexrainman/subscriptions","organizations_url":"https://api.github.com/users/alexrainman/orgs","repos_url":"https://api.github.com/users/alexrainman/repos","events_url":"https://api.github.com/users/alexrainman/events{/privacy}","received_events_url":"https://api.github.com/users/alexrainman/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T23:57:55Z","updated_at":"2016-01-11T23:57:55Z","body":"Google Nexus 5 Android 5.1"}}