Skip to content

Commit 89b3635

Browse files
committed
u
1 parent 72394a5 commit 89b3635

File tree

61 files changed

+1616
-62
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1616
-62
lines changed

android/app/build.gradle

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ android {
1818
applicationId project.rootProject.applicationId
1919
minSdkVersion Integer.parseInt(project.rootProject.minSdkVersion)
2020
targetSdkVersion Integer.parseInt(project.rootProject.targetSdkVersion)
21-
resValue "string", "app_name", "b.app"
21+
// resValue "string", "app_name", "b.app"
2222
buildConfigField('String', 'BUGLY_APP_ID', '"3d62251014"')
2323
buildConfigField('String', 'BUGLY_APP_KEY', '"a15ecf84-1786-40c6-abf5-fe975fce22e6"')
2424
buildConfigField('String', 'XIAOMI_APP_ID', '"2882303761517994447"')
@@ -126,13 +126,7 @@ android {
126126
// maxProcessCount 8
127127
// dexInProcess = true
128128
// }
129-
// flavorDimensions "default"
130-
// productFlavors{
131-
// dev{
132-
// resConfigs ("en", "xxhdpi"/*1080p*/)//优化编译速度:只编译指定资源
133-
// }
134-
//
135-
// }
129+
136130
compileOptions {
137131
sourceCompatibility JavaVersion.VERSION_17
138132
targetCompatibility JavaVersion.VERSION_17

android/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
android:name="com.jamesfchen.b.BApp"
4040
android:allowBackup="true"
4141
android:icon="@mipmap/ic_launcher"
42-
android:label="@string/app_name"
4342
android:networkSecurityConfig="@xml/network_security_config"
4443
android:supportsRtl="true"
4544
android:usesCleartextTraffic="true"

android/base/build.gradle

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,55 +22,38 @@ android{
2222

2323
}
2424
dependencies {
25-
api 'androidx.core:core-ktx:1.5.0'
26-
api 'androidx.appcompat:appcompat:1.3.0'
27-
api 'com.google.android.material:material:1.3.0'
28-
api(libs.kotlin.stdlib)
2925
api 'androidx.constraintlayout:constraintlayout:2.0.4'
26+
api(libs.androidx.core.ktx)
27+
api(libs.androidx.appcompat)
28+
api "androidx.activity:activity-ktx:1.3.1"
29+
api "androidx.activity:activity:1.3.1"
30+
api "androidx.fragment:fragment:1.3.5"
31+
api "androidx.fragment:fragment-ktx:1.3.5"
32+
api 'androidx.lifecycle:lifecycle-extensions:2.2.0'
33+
api(libs.google.android.material)
34+
api(libs.kotlin.stdlib)
35+
api(libs.glide)
36+
api(libs.retrofit.core)
37+
api(libs.retrofit.kotlin.serialization)
38+
// api "com.squareup.retrofit2:retrofit-converters:2.8.1"
39+
api "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
40+
api "com.squareup.retrofit2:converter-wire:2.9.0"
41+
api "com.squareup.retrofit2:converter-gson:2.9.0"
42+
// api "com.squareup.retrofit2:converter-moshi:2.9.0"
43+
// api "com.squareup.retrofit2:converter-protobuf:2.9.0"
3044

31-
// api 'com.google.firebase:firebase-analytics:19.0.0'
32-
// api 'com.google.firebase:firebase-crashlytics:18.0.1'
33-
// api 'com.google.firebase:firebase-crashlytics-ndk:18.0.1'
34-
//crash and anr
35-
// api 'com.tencent.bugly:nativecrashreport:3.7.1'
36-
api 'com.tencent.bugly:crashreport:3.0.0'
37-
// implementation 'com.google.android.gms:play-services-location:16.0.0'
38-
// implementation 'com.google.android.gms:play-services-fitness:16.0.1'
39-
// api 'androidx.multidex:multidex:2.0.1'
4045
testImplementation files('libs/jsoup-1.12.1.jar')
4146
// api 'com.squareup.okhttp3:okhttp:5.0.0-alpha.2'
4247
// api 'com.android.volley:volley:1.1.1'
4348
api 'com.squareup.okhttp3:okhttp-tls:4.0.1'
4449
api 'com.facebook.stetho:stetho-okhttp3:1.5.1'
4550
api "com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.2"
4651
testImplementation 'com.squareup.okhttp3:okhttp-dnsoverhttps:4.0.1'
47-
/*
48-
>>>> http style start
49-
*/
50-
51-
//restful
52-
api "com.squareup.retrofit2:retrofit:2.9.0"
53-
// api "com.squareup.retrofit2:retrofit-converters:2.8.1"
54-
api "com.squareup.retrofit2:adapter-rxjava3:2.9.0"
55-
api "com.squareup.retrofit2:converter-wire:2.9.0"
56-
api "com.squareup.retrofit2:converter-gson:2.9.0"
57-
// api "com.squareup.retrofit2:converter-moshi:2.9.0"
58-
// api "com.squareup.retrofit2:converter-protobuf:2.9.0"
59-
//rpc
60-
// api("io.grpc:grpc-protobuf-lite:${rootProject.ext.grpcVersion}") {//存在依赖冲突
61-
// exclude group: 'com.google.guava'
62-
// exclude group: 'com.google.protobuf', module: 'protobuf-java'
63-
// }
64-
// api "io.grpc:grpc-okhttp:${rootProject.ext.grpcVersion}"
65-
// api "io.grpc:grpc-stub:${rootProject.ext.grpcVersion}"
66-
67-
/*
68-
http style end
69-
*/
7052

7153
kapt "com.google.dagger:dagger-compiler:2.16"
7254
implementation 'javax.annotation:javax.annotation-api:1.3.2'
7355
implementation "com.github.jnr:jnr-unixsocket:0.23"
7456
implementation 'com.google.android.gms:play-services-cronet:17.0.0'
57+
7558
}
7659

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ useElectrolytejSnapshots=true
5151
compileSdkVersion=34
5252
buildToolsVersion=34.0.0
5353
#19:kk,21:L,23:M,24:N,26:O,28:P,29:Q,30:R
54-
minSdkVersion=23
54+
minSdkVersion=26
5555
targetSdkVersion=34
5656
versionCode=2
5757
versionName=2.0.0

android/gradle/libs.versions.toml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,21 @@ material = "1.11.0"
6969
versionCode="2"
7070
versionName="2.0.0"
7171
junit = "1.2.1"
72+
leanback = "1.0.0"
73+
glide = "4.11.0"
74+
tvFoundation = "1.0.0-alpha07"
75+
tvMaterial = "1.0.0-alpha07"
76+
playServicesWearable = "19.0.0"
77+
composeMaterial = "1.2.1"
78+
composeFoundation = "1.2.1"
79+
wearToolingPreview = "1.0.0"
80+
tiles = "1.4.0"
81+
tilesMaterial = "1.4.0"
82+
tilesTooling = "1.4.0"
83+
tilesToolingPreview = "1.4.0"
84+
horologistComposeTools = "0.6.17"
85+
horologistTiles = "0.6.17"
86+
watchfaceComplicationsDataSourceKtx = "1.2.1"
7287
[libraries]
7388
accompanist-permissions = { group = "com.google.accompanist", name = "accompanist-permissions", version.ref = "accompanist" }
7489
android-desugarJdkLibs = { group = "com.android.tools", name = "desugar_jdk_libs", version.ref = "androidDesugarJdkLibs" }
@@ -171,6 +186,21 @@ room-gradlePlugin = { group = "androidx.room", name = "room-gradle-plugin", vers
171186
androidx-navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigationFragmentKtx" }
172187
androidx-navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigationUiKtx" }
173188
androidx-navigation-fragment = { module = "androidx.navigation:navigation-fragment-ktx", version.ref = "androidx-navigation" }
189+
androidx-leanback = { group = "androidx.leanback", name = "leanback", version.ref = "leanback" }
190+
glide = { group = "com.github.bumptech.glide", name = "glide", version.ref = "glide" }
191+
androidx-tv-foundation = { group = "androidx.tv", name = "tv-foundation", version.ref = "tvFoundation" }
192+
androidx-tv-material = { group = "androidx.tv", name = "tv-material", version.ref = "tvMaterial" }
193+
play-services-wearable = { group = "com.google.android.gms", name = "play-services-wearable", version.ref = "playServicesWearable" }
194+
androidx-compose-material = { group = "androidx.wear.compose", name = "compose-material", version.ref = "composeMaterial" }
195+
compose-foundation = { group = "androidx.wear.compose", name = "compose-foundation", version.ref = "composeFoundation" }
196+
androidx-wear-tooling-preview = { group = "androidx.wear", name = "wear-tooling-preview", version.ref = "wearToolingPreview" }
197+
androidx-tiles = { group = "androidx.wear.tiles", name = "tiles", version.ref = "tiles" }
198+
androidx-tiles-material = { group = "androidx.wear.tiles", name = "tiles-material", version.ref = "tilesMaterial" }
199+
androidx-tiles-tooling = { group = "androidx.wear.tiles", name = "tiles-tooling", version.ref = "tilesTooling" }
200+
androidx-tiles-tooling-preview = { group = "androidx.wear.tiles", name = "tiles-tooling-preview", version.ref = "tilesToolingPreview" }
201+
horologist-compose-tools = { group = "com.google.android.horologist", name = "horologist-compose-tools", version.ref = "horologistComposeTools" }
202+
horologist-tiles = { group = "com.google.android.horologist", name = "horologist-tiles", version.ref = "horologistTiles" }
203+
androidx-watchface-complications-data-source-ktx = { group = "androidx.wear.watchface", name = "watchface-complications-data-source-ktx", version.ref = "watchfaceComplicationsDataSourceKtx" }
174204

175205

176206
[plugins]

android/hotel-module/bundle1/build.gradle

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins{
22
id "io.github.electrolytej.static-bundle-plugin"
3-
id("kotlin-android")
4-
id("kotlin-kapt")
3+
alias(libs.plugins.kotlin.android)
4+
alias(libs.plugins.compose)
55
}
66
android {
77
compileSdkVersion Integer.parseInt(project.rootProject.compileSdkVersion)
@@ -13,6 +13,7 @@ android {
1313
namespace "com.jamesfchen.bundle1"
1414
buildFeatures {
1515
viewBinding true
16+
compose = true
1617
}
1718
// defaultConfig {
1819
// javaCompileOptions {
@@ -34,4 +35,18 @@ dependencies {
3435
implementation project.moduleify("hotel-export")
3536
// kapt 'io.github.jamesfchen:ibc-processor:1.3.0'
3637
compileOnly project.moduleify('fwk-base')
38+
implementation(libs.androidx.core.ktx)
39+
implementation(libs.androidx.appcompat)
40+
implementation(platform(libs.androidx.compose.bom))
41+
implementation(libs.androidx.compose.ui)
42+
implementation(libs.androidx.compose.ui.graphics)
43+
implementation(libs.androidx.compose.ui.tooling.preview)
44+
implementation(libs.androidx.tv.foundation)
45+
implementation(libs.androidx.tv.material)
46+
implementation(libs.androidx.lifecycle.runtime)
47+
implementation(libs.androidx.activity.compose)
48+
androidTestImplementation(platform(libs.androidx.compose.bom))
49+
androidTestImplementation(libs.androidx.compose.ui.test)
50+
debugImplementation(libs.androidx.compose.ui.tooling)
51+
debugImplementation(libs.androidx.compose.ui.test.manifest)
3752
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-feature
6+
android:name="android.hardware.touchscreen"
7+
android:required="false" />
8+
<uses-feature
9+
android:name="android.software.leanback"
10+
android:required="false" />
11+
12+
<application
13+
android:label="@string/app_name"
14+
android:theme="@style/Theme.Android">
15+
<activity
16+
android:name="com.electrolytej.bundle1.MainActivity"
17+
android:banner="@drawable/app_icon_your_company"
18+
android:exported="true">
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
24+
</intent-filter>
25+
</activity>
26+
</application>
27+
28+
</manifest>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package com.electrolytej.bundle1
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.compose.foundation.layout.fillMaxSize
7+
import androidx.tv.material3.Text
8+
import androidx.compose.runtime.Composable
9+
import androidx.compose.ui.Modifier
10+
import androidx.compose.ui.graphics.RectangleShape
11+
import androidx.compose.ui.tooling.preview.Preview
12+
import androidx.tv.material3.ExperimentalTvMaterial3Api
13+
import androidx.tv.material3.Surface
14+
import com.electrolytej.bundle1.ui.theme.AndroidTheme
15+
16+
class MainActivity : ComponentActivity() {
17+
@OptIn(ExperimentalTvMaterial3Api::class)
18+
override fun onCreate(savedInstanceState: Bundle?) {
19+
super.onCreate(savedInstanceState)
20+
setContent {
21+
AndroidTheme {
22+
Surface(
23+
modifier = Modifier.fillMaxSize(),
24+
shape = RectangleShape
25+
) {
26+
Greeting("Android")
27+
}
28+
}
29+
}
30+
}
31+
}
32+
33+
@Composable
34+
fun Greeting(name: String, modifier: Modifier = Modifier) {
35+
Text(
36+
text = "Hello $name!",
37+
modifier = modifier
38+
)
39+
}
40+
41+
@Preview(showBackground = true)
42+
@Composable
43+
fun GreetingPreview() {
44+
AndroidTheme {
45+
Greeting("Android")
46+
}
47+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.electrolytej.bundle1.ui.theme
2+
3+
import androidx.compose.ui.graphics.Color
4+
5+
val Purple80 = Color(0xFFD0BCFF)
6+
val PurpleGrey80 = Color(0xFFCCC2DC)
7+
val Pink80 = Color(0xFFEFB8C8)
8+
9+
val Purple40 = Color(0xFF6650a4)
10+
val PurpleGrey40 = Color(0xFF625b71)
11+
val Pink40 = Color(0xFF7D5260)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.electrolytej.bundle1.ui.theme
2+
3+
import androidx.compose.foundation.isSystemInDarkTheme
4+
import androidx.compose.runtime.Composable
5+
import androidx.tv.material3.ExperimentalTvMaterial3Api
6+
import androidx.tv.material3.MaterialTheme
7+
import androidx.tv.material3.darkColorScheme
8+
import androidx.tv.material3.lightColorScheme
9+
10+
@OptIn(ExperimentalTvMaterial3Api::class)
11+
@Composable
12+
fun AndroidTheme(
13+
isInDarkTheme: Boolean = isSystemInDarkTheme(),
14+
content: @Composable () -> Unit,
15+
) {
16+
val colorScheme = if (isInDarkTheme) {
17+
darkColorScheme(
18+
primary = Purple80,
19+
secondary = PurpleGrey80,
20+
tertiary = Pink80
21+
)
22+
} else {
23+
lightColorScheme(
24+
primary = Purple40,
25+
secondary = PurpleGrey40,
26+
tertiary = Pink40
27+
)
28+
}
29+
MaterialTheme(
30+
colorScheme = colorScheme,
31+
typography = Typography,
32+
content = content
33+
)
34+
}

0 commit comments

Comments
 (0)