Compare commits
2 Commits
41c14362a8
...
9e0fdf30ec
Author | SHA1 | Date | |
---|---|---|---|
9e0fdf30ec | |||
0d84a2d7e9 |
@ -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)
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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? {
|
||||||
|
Loading…
Reference in New Issue
Block a user