diff --git a/app/src/main/java/com/readrops/app/activities/ItemActivity.java b/app/src/main/java/com/readrops/app/activities/ItemActivity.java index de878cec..3579bb22 100644 --- a/app/src/main/java/com/readrops/app/activities/ItemActivity.java +++ b/app/src/main/java/com/readrops/app/activities/ItemActivity.java @@ -170,7 +170,7 @@ public class ItemActivity extends AppCompatActivity { actionButton.setBackgroundTintList(ColorStateList.valueOf(itemWithFeed.getColor())); } - webView.setItem(itemWithFeed, Utils.getDeviceWidth(this)); + webView.setItem(itemWithFeed); } @Override diff --git a/app/src/main/java/com/readrops/app/database/entities/Folder.java b/app/src/main/java/com/readrops/app/database/entities/Folder.java index 1faf9ab8..a782d58a 100644 --- a/app/src/main/java/com/readrops/app/database/entities/Folder.java +++ b/app/src/main/java/com/readrops/app/database/entities/Folder.java @@ -37,8 +37,6 @@ public class Folder implements Parcelable, Comparable { name = in.readString(); } - - public int getId() { return id; } diff --git a/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java b/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java index a046f98c..dc099595 100644 --- a/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java +++ b/app/src/main/java/com/readrops/app/utils/ReadropsWebView.java @@ -18,7 +18,6 @@ import org.jsoup.select.Elements; public class ReadropsWebView extends WebView { private ItemWithFeed itemWithFeed; - private int width; public ReadropsWebView(Context context, AttributeSet attrs) { super(context, attrs); @@ -26,9 +25,8 @@ public class ReadropsWebView extends WebView { init(); } - public void setItem(ItemWithFeed itemWithFeed, int width) { + public void setItem(ItemWithFeed itemWithFeed) { this.itemWithFeed = itemWithFeed; - this.width = width; loadData(getText(), LibUtils.HTML_CONTENT_TYPE, "UTF-8"); } diff --git a/app/src/main/java/com/readrops/app/utils/Utils.java b/app/src/main/java/com/readrops/app/utils/Utils.java index e42f9f51..b4a3fc14 100644 --- a/app/src/main/java/com/readrops/app/utils/Utils.java +++ b/app/src/main/java/com/readrops/app/utils/Utils.java @@ -1,6 +1,5 @@ package com.readrops.app.utils; -import android.app.Activity; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Color; @@ -9,7 +8,6 @@ import android.graphics.PorterDuffColorFilter; import android.graphics.drawable.Drawable; import android.graphics.drawable.ShapeDrawable; import android.graphics.drawable.shapes.OvalShape; -import android.util.DisplayMetrics; import android.view.View; import androidx.annotation.ColorInt; @@ -31,7 +29,7 @@ public final class Utils { public static final String HTTPS_PREFIX = "https://"; - public static final int AVERAGE_WORDS_PER_MINUTE = 250; + private static final int AVERAGE_WORDS_PER_MINUTE = 250; public static Bitmap getImageFromUrl(String url) { try { @@ -52,18 +50,10 @@ public final class Utils { } } - public static int getDeviceWidth(Activity activity) { - DisplayMetrics displayMetrics = new DisplayMetrics(); - activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); - - return displayMetrics.widthPixels; - } - public static double readTimeFromString(String value) { int nbWords = value.split("\\s+").length; - double minutes = (double) nbWords / AVERAGE_WORDS_PER_MINUTE; - return minutes; + return (double) nbWords / AVERAGE_WORDS_PER_MINUTE; } public static String getCssColor(@ColorInt int color) {