Convert LicenseFragmentHelper methods to top-level declarations.

This commit is contained in:
Isira Seneviratne 2022-07-23 05:20:06 +05:30
parent 35a118a2a7
commit 013522c376
2 changed files with 75 additions and 77 deletions

View file

@ -8,7 +8,6 @@ import androidx.core.os.bundleOf
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import io.reactivex.rxjava3.disposables.CompositeDisposable import io.reactivex.rxjava3.disposables.CompositeDisposable
import org.schabi.newpipe.R import org.schabi.newpipe.R
import org.schabi.newpipe.about.LicenseFragmentHelper.showLicense
import org.schabi.newpipe.databinding.FragmentLicensesBinding import org.schabi.newpipe.databinding.FragmentLicensesBinding
import org.schabi.newpipe.databinding.ItemSoftwareComponentBinding import org.schabi.newpipe.databinding.ItemSoftwareComponentBinding

View file

@ -14,7 +14,6 @@ import org.schabi.newpipe.util.ThemeHelper
import org.schabi.newpipe.util.external_communication.ShareUtils import org.schabi.newpipe.util.external_communication.ShareUtils
import java.io.IOException import java.io.IOException
object LicenseFragmentHelper {
/** /**
* @param context the context to use * @param context the context to use
* @param license the license * @param license the license
@ -96,7 +95,8 @@ object LicenseFragmentHelper {
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe { formattedLicense -> .subscribe { formattedLicense ->
val webViewData = Base64.encodeToString(formattedLicense.toByteArray(), Base64.NO_PADDING) val webViewData =
Base64.encodeToString(formattedLicense.toByteArray(), Base64.NO_PADDING)
val webView = WebView(context) val webView = WebView(context)
webView.loadData(webViewData, "text/html; charset=UTF-8", "base64") webView.loadData(webViewData, "text/html; charset=UTF-8", "base64")
@ -110,4 +110,3 @@ object LicenseFragmentHelper {
} }
} }
} }
}