Compare commits
10 Commits
v171812347
...
v171901006
Author | SHA1 | Date | |
---|---|---|---|
|
45747a1506 | ||
|
c6e2e08bcb | ||
|
25bf18661e | ||
|
6b088dcd24 | ||
|
d2b18e1880 | ||
|
eec7c94e98 | ||
|
d1f8fcacc0 | ||
|
07e4a33cbd | ||
|
f6317f566e | ||
|
9f51e4e6a5 |
@@ -1,5 +1,13 @@
|
|||||||
**1.7.x**
|
**1.7.x**
|
||||||
|
|
||||||
|
- Hiding tags with 0 articles
|
||||||
|
|
||||||
|
- Fixed issue with basic auth and images loading
|
||||||
|
|
||||||
|
- Added the ability to justify or left align the reader text
|
||||||
|
|
||||||
|
- Fixed #251
|
||||||
|
|
||||||
- Added experimental issue to set a default timeout. Should work for #238.
|
- Added experimental issue to set a default timeout. Should work for #238.
|
||||||
|
|
||||||
- Closing #220.
|
- Closing #220.
|
||||||
|
@@ -77,6 +77,9 @@
|
|||||||
android:value="true" />
|
android:value="true" />
|
||||||
|
|
||||||
<meta-data android:name="android.max_aspect" android:value="2.1" />
|
<meta-data android:name="android.max_aspect" android:value="2.1" />
|
||||||
|
<meta-data
|
||||||
|
android:name="preloaded_fonts"
|
||||||
|
android:resource="@array/preloaded_fonts" />
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@@ -152,6 +152,8 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
|
|
||||||
private lateinit var db: AppDatabase
|
private lateinit var db: AppDatabase
|
||||||
|
|
||||||
|
private lateinit var config: Config
|
||||||
|
|
||||||
data class DrawerData(val tags: List<Tag>?, val sources: List<Source>?)
|
data class DrawerData(val tags: List<Tag>?, val sources: List<Source>?)
|
||||||
|
|
||||||
override fun onStart() {
|
override fun onStart() {
|
||||||
@@ -161,6 +163,7 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
appColors = AppColors(this@HomeActivity)
|
appColors = AppColors(this@HomeActivity)
|
||||||
|
config = Config(this@HomeActivity)
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
@@ -531,12 +534,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
gd.shape = GradientDrawable.RECTANGLE
|
gd.shape = GradientDrawable.RECTANGLE
|
||||||
gd.setSize(30, 30)
|
gd.setSize(30, 30)
|
||||||
gd.cornerRadius = 30F
|
gd.cornerRadius = 30F
|
||||||
drawer.addItem(
|
var drawerItem =
|
||||||
PrimaryDrawerItem()
|
PrimaryDrawerItem()
|
||||||
.withName(it.tag)
|
.withName(it.tag)
|
||||||
.withIdentifier(it.tag.longHash())
|
.withIdentifier(it.tag.longHash())
|
||||||
.withIcon(gd)
|
.withIcon(gd)
|
||||||
.withBadge("${it.unread}")
|
|
||||||
.withBadgeStyle(
|
.withBadgeStyle(
|
||||||
BadgeStyle().withTextColor(Color.WHITE)
|
BadgeStyle().withTextColor(Color.WHITE)
|
||||||
.withColor(appColors.colorAccent)
|
.withColor(appColors.colorAccent)
|
||||||
@@ -547,6 +549,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
if (it.unread > 0) {
|
||||||
|
drawerItem = drawerItem.withBadge("${it.unread}")
|
||||||
|
}
|
||||||
|
drawer.addItem(
|
||||||
|
drawerItem
|
||||||
)
|
)
|
||||||
|
|
||||||
(it.tag.longHash() to it.unread)
|
(it.tag.longHash() to it.unread)
|
||||||
@@ -578,12 +585,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
gd.shape = GradientDrawable.RECTANGLE
|
gd.shape = GradientDrawable.RECTANGLE
|
||||||
gd.setSize(30, 30)
|
gd.setSize(30, 30)
|
||||||
gd.cornerRadius = 30F
|
gd.cornerRadius = 30F
|
||||||
drawer.addItem(
|
var drawerItem =
|
||||||
PrimaryDrawerItem()
|
PrimaryDrawerItem()
|
||||||
.withName(it.tag)
|
.withName(it.tag)
|
||||||
.withIdentifier(it.tag.longHash())
|
.withIdentifier(it.tag.longHash())
|
||||||
.withIcon(gd)
|
.withIcon(gd)
|
||||||
.withBadge("${it.unread}")
|
|
||||||
.withBadgeStyle(
|
.withBadgeStyle(
|
||||||
BadgeStyle().withTextColor(Color.WHITE)
|
BadgeStyle().withTextColor(Color.WHITE)
|
||||||
.withColor(appColors.colorAccent)
|
.withColor(appColors.colorAccent)
|
||||||
@@ -594,6 +600,11 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
getElementsAccordingToTab()
|
getElementsAccordingToTab()
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
if (it.unread > 0) {
|
||||||
|
drawerItem = drawerItem.withBadge("${it.unread}")
|
||||||
|
}
|
||||||
|
drawer.addItem(
|
||||||
|
drawerItem
|
||||||
)
|
)
|
||||||
|
|
||||||
(it.tag.longHash() to it.unread)
|
(it.tag.longHash() to it.unread)
|
||||||
@@ -1136,7 +1147,8 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
fullHeightCards,
|
fullHeightCards,
|
||||||
appColors,
|
appColors,
|
||||||
debugReadingItems,
|
debugReadingItems,
|
||||||
userIdentifier
|
userIdentifier,
|
||||||
|
config
|
||||||
) {
|
) {
|
||||||
updateItems(it)
|
updateItems(it)
|
||||||
}
|
}
|
||||||
@@ -1152,7 +1164,8 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener {
|
|||||||
articleViewer,
|
articleViewer,
|
||||||
debugReadingItems,
|
debugReadingItems,
|
||||||
userIdentifier,
|
userIdentifier,
|
||||||
appColors
|
appColors,
|
||||||
|
config
|
||||||
) {
|
) {
|
||||||
updateItems(it)
|
updateItems(it)
|
||||||
}
|
}
|
||||||
|
@@ -10,6 +10,7 @@ import android.preference.PreferenceManager
|
|||||||
import androidx.multidex.MultiDexApplication
|
import androidx.multidex.MultiDexApplication
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import apps.amine.bou.readerforselfoss.utils.Config
|
import apps.amine.bou.readerforselfoss.utils.Config
|
||||||
|
import apps.amine.bou.readerforselfoss.utils.glide.loadMaybeBasicAuth
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.request.RequestOptions
|
import com.bumptech.glide.request.RequestOptions
|
||||||
import com.ftinc.scoop.Scoop
|
import com.ftinc.scoop.Scoop
|
||||||
@@ -42,10 +43,11 @@ import java.util.UUID.randomUUID
|
|||||||
ReportField.USER_APP_START_DATE, ReportField.USER_COMMENT, ReportField.USER_CRASH_DATE, ReportField.USER_EMAIL, ReportField.CUSTOM_DATA],
|
ReportField.USER_APP_START_DATE, ReportField.USER_COMMENT, ReportField.USER_CRASH_DATE, ReportField.USER_EMAIL, ReportField.CUSTOM_DATA],
|
||||||
buildConfigClass = BuildConfig::class)
|
buildConfigClass = BuildConfig::class)
|
||||||
class MyApp : MultiDexApplication() {
|
class MyApp : MultiDexApplication() {
|
||||||
|
private lateinit var config: Config
|
||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
config = Config(baseContext)
|
||||||
initAmplify()
|
initAmplify()
|
||||||
|
|
||||||
val prefs = getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
val prefs = getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
||||||
@@ -105,7 +107,7 @@ class MyApp : MultiDexApplication() {
|
|||||||
tag: String?
|
tag: String?
|
||||||
) {
|
) {
|
||||||
Glide.with(imageView?.context)
|
Glide.with(imageView?.context)
|
||||||
.load(uri)
|
.loadMaybeBasicAuth(config, uri.toString())
|
||||||
.apply(RequestOptions.fitCenterTransform().placeholder(placeholder))
|
.apply(RequestOptions.fitCenterTransform().placeholder(placeholder))
|
||||||
.into(imageView)
|
.into(imageView)
|
||||||
}
|
}
|
||||||
|
@@ -17,6 +17,7 @@ import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
|||||||
import apps.amine.bou.readerforselfoss.persistence.database.AppDatabase
|
import apps.amine.bou.readerforselfoss.persistence.database.AppDatabase
|
||||||
import apps.amine.bou.readerforselfoss.persistence.entities.ActionEntity
|
import apps.amine.bou.readerforselfoss.persistence.entities.ActionEntity
|
||||||
import apps.amine.bou.readerforselfoss.themes.AppColors
|
import apps.amine.bou.readerforselfoss.themes.AppColors
|
||||||
|
import apps.amine.bou.readerforselfoss.utils.Config
|
||||||
import apps.amine.bou.readerforselfoss.utils.LinkOnTouchListener
|
import apps.amine.bou.readerforselfoss.utils.LinkOnTouchListener
|
||||||
import apps.amine.bou.readerforselfoss.utils.buildCustomTabsIntent
|
import apps.amine.bou.readerforselfoss.utils.buildCustomTabsIntent
|
||||||
import apps.amine.bou.readerforselfoss.utils.customtabs.CustomTabActivityHelper
|
import apps.amine.bou.readerforselfoss.utils.customtabs.CustomTabActivityHelper
|
||||||
@@ -51,6 +52,7 @@ class ItemCardAdapter(
|
|||||||
override val appColors: AppColors,
|
override val appColors: AppColors,
|
||||||
override val debugReadingItems: Boolean,
|
override val debugReadingItems: Boolean,
|
||||||
override val userIdentifier: String,
|
override val userIdentifier: String,
|
||||||
|
override val config: Config,
|
||||||
override val updateItems: (ArrayList<Item>) -> Unit
|
override val updateItems: (ArrayList<Item>) -> Unit
|
||||||
) : ItemsAdapter<ItemCardAdapter.ViewHolder>() {
|
) : ItemsAdapter<ItemCardAdapter.ViewHolder>() {
|
||||||
private val c: Context = app.baseContext
|
private val c: Context = app.baseContext
|
||||||
@@ -86,7 +88,7 @@ class ItemCardAdapter(
|
|||||||
holder.mView.itemImage.setImageDrawable(null)
|
holder.mView.itemImage.setImageDrawable(null)
|
||||||
} else {
|
} else {
|
||||||
holder.mView.itemImage.visibility = View.VISIBLE
|
holder.mView.itemImage.visibility = View.VISIBLE
|
||||||
c.bitmapCenterCrop(itm.getThumbnail(c), holder.mView.itemImage)
|
c.bitmapCenterCrop(config, itm.getThumbnail(c), holder.mView.itemImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itm.getIcon(c).isEmpty()) {
|
if (itm.getIcon(c).isEmpty()) {
|
||||||
@@ -99,7 +101,7 @@ class ItemCardAdapter(
|
|||||||
.build(itm.sourcetitle.toTextDrawableString(c), color)
|
.build(itm.sourcetitle.toTextDrawableString(c), color)
|
||||||
holder.mView.sourceImage.setImageDrawable(drawable)
|
holder.mView.sourceImage.setImageDrawable(drawable)
|
||||||
} else {
|
} else {
|
||||||
c.circularBitmapDrawable(itm.getIcon(c), holder.mView.sourceImage)
|
c.circularBitmapDrawable(config, itm.getIcon(c), holder.mView.sourceImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.mView.favButton.isLiked = itm.starred
|
holder.mView.favButton.isLiked = itm.starred
|
||||||
|
@@ -20,6 +20,7 @@ import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
|||||||
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
||||||
import apps.amine.bou.readerforselfoss.persistence.database.AppDatabase
|
import apps.amine.bou.readerforselfoss.persistence.database.AppDatabase
|
||||||
import apps.amine.bou.readerforselfoss.themes.AppColors
|
import apps.amine.bou.readerforselfoss.themes.AppColors
|
||||||
|
import apps.amine.bou.readerforselfoss.utils.Config
|
||||||
import apps.amine.bou.readerforselfoss.utils.LinkOnTouchListener
|
import apps.amine.bou.readerforselfoss.utils.LinkOnTouchListener
|
||||||
import apps.amine.bou.readerforselfoss.utils.buildCustomTabsIntent
|
import apps.amine.bou.readerforselfoss.utils.buildCustomTabsIntent
|
||||||
import apps.amine.bou.readerforselfoss.utils.customtabs.CustomTabActivityHelper
|
import apps.amine.bou.readerforselfoss.utils.customtabs.CustomTabActivityHelper
|
||||||
@@ -52,6 +53,7 @@ class ItemListAdapter(
|
|||||||
override val debugReadingItems: Boolean,
|
override val debugReadingItems: Boolean,
|
||||||
override val userIdentifier: String,
|
override val userIdentifier: String,
|
||||||
override val appColors: AppColors,
|
override val appColors: AppColors,
|
||||||
|
override val config: Config,
|
||||||
override val updateItems: (ArrayList<Item>) -> Unit
|
override val updateItems: (ArrayList<Item>) -> Unit
|
||||||
) : ItemsAdapter<ItemListAdapter.ViewHolder>() {
|
) : ItemsAdapter<ItemListAdapter.ViewHolder>() {
|
||||||
private val generator: ColorGenerator = ColorGenerator.MATERIAL
|
private val generator: ColorGenerator = ColorGenerator.MATERIAL
|
||||||
@@ -108,10 +110,10 @@ class ItemListAdapter(
|
|||||||
|
|
||||||
holder.mView.itemImage.setImageDrawable(drawable)
|
holder.mView.itemImage.setImageDrawable(drawable)
|
||||||
} else {
|
} else {
|
||||||
c.circularBitmapDrawable(itm.getIcon(c), holder.mView.itemImage)
|
c.circularBitmapDrawable(config, itm.getIcon(c), holder.mView.itemImage)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
c.bitmapCenterCrop(itm.getThumbnail(c), holder.mView.itemImage)
|
c.bitmapCenterCrop(config, itm.getThumbnail(c), holder.mView.itemImage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,6 +13,7 @@ import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
|||||||
import apps.amine.bou.readerforselfoss.persistence.database.AppDatabase
|
import apps.amine.bou.readerforselfoss.persistence.database.AppDatabase
|
||||||
import apps.amine.bou.readerforselfoss.persistence.entities.ActionEntity
|
import apps.amine.bou.readerforselfoss.persistence.entities.ActionEntity
|
||||||
import apps.amine.bou.readerforselfoss.themes.AppColors
|
import apps.amine.bou.readerforselfoss.themes.AppColors
|
||||||
|
import apps.amine.bou.readerforselfoss.utils.Config
|
||||||
import apps.amine.bou.readerforselfoss.utils.maybeHandleSilentException
|
import apps.amine.bou.readerforselfoss.utils.maybeHandleSilentException
|
||||||
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
||||||
import apps.amine.bou.readerforselfoss.utils.persistence.toEntity
|
import apps.amine.bou.readerforselfoss.utils.persistence.toEntity
|
||||||
@@ -31,6 +32,7 @@ abstract class ItemsAdapter<VH : RecyclerView.ViewHolder?> : RecyclerView.Adapte
|
|||||||
abstract val userIdentifier: String
|
abstract val userIdentifier: String
|
||||||
abstract val app: Activity
|
abstract val app: Activity
|
||||||
abstract val appColors: AppColors
|
abstract val appColors: AppColors
|
||||||
|
abstract val config: Config
|
||||||
abstract val updateItems: (ArrayList<Item>) -> Unit
|
abstract val updateItems: (ArrayList<Item>) -> Unit
|
||||||
|
|
||||||
fun updateAllItems(newItems: ArrayList<Item>) {
|
fun updateAllItems(newItems: ArrayList<Item>) {
|
||||||
|
@@ -12,6 +12,7 @@ import apps.amine.bou.readerforselfoss.R
|
|||||||
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
import apps.amine.bou.readerforselfoss.api.selfoss.SelfossApi
|
||||||
import apps.amine.bou.readerforselfoss.api.selfoss.Source
|
import apps.amine.bou.readerforselfoss.api.selfoss.Source
|
||||||
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
import apps.amine.bou.readerforselfoss.api.selfoss.SuccessResponse
|
||||||
|
import apps.amine.bou.readerforselfoss.utils.Config
|
||||||
import apps.amine.bou.readerforselfoss.utils.glide.circularBitmapDrawable
|
import apps.amine.bou.readerforselfoss.utils.glide.circularBitmapDrawable
|
||||||
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
||||||
import apps.amine.bou.readerforselfoss.utils.toTextDrawableString
|
import apps.amine.bou.readerforselfoss.utils.toTextDrawableString
|
||||||
@@ -29,6 +30,7 @@ class SourcesListAdapter(
|
|||||||
) : RecyclerView.Adapter<SourcesListAdapter.ViewHolder>() {
|
) : RecyclerView.Adapter<SourcesListAdapter.ViewHolder>() {
|
||||||
private val c: Context = app.baseContext
|
private val c: Context = app.baseContext
|
||||||
private val generator: ColorGenerator = ColorGenerator.MATERIAL
|
private val generator: ColorGenerator = ColorGenerator.MATERIAL
|
||||||
|
private lateinit var config: Config
|
||||||
|
|
||||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||||
val v = LayoutInflater.from(c).inflate(
|
val v = LayoutInflater.from(c).inflate(
|
||||||
@@ -41,6 +43,7 @@ class SourcesListAdapter(
|
|||||||
|
|
||||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||||
val itm = items[position]
|
val itm = items[position]
|
||||||
|
config = Config(c)
|
||||||
|
|
||||||
if (itm.getIcon(c).isEmpty()) {
|
if (itm.getIcon(c).isEmpty()) {
|
||||||
val color = generator.getColor(itm.title)
|
val color = generator.getColor(itm.title)
|
||||||
@@ -52,7 +55,7 @@ class SourcesListAdapter(
|
|||||||
.build(itm.title.toTextDrawableString(c), color)
|
.build(itm.title.toTextDrawableString(c), color)
|
||||||
holder.mView.itemImage.setImageDrawable(drawable)
|
holder.mView.itemImage.setImageDrawable(drawable)
|
||||||
} else {
|
} else {
|
||||||
c.circularBitmapDrawable(itm.getIcon(c), holder.mView.itemImage)
|
c.circularBitmapDrawable(config, itm.getIcon(c), holder.mView.itemImage)
|
||||||
}
|
}
|
||||||
|
|
||||||
holder.mView.sourceTitle.text = itm.title
|
holder.mView.sourceTitle.text = itm.title
|
||||||
|
@@ -3,6 +3,8 @@ package apps.amine.bou.readerforselfoss.fragments
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.SharedPreferences
|
import android.content.SharedPreferences
|
||||||
import android.content.res.ColorStateList
|
import android.content.res.ColorStateList
|
||||||
|
import android.content.res.TypedArray
|
||||||
|
import android.graphics.Typeface
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
@@ -19,6 +21,7 @@ import android.view.View
|
|||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.webkit.WebSettings
|
import android.webkit.WebSettings
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.room.Room
|
import androidx.room.Room
|
||||||
import apps.amine.bou.readerforselfoss.R
|
import apps.amine.bou.readerforselfoss.R
|
||||||
import apps.amine.bou.readerforselfoss.api.mercury.MercuryApi
|
import apps.amine.bou.readerforselfoss.api.mercury.MercuryApi
|
||||||
@@ -34,6 +37,7 @@ import apps.amine.bou.readerforselfoss.themes.AppColors
|
|||||||
import apps.amine.bou.readerforselfoss.utils.Config
|
import apps.amine.bou.readerforselfoss.utils.Config
|
||||||
import apps.amine.bou.readerforselfoss.utils.buildCustomTabsIntent
|
import apps.amine.bou.readerforselfoss.utils.buildCustomTabsIntent
|
||||||
import apps.amine.bou.readerforselfoss.utils.customtabs.CustomTabActivityHelper
|
import apps.amine.bou.readerforselfoss.utils.customtabs.CustomTabActivityHelper
|
||||||
|
import apps.amine.bou.readerforselfoss.utils.glide.loadMaybeBasicAuth
|
||||||
import apps.amine.bou.readerforselfoss.utils.isEmptyOrNullOrNullString
|
import apps.amine.bou.readerforselfoss.utils.isEmptyOrNullOrNullString
|
||||||
import apps.amine.bou.readerforselfoss.utils.maybeHandleSilentException
|
import apps.amine.bou.readerforselfoss.utils.maybeHandleSilentException
|
||||||
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
import apps.amine.bou.readerforselfoss.utils.network.isNetworkAccessible
|
||||||
@@ -44,6 +48,7 @@ import apps.amine.bou.readerforselfoss.utils.succeeded
|
|||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
import com.bumptech.glide.request.RequestOptions
|
import com.bumptech.glide.request.RequestOptions
|
||||||
import com.github.rubensousa.floatingtoolbar.FloatingToolbar
|
import com.github.rubensousa.floatingtoolbar.FloatingToolbar
|
||||||
|
import kotlinx.android.synthetic.main.fragment_article.*
|
||||||
import kotlinx.android.synthetic.main.fragment_article.view.*
|
import kotlinx.android.synthetic.main.fragment_article.view.*
|
||||||
import org.acra.ACRA
|
import org.acra.ACRA
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
@@ -68,6 +73,15 @@ class ArticleFragment : Fragment() {
|
|||||||
private lateinit var appColors: AppColors
|
private lateinit var appColors: AppColors
|
||||||
private lateinit var db: AppDatabase
|
private lateinit var db: AppDatabase
|
||||||
private lateinit var textAlignment: String
|
private lateinit var textAlignment: String
|
||||||
|
private lateinit var config: Config
|
||||||
|
|
||||||
|
private var rootView: ViewGroup? = null
|
||||||
|
|
||||||
|
private lateinit var prefs: SharedPreferences
|
||||||
|
|
||||||
|
private var typeface: Typeface? = null
|
||||||
|
private var resId: Int = 0
|
||||||
|
private var font = ""
|
||||||
|
|
||||||
override fun onStop() {
|
override fun onStop() {
|
||||||
super.onStop()
|
super.onStop()
|
||||||
@@ -78,6 +92,7 @@ class ArticleFragment : Fragment() {
|
|||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
appColors = AppColors(activity!!)
|
appColors = AppColors(activity!!)
|
||||||
|
config = Config(activity!!)
|
||||||
|
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
@@ -90,10 +105,6 @@ class ArticleFragment : Fragment() {
|
|||||||
).addMigrations(MIGRATION_1_2).addMigrations(MIGRATION_2_3).build()
|
).addMigrations(MIGRATION_1_2).addMigrations(MIGRATION_2_3).build()
|
||||||
}
|
}
|
||||||
|
|
||||||
private var rootView: ViewGroup? = null
|
|
||||||
|
|
||||||
private lateinit var prefs: SharedPreferences
|
|
||||||
|
|
||||||
override fun onCreateView(
|
override fun onCreateView(
|
||||||
inflater: LayoutInflater,
|
inflater: LayoutInflater,
|
||||||
container: ViewGroup?,
|
container: ViewGroup?,
|
||||||
@@ -112,6 +123,13 @@ class ArticleFragment : Fragment() {
|
|||||||
prefs = PreferenceManager.getDefaultSharedPreferences(activity)
|
prefs = PreferenceManager.getDefaultSharedPreferences(activity)
|
||||||
editor = prefs.edit()
|
editor = prefs.edit()
|
||||||
fontSize = prefs.getString("reader_font_size", "16").toInt()
|
fontSize = prefs.getString("reader_font_size", "16").toInt()
|
||||||
|
|
||||||
|
font = prefs.getString("reader_font", "")
|
||||||
|
if (font.isNotEmpty()) {
|
||||||
|
resId = context!!.resources.getIdentifier(font, "font", context!!.packageName)
|
||||||
|
typeface = ResourcesCompat.getFont(context!!, resId)!!
|
||||||
|
}
|
||||||
|
|
||||||
refreshAlignment()
|
refreshAlignment()
|
||||||
|
|
||||||
val settings = activity!!.getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
val settings = activity!!.getSharedPreferences(Config.settingsName, Context.MODE_PRIVATE)
|
||||||
@@ -201,11 +219,17 @@ class ArticleFragment : Fragment() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
rootView!!.source.text = contentSource
|
rootView!!.source.text = contentSource
|
||||||
|
if (typeface != null) {
|
||||||
|
rootView!!.source.typeface = typeface
|
||||||
|
}
|
||||||
|
|
||||||
if (contentText.isEmptyOrNullOrNullString()) {
|
if (contentText.isEmptyOrNullOrNullString()) {
|
||||||
getContentFromMercury(customTabsIntent, prefs)
|
getContentFromMercury(customTabsIntent, prefs)
|
||||||
} else {
|
} else {
|
||||||
rootView!!.titleView.text = contentTitle
|
rootView!!.titleView.text = contentTitle
|
||||||
|
if (typeface != null) {
|
||||||
|
rootView!!.titleView.typeface = typeface
|
||||||
|
}
|
||||||
|
|
||||||
htmlToWebview()
|
htmlToWebview()
|
||||||
|
|
||||||
@@ -214,7 +238,7 @@ class ArticleFragment : Fragment() {
|
|||||||
Glide
|
Glide
|
||||||
.with(context!!)
|
.with(context!!)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(contentImage)
|
.loadMaybeBasicAuth(config, contentImage)
|
||||||
.apply(RequestOptions.fitCenterTransform())
|
.apply(RequestOptions.fitCenterTransform())
|
||||||
.into(rootView!!.imageView)
|
.into(rootView!!.imageView)
|
||||||
} else {
|
} else {
|
||||||
@@ -280,6 +304,9 @@ class ArticleFragment : Fragment() {
|
|||||||
if (response.body() != null && response.body()!!.content != null && !response.body()!!.content.isNullOrEmpty()) {
|
if (response.body() != null && response.body()!!.content != null && !response.body()!!.content.isNullOrEmpty()) {
|
||||||
try {
|
try {
|
||||||
rootView!!.titleView.text = response.body()!!.title
|
rootView!!.titleView.text = response.body()!!.title
|
||||||
|
if (typeface != null) {
|
||||||
|
rootView!!.titleView.typeface = typeface
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// Note: Mercury may return relative urls... If it does the url val will not be changed.
|
// Note: Mercury may return relative urls... If it does the url val will not be changed.
|
||||||
URL(response.body()!!.url)
|
URL(response.body()!!.url)
|
||||||
@@ -309,7 +336,7 @@ class ArticleFragment : Fragment() {
|
|||||||
Glide
|
Glide
|
||||||
.with(context!!)
|
.with(context!!)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(response.body()!!.lead_image_url)
|
.loadMaybeBasicAuth(config, response.body()!!.lead_image_url.orEmpty())
|
||||||
.apply(RequestOptions.fitCenterTransform())
|
.apply(RequestOptions.fitCenterTransform())
|
||||||
.into(rootView!!.imageView)
|
.into(rootView!!.imageView)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -361,6 +388,11 @@ class ArticleFragment : Fragment() {
|
|||||||
private fun htmlToWebview() {
|
private fun htmlToWebview() {
|
||||||
val stringColor = String.format("#%06X", 0xFFFFFF and appColors.colorAccent)
|
val stringColor = String.format("#%06X", 0xFFFFFF and appColors.colorAccent)
|
||||||
|
|
||||||
|
val attrs: IntArray = intArrayOf(android.R.attr.fontFamily)
|
||||||
|
val a: TypedArray = context!!.obtainStyledAttributes(resId, attrs)
|
||||||
|
|
||||||
|
|
||||||
|
rootView!!.webcontent.settings.standardFontFamily = a.getString(0)
|
||||||
rootView!!.webcontent.visibility = View.VISIBLE
|
rootView!!.webcontent.visibility = View.VISIBLE
|
||||||
val (textColor, backgroundColor) = if (appColors.isDarkTheme) {
|
val (textColor, backgroundColor) = if (appColors.isDarkTheme) {
|
||||||
if (context != null) {
|
if (context != null) {
|
||||||
@@ -420,6 +452,24 @@ class ArticleFragment : Fragment() {
|
|||||||
ACRA.getErrorReporter().maybeHandleSilentException(e, activity!!)
|
ACRA.getErrorReporter().maybeHandleSilentException(e, activity!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val fontName = when (font) {
|
||||||
|
getString(R.string.open_sans_font_id) -> "Open Sans"
|
||||||
|
getString(R.string.roboto_font_id) -> "Roboto"
|
||||||
|
else -> ""
|
||||||
|
}
|
||||||
|
|
||||||
|
val fontLinkAndStyle = if (font.isNotEmpty()) {
|
||||||
|
"""<link href="https://fonts.googleapis.com/css?family=${fontName.replace(" ", "+")}" rel="stylesheet">
|
||||||
|
|<style>
|
||||||
|
| * {
|
||||||
|
| font-family: '$fontName';
|
||||||
|
| }
|
||||||
|
|</style>
|
||||||
|
""".trimMargin()
|
||||||
|
} else {
|
||||||
|
""
|
||||||
|
}
|
||||||
|
|
||||||
rootView!!.webcontent.loadDataWithBaseURL(
|
rootView!!.webcontent.loadDataWithBaseURL(
|
||||||
baseUrl,
|
baseUrl,
|
||||||
"""<html>
|
"""<html>
|
||||||
@@ -443,6 +493,7 @@ class ArticleFragment : Fragment() {
|
|||||||
| text-align: $textAlignment;
|
| text-align: $textAlignment;
|
||||||
| word-break: break-word;
|
| word-break: break-word;
|
||||||
| overflow:hidden;
|
| overflow:hidden;
|
||||||
|
| line-height: 1.5em;
|
||||||
| }
|
| }
|
||||||
| a, pre, code {
|
| a, pre, code {
|
||||||
| text-align: $textAlignment;
|
| text-align: $textAlignment;
|
||||||
@@ -453,6 +504,7 @@ class ArticleFragment : Fragment() {
|
|||||||
| background-color: $stringBackgroundColor;
|
| background-color: $stringBackgroundColor;
|
||||||
| }
|
| }
|
||||||
| </style>
|
| </style>
|
||||||
|
| $fontLinkAndStyle
|
||||||
|</head>
|
|</head>
|
||||||
|<body>
|
|<body>
|
||||||
| $contentText
|
| $contentText
|
||||||
|
@@ -2,30 +2,30 @@ package apps.amine.bou.readerforselfoss.utils.glide
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
|
import android.graphics.drawable.Drawable
|
||||||
|
import android.util.Base64
|
||||||
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory
|
import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
|
import apps.amine.bou.readerforselfoss.utils.Config
|
||||||
import com.bumptech.glide.Glide
|
import com.bumptech.glide.Glide
|
||||||
|
import com.bumptech.glide.RequestBuilder
|
||||||
|
import com.bumptech.glide.RequestManager
|
||||||
|
import com.bumptech.glide.load.model.GlideUrl
|
||||||
|
import com.bumptech.glide.load.model.LazyHeaders
|
||||||
import com.bumptech.glide.request.RequestOptions
|
import com.bumptech.glide.request.RequestOptions
|
||||||
import com.bumptech.glide.request.target.BitmapImageViewTarget
|
import com.bumptech.glide.request.target.BitmapImageViewTarget
|
||||||
|
|
||||||
fun Context.bitmapCenterCrop(url: String, iv: ImageView) =
|
fun Context.bitmapCenterCrop(config: Config, url: String, iv: ImageView) =
|
||||||
Glide.with(this)
|
Glide.with(this)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(url)
|
.loadMaybeBasicAuth(config, url)
|
||||||
.apply(RequestOptions.centerCropTransform())
|
.apply(RequestOptions.centerCropTransform())
|
||||||
.into(iv)
|
.into(iv)
|
||||||
|
|
||||||
fun Context.bitmapFitCenter(url: String, iv: ImageView) =
|
fun Context.circularBitmapDrawable(config: Config, url: String, iv: ImageView) =
|
||||||
Glide.with(this)
|
Glide.with(this)
|
||||||
.asBitmap()
|
.asBitmap()
|
||||||
.load(url)
|
.loadMaybeBasicAuth(config, url)
|
||||||
.apply(RequestOptions.fitCenterTransform())
|
|
||||||
.into(iv)
|
|
||||||
|
|
||||||
fun Context.circularBitmapDrawable(url: String, iv: ImageView) =
|
|
||||||
Glide.with(this)
|
|
||||||
.asBitmap()
|
|
||||||
.load(url)
|
|
||||||
.apply(RequestOptions.centerCropTransform())
|
.apply(RequestOptions.centerCropTransform())
|
||||||
.into(object : BitmapImageViewTarget(iv) {
|
.into(object : BitmapImageViewTarget(iv) {
|
||||||
override fun setResource(resource: Bitmap?) {
|
override fun setResource(resource: Bitmap?) {
|
||||||
@@ -36,4 +36,24 @@ fun Context.circularBitmapDrawable(url: String, iv: ImageView) =
|
|||||||
circularBitmapDrawable.isCircular = true
|
circularBitmapDrawable.isCircular = true
|
||||||
iv.setImageDrawable(circularBitmapDrawable)
|
iv.setImageDrawable(circularBitmapDrawable)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
fun RequestBuilder<Bitmap>.loadMaybeBasicAuth(config: Config, url: String): RequestBuilder<Bitmap> {
|
||||||
|
val builder: LazyHeaders.Builder = LazyHeaders.Builder()
|
||||||
|
if (config.httpUserLogin.isNotEmpty() || config.httpUserPassword.isNotEmpty()) {
|
||||||
|
val basicAuth = "Basic " + Base64.encodeToString("${config.httpUserLogin}:${config.httpUserPassword}".toByteArray(), Base64.NO_WRAP)
|
||||||
|
builder.addHeader("Authorization", basicAuth)
|
||||||
|
}
|
||||||
|
val glideUrl = GlideUrl(url, builder.build())
|
||||||
|
return this.load(glideUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun RequestManager.loadMaybeBasicAuth(config: Config, url: String): RequestBuilder<Drawable> {
|
||||||
|
val builder: LazyHeaders.Builder = LazyHeaders.Builder()
|
||||||
|
if (config.httpUserLogin.isNotEmpty() || config.httpUserPassword.isNotEmpty()) {
|
||||||
|
val basicAuth = "Basic " + Base64.encodeToString("${config.httpUserLogin}:${config.httpUserPassword}".toByteArray(), Base64.NO_WRAP)
|
||||||
|
builder.addHeader("Authorization", basicAuth)
|
||||||
|
}
|
||||||
|
val glideUrl = GlideUrl(url, builder.build())
|
||||||
|
return this.load(glideUrl)
|
||||||
|
}
|
7
app/src/main/res/font/open_sans.xml
Normal file
7
app/src/main/res/font/open_sans.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
app:fontProviderAuthority="com.google.android.gms.fonts"
|
||||||
|
app:fontProviderPackage="com.google.android.gms"
|
||||||
|
app:fontProviderQuery="Open Sans"
|
||||||
|
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||||
|
</font-family>
|
7
app/src/main/res/font/roboto.xml
Normal file
7
app/src/main/res/font/roboto.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<font-family xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
app:fontProviderAuthority="com.google.android.gms.fonts"
|
||||||
|
app:fontProviderPackage="com.google.android.gms"
|
||||||
|
app:fontProviderQuery="Roboto"
|
||||||
|
app:fontProviderCerts="@array/com_google_android_gms_fonts_certs">
|
||||||
|
</font-family>
|
@@ -31,8 +31,8 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
app:layout_constraintHorizontal_bias="0.0"
|
app:layout_constraintHorizontal_bias="0.0"
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Problema con el visor web</string>
|
<string name="webview_dialog_issue_title">Problema con el visor web</string>
|
||||||
<string name="reader_text_align_left">Alinear a la izquierda</string>
|
<string name="reader_text_align_left">Alinear a la izquierda</string>
|
||||||
<string name="reader_text_align_justify">Justificado</string>
|
<string name="reader_text_align_justify">Justificado</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Problème de Webview</string>
|
<string name="webview_dialog_issue_title">Problème de Webview</string>
|
||||||
<string name="reader_text_align_left">Aligner à gauche</string>
|
<string name="reader_text_align_left">Aligner à gauche</string>
|
||||||
<string name="reader_text_align_justify">Justifier le texte</string>
|
<string name="reader_text_align_justify">Justifier le texte</string>
|
||||||
|
<string name="settings_reader_font">Police du lecteur d\'articles</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Problema co visor web</string>
|
<string name="webview_dialog_issue_title">Problema co visor web</string>
|
||||||
<string name="reader_text_align_left">Aliñar á esquerda</string>
|
<string name="reader_text_align_left">Aliñar á esquerda</string>
|
||||||
<string name="reader_text_align_justify">Xustificado</string>
|
<string name="reader_text_align_justify">Xustificado</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -172,4 +172,5 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
17
app/src/main/res/values/font_certs.xml
Normal file
17
app/src/main/res/values/font_certs.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<array name="com_google_android_gms_fonts_certs">
|
||||||
|
<item>@array/com_google_android_gms_fonts_certs_dev</item>
|
||||||
|
<item>@array/com_google_android_gms_fonts_certs_prod</item>
|
||||||
|
</array>
|
||||||
|
<string-array name="com_google_android_gms_fonts_certs_dev">
|
||||||
|
<item>
|
||||||
|
MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
|
||||||
|
</item>
|
||||||
|
</string-array>
|
||||||
|
<string-array name="com_google_android_gms_fonts_certs_prod">
|
||||||
|
<item>
|
||||||
|
MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
|
||||||
|
</item>
|
||||||
|
</string-array>
|
||||||
|
</resources>
|
7
app/src/main/res/values/preloaded_fonts.xml
Normal file
7
app/src/main/res/values/preloaded_fonts.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<array name="preloaded_fonts" translatable="false">
|
||||||
|
<item>@font/open_sans</item>
|
||||||
|
<item>@font/roboto</item>
|
||||||
|
</array>
|
||||||
|
</resources>
|
8
app/src/main/res/values/preloaded_fonts_keys.xml
Normal file
8
app/src/main/res/values/preloaded_fonts_keys.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<array name="preloaded_fonts_keys" translatable="false">
|
||||||
|
<item></item>
|
||||||
|
<item>@string/open_sans_font_id</item>
|
||||||
|
<item>@string/roboto_font_id</item>
|
||||||
|
</array>
|
||||||
|
</resources>
|
8
app/src/main/res/values/preloaded_fonts_values.xml
Normal file
8
app/src/main/res/values/preloaded_fonts_values.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<array name="preloaded_fonts_values" translatable="false">
|
||||||
|
<item>Systems</item>
|
||||||
|
<item>Open Sans</item>
|
||||||
|
<item>Roboto</item>
|
||||||
|
</array>
|
||||||
|
</resources>
|
@@ -172,4 +172,7 @@
|
|||||||
<string name="webview_dialog_issue_title">Webview issue</string>
|
<string name="webview_dialog_issue_title">Webview issue</string>
|
||||||
<string name="reader_text_align_left">Align left</string>
|
<string name="reader_text_align_left">Align left</string>
|
||||||
<string name="reader_text_align_justify">Justify</string>
|
<string name="reader_text_align_justify">Justify</string>
|
||||||
|
<string name="settings_reader_font">Reader font</string>
|
||||||
|
<string name="open_sans_font_id" translatable="false">open_sans</string>
|
||||||
|
<string name="roboto_font_id" translatable="false">roboto</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@@ -13,4 +13,10 @@
|
|||||||
android:selectAllOnFocus="true"
|
android:selectAllOnFocus="true"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:title="@string/pref_content_reader_font_size" />
|
android:title="@string/pref_content_reader_font_size" />
|
||||||
|
<ListPreference
|
||||||
|
android:defaultValue="1"
|
||||||
|
android:entries="@array/preloaded_fonts_values"
|
||||||
|
android:entryValues="@array/preloaded_fonts_keys"
|
||||||
|
android:key="reader_font"
|
||||||
|
android:title="@string/settings_reader_font" />
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
Reference in New Issue
Block a user