Fix flairs contains only images not shown.

This commit is contained in:
Alex Ning 2020-09-17 21:18:03 +08:00
parent a3367c193b
commit 38ce4db311
2 changed files with 4 additions and 2 deletions

View File

@ -78,6 +78,8 @@ public class SearchActivity extends BaseActivity {
protected void onCreate(Bundle savedInstanceState) {
((Infinity) getApplication()).getAppComponent().inject(this);
setImmersiveModeNotApplicable();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_search);

View File

@ -87,10 +87,10 @@ public class GlideImageGetter implements Html.ImageGetter {
int drawableWidth = (int) (drawable.getIntrinsicWidth() * density);
int drawableHeight = (int) (drawable.getIntrinsicHeight() * density);
float ratio = (float) drawableWidth / (float) drawableHeight;
drawableHeight = (int) textSize;
drawableHeight = (int) (textSize * 1.5);
drawableWidth = (int) (drawableHeight * ratio);
int maxWidth = container.get().getMeasuredWidth();
if ((drawableWidth > maxWidth) || matchParentWidth) {
if ((maxWidth > 0 && (drawableWidth > maxWidth)) || matchParentWidth) {
int calculatedHeight = maxWidth * drawableHeight / drawableWidth;
drawable.setBounds(0, 0, maxWidth, calculatedHeight);
setBounds(0, 0, maxWidth, calculatedHeight);