Compare commits

...

2 Commits

Author SHA1 Message Date
9e0fdf30ec Prevent Glide from opening svg images 2021-01-09 23:43:31 +01:00
0d84a2d7e9 Update to support rebase 2021-01-09 23:41:57 +01:00
3 changed files with 10 additions and 3 deletions

View File

@ -21,7 +21,7 @@ class ImageActivity : AppCompatActivity() {
supportActionBar?.setDisplayShowTitleEnabled(false) supportActionBar?.setDisplayShowTitleEnabled(false)
supportActionBar?.setDisplayHomeAsUpEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true)
allImages = intent.getStringArrayListExtra("allImages") allImages = intent.getStringArrayListExtra("allImages") as ArrayList<String>
position = intent.getIntExtra("position", 0) position = intent.getIntExtra("position", 0)
pager.adapter = ScreenSlidePagerAdapter(supportFragmentManager) pager.adapter = ScreenSlidePagerAdapter(supportFragmentManager)

View File

@ -141,7 +141,14 @@ data class Item(
var allImages = ArrayList<String>() var allImages = ArrayList<String>()
for ( image in Jsoup.parse(content).getElementsByTag("img")) { for ( image in Jsoup.parse(content).getElementsByTag("img")) {
allImages.add(image.attr("src")) val url = image.attr("src")
if (url.toLowerCase().contains(".jpg") ||
url.toLowerCase().contains(".jpeg") ||
url.toLowerCase().contains(".png") ||
url.toLowerCase().contains(".webp"))
{
allImages.add(url)
}
} }
return allImages return allImages
} }

View File

@ -17,7 +17,7 @@ class ImageFragment : Fragment() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
imageUrl = arguments!!.getString("imageUrl")!! imageUrl = requireArguments().getString("imageUrl")!!
} }
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {