Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections after 1.8.1 release #474

Merged
merged 16 commits into from
Dec 26, 2024
Merged
Prev Previous commit
Next Next commit
Rename IDownloaderObserver to IFileRequestObserver
Reco1I committed Dec 18, 2024
commit c3c28e99142a73b15b19548b2d328f23cbb6d6c1
16 changes: 6 additions & 10 deletions src/com/reco1l/framework/net/FileRequest.kt
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ class FileRequest(val file: File, url: HttpUrl): WebRequest(url) {
/**
* The download observer.
*/
var observer: IDownloaderObserver? = null
var observer: IFileRequestObserver? = null

/**
* Whether the download is in progress, this is set to true once [execute] is called.
@@ -116,13 +116,9 @@ class FileRequest(val file: File, url: HttpUrl): WebRequest(url) {
}


interface IDownloaderObserver
{
fun onDownloadEnd(downloader: FileRequest) = Unit

fun onDownloadCancel(downloader: FileRequest) = Unit

fun onDownloadUpdate(downloader: FileRequest) = Unit

fun onDownloadFail(downloader: FileRequest, exception: Exception) = Unit
interface IFileRequestObserver {
fun onDownloadEnd(request: FileRequest) = Unit
fun onDownloadCancel(request: FileRequest) = Unit
fun onDownloadUpdate(request: FileRequest) = Unit
fun onDownloadFail(request: FileRequest, exception: Exception) = Unit
}
4 changes: 2 additions & 2 deletions src/com/reco1l/osu/beatmaplisting/BeatmapDownloader.kt
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import android.os.Environment.DIRECTORY_DOWNLOADS
import android.view.View
import com.osudroid.resources.R.*
import com.reco1l.framework.net.FileRequest
import com.reco1l.framework.net.IDownloaderObserver
import com.reco1l.framework.net.IFileRequestObserver
import com.reco1l.osu.mainThread
import com.reco1l.osu.multiplayer.Multiplayer
import com.reco1l.osu.multiplayer.RoomScene
@@ -18,7 +18,7 @@ import ru.nsu.ccfit.zuev.osu.helper.FileUtils
import ru.nsu.ccfit.zuev.osu.helper.StringTable
import java.io.IOException

object BeatmapDownloader : IDownloaderObserver {
object BeatmapDownloader : IFileRequestObserver {


private lateinit var fragment: DownloadFragment
6 changes: 2 additions & 4 deletions src/com/reco1l/osu/beatmaplisting/BeatmapListing.kt
Original file line number Diff line number Diff line change
@@ -2,7 +2,6 @@ package com.reco1l.osu.beatmaplisting

import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.util.Log
import android.view.Choreographer
import android.view.Choreographer.FrameCallback
@@ -34,15 +33,14 @@ import com.edlplan.ui.fragment.BaseFragment
import com.google.android.material.progressindicator.CircularProgressIndicator
import com.reco1l.*
import com.reco1l.framework.bass.URLBassStream
import com.reco1l.framework.net.IDownloaderObserver
import com.reco1l.framework.net.IFileRequestObserver
import com.reco1l.framework.net.JsonArrayRequest
import com.reco1l.osu.*
import com.reco1l.osu.beatmaplisting.BeatmapMirrorSearchRequestModel.OrderType
import com.reco1l.osu.beatmaplisting.BeatmapMirrorSearchRequestModel.SortType
import com.reco1l.osu.ui.Option
import com.reco1l.osu.ui.SelectDialog
import com.reco1l.osu.ui.SelectDropdown
import com.reco1l.toolkt.android.backgroundColor
import com.reco1l.toolkt.android.cornerRadius
import com.reco1l.toolkt.android.dp
import com.reco1l.toolkt.android.drawableLeft
@@ -67,7 +65,7 @@ import ru.nsu.ccfit.zuev.osu.RankedStatus


class BeatmapListing : BaseFragment(),
IDownloaderObserver,
IFileRequestObserver,
OnEditorActionListener,
OnKeyListener,
FrameCallback {