desc:网络设置和恢复出厂设置
parent
4d2cea12b6
commit
5f01cab9fd
@ -0,0 +1,35 @@
|
||||
package com.yinuo.safetywatcher.watcher.ui
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Intent
|
||||
import android.provider.Settings
|
||||
import android.view.View
|
||||
import com.yinuo.safetywatcher.R
|
||||
import com.yinuo.safetywatcher.databinding.ActivityNetSettingBinding
|
||||
import com.yinuo.safetywatcher.watcher.base.NoOptionsActivity
|
||||
|
||||
class NetSettingActivity : NoOptionsActivity() {
|
||||
private val mBinding by lazy {
|
||||
ActivityNetSettingBinding.inflate(layoutInflater)
|
||||
}
|
||||
|
||||
override fun getTopBarTitle(): String? {
|
||||
return getString(R.string.net_setting)
|
||||
}
|
||||
|
||||
override fun generateContentView(): View {
|
||||
return mBinding.root
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
override fun initView() {
|
||||
mBinding.apply {
|
||||
val usedValue = 100
|
||||
tvUsed.text = "流量使用情况:$usedValue G"
|
||||
itemWifi.setOnClickListener {
|
||||
Intent.ACTION_FACTORY_TEST
|
||||
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item_time"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/_108dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/_121dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/_32dp"
|
||||
android:layout_height="@dimen/_32dp"
|
||||
android:src="@mipmap/ic_value_used" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_used"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/_21dp"
|
||||
android:text="@string/time_setting"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_36dp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/_2dp"
|
||||
android:background="@color/_242f4d" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/item_wifi"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/_108dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/_121dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/_32dp"
|
||||
android:layout_height="@dimen/_32dp"
|
||||
android:src="@mipmap/ic_wifi_setting" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/_21dp"
|
||||
android:text="@string/wifi_setting"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_36dp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
Binary file not shown.
After Width: | Height: | Size: 7.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.3 KiB |
Loading…
Reference in New Issue