From 2d00a605e0b56dda29575b30a1c56b9e08285d51 Mon Sep 17 00:00:00 2001 From: lunaticbum Date: Mon, 27 Mar 2023 18:43:46 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=85=EB=8E=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 + .../com/mime/dualscreenview/activity/Base.kt | 26 +- .../com/mime/dualscreenview/activity/Intro.kt | 307 +++++++++++------- .../com/mime/dualscreenview/common/Definez.kt | 15 + .../com/mime/dualscreenview/dialog/Stylez.kt | 99 ++++++ .../mime/dualscreenview/dto/BookPageInfo.kt | 2 +- .../com/mime/dualscreenview/dto/PageInfo.kt | 32 +- .../dualscreenview/view/PagedTextLayout.kt | 4 +- .../webcontents/BaseWebContents.kt | 2 +- .../webcontents/BaseWebContentsViewer.kt | 2 +- .../webcontents/contentsinfo/Booktoki.kt | 2 +- app/src/main/res/drawable/history.png | Bin 0 -> 13708 bytes app/src/main/res/layout/dialog_stylesz.xml | 24 ++ app/src/main/res/layout/intro.xml | 6 +- app/src/main/res/layout/item_colorz.xml | 14 + app/src/main/res/values/strings.xml | 66 ++++ gradlew | 269 ++++++++------- gradlew.bat | 178 +++++----- 18 files changed, 719 insertions(+), 332 deletions(-) create mode 100644 app/src/main/java/com/mime/dualscreenview/common/Definez.kt create mode 100644 app/src/main/java/com/mime/dualscreenview/dialog/Stylez.kt create mode 100644 app/src/main/res/drawable/history.png create mode 100644 app/src/main/res/layout/dialog_stylesz.xml create mode 100644 app/src/main/res/layout/item_colorz.xml diff --git a/README.md b/README.md index 5ecbc27..d422e82 100644 --- a/README.md +++ b/README.md @@ -1 +1,4 @@ # tokkiz + + +resource from : https://www.flaticon.com/search/2?word=rotate&color=black&shape=fill diff --git a/app/src/main/java/com/mime/dualscreenview/activity/Base.kt b/app/src/main/java/com/mime/dualscreenview/activity/Base.kt index 10e1328..02dc36e 100644 --- a/app/src/main/java/com/mime/dualscreenview/activity/Base.kt +++ b/app/src/main/java/com/mime/dualscreenview/activity/Base.kt @@ -1,5 +1,6 @@ package com.mime.dualscreenview.activity +import android.content.res.Configuration import android.os.Handler import android.os.Looper import android.os.Message @@ -18,6 +19,12 @@ import android.view.KeyEvent.KEYCODE_VOLUME_UP import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import com.mime.dualscreenview.common.Blog +import com.mime.dualscreenview.dto.HistoryItem +import com.mime.dualscreenview.dto.LastInfo +import io.realm.kotlin.Realm +import io.realm.kotlin.RealmConfiguration +import io.realm.kotlin.types.BaseRealmObject +import kotlin.reflect.KClass open class Base : AppCompatActivity() { @@ -26,18 +33,6 @@ open class Base : AppCompatActivity() { override fun handleMessage(msg: Message) { super.handleMessage(msg) } -// -// override fun dispatchMessage(msg: Message) { -// super.dispatchMessage(msg) -// } -// -// override fun getMessageName(message: Message): String { -// return super.getMessageName(message) -// } -// -// override fun sendMessageAtTime(msg: Message, uptimeMillis: Long): Boolean { -// return super.sendMessageAtTime(msg, uptimeMillis) -// } } val baseHandler = BaseHandler() var didBackPress = false @@ -131,5 +126,12 @@ open class Base : AppCompatActivity() { return false } + fun openRealm() : Realm { + val clazz : Set> = setOf(LastInfo::class, HistoryItem::class) + val config = RealmConfiguration.Builder(clazz) + .schemaVersion(1) + .build() + return Realm.open(config) + } } \ No newline at end of file diff --git a/app/src/main/java/com/mime/dualscreenview/activity/Intro.kt b/app/src/main/java/com/mime/dualscreenview/activity/Intro.kt index aaa6178..c3ad83e 100644 --- a/app/src/main/java/com/mime/dualscreenview/activity/Intro.kt +++ b/app/src/main/java/com/mime/dualscreenview/activity/Intro.kt @@ -6,8 +6,8 @@ import android.content.DialogInterface import android.content.Intent import android.content.pm.ActivityInfo import android.content.res.Configuration -import android.graphics.Color import android.hardware.display.DisplayManager +import android.net.Uri import android.os.Build import android.os.Bundle import android.util.Log @@ -16,21 +16,21 @@ import android.view.View import android.view.View.* import android.webkit.WebView import android.widget.ArrayAdapter -import android.widget.Button import android.widget.ImageButton -import android.widget.LinearLayout import android.widget.ProgressBar import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AlertDialog import androidx.appcompat.widget.AppCompatButton -import androidx.constraintlayout.widget.ConstraintLayout -import androidx.core.view.updateLayoutParams import com.google.gson.Gson import com.lge.display.DisplayManagerHelper import com.mime.dualscreenview.R import com.mime.dualscreenview.common.Blog +import com.mime.dualscreenview.dialog.StyleSelectInterface +import com.mime.dualscreenview.dialog.Stylez +import com.mime.dualscreenview.dto.BookPageInfo import com.mime.dualscreenview.dto.BookPageInfos +import com.mime.dualscreenview.dto.HistoryItem import com.mime.dualscreenview.dto.LastInfo import com.mime.dualscreenview.view.PagedTextLayout import com.mime.dualscreenview.view.PagedTextViewInterface @@ -41,8 +41,13 @@ import com.mime.dualscreenview.webcontents.contentsinfo.Booktoki import com.mime.dualscreenview.webcontents.contentsinfo.GotoSomeWhere import io.realm.kotlin.Realm import io.realm.kotlin.RealmConfiguration +import io.realm.kotlin.UpdatePolicy import io.realm.kotlin.ext.copyFromRealm import io.realm.kotlin.ext.query +import java.lang.System.currentTimeMillis +import java.net.URI +import java.text.SimpleDateFormat +import java.util.Date class Intro : Base() , MainControllInterface, PagedTextViewInterface { @@ -60,18 +65,7 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { private lateinit var mBaseWebContentsViewer : BaseWebContentsViewer var lastInfo : LastInfo? = null - val colors = arrayOf>( - arrayOf("#E1F5FE", "#263238"), - arrayOf("#F0F4C3", "#37474F"), - arrayOf("#ECEFF1", "#455A64"), - arrayOf("#E0F7FA", "#263238"), - arrayOf("#F5F5F5", "#263238"), - arrayOf("#ECEFF1", "#263238"), - arrayOf("#F8BBD0", "#263238"), - arrayOf("#E6EE9C", "#455A64"), - arrayOf("#CFD8DC", "#455A64"), - arrayOf("#FFF59D", "#37474F") - ) + override fun onConfigurationChanged(newConfig: Configuration) { super.onConfigurationChanged(newConfig) @@ -80,10 +74,9 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { } override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - Blog.LOGD(log= "onCreate ${this::class.java.name} >> savedInstanceState ${savedInstanceState}") - setContentView(R.layout.intro) + mBaseWebContentsViewer = BaseWebContentsViewer(findViewById(R.id.menu_web),this) try { // Try to construct the DisplayMangerHelper. @@ -106,8 +99,15 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { findViewById(R.id.btn_list).setOnClickListener { v -> mBaseWebContentsViewer?.findListItem {result -> - var infos = Gson().fromJson(result, BookPageInfos::class.java) - showList(infos) + if (result != null && "null".equals(result) == false && result?.length ?: 0 > 10) { + try { + Gson().fromJson(result, BookPageInfos::class.java)?.let{ + showList(it) + } + } catch (e : Exception) { + + } + } } } @@ -117,32 +117,46 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { findViewById(R.id.btn_setting).setOnClickListener { v-> showStyleList() } + findViewById(R.id.btn_history).setOnClickListener { v-> + var realm = openRealm() + realm.query()?.find()?.let { + showHistory(realm.copyFromRealm(it)) + } + realm.close() + } findViewById(R.id.btn_home).setOnClickListener { v-> + pagedTextLayout?.visibility = GONE mBaseWebContentsViewer.loadContents(Booktoki()) } - val config = RealmConfiguration.Builder(setOf(LastInfo::class)).schemaVersion(1) - .build() - val realm = Realm.open(config) + } - try { - lastInfo = realm?.query()?.find()?.last()?.copyFromRealm() - } catch (e : Exception) { - + fun reloadLastInfo() { + val realm = openRealm() + try { lastInfo = realm?.query()?.find()?.last()?.copyFromRealm() } catch (e : Exception) { } + val configuration: Configuration = getResources().getConfiguration() + if(lastInfo != null && lastInfo?.displayOrientation != configuration.orientation) { + findViewById(R.id.btn_rotate).performClick() } - if (lastInfo != null) { - setRequestedOrientation(lastInfo!!.displayOrientation); - mBaseWebContentsViewer.loadLastInfo(lastInfo!!) - } else { - setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); - mBaseWebContentsViewer.loadContents(Booktoki()) - } - Blog.LOGD(log ="Successfully opened realm: ${realm.configuration.name}") realm.close() } + + fun reloadTo(lastInfo: LastInfo?) { + findViewById(R.id.menu_web)?.postDelayed({ + if (lastInfo != null) { + mBaseWebContentsViewer.loadLastInfo(lastInfo!!) + } else { + mBaseWebContentsViewer.loadContents(Booktoki()) + } + },200L) + } + override fun onResume() { + super.onResume() + reloadLastInfo() + reloadTo(lastInfo) + } fun switcvhOrient(){ - val windowManager = getSystemService(WINDOW_SERVICE) val configuration: Configuration = getResources().getConfiguration() setRequestedOrientation( if(configuration.orientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT) { ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE } @@ -150,9 +164,65 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { ) } + fun showHistory(infos: List) { + val builderSingle: AlertDialog.Builder = AlertDialog.Builder(this@Intro) + builderSingle.setTitle("${currentTitle} : ${currentChapter} -> Select One ") + val arrayAdapter = + ArrayAdapter(this@Intro, android.R.layout.select_dialog_singlechoice) + for (item in infos) { + arrayAdapter.addAll(item.title) + } + + + + builderSingle.setNegativeButton("cancel", + DialogInterface.OnClickListener { dialog, which -> dialog.dismiss() }) + + builderSingle.setAdapter(arrayAdapter, + DialogInterface.OnClickListener { dialog, which -> + val strName = arrayAdapter.getItem(which) + val item = infos.get(which) + val builderInner: AlertDialog.Builder = AlertDialog.Builder(this@Intro) + builderInner.setMessage(strName) + builderInner.setTitle("${infos.get(which).title}로 이동 고고!?") + builderInner.setPositiveButton("Ok", + DialogInterface.OnClickListener { + dialog, which -> + reloadTo(item.makeLastInfo()) + dialog.dismiss() + }) + builderInner.setNeutralButton("삭제", + DialogInterface.OnClickListener { + dialog, which -> + var realm = openRealm() + realm?.writeBlocking { + this.query().query("title == '${item.title}'", ).find()?.last()?.let{ + this.delete(it) + } + } + realm.close() + dialog.dismiss() + }) + builderInner.setNegativeButton("취소", + DialogInterface.OnClickListener { + dialog, which -> + dialog.dismiss() + }) + builderInner.show() + }) + var ddddd= builderSingle.create() + ddddd.setOnShowListener { d-> + (d as? AlertDialog)?.let{ + it.listView?.setSelection(currentChapter) + } + } + + ddddd.show() + } + fun showList(infos: BookPageInfos) { val builderSingle: AlertDialog.Builder = AlertDialog.Builder(this@Intro) - builderSingle.setTitle("Select One Name:-") + builderSingle.setTitle("${currentTitle} : ${currentChapter} -> Select One ") val arrayAdapter = ArrayAdapter(this@Intro, android.R.layout.select_dialog_singlechoice) arrayAdapter.addAll(infos.getTitleArray()) @@ -164,60 +234,51 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { builderSingle.setAdapter(arrayAdapter, DialogInterface.OnClickListener { dialog, which -> val strName = arrayAdapter.getItem(which) + val item = infos.list?.get(which) val builderInner: AlertDialog.Builder = AlertDialog.Builder(this@Intro) builderInner.setMessage(strName) builderInner.setTitle("Your Selected Item is") builderInner.setPositiveButton("Ok", - DialogInterface.OnClickListener { dialog, which -> dialog.dismiss() }) + DialogInterface.OnClickListener { dialog, which -> +// mBaseWebContentsViewer?.webview?.loadUrl() + moveTo(item) + dialog.dismiss() + } + ) builderInner.show() }) var ddddd= builderSingle.create() ddddd.setOnShowListener { d-> (d as? AlertDialog)?.let{ - it.listView?.smoothScrollToPosition(currentChapter) + it.listView?.setSelection(currentChapter) } } ddddd.show() } - fun showStyleList() { - val builderSingle: AlertDialog.Builder = AlertDialog.Builder(this@Intro) - builderSingle.setTitle("Select One Name:-") - val arrayAdapter = - ArrayAdapter(this@Intro, android.R.layout.select_dialog_singlechoice) - var styleNum = 1; - for (a in colors) { - arrayAdapter.add("스타일 ${styleNum}") - styleNum = styleNum.inc() - } - - - builderSingle.setNegativeButton("cancel", - DialogInterface.OnClickListener { dialog, which -> dialog.dismiss() }) - - builderSingle.setAdapter(arrayAdapter, - DialogInterface.OnClickListener { dialog, which -> - val color = colors.get(which) - val builderInner: AlertDialog.Builder = AlertDialog.Builder(this@Intro) - builderInner.setMessage("스타일 ${which + 1}") - - builderInner.setTitle("Your Selected Item is") - builderInner.setPositiveButton("Ok", - DialogInterface.OnClickListener { dialog, which -> dialog.dismiss() - pg?.setColorStyle(color) - findViewById(R.id.intro_bg).setBackgroundColor(Color.parseColor(color.get(1))) - }) - builderInner.show() - }) - var ddddd= builderSingle.create() - ddddd.setOnShowListener { d-> - (d as? AlertDialog)?.let{ - it.listView?.smoothScrollToPosition(currentChapter) + private fun moveTo(item: BookPageInfo?) { + item?.link?.let {newPath -> + mBaseWebContentsViewer?.webview?.url?.let{currentUrl -> + Uri.parse(currentUrl)?.lastPathSegment?.let { + currentUrl.replace(it,newPath)?.let { + mBaseWebContentsViewer?.webview?.loadUrl(it) + } + } } } - ddddd.show() + + } + + fun showStyleList() { + var mStylez = Stylez(this@Intro) + mStylez.styleSelectInterface = object : StyleSelectInterface { + override fun onSelectStyle(bgColor: String, textColor: String) { + pagedTextLayout?.setColorStyle(arrayOf(textColor,bgColor)) + } + } + mStylez.show() } @@ -339,7 +400,7 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { } } } - var pg : PagedTextLayout? = null; + var pagedTextLayout : PagedTextLayout? = null; var onNextClickAction: GotoSomeWhere? = null override fun showNextBtn(find : Boolean , onClickAction: GotoSomeWhere) { @@ -354,9 +415,9 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { } fun actionNextEvent() { - if (pg != null && pg!!.visibility == View.VISIBLE && pg!!.size() > 0 && (pg!!.current() < pg!!.size() - 1) ) { - pg!!.doNext() - updateLastInfo(pg!!) + if (pagedTextLayout != null && pagedTextLayout!!.visibility == View.VISIBLE && pagedTextLayout!!.size() > 0 && (pagedTextLayout!!.current() < pagedTextLayout!!.size() - 1) ) { + pagedTextLayout!!.doNext() + updateLastInfo(pagedTextLayout!!) }else { onNextClickAction?.let { it() } } @@ -375,9 +436,9 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { fun actionPrevEvent() { - if (pg != null && pg!!.visibility == View.VISIBLE && pg!!.size() > 0 && pg!!.current() > 0 ) { - pg!!.doPrev() - updateLastInfo(pg!!) + if (pagedTextLayout != null && pagedTextLayout!!.visibility == View.VISIBLE && pagedTextLayout!!.size() > 0 && pagedTextLayout!!.current() > 0 ) { + pagedTextLayout!!.doPrev() + updateLastInfo(pagedTextLayout!!) } else { onPrevClickAction?.let{ it() } } @@ -407,10 +468,8 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { firstBackPress() return } - + finish() didBackPress = false - - super.onBackPressed() } @@ -419,19 +478,19 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { } override fun onLoadedContents(contents: String) { - pg = null; + pagedTextLayout = null; findViewById(R.id.paged_layer).apply { if (contents != null) { - pg = this + pagedTextLayout = this visibility = VISIBLE mPagedTextViewInterface = this@Intro setText(contents.replace("\\n", System.getProperty("line.separator"))) setTextSize(22f) if(lastInfo != null && lastInfo!!.pageUrl.equals(mBaseWebContentsViewer.webview.url)) { this@Intro.findViewById(R.id.progress)?.visibility = VISIBLE - pg?.postDelayed({ + pagedTextLayout?.postDelayed({ next(lastInfo!!.pageIndex) - pg?.post { + pagedTextLayout?.post { this@Intro.findViewById(R.id.progress)?.visibility = GONE } },1000) @@ -452,10 +511,21 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { Blog.LOGI(TAG,"onFindTitle >> " + contents + " ::: ${testRegex.replace(contents,"")}") if(contents.contains("-")) { currentTitle = contents.split("-")[0] - currentChapter = testRegex.replace(contents.split("-")[1],"").toInt() + try { + currentChapter = testRegex.replace(contents.split("-")[1],"").toInt() + } catch (e : Exception) { + currentChapter = 0 + } + } else if(testRegex.replace(contents,"").length > 0){ + currentChapter = testRegex.replace(contents,"").toInt() + currentTitle = contents.split(testRegex.replace(contents,""))[0] + } else { + val dateFormat = "yyyyMMdd-HH" + val date = Date(currentTimeMillis()) + val simpleDateFormat = SimpleDateFormat(dateFormat) + currentTitle = simpleDateFormat.format(date) } - } override fun onStartLoad() { @@ -463,39 +533,54 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { } override fun completePageLoad(lastInfo: LastInfo) { - if(this.lastInfo == null || !(this.lastInfo?.pageUrl.equals(lastInfo?.pageUrl))) { + val configuration: Configuration = getResources().getConfiguration() + + if(this.lastInfo == null || !(this.lastInfo?.pageUrl.equals(lastInfo?.pageUrl)) || this.lastInfo?.displayOrientation != configuration?.orientation) { + lastInfo.displayOrientation = configuration?.orientation ?: ActivityInfo.SCREEN_ORIENTATION_PORTRAIT saveLastInfo(lastInfo) } findViewById(R.id.progress).visibility = GONE } fun saveLastInfo(lastInfo: LastInfo) { - val windowManager = getSystemService(WINDOW_SERVICE) - val configuration: Configuration = getResources().getConfiguration() - val config = RealmConfiguration.Builder(setOf(LastInfo::class)) - .schemaVersion(1) - .build() - val realm = Realm.open(config) - realm.writeBlocking { - lastInfo.displayOrientation = configuration.orientation - copyToRealm(lastInfo) + val realm = openRealm() + if((realm.query()?.count()?.find() ?: 0) > 0) { + realm.writeBlocking { + this.query()?.find()?.last()?.let{ + it.pageUrl = lastInfo.pageUrl + it.title = currentTitle + it.chapter = currentChapter + it.pageIndex = lastInfo.pageIndex + it.contentsName = lastInfo.contentsName + it.displayOrientation = lastInfo.displayOrientation + this@Intro.lastInfo = copyFromRealm(it) + } + } + } else { + realm.writeBlocking { + copyToRealm(lastInfo) + } } Blog.LOGD(log ="Successfully opened realm: ${realm.configuration.name}") realm.close() } fun updateLastInfo(pagedTextLayout: PagedTextLayout) { - val windowManager = getSystemService(WINDOW_SERVICE) val configuration: Configuration = getResources().getConfiguration() - val config = RealmConfiguration.Builder(setOf(LastInfo::class)) - .schemaVersion(1) - .build() - val realm = Realm.open(config) - + val realm = openRealm() realm.writeBlocking { - var info = this.query()?.find()?.last() - info?.pageIndex = pagedTextLayout.current() - info?.displayOrientation = configuration.orientation + this.query()?.find()?.last()?.let{ + it.displayOrientation = configuration.orientation + it.title = currentTitle + it.chapter = currentChapter + it.pageIndex = pagedTextLayout.current() + this@Intro.lastInfo = copyFromRealm(it) + } + if (currentTitle.length > 0 && currentChapter > 0) { + this@Intro.lastInfo?.makeHistoryItem()?.let{ + copyToRealm(it, UpdatePolicy.ALL) + } + } } Blog.LOGD(log ="Successfully opened realm: ${realm.configuration.name}") @@ -522,7 +607,7 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { findViewById(R.id.textView).visibility = VISIBLE findViewById(R.id.btn_home).visibility = VISIBLE findViewById(R.id.btn_list).visibility = VISIBLE - findViewById(R.id.btn_menu).visibility = VISIBLE + findViewById(R.id.btn_history).visibility = VISIBLE findViewById(R.id.btn_rotate).visibility = VISIBLE } @@ -561,7 +646,7 @@ class Intro : Base() , MainControllInterface, PagedTextViewInterface { findViewById(R.id.textView).visibility = GONE findViewById(R.id.btn_home).visibility = GONE findViewById(R.id.btn_list).visibility = GONE - findViewById(R.id.btn_menu).visibility = GONE + findViewById(R.id.btn_history).visibility = GONE findViewById(R.id.btn_rotate).visibility = GONE } diff --git a/app/src/main/java/com/mime/dualscreenview/common/Definez.kt b/app/src/main/java/com/mime/dualscreenview/common/Definez.kt new file mode 100644 index 0000000..812d0ad --- /dev/null +++ b/app/src/main/java/com/mime/dualscreenview/common/Definez.kt @@ -0,0 +1,15 @@ +package com.mime.dualscreenview.common + + +val colorz = arrayOf>( + arrayOf("#E1F5FE", "#263238"), + arrayOf("#F0F4C3", "#37474F"), + arrayOf("#ECEFF1", "#455A64"), + arrayOf("#E0F7FA", "#263238"), + arrayOf("#F5F5F5", "#263238"), + arrayOf("#ECEFF1", "#263238"), + arrayOf("#F8BBD0", "#263238"), + arrayOf("#E6EE9C", "#455A64"), + arrayOf("#CFD8DC", "#455A64"), + arrayOf("#FFF59D", "#37474F") +) \ No newline at end of file diff --git a/app/src/main/java/com/mime/dualscreenview/dialog/Stylez.kt b/app/src/main/java/com/mime/dualscreenview/dialog/Stylez.kt new file mode 100644 index 0000000..7bad35b --- /dev/null +++ b/app/src/main/java/com/mime/dualscreenview/dialog/Stylez.kt @@ -0,0 +1,99 @@ +package com.mime.dualscreenview.dialog + +import android.app.Dialog +import android.content.Context +import android.content.DialogInterface +import android.graphics.Color +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.Window +import android.widget.TextView +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.mime.dualscreenview.R +import com.mime.dualscreenview.common.colorz +import kotlin.random.Random + +interface StyleSelectInterface { + fun onSelectStyle(bgColor : String, textColor : String) +} +class Stylez : Dialog { + constructor(context: Context) : super(context) {initView(context)} + constructor(context: Context, themeResId: Int) : super(context, themeResId) {initView(context)} + constructor( + context: Context, + cancelable: Boolean, + cancelListener: DialogInterface.OnCancelListener? + ) : super(context, cancelable, cancelListener) {initView(context)} + + var styleSelectInterface : StyleSelectInterface? = null + + fun initView(context: Context) { + + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + this.requestWindowFeature(Window.FEATURE_NO_TITLE); + setCancelable(true) + setContentView(R.layout.dialog_stylesz) + val recyclerView: RecyclerView = findViewById(R.id.stylez_recyclerview) + val adapterRe = AdapterRe(context, colorz) + recyclerView.adapter = adapterRe + recyclerView.layoutManager = + GridLayoutManager(context, 2, GridLayoutManager.VERTICAL, false) + } + + inner class AdapterRe(ctx: Context, myImageNameList: Array>) : + RecyclerView.Adapter() { + private val inflater: LayoutInflater + private val myImageNameList: Array> + private val ctx : Context + init { + inflater = LayoutInflater.from(ctx) + this.ctx = ctx + this.myImageNameList = myImageNameList + } + + override fun onCreateViewHolder ( + parent: ViewGroup, + viewType: Int + ): StylezViewHolder { + val view: View = inflater.inflate(R.layout.item_colorz, parent, false) + return StylezViewHolder(view) + } + + override fun onBindViewHolder(holder: StylezViewHolder, position: Int) { + var colorz = myImageNameList.get(position) + var sampleTextz = ctx.resources.getStringArray(R.array.sample_textz) + holder?.setStyle(bgColor = colorz.get(1), textColor = colorz.get(0),sampleTextz.get(Random.nextInt(9876) % sampleTextz.size)) + } + + + override fun getItemCount(): Int { + return myImageNameList.size + } + + } + + inner class StylezViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { + var textView: TextView + var bg : View + init { + textView = itemView.findViewById(R.id.textview_sample) + bg = itemView.findViewById(R.id.bg_sample) + } + fun setStyle(bgColor : String, textColor : String, sampleText : String ) { + bg.setBackgroundColor(Color.parseColor(bgColor)) + textView.setTextColor(Color.parseColor(textColor)) + textView.text = sampleText + itemView?.setOnClickListener { v -> + styleSelectInterface?.onSelectStyle(bgColor,textColor) + dismiss() + } + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/mime/dualscreenview/dto/BookPageInfo.kt b/app/src/main/java/com/mime/dualscreenview/dto/BookPageInfo.kt index 9d538c9..e44fb4d 100644 --- a/app/src/main/java/com/mime/dualscreenview/dto/BookPageInfo.kt +++ b/app/src/main/java/com/mime/dualscreenview/dto/BookPageInfo.kt @@ -11,5 +11,5 @@ var list : ArrayList? = null } class BookPageInfo { var title : String? = "" - var lastPath : String? = "" + var link : String? = "" } \ No newline at end of file diff --git a/app/src/main/java/com/mime/dualscreenview/dto/PageInfo.kt b/app/src/main/java/com/mime/dualscreenview/dto/PageInfo.kt index d2c8024..709e96b 100644 --- a/app/src/main/java/com/mime/dualscreenview/dto/PageInfo.kt +++ b/app/src/main/java/com/mime/dualscreenview/dto/PageInfo.kt @@ -7,15 +7,43 @@ import org.mongodb.kbson.ObjectId class LastInfo() : RealmObject { + @PrimaryKey var _id : String = "UniqLastId" var pageUrl : String = "" var title : String = "" - var contentsData : String = "" + var chapter : Int = 0 var pageIndex : Int = 0 var contentsName : String = "" var displayOrientation : Int = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT -} + fun makeHistoryItem() : HistoryItem = HistoryItem().apply { + title = this@LastInfo.title + pageUrl = this@LastInfo.pageUrl + chapter = this@LastInfo.chapter + pageIndex = this@LastInfo.pageIndex + contentsName = this@LastInfo.contentsName + displayOrientation = this@LastInfo.displayOrientation + } +} +class HistoryItem() : RealmObject { + @PrimaryKey + var title : String = "" + var pageUrl : String = "" + var chapter : Int = 0 + var pageIndex : Int = 0 + var contentsName : String = "" + var displayOrientation : Int = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT + + fun makeLastInfo() = LastInfo().apply{ + _id = "UniqLastId" + title = this@HistoryItem.title + pageUrl = this@HistoryItem.pageUrl + chapter = this@HistoryItem.chapter + pageIndex = this@HistoryItem.pageIndex + contentsName = this@HistoryItem.contentsName + displayOrientation = this@HistoryItem.displayOrientation + } +} class Bookmark() : RealmObject { @PrimaryKey var pageUrl : String = "" diff --git a/app/src/main/java/com/mime/dualscreenview/view/PagedTextLayout.kt b/app/src/main/java/com/mime/dualscreenview/view/PagedTextLayout.kt index ed1b8c6..36e1eae 100644 --- a/app/src/main/java/com/mime/dualscreenview/view/PagedTextLayout.kt +++ b/app/src/main/java/com/mime/dualscreenview/view/PagedTextLayout.kt @@ -66,7 +66,9 @@ class PagedTextLayout : ConstraintLayout , PagedTextGenerateInterface { var isCenterTouch = TouchArea.Center.equals(touchArea) hanler.removeCallbacks(touchTimeover) mPagedTextViewInterface?.onTouch(touchArea) - hanler?.postDelayed(touchTimeover, 3000L) + if(isCenterTouch) { + hanler?.postDelayed(touchTimeover, 3000L) + } } }) } diff --git a/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContents.kt b/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContents.kt index 5f93fb0..f0e45b9 100644 --- a/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContents.kt +++ b/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContents.kt @@ -8,7 +8,7 @@ import com.mime.dualscreenview.webcontents.contentsinfo.DidFindContents abstract class BaseWebContents : ContentsInfoInterface { - var lastNumber : Int = 221 + open var lastNumber : Int = 221 var completeAction : ActionByBool? = null val definedActionCount = 5 var completeActionCount = 0 diff --git a/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContentsViewer.kt b/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContentsViewer.kt index e11a676..9ce9a99 100644 --- a/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContentsViewer.kt +++ b/app/src/main/java/com/mime/dualscreenview/webcontents/BaseWebContentsViewer.kt @@ -143,7 +143,7 @@ open class BaseWebContentsViewer { currentContentsProvider?.doOnloaded(it , { result -> result?.let { mainControllInterface.onLoadedContents(it) } } , { - it?.let { mainControllInterface.onFindTitle(it) } + it?.let { mainControllInterface.onFindTitle(it.replace("\"","")) } }, {btn -> mainControllInterface?.showNextBtn (btn != null){ webview?.evaluateJavascript("if(document.getElementById('${currentContentsProvider!!.getNextButtonJs()}') != null) document.getElementById('${currentContentsProvider!!.getNextButtonJs()}').click()") { diff --git a/app/src/main/java/com/mime/dualscreenview/webcontents/contentsinfo/Booktoki.kt b/app/src/main/java/com/mime/dualscreenview/webcontents/contentsinfo/Booktoki.kt index b1fa5c3..d3446df 100644 --- a/app/src/main/java/com/mime/dualscreenview/webcontents/contentsinfo/Booktoki.kt +++ b/app/src/main/java/com/mime/dualscreenview/webcontents/contentsinfo/Booktoki.kt @@ -4,7 +4,7 @@ import com.mime.dualscreenview.webcontents.BaseWebContents class Booktoki : BaseWebContents() { - + override var lastNumber : Int = 222 override fun getWebcontentsName(): String { return "Booktoki" diff --git a/app/src/main/res/drawable/history.png b/app/src/main/res/drawable/history.png new file mode 100644 index 0000000000000000000000000000000000000000..15fb4f7e5da01e56ba62f3af71cde1a30eac79d1 GIT binary patch literal 13708 zcmY*=c|4Tg+y8yfV6qL0tYaNyS6Rotn`F(FC0fK}n;1)onN*~*45e&|QBjucWV!pa zXtPaizZnFKsXb8eS+WH6gMBX_D2E{2h-joB8$0>1#qk^EgxHwHxL}>KU z!{i{%$f)4L@5T}kBnuI(E!^Xa=EmbX{5^`7emEys+AHL_SVhV^T60*asLmKrc?<}9 zviM(4rv?=r5s#6=#e6gUxvTl4V2_ZkyZIB>j5D&G`{r-9KyrezpI43+8@HV;{PZDu z@k4jh;zmb6?eBJd+P9ybQzg-FBWpX~jvmc!58A1Xy@uTnz2#CuAD}i-iH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og_stylesz.xml new file mode 100644 index 0000000..c22644f --- /dev/null +++ b/app/src/main/res/layout/dialog_stylesz.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/intro.xml b/app/src/main/res/layout/intro.xml index 6f0b89d..d7cc571 100644 --- a/app/src/main/res/layout/intro.xml +++ b/app/src/main/res/layout/intro.xml @@ -80,18 +80,18 @@ android:background="#8FFF" app:layout_constraintTop_toTopOf="parent" app:layout_constraintLeft_toRightOf="@id/btn_list" - app:layout_constraintRight_toLeftOf="@+id/btn_menu" + app:layout_constraintRight_toLeftOf="@+id/btn_history" app:layout_constraintHorizontal_chainStyle="spread_inside" /> + + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 443bce2..feb9060 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,4 +2,70 @@ DualScreenView 화면 옮 기 기 it\'s 두번째화면 + + + 여섯글자마다 방점을찍어놔 + 가사관찰하다 반쯤놓치거나 + 해석잘안되면 몇번돌리든가 + 이건이를테면 덤비는리듬과 + 손묶인채붙는 일종의노름판 + 신도구제불능 내가물오른밤 + 감방에날가둬 내가패를까도 + 가난한니네가 판돈잃지않게 + 나하고니네가 의견일치한게 + 아마처음일걸 그마저운일걸 + 존나좋음이퀄 내중저음일걸 + 이배열어쩌면 너에대한배려 + 너에겐어쩌면 언어적배리어 + 그럼넌글렀어 지망생여기에 + 잠들다글로써 훗날니묘비에 + For sale my rhymes never used + For sale my rhymes never used + 판매자바로너 니가씨발오너 + For sale my rhymes never used + 노예처럼일해서왕처럼지배 + 성탄처럼지내설탕뿌려위에 + 성공을말했기에난그길위에 + 선딱그어이젠자봐주의깊게 + 멈칫할시간도없는듯써내려 + 활자로활짝갠곳에돈비내려 + 초라한핀조명과낮은무대위 + 목표를조준하기에충분했지 + 시인의신이될준비는치밀해 + 흘러군침이계속이기기위해 + 처음시작했던이유따윈잊어 + 맨발맨손으로역사들을빚어 + 미안해난비션갖고와내기적 + 자음모음이어리듬위에띄어 + 금은보화이쁜걸로손에끼워 + Uh she suckin\' my soul like + De La to the Soul + I shout out to the Rhonda + But before I\'m sober + 변태는 변태인데 underground 모범생 + 맨날 난 오덕 돼 활자에 꼬여 + 내 팔자도 고쳐낼 하나의 초월체를 + 만들려 고쳐댄 rhyme들만 몇 truck 돼 + 그러다 깨어나 여기에 + 빼어난 묘기에 없네 기본기 + 내 눈엔 수명이 대본처럼 읽히네 + 뭐처럼 비치네 뭐처럼 비치네 + Fuck all of ya list man + If it ain\'t Forbes list mayne + Your wristwatch cheaper than + My profile picture damn + Picture the future and + 믿어 like it\'s happend + Big ass house foreign cars have several + 미녀 fine ass apple hip 내 옆에 같이 태우고 + Top of the top으로 가 죽어야 들어 잠은 + 넌 안 죽었다는 척 + 갖은 폼 잡으면 뭐하냐 + 좆밥들 또 반년만 가면 쏙 + 다 들어가는 거 다 보여 + 내 눈엔 너가 금방 죽어 + 다음 무덤 안 들어갈 주검 + 한 우물 파는 넌 밟고서 + 땅을 쳐봐 내 발자국을 + \ No newline at end of file diff --git a/gradlew b/gradlew index 4f906e0..1b6c787 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ -#!/usr/bin/env sh +#!/bin/sh # -# Copyright 2015 the original author or authors. +# Copyright © 2015-2021 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,67 +17,101 @@ # ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar @@ -87,9 +121,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -98,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -106,80 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 107acd3..ac1b06f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,89 +1,89 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega