aboutsummaryrefslogtreecommitdiff
path: root/app/src
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2020-09-17 13:18:03 +0000
committerAlex Ning <chineseperson5@gmail.com>2020-09-17 13:18:03 +0000
commit38ce4db31164fece7f26c7b2a84cbc6f2091cacf (patch)
tree06aff0431c324405f26f6f39d780deb59abf503c /app/src
parenta3367c193b2b9f6e385c155e543debd9f2bb3426 (diff)
downloadinfinity-for-reddit-38ce4db31164fece7f26c7b2a84cbc6f2091cacf.tar
infinity-for-reddit-38ce4db31164fece7f26c7b2a84cbc6f2091cacf.tar.gz
infinity-for-reddit-38ce4db31164fece7f26c7b2a84cbc6f2091cacf.tar.bz2
infinity-for-reddit-38ce4db31164fece7f26c7b2a84cbc6f2091cacf.tar.lz
infinity-for-reddit-38ce4db31164fece7f26c7b2a84cbc6f2091cacf.tar.xz
infinity-for-reddit-38ce4db31164fece7f26c7b2a84cbc6f2091cacf.tar.zst
infinity-for-reddit-38ce4db31164fece7f26c7b2a84cbc6f2091cacf.zip
Fix flairs contains only images not shown.
Diffstat (limited to 'app/src')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java2
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Utils/GlideImageGetter.java4
2 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java
index 3fd343f4..78ab544c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/SearchActivity.java
@@ -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);
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/GlideImageGetter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/GlideImageGetter.java
index fc8cfcf9..f3cef706 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/GlideImageGetter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/GlideImageGetter.java
@@ -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);