File tree Expand file tree Collapse file tree
app/src/main/java/com/example/deeplviewer/activity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,10 +3,7 @@ package com.example.deeplviewer.activity
33import android.annotation.SuppressLint
44import android.content.Context
55import android.content.Intent
6- import android.net.Uri
76import android.os.Bundle
8- import android.os.Handler
9- import android.os.Looper
107import android.view.View
118import android.view.animation.AlphaAnimation
129import android.webkit.WebView
@@ -27,15 +24,20 @@ class FloatingTextSelection : AppCompatActivity() {
2724 private lateinit var layout: View
2825
2926 private val startUrl by lazy {
30- val urlParam = getSharedPreferences(" config" , Context .MODE_PRIVATE ).getString(
27+ val configPrefs = getSharedPreferences(" config" , Context .MODE_PRIVATE )
28+ val urlParam = configPrefs.getString(
3129 " urlParam" ,
3230 DEFAULT_PARAM
3331 ) ? : DEFAULT_PARAM
34- return @lazy " https://www.deepl.com/translator$urlParam "
32+ val pageType = configPrefs.getString(" pageType" , DEFAULT_PAGE_TYPE ) ? : DEFAULT_PAGE_TYPE
33+
34+ ORIGIN_URL + pageType + urlParam
3535 }
3636
3737 companion object {
38+ private const val ORIGIN_URL = " https://www.deepl.com/"
3839 private const val DEFAULT_PARAM = " #en/en/"
40+ private const val DEFAULT_PAGE_TYPE = " translator"
3941 }
4042
4143 override fun onCreate (savedInstanceState : Bundle ? ) {
You can’t perform that action at this time.
0 commit comments