mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-04 07:17:12 +01:00
Fix flairs contains only images not shown.
This commit is contained in:
parent
a3367c193b
commit
38ce4db311
@ -78,6 +78,8 @@ public class SearchActivity extends BaseActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
((Infinity) getApplication()).getAppComponent().inject(this);
|
((Infinity) getApplication()).getAppComponent().inject(this);
|
||||||
|
|
||||||
|
setImmersiveModeNotApplicable();
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
setContentView(R.layout.activity_search);
|
setContentView(R.layout.activity_search);
|
||||||
|
@ -87,10 +87,10 @@ public class GlideImageGetter implements Html.ImageGetter {
|
|||||||
int drawableWidth = (int) (drawable.getIntrinsicWidth() * density);
|
int drawableWidth = (int) (drawable.getIntrinsicWidth() * density);
|
||||||
int drawableHeight = (int) (drawable.getIntrinsicHeight() * density);
|
int drawableHeight = (int) (drawable.getIntrinsicHeight() * density);
|
||||||
float ratio = (float) drawableWidth / (float) drawableHeight;
|
float ratio = (float) drawableWidth / (float) drawableHeight;
|
||||||
drawableHeight = (int) textSize;
|
drawableHeight = (int) (textSize * 1.5);
|
||||||
drawableWidth = (int) (drawableHeight * ratio);
|
drawableWidth = (int) (drawableHeight * ratio);
|
||||||
int maxWidth = container.get().getMeasuredWidth();
|
int maxWidth = container.get().getMeasuredWidth();
|
||||||
if ((drawableWidth > maxWidth) || matchParentWidth) {
|
if ((maxWidth > 0 && (drawableWidth > maxWidth)) || matchParentWidth) {
|
||||||
int calculatedHeight = maxWidth * drawableHeight / drawableWidth;
|
int calculatedHeight = maxWidth * drawableHeight / drawableWidth;
|
||||||
drawable.setBounds(0, 0, maxWidth, calculatedHeight);
|
drawable.setBounds(0, 0, maxWidth, calculatedHeight);
|
||||||
setBounds(0, 0, maxWidth, calculatedHeight);
|
setBounds(0, 0, maxWidth, calculatedHeight);
|
||||||
|
Loading…
Reference in New Issue
Block a user