clean project
This commit is contained in:
@@ -21,10 +21,6 @@
|
||||
android:name=".activity.setting.SettingsActivity"
|
||||
android:exported="false"
|
||||
android:label="@string/title_activity_settings" />
|
||||
<activity
|
||||
android:name=".activity.setting.SettingsActivity_BackUp"
|
||||
android:exported="false"
|
||||
android:label="@string/title_activity_settings_backup" />
|
||||
|
||||
<service
|
||||
android:name=".service.DownloadService"
|
||||
|
||||
@@ -46,14 +46,12 @@ class MainActivity : AppCompatActivity() {
|
||||
private var shortAnnotationDuration:Int = 0
|
||||
private var nowPage = 1
|
||||
private lateinit var adapter: PostAdapter
|
||||
// private var isLoading = false
|
||||
private var nowPosition =0
|
||||
private var username:String? = ""
|
||||
private lateinit var sourceUrl:Array<String>
|
||||
private lateinit var sourceName:Array<String>
|
||||
private lateinit var source:String
|
||||
private var nowSourceName: String?=null
|
||||
// private var isRefresh=true
|
||||
val TAG = javaClass.simpleName
|
||||
private lateinit var layoutManager: RecyclerView.LayoutManager
|
||||
private var safeMode:String? = "Safe" //安全模式
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
package com.lsp.view.activity.setting
|
||||
|
||||
import android.content.SharedPreferences
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import android.widget.AdapterView
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Spinner
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import com.lsp.view.R
|
||||
|
||||
class SettingsActivity_BackUp : AppCompatActivity(), AdapterView.OnItemSelectedListener {
|
||||
|
||||
lateinit var name_sourceArray: Array<String>
|
||||
lateinit var url_sourceArray:Array<String>
|
||||
lateinit var configSp: SharedPreferences
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.settings_activity_backup)
|
||||
|
||||
configSp = getSharedPreferences("config", MODE_PRIVATE)
|
||||
|
||||
name_sourceArray = resources.getStringArray(R.array.pic_source)
|
||||
url_sourceArray = resources.getStringArray(R.array.url_source)
|
||||
|
||||
val spinner = findViewById<Spinner>(R.id.source)
|
||||
//设置spinner列表
|
||||
val adapter = ArrayAdapter(this,R.layout.spinner_item_layout,name_sourceArray)
|
||||
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item)
|
||||
spinner.adapter = adapter
|
||||
spinner.onItemSelectedListener = this
|
||||
|
||||
val source = configSp.getString("source",null)
|
||||
if (source!=null ){
|
||||
for ( (index,value) in url_sourceArray.withIndex()){
|
||||
if (value == source){
|
||||
spinner.setSelection(index)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onItemSelected(p0: AdapterView<*>?, p1: View?, p2: Int, p3: Long) {
|
||||
configSp.edit().putString("source",url_sourceArray[p2]).apply()
|
||||
// if (p2==2){
|
||||
// configSp.edit().putString("type","1").apply()
|
||||
// }else{
|
||||
configSp.edit().putString("type","0").apply()
|
||||
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onNothingSelected(p0: AdapterView<*>?) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="6"
|
||||
android:text="加载源"
|
||||
android:textSize="20sp" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/source"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="4"
|
||||
android:textSize="20sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user