@@ -4,7 +4,6 @@ import android.animation.Animator
|
||||
import android.animation.AnimatorListenerAdapter
|
||||
import android.content.Intent
|
||||
import android.os.*
|
||||
import android.util.Log
|
||||
import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
@@ -259,7 +258,6 @@ class MainActivity : BaseActivity() {
|
||||
|
||||
//执行搜索
|
||||
private fun searchAction(tags: String?) {
|
||||
Log.e("num",tags.toString())
|
||||
var tag = tags
|
||||
var isNum = true
|
||||
try {
|
||||
@@ -283,8 +281,6 @@ class MainActivity : BaseActivity() {
|
||||
//缓存搜索的tags
|
||||
this.tags = tags
|
||||
|
||||
Log.e(TAG,"now page is $page")
|
||||
|
||||
val swipeRefreshLayout =
|
||||
findViewById<androidx.swiperefreshlayout.widget.SwipeRefreshLayout>(
|
||||
R.id.swipeRefreshLayout
|
||||
|
||||
@@ -63,7 +63,6 @@ class PostAdapter(val context: Context, private var postYandList: ArrayList<Post
|
||||
if (file_ext == null){
|
||||
val strarr = postYandList[position].sample_url.split(".")
|
||||
file_ext = strarr[strarr.lastIndex]
|
||||
Log.e("file_ext",file_ext)
|
||||
}
|
||||
|
||||
PicActivity.actionStartActivity(context,postYandList[position].id,postYandList[position].sample_url,
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.os.*
|
||||
import android.util.Log
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.LinearLayout
|
||||
@@ -200,7 +199,7 @@ class PicActivity : BaseActivity() {
|
||||
isFirstResource: Boolean
|
||||
): Boolean {
|
||||
if (e != null) {
|
||||
Log.e("Pic", e.stackTraceToString())
|
||||
e.printStackTrace()
|
||||
}
|
||||
val pb = findViewById<ProgressBar>(R.id.pb)
|
||||
Snackbar.make(pb, R.string.toast_load_fail, Snackbar.LENGTH_LONG).setAction(R.string.button_check) {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.lsp.view.activity.pic
|
||||
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -24,7 +23,6 @@ class SizeAdapter(val tagList: List<Size>) : RecyclerView.Adapter<SizeAdapter.Vi
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val tag = tagList[position]
|
||||
Log.e("size", tag.file_size)
|
||||
if (position == 0) {
|
||||
holder.tagText.text = tag.file_size
|
||||
holder.tagText.setBackgroundResource(R.drawable.title_bg)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.lsp.view.retrofit
|
||||
|
||||
import android.util.Log
|
||||
import retrofit2.Retrofit
|
||||
import retrofit2.converter.gson.GsonConverterFactory
|
||||
|
||||
@@ -18,7 +17,6 @@ object ServiceCreator {
|
||||
.baseUrl(source)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.build()
|
||||
Log.e("Post", source)
|
||||
ServiceCreator.source = source
|
||||
return retrofit.create(serviceClass)
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.media.MediaScannerConnection
|
||||
import android.os.*
|
||||
import android.util.Log
|
||||
import com.lsp.view.util.CallBackStatus
|
||||
import okhttp3.OkHttpClient
|
||||
import okhttp3.Request
|
||||
@@ -40,7 +39,6 @@ class DownloadService : Service() {
|
||||
|
||||
if (file.exists()){
|
||||
callBack(handler,CallBackStatus.FILEEXISTS)
|
||||
Log.e("callback","文件存在")
|
||||
return@thread
|
||||
}
|
||||
|
||||
@@ -71,7 +69,6 @@ class DownloadService : Service() {
|
||||
return@thread
|
||||
|
||||
} else {
|
||||
Log.e("Test", "errorNet")
|
||||
file.delete()
|
||||
callBack(handler, CallBackStatus.NETWORKERROR)
|
||||
return@thread
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.os.Message
|
||||
import android.widget.Toast
|
||||
import androidx.core.content.FileProvider
|
||||
import com.bumptech.glide.Glide
|
||||
import com.lsp.view.R
|
||||
import com.lsp.view.YandViewApplication
|
||||
import java.io.File
|
||||
import kotlin.concurrent.thread
|
||||
@@ -45,7 +46,7 @@ object Util {
|
||||
shareIntent.type = "image/*"
|
||||
shareIntent.putExtra(Intent.EXTRA_STREAM,imageUri)
|
||||
|
||||
val intent = Intent.createChooser(shareIntent,"分享")
|
||||
val intent = Intent.createChooser(shareIntent,R.string.title_share.toString())
|
||||
|
||||
val resInfoList: List<ResolveInfo> = context.packageManager
|
||||
.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY)
|
||||
@@ -65,7 +66,7 @@ object Util {
|
||||
}
|
||||
|
||||
fun download(file_url: String?, file_ext: String?,md5: String?){
|
||||
Toast.makeText(YandViewApplication.context, "开始保存", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(YandViewApplication.context, R.string.toast_download_start, Toast.LENGTH_SHORT).show()
|
||||
|
||||
if (file_url != null) {
|
||||
if (file_ext != null) {
|
||||
@@ -79,19 +80,19 @@ object Util {
|
||||
super.handleMessage(msg)
|
||||
when(msg.what){
|
||||
CallBackStatus.OK.ordinal ->{
|
||||
Toast.makeText(YandViewApplication.context, "保存成功", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(YandViewApplication.context, R.string.toast_download_success, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
|
||||
CallBackStatus.DOWNLOADERROR.ordinal -> {
|
||||
Toast.makeText(YandViewApplication.context, "下载异常", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(YandViewApplication.context, R.string.toast_download_fail, Toast.LENGTH_SHORT).show()
|
||||
|
||||
}
|
||||
CallBackStatus.MD5COMPAREERROR.ordinal -> {
|
||||
Toast.makeText(YandViewApplication.context, "文件下载异常,MD5对比失败", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(YandViewApplication.context, R.string.toast_compar_md5_fail, Toast.LENGTH_SHORT).show()
|
||||
|
||||
}
|
||||
CallBackStatus.FILEEXISTS.ordinal -> {
|
||||
Toast.makeText(YandViewApplication.context, "文件已经存在", Toast.LENGTH_SHORT).show()
|
||||
Toast.makeText(YandViewApplication.context, R.string.toast_file_exist, Toast.LENGTH_SHORT).show()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,10 @@
|
||||
<string name="title_setting_load_source">加载源</string>
|
||||
<string name="toast_tag_add_fav">收藏了新的标签</string>
|
||||
<string name="toast_tag_exist">收藏过了哦</string>
|
||||
<string name="toast_download_success">下载成功</string>
|
||||
<string name="toast_download_fail">下载失败</string>
|
||||
<string name="toast_compar_md5_fail">MD5对比失败</string>
|
||||
<string name="toast_file_exist">文件已经存在</string>
|
||||
<string name="toast_download_start">开始下载</string>
|
||||
<string name="title_share">分享</string>
|
||||
</resources>
|
||||
@@ -23,4 +23,10 @@
|
||||
<string name="title_setting_load_source">Load source</string>
|
||||
<string name="toast_tag_add_fav">Add to new favorites</string>
|
||||
<string name="toast_tag_exist">This tag exist</string>
|
||||
<string name="toast_download_success">Successfully download</string>
|
||||
<string name="toast_download_fail">Download failed</string>
|
||||
<string name="toast_compar_md5_fail">MD5 comparison failed</string>
|
||||
<string name="toast_file_exist">File exists</string>
|
||||
<string name="toast_download_start">Start download</string>
|
||||
<string name="title_share">Share</string>
|
||||
</resources>
|
||||
Reference in New Issue
Block a user