develop
yanzs 2023-11-16 09:47:43 +08:00
parent 732932ec75
commit 9fe35bb655
16 changed files with 169 additions and 237 deletions

View File

@ -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$" />

View File

@ -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">

View File

@ -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'
} }

View File

@ -14,6 +14,7 @@
tools:targetApi="31" > tools:targetApi="31" >
<activity <activity
android:name=".module.wecome.WecomeActivity" android:name=".module.wecome.WecomeActivity"
android:theme="@style/AppStartupTheme"
android:exported="true" > android:exported="true" >
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -23,6 +24,7 @@
</activity> </activity>
<activity <activity
android:name=".module.home.MainActivity" android:name=".module.home.MainActivity"
android:screenOrientation="landscape"
android:launchMode="singleTask"> android:launchMode="singleTask">
</activity> </activity>
<activity <activity

View File

@ -5,7 +5,9 @@ import android.graphics.Color
import android.graphics.drawable.GradientDrawable import android.graphics.drawable.GradientDrawable
import android.util.AttributeSet import android.util.AttributeSet
import android.view.LayoutInflater import android.view.LayoutInflater
import android.widget.FrameLayout
import android.widget.LinearLayout import android.widget.LinearLayout
import com.uls.service.databinding.HomeContentViewBinding
import com.uls.service.databinding.HomeItemViewBinding import com.uls.service.databinding.HomeItemViewBinding
import com.util.extension.dp import com.util.extension.dp
import com.util.extension.roundCorner import com.util.extension.roundCorner
@ -13,16 +15,60 @@ import com.util.extension.roundCorner
/** /**
Created by yanzs on 2023/11/14 Created by yanzs on 2023/11/14
*/ */
class HomeItemView @JvmOverloads constructor( open class HomeItemView @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null context: Context, attrs: AttributeSet? = null
) : LinearLayout(context, attrs) { ) : LinearLayout(context, attrs) {
private var binding = HomeItemViewBinding.inflate(LayoutInflater.from(context), this, true) protected var binding = HomeItemViewBinding.inflate(LayoutInflater.from(context), this, true)
init { init {
roundCorner(30.dp) roundCorner(30.dp)
background = GradientDrawable( }
}
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, GradientDrawable.Orientation.LEFT_RIGHT,
intArrayOf(Color.parseColor("#ff36C1C8"), Color.parseColor("#ff37D1D9")) 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)
} }

View File

@ -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>

View File

Before

Width:  |  Height:  |  Size: 232 KiB

After

Width:  |  Height:  |  Size: 232 KiB

View File

@ -8,16 +8,15 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="horizontal" android:orientation="horizontal">
>
<androidx.appcompat.widget.LinearLayoutCompat <com.uls.service.module.home.view.HomeContentView
android:layout_width="match_parent" android:id="@+id/home_content"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:orientation="vertical" android:layout_height="wrap_content"
> android:layout_marginStart="25dp"
/>
</androidx.appcompat.widget.LinearLayoutCompat>
</LinearLayout> </LinearLayout>

View File

@ -7,27 +7,31 @@
android:orientation="vertical" android:orientation="vertical"
android:gravity="center" android:gravity="center"
tools:context=".module.wecome.WecomeActivity"> tools:context=".module.wecome.WecomeActivity">
<RelativeLayout <!-- <RelativeLayout-->
android:layout_width="466dp" <!-- android:layout_width="466dp"-->
android:layout_height="466dp"> <!-- android:layout_height="466dp">-->
<ImageView <!-- <ImageView-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="match_parent" <!-- android:layout_height="match_parent"-->
android:src="@mipmap/wecom_logo" <!-- android:src="@drawable/logo_bg"-->
/> <!-- />-->
<TextView <!-- <TextView-->
android:layout_width="wrap_content" <!-- android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:textColor="#ff3D3D3D" <!-- android:textColor="#ff3D3D3D"-->
android:textSize="80sp" <!-- android:textSize="80sp"-->
android:text="尤岚氏机器人" <!-- android:text="尤岚氏机器人"-->
android:layout_centerHorizontal="true" <!-- android:layout_centerHorizontal="true"-->
android:layout_alignParentBottom="true" <!-- android:layout_alignParentBottom="true"-->
/> <!-- />-->
</RelativeLayout> <!-- </RelativeLayout>-->
<ImageView <!-- <ImageView-->
android:layout_width="wrap_content" <!-- android:layout_width="wrap_content"-->
android:layout_height="wrap_content" <!-- android:layout_height="wrap_content"-->
android:src="@mipmap/wecom_logo_subtitle" <!-- android:src="@mipmap/wecom_logo_subtitle"-->
/> <!-- />-->
</androidx.appcompat.widget.LinearLayoutCompat> </androidx.appcompat.widget.LinearLayoutCompat>

View File

@ -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>

View File

@ -14,6 +14,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
android:layout_marginLeft="18dp"
android:layout_weight="1"> android:layout_weight="1">
<TextView <TextView
android:id="@+id/tv_title" android:id="@+id/tv_title"

View File

@ -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>

View File

@ -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>
@ -14,4 +15,9 @@
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
<item name="android:screenOrientation">landscape</item> <item name="android:screenOrientation">landscape</item>
</style> </style>
<style name="AppStartupTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">@drawable/ic_launcher_background</item>
</style>
</resources> </resources>

View File

@ -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')
} }
} }
} }

View File

@ -25,9 +25,10 @@ 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 {

View File

@ -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,6 +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.ljx.rxlife3:rxlife-rxjava:3.0.0' api 'com.github.liujingxing.rxlife:rxlife-rxjava3:2.2.2'
api 'com.geyifeng.immersionbar:immersionbar:3.2.2'
} }