| 52 | } |
| 53 | |
| 54 | Size ViewCore::sizeForSpace(Size availableSpace) const |
| 55 | { |
| 56 | int widthSpec; |
| 57 | int heightSpec; |
| 58 | |
| 59 | if (std::isfinite(availableSpace.width) && canAdjustWidthToAvailableSpace()) { |
| 60 | widthSpec = bdn::android::wrapper::View::MeasureSpec::makeMeasureSpec( |
| 61 | availableSpace.width * _uiScaleFactor, bdn::android::wrapper::View::MeasureSpec::AT_MOST); |
| 62 | } else { |
| 63 | widthSpec = bdn::android::wrapper::View::MeasureSpec::makeMeasureSpec( |
| 64 | 0, bdn::android::wrapper::View::MeasureSpec::UNSPECIFIED); |
| 65 | } |
| 66 | |
| 67 | if (std::isfinite(availableSpace.height) && canAdjustHeightToAvailableSpace()) { |
| 68 | heightSpec = bdn::android::wrapper::View::MeasureSpec::makeMeasureSpec( |
| 69 | availableSpace.height * _uiScaleFactor, bdn::android::wrapper::View::MeasureSpec::AT_MOST); |
| 70 | } else { |
| 71 | heightSpec = bdn::android::wrapper::View::MeasureSpec::makeMeasureSpec( |
| 72 | 0, bdn::android::wrapper::View::MeasureSpec::UNSPECIFIED); |
| 73 | } |
| 74 | |
| 75 | _jView.measure(widthSpec, heightSpec); |
| 76 | |
| 77 | int width = _jView.getMeasuredWidth(); |
| 78 | int height = _jView.getMeasuredHeight(); |
| 79 | |
| 80 | Size prefSize(width / _uiScaleFactor, height / _uiScaleFactor); |
| 81 | |
| 82 | return prefSize; |
| 83 | } |
| 84 | |
| 85 | float ViewCore::baseline(Size forSize) const |
| 86 | { |
nothing calls this directly
no outgoing calls
no test coverage detected