pull/34/head
kunfei 5 years ago
parent 3875f046fc
commit 0d6f48246f
  1. 7
      app/src/main/java/io/legado/app/help/storage/WebDavHelp.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugActivity.kt
  3. 5
      app/src/main/java/io/legado/app/ui/book/source/debug/SourceDebugAdapter.kt
  4. 4
      app/src/main/java/io/legado/app/ui/book/source/edit/SourceEditActivity.kt
  5. 0
      app/src/main/res/layout/activity_book_source_debug.xml
  6. 0
      app/src/main/res/layout/activity_book_source_edit.xml
  7. 0
      app/src/main/res/layout/item_log.xml

@ -88,10 +88,9 @@ object WebDavHelp {
FileHelp.deleteFile(zipFilePath) FileHelp.deleteFile(zipFilePath)
if (ZipUtils.zipFiles(paths, zipFilePath)) { if (ZipUtils.zipFiles(paths, zipFilePath)) {
WebDav(getWebDavUrl() + "legado").makeAsDir() WebDav(getWebDavUrl() + "legado").makeAsDir()
val putUrl = getWebDavUrl() + "legado/backup" + SimpleDateFormat( val putUrl = getWebDavUrl() + "legado/backup" +
"yyyy-MM-dd", SimpleDateFormat("yyyy-MM-dd", Locale.getDefault())
Locale.getDefault() .format(Date(System.currentTimeMillis())) + ".zip"
).format(Date(System.currentTimeMillis())) + ".zip"
WebDav(putUrl).upload(zipFilePath) WebDav(putUrl).upload(zipFilePath)
} }
} }

@ -12,13 +12,13 @@ import io.legado.app.lib.theme.ATH
import io.legado.app.lib.theme.accentColor import io.legado.app.lib.theme.accentColor
import io.legado.app.ui.qrcode.QrCodeActivity import io.legado.app.ui.qrcode.QrCodeActivity
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_source_debug.* import kotlinx.android.synthetic.main.activity_book_source_debug.*
import kotlinx.android.synthetic.main.view_search.* import kotlinx.android.synthetic.main.view_search.*
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.jetbrains.anko.startActivityForResult import org.jetbrains.anko.startActivityForResult
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_source_debug) { class SourceDebugActivity : VMBaseActivity<SourceDebugModel>(R.layout.activity_book_source_debug) {
override val viewModel: SourceDebugModel override val viewModel: SourceDebugModel
get() = getViewModel(SourceDebugModel::class.java) get() = getViewModel(SourceDebugModel::class.java)

@ -4,9 +4,10 @@ import android.content.Context
import io.legado.app.R import io.legado.app.R
import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.ItemViewHolder
import io.legado.app.base.adapter.SimpleRecyclerAdapter import io.legado.app.base.adapter.SimpleRecyclerAdapter
import kotlinx.android.synthetic.main.item_source_debug.view.* import kotlinx.android.synthetic.main.item_log.view.*
class SourceDebugAdapter(context: Context) : SimpleRecyclerAdapter<String>(context, R.layout.item_source_debug) { class SourceDebugAdapter(context: Context) :
SimpleRecyclerAdapter<String>(context, R.layout.item_log) {
override fun convert(holder: ItemViewHolder, item: String, payloads: MutableList<Any>) { override fun convert(holder: ItemViewHolder, item: String, payloads: MutableList<Any>) {
holder.itemView.apply { holder.itemView.apply {
text_view.text = item text_view.text = item

@ -24,14 +24,14 @@ import io.legado.app.ui.book.source.debug.SourceDebugActivity
import io.legado.app.ui.widget.KeyboardToolPop import io.legado.app.ui.widget.KeyboardToolPop
import io.legado.app.utils.GSON import io.legado.app.utils.GSON
import io.legado.app.utils.getViewModel import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_source_edit.* import kotlinx.android.synthetic.main.activity_book_source_edit.*
import org.jetbrains.anko.displayMetrics import org.jetbrains.anko.displayMetrics
import org.jetbrains.anko.startActivity import org.jetbrains.anko.startActivity
import org.jetbrains.anko.toast import org.jetbrains.anko.toast
import kotlin.math.abs import kotlin.math.abs
class SourceEditActivity : class SourceEditActivity :
VMBaseActivity<SourceEditViewModel>(R.layout.activity_source_edit, false), VMBaseActivity<SourceEditViewModel>(R.layout.activity_book_source_edit, false),
KeyboardToolPop.OnClickListener { KeyboardToolPop.OnClickListener {
override val viewModel: SourceEditViewModel override val viewModel: SourceEditViewModel
get() = getViewModel(SourceEditViewModel::class.java) get() = getViewModel(SourceEditViewModel::class.java)

Loading…
Cancel
Save