模板包详情
This commit is contained in:
parent
62096ab2c3
commit
5497ed86ef
|
@ -0,0 +1,11 @@
|
|||
package com.coldmint.rust.pro
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
|
||||
class NetworkTemplatePackageDetailsActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_network_template_package_details)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.adapters
|
||||
|
||||
class MyWebTemplateAdapter {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.adapters
|
||||
|
||||
class TemplateItemAdapter {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.adapters
|
||||
|
||||
class TemplatePageAdapter {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.adapters
|
||||
|
||||
class TemplateSeleteAdapter {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.databean
|
||||
|
||||
class CodeData {
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
package com.coldmint.rust.pro.fragments
|
||||
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.os.Bundle
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.core.LocalTemplatePackage
|
||||
import com.coldmint.rust.pro.adapters.TemplateListAdapter
|
||||
import com.coldmint.rust.pro.base.BaseFragment
|
||||
import com.coldmint.rust.pro.databinding.TemplateFragemntBinding
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class LocalTemplateFragment : BaseFragment<TemplateFragemntBinding>() {
|
||||
private var first = true
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (!first) {
|
||||
val directent = AppSettings.getValue(
|
||||
AppSettings.Setting.TemplateDirectory,
|
||||
requireContext().filesDir.absolutePath + "/template/"
|
||||
)
|
||||
loadList(directent)
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
}
|
||||
|
||||
fun loadList(path: String) {
|
||||
val language =
|
||||
AppSettings.getValue(AppSettings.Setting.AppLanguage, Locale.getDefault().language)
|
||||
val file = File(path)
|
||||
if (file.exists() && file.isDirectory) {
|
||||
val files = file.listFiles()
|
||||
val mutableList: ArrayList<LocalTemplatePackage> = ArrayList()
|
||||
for (f in files) {
|
||||
val tem = LocalTemplatePackage(f)
|
||||
if (tem.isTemplate) {
|
||||
mutableList.add(tem)
|
||||
}
|
||||
}
|
||||
if (mutableList.isNotEmpty()) {
|
||||
val listAdapter = TemplateListAdapter(requireContext(), mutableList, language, path)
|
||||
val layoutManager = LinearLayoutManager(activity)
|
||||
viewBinding.templateList.layoutManager = layoutManager
|
||||
viewBinding.templateList.adapter = listAdapter
|
||||
viewBinding.templateList.isVisible = true
|
||||
viewBinding.templateError.isVisible = false
|
||||
viewBinding.templateErrorIcon.isVisible = false
|
||||
} else {
|
||||
viewBinding.templateList.isVisible = false
|
||||
viewBinding.templateError.isVisible = true
|
||||
viewBinding.templateErrorIcon.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): TemplateFragemntBinding {
|
||||
return TemplateFragemntBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun whenViewCreated(inflater: LayoutInflater, savedInstanceState: Bundle?) {
|
||||
val directent = AppSettings.getValue(
|
||||
AppSettings.Setting.TemplateDirectory,
|
||||
requireContext().filesDir.absolutePath + "/template/"
|
||||
)
|
||||
loadList(directent)
|
||||
}
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.fragments
|
||||
|
||||
class NetworkTemplateFragemt {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.fragments
|
||||
|
||||
class SaveTemplateFragment {
|
||||
}
|
|
@ -1,73 +1,4 @@
|
|||
package com.coldmint.rust.pro.fragments
|
||||
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.os.Bundle
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.coldmint.rust.pro.tool.AppSettings
|
||||
import com.coldmint.rust.core.LocalTemplatePackage
|
||||
import com.coldmint.rust.pro.adapters.TemplateListAdapter
|
||||
import com.coldmint.rust.pro.base.BaseFragment
|
||||
import com.coldmint.rust.pro.databinding.TemplateFragemntBinding
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
class TemplateFragment : BaseFragment<TemplateFragemntBinding>() {
|
||||
private var first = true
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (!first) {
|
||||
val directent = AppSettings.getValue(
|
||||
AppSettings.Setting.TemplateDirectory,
|
||||
requireContext().filesDir.absolutePath + "/template/"
|
||||
)
|
||||
loadList(directent)
|
||||
} else {
|
||||
first = false
|
||||
}
|
||||
}
|
||||
|
||||
fun loadList(path: String) {
|
||||
val language =
|
||||
AppSettings.getValue(AppSettings.Setting.AppLanguage, Locale.getDefault().language)
|
||||
val file = File(path)
|
||||
if (file.exists() && file.isDirectory) {
|
||||
val files = file.listFiles()
|
||||
val mutableList: ArrayList<LocalTemplatePackage> = ArrayList()
|
||||
for (f in files) {
|
||||
val tem = LocalTemplatePackage(f)
|
||||
if (tem.isTemplate) {
|
||||
mutableList.add(tem)
|
||||
}
|
||||
}
|
||||
if (mutableList.isNotEmpty()) {
|
||||
val listAdapter = TemplateListAdapter(requireContext(), mutableList, language, path)
|
||||
val layoutManager = LinearLayoutManager(activity)
|
||||
viewBinding.templateList.layoutManager = layoutManager
|
||||
viewBinding.templateList.adapter = listAdapter
|
||||
viewBinding.templateList.isVisible = true
|
||||
viewBinding.templateError.isVisible = false
|
||||
viewBinding.templateErrorIcon.isVisible = false
|
||||
} else {
|
||||
viewBinding.templateList.isVisible = false
|
||||
viewBinding.templateError.isVisible = true
|
||||
viewBinding.templateErrorIcon.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getViewBindingObject(layoutInflater: LayoutInflater): TemplateFragemntBinding {
|
||||
return TemplateFragemntBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun whenViewCreated(inflater: LayoutInflater, savedInstanceState: Bundle?) {
|
||||
val directent = AppSettings.getValue(
|
||||
AppSettings.Setting.TemplateDirectory,
|
||||
requireContext().filesDir.absolutePath + "/template/"
|
||||
)
|
||||
loadList(directent)
|
||||
}
|
||||
class TemplateFragment {
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
package com.coldmint.rust.pro.viewmodel
|
||||
|
||||
class TemplateMakerViewModel {
|
||||
}
|
5
app/src/main/res/drawable/ic_outline_edit_24.xml
Normal file
5
app/src/main/res/drawable/ic_outline_edit_24.xml
Normal file
|
@ -0,0 +1,5 @@
|
|||
<vector android:height="24dp" android:tint="#000000"
|
||||
android:viewportHeight="24" android:viewportWidth="24"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="@android:color/white" android:pathData="M14.06,9.02l0.92,0.92L5.92,19L5,19v-0.92l9.06,-9.06M17.66,3c-0.25,0 -0.51,0.1 -0.7,0.29l-1.83,1.83 3.75,3.75 1.83,-1.83c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.2,-0.2 -0.45,-0.29 -0.71,-0.29zM14.06,6.19L3,17.25L3,21h3.75L17.81,9.94l-3.75,-3.75z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".NetworkTemplatePackageDetailsActivity">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
6
app/src/main/res/layout/fragment_network_template.xml
Normal file
6
app/src/main/res/layout/fragment_network_template.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
6
app/src/main/res/layout/fragment_save_template.xml
Normal file
6
app/src/main/res/layout/fragment_save_template.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
6
app/src/main/res/layout/fragment_template.xml
Normal file
6
app/src/main/res/layout/fragment_template.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
6
app/src/main/res/layout/item_my_web_template.xml
Normal file
6
app/src/main/res/layout/item_my_web_template.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
6
app/src/main/res/layout/item_template.xml
Normal file
6
app/src/main/res/layout/item_template.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
6
app/src/main/res/layout/item_template_select.xml
Normal file
6
app/src/main/res/layout/item_template_select.xml
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -0,0 +1,68 @@
|
|||
package com.coldmint.rust.core.dataBean
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class WebTemplatePackageDetailsData(
|
||||
@SerializedName("code")
|
||||
val code: Int,
|
||||
@SerializedName("data")
|
||||
val `data`: Data,
|
||||
@SerializedName("message")
|
||||
val message: String
|
||||
) {
|
||||
data class Data(
|
||||
@SerializedName("packageData")
|
||||
val packageData: PackageData,
|
||||
@SerializedName("templateList")
|
||||
val templateList: List<Template>
|
||||
) {
|
||||
data class PackageData(
|
||||
@SerializedName("appVersionName")
|
||||
val appVersionName: String,
|
||||
@SerializedName("appVersionNumber")
|
||||
val appVersionNumber: String,
|
||||
@SerializedName("createTime")
|
||||
val createTime: String,
|
||||
@SerializedName("describe")
|
||||
val describe: String,
|
||||
@SerializedName("developer")
|
||||
val developer: String,
|
||||
@SerializedName("id")
|
||||
val id: String,
|
||||
@SerializedName("modificationTime")
|
||||
val modificationTime: String,
|
||||
@SerializedName("name")
|
||||
val name: String,
|
||||
@SerializedName("public")
|
||||
val `public`: String,
|
||||
@SerializedName("subscriptionNumber")
|
||||
val subscriptionNumber: String,
|
||||
@SerializedName("templateNumber")
|
||||
val templateNumber: String,
|
||||
@SerializedName("versionName")
|
||||
val versionName: String,
|
||||
@SerializedName("versionNumber")
|
||||
val versionNumber: String
|
||||
)
|
||||
|
||||
data class Template(
|
||||
@SerializedName("content")
|
||||
val content: String,
|
||||
@SerializedName("createTime")
|
||||
val createTime: String,
|
||||
@SerializedName("deleted")
|
||||
val deleted: String,
|
||||
@SerializedName("developer")
|
||||
val developer: String,
|
||||
@SerializedName("id")
|
||||
val id: String,
|
||||
@SerializedName("modificationTime")
|
||||
val modificationTime: String,
|
||||
@SerializedName("packageId")
|
||||
val packageId: String,
|
||||
@SerializedName("title")
|
||||
val title: String
|
||||
)
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ data class WebTemplatePackageListData(
|
|||
@SerializedName("code")
|
||||
val code: Int,
|
||||
@SerializedName("data")
|
||||
val `data`: MutableList<Data>,
|
||||
val `data`: List<Data>,
|
||||
@SerializedName("message")
|
||||
val message: String
|
||||
) {
|
||||
|
@ -30,8 +30,6 @@ data class WebTemplatePackageListData(
|
|||
val name: String,
|
||||
@SerializedName("public")
|
||||
val `public`: String,
|
||||
@SerializedName("subscribe")
|
||||
var subscribe: Boolean,
|
||||
@SerializedName("subscriptionNumber")
|
||||
val subscriptionNumber: String,
|
||||
@SerializedName("templateNumber")
|
||||
|
|
Loading…
Reference in New Issue
Block a user