diff --git a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt index b557db80..cb675384 100644 --- a/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt +++ b/V2rayNG/app/src/main/kotlin/com/v2ray/ang/ui/MainRecyclerAdapter.kt @@ -9,10 +9,12 @@ import com.v2ray.ang.AppConfig import com.v2ray.ang.R import com.v2ray.ang.dto.AngConfig import com.v2ray.ang.dto.EConfigType +import com.v2ray.ang.extension.defaultDPreference import com.v2ray.ang.helper.ItemTouchHelperAdapter import com.v2ray.ang.helper.ItemTouchHelperViewHolder import com.v2ray.ang.util.AngConfigManager import com.v2ray.ang.util.Utils +import com.v2ray.ang.util.V2rayConfigUtil import kotlinx.android.synthetic.main.item_qrcode.view.* import kotlinx.android.synthetic.main.item_recycler_main.view.* import org.jetbrains.anko.* @@ -67,31 +69,40 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter + mActivity.selector(null, shareOptions) { dialogInterface, i -> try { when (i) { 0 -> { - val iv = mActivity.layoutInflater.inflate(R.layout.item_qrcode, null) - iv.iv_qcode.setImageBitmap(AngConfigManager.share2QRCode(position)) + if (configType == EConfigType.CUSTOM) { + shareFullContent(position) + } else { + val iv = mActivity.layoutInflater.inflate(R.layout.item_qrcode, null) + iv.iv_qcode.setImageBitmap(AngConfigManager.share2QRCode(position)) - mActivity.alert { - customView { - linearLayout { - addView(iv) + mActivity.alert { + customView { + linearLayout { + addView(iv) + } } - } - }.show() + }.show() + } } 1 -> { if (AngConfigManager.share2Clipboard(position) == 0) { @@ -100,15 +111,8 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter { - if (AngConfigManager.shareFullContent2Clipboard(position) == 0) { - mActivity.toast(R.string.toast_success) - } else { - mActivity.toast(R.string.toast_failure) - } - } - else -> - mActivity.toast("else") + 2 -> shareFullContent(position) + else -> mActivity.toast("else") } } catch (e: Exception) { e.printStackTrace() @@ -168,6 +172,14 @@ class MainRecyclerAdapter(val activity: MainActivity) : RecyclerView.Adapter diff --git a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml index 3b0079fb..b08a711a 100644 --- a/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rCN/strings.xml @@ -136,7 +136,7 @@ Logcat 复制 删除 - 导出全部配置至剪贴板 + 导出全部(非自定义)配置至剪贴板 订阅设置 备注 地址(url) diff --git a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml index 452be54d..d7310a34 100644 --- a/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml +++ b/V2rayNG/app/src/main/res/values-zh-rTW/strings.xml @@ -138,7 +138,7 @@ Logcat 複製 刪除 - 匯出全部配置至剪貼簿 + 匯出全部(非自訂)配置至剪貼簿 訂閱設定 備註 位址(url) diff --git a/V2rayNG/app/src/main/res/values/strings.xml b/V2rayNG/app/src/main/res/values/strings.xml index edf83f0b..129d0264 100644 --- a/V2rayNG/app/src/main/res/values/strings.xml +++ b/V2rayNG/app/src/main/res/values/strings.xml @@ -138,7 +138,7 @@ Logcat Copy Delete - Export all config to clipboard + Export non-custom configs to clipboard Subscription setting remarks url