desc:单位使用PX

main
xiaowusky 2 years ago
parent 83cfee24fe
commit 5e54f22fad

@ -27,13 +27,16 @@
<activity
android:name=".watcher.HomeActivity"
android:exported="true"
android:screenOrientation="portrait">
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".watcher.SettingActivity"
android:exported="false"/>
<activity
android:name=".MainActivity"
android:exported="false"

@ -1,6 +1,9 @@
package com.yinuo.safetywatcher.watcher
import android.content.Intent
import android.os.Build
import android.view.View
import androidx.annotation.RequiresApi
import com.yinuo.safetywatcher.databinding.ActivityHomeBinding
import com.yinuo.safetywatcher.watcher.base.BaseActivity
@ -13,4 +16,17 @@ class HomeActivity : BaseActivity() {
override fun generateContentView(): View {
return mBinding.root
}
@RequiresApi(Build.VERSION_CODES.R)
override fun initView() {
mBinding.apply {
itemSetting.setOnClickListener {
startActivity(Intent(this@HomeActivity, SettingActivity::class.java))
}
itemQuery.setOnClickListener { }
itemWraning.setOnClickListener { }
itemRecovery.setOnClickListener { }
cameraSwitch.setOnCheckedChangeListener { buttonView, isChecked -> }
}
}
}

@ -0,0 +1,19 @@
package com.yinuo.safetywatcher.watcher
import android.view.View
import com.yinuo.safetywatcher.databinding.ActivitySettingBinding
import com.yinuo.safetywatcher.watcher.base.BaseActivity
class SettingActivity: BaseActivity() {
private val mBinding: ActivitySettingBinding by lazy {
ActivitySettingBinding.inflate(layoutInflater)
}
override fun generateContentView(): View {
return mBinding.root
}
override fun initView() {
}
}

@ -1,9 +1,8 @@
package com.yinuo.safetywatcher.watcher.base
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import com.yinuo.safetywatcher.R
import androidx.appcompat.app.AppCompatActivity
import com.yinuo.safetywatcher.databinding.ActivityBaseBinding
abstract class BaseActivity : AppCompatActivity() {
@ -16,7 +15,9 @@ abstract class BaseActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(baseBinding.root)
baseBinding.container.addView(generateContentView())
initView()
}
open abstract fun generateContentView(): View
abstract fun initView()
}

@ -1,8 +1,21 @@
package com.yinuo.safetywatcher.watcher.view
import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import android.widget.LinearLayout
class CommonTopBar(context: Context) : LinearLayout(context) {
class CommonTopBar : LinearLayout {
constructor(context: Context?) : this(context, null)
constructor(context: Context?, attrs: AttributeSet?) : this(context, attrs, 0)
constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
init {
//初始化方法
setBackgroundColor(Color.RED)
}
}

@ -3,4 +3,130 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<View
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/setting_area"
android:layout_width="@dimen/_288dp"
android:layout_height="@dimen/_536dp"
android:layout_alignParentEnd="true"
android:layout_marginEnd="@dimen/_21dp"
android:layout_marginTop="@dimen/_185dp"
android:background="@color/_242f4d_30"
android:orientation="vertical"
android:paddingTop="@dimen/_68dp">
<LinearLayout
android:id="@+id/item_setting"
android:layout_width="match_parent"
android:layout_height="@dimen/_88dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_66dp">
<ImageView
android:layout_width="@dimen/_29dp"
android:layout_height="@dimen/_29dp"
android:src="@mipmap/ic_setting" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_13dp"
android:text="@string/setting"
android:textColor="@color/white"
android:textSize="@dimen/_30dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/item_query"
android:layout_width="match_parent"
android:layout_height="@dimen/_88dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_66dp">
<ImageView
android:layout_width="@dimen/_29dp"
android:layout_height="@dimen/_29dp"
android:src="@mipmap/ic_query" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_13dp"
android:text="@string/query"
android:textColor="@color/white"
android:textSize="@dimen/_30dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/item_wraning"
android:layout_width="match_parent"
android:layout_height="@dimen/_88dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_66dp">
<ImageView
android:layout_width="@dimen/_29dp"
android:layout_height="@dimen/_29dp"
android:src="@mipmap/ic_wraning" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_13dp"
android:text="@string/wraning"
android:textColor="@color/white"
android:textSize="@dimen/_30dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/item_recovery"
android:layout_width="match_parent"
android:layout_height="@dimen/_88dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_66dp">
<ImageView
android:layout_width="@dimen/_29dp"
android:layout_height="@dimen/_29dp"
android:src="@mipmap/ic_recovery" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_13dp"
android:text="@string/recovery"
android:textColor="@color/white"
android:textSize="@dimen/_30dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/_88dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_66dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/camera"
android:textColor="@color/white"
android:textSize="@dimen/_30dp" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/camera_switch"
android:layout_width="wrap_content"
android:layout_height="@dimen/_34dp"
android:layout_marginStart="@dimen/_13dp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>

@ -0,0 +1,30 @@
<?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_query"
android:layout_width="match_parent"
android:layout_height="@dimen/_88dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="@dimen/_66dp">
<ImageView
android:layout_width="@dimen/_29dp"
android:layout_height="@dimen/_29dp"
android:src="@mipmap/ic_query" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/_13dp"
android:text="@string/query"
android:textColor="@color/white"
android:textSize="@dimen/_30dp" />
</LinearLayout>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 557 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 884 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 709 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -7,4 +7,8 @@
<color name="white">#ffffff</color>
<color name="colorTheme">#1ED5CA</color>
<color name="black_overlay">#66000000</color>
<color name="_242f4d">#242F4D</color>
<color name="_242f4d_30">#4C242F4D</color>
</resources>

@ -1,4 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="_87dp">87dp</dimen>
<dimen name="_87dp">87px</dimen>
<dimen name="_288dp">288px</dimen>
<dimen name="_536dp">536px</dimen>
<dimen name="_21dp">21px</dimen>
<dimen name="_272dp">272px</dimen>
<dimen name="_88dp">88px</dimen>
<dimen name="_29dp">29px</dimen>
<dimen name="_68dp">68px</dimen>
<dimen name="_66dp">66px</dimen>
<dimen name="_30dp">30px</dimen>
<dimen name="_13dp">13px</dimen>
<dimen name="_34dp">34px</dimen>
<dimen name="_185dp">185px</dimen>
</resources>

@ -1,5 +1,10 @@
<resources>
<string name="app_name">My Application</string>
<string name="setting">设置</string>
<string name="query">数据查询</string>
<string name="wraning">报警记录</string>
<string name="recovery">报警重置</string>
<string name="camera">摄像头</string>
<string-array name="excel_column">

Loading…
Cancel
Save