Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
yanzs | 9fe35bb655 | |
yanzs | 732932ec75 |
|
@ -7,7 +7,7 @@
|
||||||
<option name="testRunner" value="GRADLE" />
|
<option name="testRunner" value="GRADLE" />
|
||||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
<option name="gradleJvm" value="corretto-11" />
|
<option name="gradleJvm" value="Embedded JDK" />
|
||||||
<option name="modules">
|
<option name="modules">
|
||||||
<set>
|
<set>
|
||||||
<option value="$PROJECT_DIR$" />
|
<option value="$PROJECT_DIR$" />
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="corretto-11" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||||
</component>
|
</component>
|
||||||
<component name="ProjectType">
|
<component name="ProjectType">
|
||||||
|
|
|
@ -28,8 +28,15 @@ android {
|
||||||
sourceCompatibility JavaVersion.VERSION_11
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
targetCompatibility JavaVersion.VERSION_11
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
// kotlinOptions {
|
||||||
jvmTarget = '1.8'
|
// jvmTarget = '1.8'
|
||||||
|
// }
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
// jvmToolchain {
|
||||||
|
// languageVersion.set(JavaLanguageVersion.of(17))
|
||||||
|
// }
|
||||||
|
jvmToolchain(11)
|
||||||
}
|
}
|
||||||
buildFeatures {
|
buildFeatures {
|
||||||
viewBinding true
|
viewBinding true
|
||||||
|
@ -37,9 +44,5 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
implementation project(":uikit")
|
implementation project(":uikit")
|
||||||
implementation 'androidx.appcompat:appcompat:1.4.1'
|
|
||||||
implementation 'com.google.android.material:material:1.5.0'
|
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
xmlns:tools="http://schemas.android.com/tools" >
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
@ -11,19 +11,22 @@
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.Android_ulsService"
|
android:theme="@style/Theme.Android_ulsService"
|
||||||
tools:targetApi="31">
|
tools:targetApi="31" >
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".module.home.MainActivity"
|
android:name=".module.wecome.WecomeActivity"
|
||||||
android:exported="true"
|
android:theme="@style/AppStartupTheme"
|
||||||
android:label="@string/app_name">
|
android:exported="true" >
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".module.home.MainActivity"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
|
android:launchMode="singleTask">
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".module.test.FuncListActivity"
|
android:name=".module.test.FuncListActivity"
|
||||||
android:exported="false" />
|
android:exported="false" />
|
||||||
|
|
|
@ -19,18 +19,5 @@ class MainActivity : AppCompatActivity() {
|
||||||
|
|
||||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
|
||||||
val navView: BottomNavigationView = binding.navView
|
|
||||||
|
|
||||||
val navController = findNavController(R.id.nav_host_fragment_activity_main)
|
|
||||||
// Passing each menu ID as a set of Ids because each
|
|
||||||
// menu should be considered as top level destinations.
|
|
||||||
val appBarConfiguration = AppBarConfiguration(
|
|
||||||
setOf(
|
|
||||||
R.id.navigation_home, R.id.navigation_dashboard, R.id.navigation_notifications
|
|
||||||
)
|
|
||||||
)
|
|
||||||
setupActionBarWithNavController(navController, appBarConfiguration)
|
|
||||||
navView.setupWithNavController(navController)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.uls.service.module.home.view
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
|
import android.graphics.drawable.GradientDrawable
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import com.uls.service.databinding.HomeContentViewBinding
|
||||||
|
import com.uls.service.databinding.HomeItemViewBinding
|
||||||
|
import com.util.extension.dp
|
||||||
|
import com.util.extension.roundCorner
|
||||||
|
|
||||||
|
/**
|
||||||
|
Created by yanzs on 2023/11/14
|
||||||
|
*/
|
||||||
|
open class HomeItemView @JvmOverloads constructor(
|
||||||
|
context: Context, attrs: AttributeSet? = null
|
||||||
|
) : LinearLayout(context, attrs) {
|
||||||
|
protected var binding = HomeItemViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
|
|
||||||
|
init {
|
||||||
|
roundCorner(30.dp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class DoctorItemView(context: Context, attrs: AttributeSet? = null) : HomeItemView(context, attrs) {
|
||||||
|
init {
|
||||||
|
binding.tvTitle.text = "家庭医生"
|
||||||
|
binding.tvSubtitle.text = "专家坐诊,线上咨询"
|
||||||
|
binding.root.background = GradientDrawable(
|
||||||
|
GradientDrawable.Orientation.LEFT_RIGHT,
|
||||||
|
intArrayOf(Color.parseColor("#ff37D1D9"), Color.parseColor( "#ff36C1C8"))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class ContactItemView (context: Context, attrs: AttributeSet? = null) : HomeItemView(context, attrs) {
|
||||||
|
init {
|
||||||
|
binding.tvTitle.text = "联系家人"
|
||||||
|
binding.tvSubtitle.text = "视屏通话,爱在身边"
|
||||||
|
binding.root.background = GradientDrawable(
|
||||||
|
GradientDrawable.Orientation.LEFT_RIGHT,
|
||||||
|
intArrayOf(Color.parseColor("#F48538"), Color.parseColor("#F69244"))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class YuleItemView(context: Context, attrs: AttributeSet? = null) : HomeItemView(context, attrs) {
|
||||||
|
init {
|
||||||
|
binding.tvTitle.text = "娱乐"
|
||||||
|
binding.tvSubtitle.text = "看电影,听戏曲"
|
||||||
|
binding.root.background = GradientDrawable(
|
||||||
|
GradientDrawable.Orientation.LEFT_RIGHT,
|
||||||
|
intArrayOf(Color.parseColor("#F16A56"), Color.parseColor("#F16A56"))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class MomentItemView(context: Context, attrs: AttributeSet? = null) : HomeItemView(context, attrs) {
|
||||||
|
init {
|
||||||
|
binding.tvTitle.text = "回忆录"
|
||||||
|
binding.tvSubtitle.text = "生成美好瞬间"
|
||||||
|
binding.root.background = GradientDrawable(
|
||||||
|
GradientDrawable.Orientation.LEFT_RIGHT,
|
||||||
|
intArrayOf(Color.parseColor("#79B2F6"), Color.parseColor("#3490FD"))
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class HomeContentView @JvmOverloads constructor(
|
||||||
|
context: Context, attrs: AttributeSet? = null
|
||||||
|
) : FrameLayout(context, attrs){
|
||||||
|
private var binding = HomeContentViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
|
}
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.uls.service.module.wecome
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Intent
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.uls.service.R
|
||||||
|
import com.uls.service.module.home.MainActivity
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.core.Flowable
|
||||||
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
|
class WecomeActivity : AppCompatActivity() {
|
||||||
|
@SuppressLint("CheckResult")
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContentView(R.layout.activity_wecome)
|
||||||
|
Flowable.timer(300,TimeUnit.MILLISECONDS)
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe {
|
||||||
|
finish()
|
||||||
|
startActivity(Intent(this,MainActivity::class.java))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,170 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
android:width="108dp"
|
<item android:drawable="@android:color/white" />
|
||||||
android:height="108dp"
|
<item>
|
||||||
android:viewportWidth="108"
|
<bitmap
|
||||||
android:viewportHeight="108">
|
android:layout_width="wrap_content"
|
||||||
<path
|
android:layout_height="wrap_content"
|
||||||
android:fillColor="#3DDC84"
|
android:gravity="center"
|
||||||
android:pathData="M0,0h108v108h-108z" />
|
android:src="@drawable/logo_bg" />
|
||||||
<path
|
</item>
|
||||||
android:fillColor="#00000000"
|
</layer-list>
|
||||||
android:pathData="M9,0L9,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,0L19,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,0L29,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,0L39,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,0L49,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,0L59,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,0L69,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,0L79,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M89,0L89,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M99,0L99,108"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,9L108,9"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,19L108,19"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,29L108,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,39L108,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,49L108,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,59L108,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,69L108,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,79L108,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,89L108,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M0,99L108,99"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,29L89,29"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,39L89,39"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,49L89,49"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,59L89,59"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,69L89,69"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M19,79L89,79"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M29,19L29,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M39,19L39,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M49,19L49,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M59,19L59,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M69,19L69,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
<path
|
|
||||||
android:fillColor="#00000000"
|
|
||||||
android:pathData="M79,19L79,89"
|
|
||||||
android:strokeWidth="0.8"
|
|
||||||
android:strokeColor="#33FFFFFF" />
|
|
||||||
</vector>
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 232 KiB |
|
@ -1,33 +1,23 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:paddingTop="?attr/actionBarSize">
|
android:orientation="horizontal">
|
||||||
|
<LinearLayout
|
||||||
<com.google.android.material.bottomnavigation.BottomNavigationView
|
|
||||||
android:id="@+id/nav_view"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="0dp"
|
|
||||||
android:layout_marginEnd="0dp"
|
|
||||||
android:background="?android:attr/windowBackground"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:menu="@menu/bottom_nav_menu" />
|
|
||||||
|
|
||||||
<fragment
|
|
||||||
android:id="@+id/nav_host_fragment_activity_main"
|
|
||||||
android:name="androidx.navigation.fragment.NavHostFragment"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
app:defaultNavHost="true"
|
android:orientation="horizontal">
|
||||||
app:layout_constraintBottom_toTopOf="@id/nav_view"
|
|
||||||
app:layout_constraintLeft_toLeftOf="parent"
|
|
||||||
app:layout_constraintRight_toRightOf="parent"
|
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
|
||||||
app:navGraph="@navigation/mobile_navigation" />
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
<com.uls.service.module.home.view.HomeContentView
|
||||||
|
android:id="@+id/home_content"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="25dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
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"
|
||||||
|
android:gravity="center"
|
||||||
|
tools:context=".module.wecome.WecomeActivity">
|
||||||
|
<!-- <RelativeLayout-->
|
||||||
|
<!-- android:layout_width="466dp"-->
|
||||||
|
<!-- android:layout_height="466dp">-->
|
||||||
|
<!-- <ImageView-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="match_parent"-->
|
||||||
|
<!-- android:src="@drawable/logo_bg"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- <TextView-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:textColor="#ff3D3D3D"-->
|
||||||
|
<!-- android:textSize="80sp"-->
|
||||||
|
<!-- android:text="尤岚氏机器人"-->
|
||||||
|
<!-- android:layout_centerHorizontal="true"-->
|
||||||
|
<!-- android:layout_alignParentBottom="true"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </RelativeLayout>-->
|
||||||
|
<!-- <ImageView-->
|
||||||
|
<!-- android:layout_width="wrap_content"-->
|
||||||
|
<!-- android:layout_height="wrap_content"-->
|
||||||
|
<!-- android:src="@mipmap/wecom_logo_subtitle"-->
|
||||||
|
<!-- />-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?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="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<com.uls.service.module.home.view.DoctorItemView
|
||||||
|
android:id="@+id/vDoctor"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/vContact"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_marginEnd="18dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<com.uls.service.module.home.view.ContactItemView
|
||||||
|
android:id="@+id/vContact"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toEndOf="@id/vDoctor"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<com.uls.service.module.home.view.YuleItemView
|
||||||
|
android:id="@+id/vYule"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/vDoctor"
|
||||||
|
app:layout_constraintEnd_toStartOf="@id/vMoment"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/vDoctor"
|
||||||
|
android:layout_marginEnd="18dp"
|
||||||
|
android:layout_marginTop="18dp"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
<com.uls.service.module.home.view.MomentItemView
|
||||||
|
android:id="@+id/vMoment"
|
||||||
|
app:layout_constraintEnd_toEndOf="@id/vContact"
|
||||||
|
app:layout_constraintStart_toStartOf="@id/vContact"
|
||||||
|
app:layout_constraintTop_toTopOf="@id/vYule"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#36C1C8"
|
||||||
|
android:padding="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="90dp"
|
||||||
|
android:layout_height="90dp"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginLeft="18dp"
|
||||||
|
android:layout_weight="1">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="家庭医生"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="38sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_subtitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textSize="26sp"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:text="专家坐诊,线上咨询"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
Binary file not shown.
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
|
@ -1,16 +0,0 @@
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<!-- Base application theme. -->
|
|
||||||
<style name="Theme.Android_ulsService" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
|
||||||
<!-- Primary brand color. -->
|
|
||||||
<item name="colorPrimary">@color/purple_200</item>
|
|
||||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
|
||||||
<item name="colorOnPrimary">@color/black</item>
|
|
||||||
<!-- Secondary brand color. -->
|
|
||||||
<item name="colorSecondary">@color/teal_200</item>
|
|
||||||
<item name="colorSecondaryVariant">@color/teal_200</item>
|
|
||||||
<item name="colorOnSecondary">@color/black</item>
|
|
||||||
<!-- Status bar color. -->
|
|
||||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
|
||||||
<!-- Customize your theme here. -->
|
|
||||||
</style>
|
|
||||||
</resources>
|
|
|
@ -1,9 +1,10 @@
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<!-- Base application theme. -->
|
<!-- Base application theme. -->
|
||||||
<style name="Theme.Android_ulsService" parent="Theme.MaterialComponents.DayNight.DarkActionBar">
|
<style name="Theme.Android_ulsService" parent="Theme.MaterialComponents.Light.NoActionBar">
|
||||||
<!-- Primary brand color. -->
|
<!-- Primary brand color. -->
|
||||||
<item name="colorPrimary">@color/purple_500</item>
|
<item name="colorPrimary">@color/white</item>
|
||||||
<item name="colorPrimaryVariant">@color/purple_700</item>
|
<item name="colorPrimaryVariant">@color/white</item>
|
||||||
|
<item name="colorPrimaryDark">@color/white</item>
|
||||||
<item name="colorOnPrimary">@color/white</item>
|
<item name="colorOnPrimary">@color/white</item>
|
||||||
<!-- Secondary brand color. -->
|
<!-- Secondary brand color. -->
|
||||||
<item name="colorSecondary">@color/teal_200</item>
|
<item name="colorSecondary">@color/teal_200</item>
|
||||||
|
@ -12,5 +13,11 @@
|
||||||
<!-- Status bar color. -->
|
<!-- Status bar color. -->
|
||||||
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
<item name="android:statusBarColor">?attr/colorPrimaryVariant</item>
|
||||||
<!-- Customize your theme here. -->
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="android:screenOrientation">landscape</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppStartupTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="android:windowBackground">@drawable/ic_launcher_background</item>
|
||||||
</style>
|
</style>
|
||||||
</resources>
|
</resources>
|
|
@ -3,6 +3,7 @@ pluginManagement {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencyResolutionManagement {
|
dependencyResolutionManagement {
|
||||||
|
@ -10,6 +11,7 @@ dependencyResolutionManagement {
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url "https://jitpack.io" }
|
||||||
}
|
}
|
||||||
versionCatalogs{
|
versionCatalogs{
|
||||||
|
|
||||||
|
@ -36,7 +38,7 @@ dependencyResolutionManagement {
|
||||||
bundle('androidx', ['navigation-fragment','navigation-ui','core-ktx', 'appcompat', 'constraintlayout','livedata','viewmodel'])
|
bundle('androidx', ['navigation-fragment','navigation-ui','core-ktx', 'appcompat', 'constraintlayout','livedata','viewmodel'])
|
||||||
}
|
}
|
||||||
create('googleLibs') {
|
create('googleLibs') {
|
||||||
library('material', 'com.google.android', 'material').version('1.5.0')
|
library('material', 'com.google.android.material', 'material').version('1.5.0')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,14 +25,15 @@ android {
|
||||||
sourceCompatibility JavaVersion.VERSION_11
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
targetCompatibility JavaVersion.VERSION_11
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlin {
|
||||||
jvmTarget = '1.8'
|
jvmToolchain(17)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
||||||
api project(":uikit")
|
api project(":util")
|
||||||
api androidxLibs.bundles.androidx
|
api androidxLibs.bundles.androidx
|
||||||
api googleLibs.material
|
api googleLibs.material
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ android {
|
||||||
sourceCompatibility JavaVersion.VERSION_11
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
targetCompatibility JavaVersion.VERSION_11
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
kotlinOptions {
|
kotlin {
|
||||||
jvmTarget = '1.8'
|
jvmToolchain(11)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,5 +39,7 @@ dependencies {
|
||||||
api 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
|
api 'com.squareup.retrofit2:adapter-rxjava3:2.9.0'
|
||||||
api 'com.squareup.retrofit2:converter-gson:2.9.0'
|
api 'com.squareup.retrofit2:converter-gson:2.9.0'
|
||||||
api 'com.squareup.okhttp3:okhttp:4.2.2'
|
api 'com.squareup.okhttp3:okhttp:4.2.2'
|
||||||
|
api 'com.github.liujingxing.rxlife:rxlife-rxjava3:2.2.2'
|
||||||
|
api 'com.geyifeng.immersionbar:immersionbar:3.2.2'
|
||||||
|
|
||||||
}
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.util.extension
|
||||||
|
|
||||||
|
import android.content.res.Resources
|
||||||
|
|
||||||
|
|
||||||
|
// see https://github.com/nitrico/kema/blob/master/kema/src/main/java/com/github/nitrico/kema/Conversions.kt
|
||||||
|
|
||||||
|
// dp to pixels
|
||||||
|
val Int.dp: Int get() = (this * Resources.getSystem().displayMetrics.density + 0.5f).toInt()
|
||||||
|
|
||||||
|
// float dp to pixels
|
||||||
|
val Float.dp: Float get() = (this * Resources.getSystem().displayMetrics.density + 0.5f)
|
||||||
|
|
||||||
|
val Int.sp: Int get() = (this * Resources.getSystem().displayMetrics.scaledDensity + 0.5f).toInt()
|
||||||
|
|
||||||
|
val Float.sp: Float get() = (this * Resources.getSystem().displayMetrics.scaledDensity + 0.5f)
|
||||||
|
|
||||||
|
|
||||||
|
// integer to float
|
||||||
|
val Int.f: Float get() = toFloat()
|
||||||
|
|
||||||
|
// integer to double
|
||||||
|
val Int.d: Double get() = toDouble()
|
||||||
|
|
||||||
|
// float to integer
|
||||||
|
val Float.i: Int get() = toInt()
|
||||||
|
|
||||||
|
// double to integer
|
||||||
|
val Double.i: Int get() = toInt()
|
|
@ -0,0 +1,155 @@
|
||||||
|
package com.util.extension
|
||||||
|
|
||||||
|
|
||||||
|
import android.graphics.Outline
|
||||||
|
import android.os.Handler
|
||||||
|
import android.os.Looper
|
||||||
|
import android.text.Editable
|
||||||
|
import android.text.TextWatcher
|
||||||
|
import android.view.View
|
||||||
|
import android.view.ViewOutlineProvider
|
||||||
|
import android.widget.EditText
|
||||||
|
import android.widget.TextView
|
||||||
|
import kotlin.math.abs
|
||||||
|
|
||||||
|
|
||||||
|
fun View.visible() {
|
||||||
|
visibility = View.VISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
fun View.invisible() {
|
||||||
|
visibility = View.INVISIBLE
|
||||||
|
}
|
||||||
|
|
||||||
|
fun View.gone() {
|
||||||
|
visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
fun View.setVisible(isVisible: Boolean) {
|
||||||
|
visibility = if (isVisible) {
|
||||||
|
View.VISIBLE
|
||||||
|
} else {
|
||||||
|
View.GONE
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置防抖动的点击事件
|
||||||
|
*
|
||||||
|
* @param intervalInMillis 防抖动阈值,默认800ms
|
||||||
|
*/
|
||||||
|
fun View.setOnThrottledClickListener(
|
||||||
|
intervalInMillis: Long = 800L,
|
||||||
|
action: (View) -> Unit
|
||||||
|
) {
|
||||||
|
setOnClickListener(
|
||||||
|
object : View.OnClickListener {
|
||||||
|
private var lastClickedTimeInMillis: Long = 0
|
||||||
|
|
||||||
|
override fun onClick(v: View) {
|
||||||
|
if (abs(System.currentTimeMillis() - lastClickedTimeInMillis) >= intervalInMillis) {
|
||||||
|
lastClickedTimeInMillis = System.currentTimeMillis()
|
||||||
|
action.invoke(v)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用于让类继承,在onClick方法中统一用view.id区分
|
||||||
|
*/
|
||||||
|
fun View.setOnThrottledClickListener(
|
||||||
|
onThrottledClickListener: OnThrottledClickListener,
|
||||||
|
intervalInMillis: Long = 800L
|
||||||
|
) {
|
||||||
|
setOnClickListener(
|
||||||
|
object : View.OnClickListener {
|
||||||
|
private var lastClickedTimeInMillis: Long = 0
|
||||||
|
|
||||||
|
override fun onClick(v: View) {
|
||||||
|
if (abs(System.currentTimeMillis() - lastClickedTimeInMillis) >= intervalInMillis) {
|
||||||
|
onThrottledClickListener.onClick(v)
|
||||||
|
lastClickedTimeInMillis = System.currentTimeMillis()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun TextView.setOnDebouncedAfterTextChanged(
|
||||||
|
intervalInMillis: Long = 200L,
|
||||||
|
onAfterChanged: (text: Editable?) -> Unit
|
||||||
|
) {
|
||||||
|
this.addTextChangedListener(object : TextWatcher {
|
||||||
|
val handler = Handler(Looper.getMainLooper())
|
||||||
|
var runnable: Runnable? = null
|
||||||
|
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
|
||||||
|
runnable?.let {
|
||||||
|
handler.removeCallbacks(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun afterTextChanged(s: Editable?) {
|
||||||
|
runnable = Runnable {
|
||||||
|
onAfterChanged(s)
|
||||||
|
}.also {
|
||||||
|
handler.postDelayed(it, intervalInMillis)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
var EditText.trimText: String?
|
||||||
|
set(value) {
|
||||||
|
this.setText(value)//设置的数据不处理
|
||||||
|
}
|
||||||
|
get() {
|
||||||
|
return this.text.toString().trim()
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnThrottledClickListener {
|
||||||
|
fun onClick(v: View)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun View.roundCorner(
|
||||||
|
round: Int
|
||||||
|
) {
|
||||||
|
outlineProvider = object : ViewOutlineProvider() {
|
||||||
|
override fun getOutline(view: View, outline: Outline) {
|
||||||
|
outline.setRoundRect(0, 0, view.width, view.height, round.toFloat())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clipToOutline = true
|
||||||
|
}
|
||||||
|
|
||||||
|
fun View.roundTopCorner(
|
||||||
|
round: Int
|
||||||
|
) {
|
||||||
|
outlineProvider = object : ViewOutlineProvider() {
|
||||||
|
override fun getOutline(view: View, outline: Outline) {
|
||||||
|
outline.setRoundRect(0, 0, view.width, view.height + round, round.toFloat())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clipToOutline = true
|
||||||
|
}
|
||||||
|
fun View.roundBottomCorner(
|
||||||
|
radius: Int
|
||||||
|
) {
|
||||||
|
outlineProvider = object : ViewOutlineProvider() {
|
||||||
|
override fun getOutline(view: View, outline: Outline) {
|
||||||
|
outline.setRoundRect(0, -radius, view.width, view.height, radius.toFloat())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clipToOutline = true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue