diff options
Diffstat (limited to 'app/src')
5 files changed, 10 insertions, 6 deletions
diff --git a/app/src/main/java/uk/co/blatech/blaupload3/model/File.kt b/app/src/main/java/uk/co/blatech/blaupload3/model/File.kt index 677b852..70c4b34 100644 --- a/app/src/main/java/uk/co/blatech/blaupload3/model/File.kt +++ b/app/src/main/java/uk/co/blatech/blaupload3/model/File.kt @@ -1,13 +1,14 @@ package uk.co.blatech.blaupload3.model +import android.net.Uri import java.net.URI import java.text.SimpleDateFormat import java.util.* data class File (var filename: String, var type: String, var modified: Long, var size: Long) { - var url = URI("http://wupload.of.je/$filename") - var thumb_url = URI("http://wupload.of.je/thumbs/$filename") + var url = Uri.parse("http://wupload.of.je/$filename") + var thumb_url = Uri.parse("http://wupload.of.je/thumbs/$filename") var modified_formatted = SimpleDateFormat("dd/MM/yyyy mm:HH:ss").format(Date(modified*1000)) val units = arrayOf<String>("B", "kB", "MB", "GB", "TB") var size_lambda = { size : Long -> diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/FileListAdapter.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/FileListAdapter.kt index b32fe6c..bf14438 100644 --- a/app/src/main/java/uk/co/blatech/blaupload3/util/FileListAdapter.kt +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/FileListAdapter.kt @@ -18,7 +18,7 @@ class FileListAdapter(private val context: Context, private val fileList : Array listRow.list_filename.text = fileList[position].filename listRow.list_modified.text = fileList[position].modified_formatted.toString() listRow.list_size.text = fileList[position].size_formatted - listRow.list_thumbnail.setImageUrl(fileList[position].thumb_url.toASCIIString(), imageLoader) + listRow.list_thumbnail.setImageUrl(fileList[position].thumb_url.toString(), imageLoader) return listRow } diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/ImageGalleryAdapter.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/ImageGalleryAdapter.kt index 82ce858..34ed051 100644 --- a/app/src/main/java/uk/co/blatech/blaupload3/util/ImageGalleryAdapter.kt +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/ImageGalleryAdapter.kt @@ -16,7 +16,7 @@ class ImageGalleryAdapter(private val fileList : ArrayList<File>) : RecyclerView var imageLoader = AppController.instance?.imageLoader fun bind(file: File) { - itemView.gallery_thumbnail.setImageUrl(file.thumb_url.toASCIIString(), imageLoader) + itemView.gallery_thumbnail.setImageUrl(file.thumb_url.toString(), imageLoader) itemView.gallery_title.text = file.filename } } diff --git a/app/src/main/java/uk/co/blatech/blaupload3/util/ImagePagerAdapter.kt b/app/src/main/java/uk/co/blatech/blaupload3/util/ImagePagerAdapter.kt index 628f878..65e7e62 100644 --- a/app/src/main/java/uk/co/blatech/blaupload3/util/ImagePagerAdapter.kt +++ b/app/src/main/java/uk/co/blatech/blaupload3/util/ImagePagerAdapter.kt @@ -1,10 +1,12 @@ package uk.co.blatech.blaupload3.util +import android.net.Uri import android.util.Log import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView +import com.squareup.picasso.Picasso import kotlinx.android.synthetic.main.pager_item.view.* import uk.co.blatech.blaupload3.R import uk.co.blatech.blaupload3.model.File @@ -15,7 +17,8 @@ class ImagePagerAdapter(private val fileList : ArrayList<File>) : RecyclerView. var imageLoader = AppController.instance?.imageLoader fun bind(file: File) { - itemView.pager_image.setImageUrl(file.url.toASCIIString(), imageLoader) + val imageView = itemView.pager_image + Picasso.get().load(file.url).into(imageView) itemView.pager_title.text = file.filename } } diff --git a/app/src/main/res/layout/pager_item.xml b/app/src/main/res/layout/pager_item.xml index d948c64..8bb5013 100644 --- a/app/src/main/res/layout/pager_item.xml +++ b/app/src/main/res/layout/pager_item.xml @@ -9,7 +9,7 @@ android:layout_height="wrap_content" android:layout_below="@id/pager_image" android:textSize="20dp"/> - <com.android.volley.toolbox.NetworkImageView + <com.ortiz.touchview.TouchImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/pager_image" android:layout_width="match_parent" |