New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
timob-8362: scrollview layout fix. #2015
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,6 @@ | |
import android.graphics.Canvas; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.view.View.MeasureSpec; | ||
import android.widget.FrameLayout; | ||
import android.widget.HorizontalScrollView; | ||
import android.widget.ScrollView; | ||
|
@@ -127,17 +126,22 @@ protected int getHeightMeasureSpec(View child) | |
return super.getHeightMeasureSpec(child); | ||
} | ||
} | ||
|
||
@Override | ||
protected int getMeasuredWidth(int maxWidth, int widthSpec) | ||
{ | ||
int contentWidth = getContentProperty(TiC.PROPERTY_CONTENT_WIDTH); | ||
if (contentWidth == AUTO) { | ||
contentWidth = maxWidth; // measuredWidth; | ||
} | ||
|
||
|
||
// Force the minimum width of the content view to be the size of its parent (scroll view) | ||
return Math.max(contentWidth, parentWidth); | ||
if (contentWidth > parentWidth) { | ||
return Math.max(contentWidth, parentWidth); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can probably just return contentWidth here instead of using max since you already check for it in the if statement. |
||
} else { | ||
return resolveSize(maxWidth, widthSpec); | ||
} | ||
} | ||
|
||
@Override | ||
|
@@ -149,8 +153,12 @@ protected int getMeasuredHeight(int maxHeight, int heightSpec) | |
} | ||
|
||
// Force the minimum height of the content view to be the size of its parent (scroll view) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the logic here changed, we should also update the comments as well. |
||
return Math.max(contentHeight, parentHeight); | ||
} | ||
if (contentHeight > parentHeight) { | ||
return Math.max(contentHeight, parentHeight); | ||
} else { | ||
return resolveSize(maxHeight, heightSpec); | ||
} | ||
} | ||
} | ||
|
||
// same code, different super-classes | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the extra space here? =)