Skip to content

Commit 78009e7

Browse files
committed
first commit
1 parent a036195 commit 78009e7

Some content is hidden

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

52 files changed

+1673
-82
lines changed

.gitignore

Lines changed: 8 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,11 @@
1-
# Built application files
2-
*.apk
3-
*.aar
4-
*.ap_
5-
*.aab
6-
7-
# Files for the ART/Dalvik VM
8-
*.dex
9-
10-
# Java class files
11-
*.class
12-
13-
# Generated files
14-
bin/
15-
gen/
16-
out/
17-
# Uncomment the following line in case you need and you don't have the release build type files in your app
18-
# release/
19-
20-
# Gradle files
21-
.gradle/
22-
build/
23-
24-
# Local configuration file (sdk path, etc)
25-
local.properties
26-
27-
# Proguard folder generated by Eclipse
28-
proguard/
29-
30-
# Log Files
31-
*.log
32-
33-
# Android Studio Navigation editor temp files
34-
.navigation/
35-
36-
# Android Studio captures folder
37-
captures/
38-
39-
# IntelliJ
401
*.iml
41-
.idea/workspace.xml
42-
.idea/tasks.xml
43-
.idea/gradle.xml
44-
.idea/assetWizardSettings.xml
45-
.idea/dictionaries
46-
.idea/libraries
47-
# Android Studio 3 in .gitignore file.
48-
.idea/caches
49-
.idea/modules.xml
50-
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
51-
.idea/navEditor.xml
52-
53-
# Keystore files
54-
# Uncomment the following lines if you do not want to check your keystore files in.
55-
#*.jks
56-
#*.keystore
57-
58-
# External native build folder generated in Android Studio 2.2 and later
2+
.gradle
3+
/local.properties
4+
/.idea/*
5+
.DS_Store
6+
/build
7+
/captures
598
.externalNativeBuild
60-
.cxx/
61-
62-
# Google Services (e.g. APIs or Firebase)
63-
# google-services.json
64-
65-
# Freeline
66-
freeline.py
67-
freeline/
68-
freeline_project_description.json
69-
70-
# fastlane
71-
fastlane/report.xml
72-
fastlane/Preview.html
73-
fastlane/screenshots
74-
fastlane/test_output
75-
fastlane/readme.md
76-
77-
# Version control
78-
vcs.xml
9+
.cxx
10+
local.properties
7911

80-
# lint
81-
lint/intermediates/
82-
lint/generated/
83-
lint/outputs/
84-
lint/tmp/
85-
# lint/reports/

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
5+
6+
android {
7+
compileSdk 31
8+
buildToolsVersion "30.0.3"
9+
10+
defaultConfig {
11+
applicationId "com.github.compose.waveloading"
12+
minSdk 21
13+
targetSdk 31
14+
versionCode 1
15+
versionName "1.0"
16+
17+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18+
vectorDrawables {
19+
useSupportLibrary true
20+
}
21+
}
22+
23+
buildTypes {
24+
release {
25+
minifyEnabled false
26+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
27+
}
28+
}
29+
compileOptions {
30+
sourceCompatibility JavaVersion.VERSION_1_8
31+
targetCompatibility JavaVersion.VERSION_1_8
32+
}
33+
kotlinOptions {
34+
jvmTarget = '1.8'
35+
useIR = true
36+
}
37+
buildFeatures {
38+
compose true
39+
}
40+
composeOptions {
41+
kotlinCompilerExtensionVersion compose_version
42+
kotlinCompilerVersion '1.5.10'
43+
}
44+
}
45+
46+
dependencies {
47+
48+
implementation 'androidx.core:core-ktx:1.6.0'
49+
implementation 'androidx.appcompat:appcompat:1.3.1'
50+
implementation 'com.google.android.material:material:1.4.0'
51+
implementation "androidx.compose.ui:ui:$compose_version"
52+
implementation "androidx.compose.material:material:$compose_version"
53+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
54+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
55+
implementation 'androidx.activity:activity-compose:1.3.1'
56+
implementation project(path: ':lib')
57+
testImplementation 'junit:junit:4.+'
58+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
59+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
60+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
61+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
62+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.github.compose.waveloading
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.github.compose.waveloading", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.github.compose.waveloading">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:roundIcon="@mipmap/ic_launcher_round"
10+
android:supportsRtl="true"
11+
android:theme="@style/Theme.Composewaveloading">
12+
<activity
13+
android:name=".MainActivity"
14+
android:exported="true"
15+
android:label="@string/app_name"
16+
android:theme="@style/Theme.Composewaveloading.NoActionBar">
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
</application>
24+
25+
</manifest>

app/src/main/assets/fundroid.png

554 KB
Loading
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
package com.github.compose.waveloading
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.compose.foundation.Image
7+
import androidx.compose.foundation.background
8+
import androidx.compose.foundation.border
9+
import androidx.compose.foundation.layout.Box
10+
import androidx.compose.foundation.layout.Row
11+
import androidx.compose.foundation.layout.Spacer
12+
import androidx.compose.foundation.layout.fillMaxSize
13+
import androidx.compose.foundation.layout.height
14+
import androidx.compose.foundation.layout.padding
15+
import androidx.compose.foundation.layout.size
16+
import androidx.compose.foundation.layout.width
17+
import androidx.compose.foundation.shape.RoundedCornerShape
18+
import androidx.compose.material.MaterialTheme
19+
import androidx.compose.material.Shapes
20+
import androidx.compose.material.Surface
21+
import androidx.compose.material.Text
22+
import androidx.compose.material.icons.Icons
23+
import androidx.compose.material.icons.filled.CheckCircle
24+
import androidx.compose.material.swipeable
25+
import androidx.compose.runtime.Composable
26+
import androidx.compose.ui.Alignment
27+
import androidx.compose.ui.Modifier
28+
import androidx.compose.ui.draw.clip
29+
import androidx.compose.ui.draw.clipToBounds
30+
import androidx.compose.ui.graphics.Color
31+
import androidx.compose.ui.graphics.RectangleShape
32+
import androidx.compose.ui.graphics.vector.ImageVector
33+
import androidx.compose.ui.res.painterResource
34+
import androidx.compose.ui.res.vectorResource
35+
import androidx.compose.ui.text.font.FontWeight
36+
import androidx.compose.ui.tooling.preview.Preview
37+
import androidx.compose.ui.unit.TextUnit
38+
import androidx.compose.ui.unit.dp
39+
import androidx.compose.ui.unit.sp
40+
import com.github.compose.waveloading.ui.theme.ComposewaveloadingTheme
41+
42+
class MainActivity : ComponentActivity() {
43+
override fun onCreate(savedInstanceState: Bundle?) {
44+
super.onCreate(savedInstanceState)
45+
setContent {
46+
ComposewaveloadingTheme {
47+
// A surface container using the 'background' color from the theme
48+
Surface(color = MaterialTheme.colors.background) {
49+
Box(Modifier.fillMaxSize()) {
50+
// WaveLoading(
51+
// Modifier
52+
// .width(200.dp)
53+
// .height(200.dp)
54+
// .align(Alignment.Center)
55+
// .clip(RoundedCornerShape(100))
56+
// )
57+
58+
59+
WaveLoading2(
60+
Modifier
61+
.align(Alignment.Center)
62+
) {
63+
64+
65+
Image(
66+
modifier = Modifier
67+
.padding(10.dp)
68+
.clip(RoundedCornerShape(100)),
69+
painter = painterResource(id = R.drawable.fundroid),
70+
contentDescription = ""
71+
)
72+
//
73+
// Row(Modifier.align(Alignment.Center)) {
74+
//
75+
// Image(
76+
// modifier = Modifier
77+
// .weight(1f)
78+
// .padding(10.dp)
79+
// .clip(RoundedCornerShape(100)),
80+
// painter = painterResource(id = R.drawable.logo_bmw),
81+
// contentDescription = ""
82+
// )
83+
//
84+
//
85+
// Text(
86+
// modifier = Modifier
87+
// .weight(1f).align(Alignment.CenterVertically),
88+
// text = "中秋",
89+
// style = MaterialTheme.typography.h3,
90+
// fontWeight = FontWeight.Bold,
91+
// color = Color.Red
92+
// )
93+
//
94+
// Image(
95+
// modifier = Modifier
96+
// .weight(1f)
97+
// .padding(10.dp)
98+
// .clip(RoundedCornerShape(100)),
99+
// painter = painterResource(id = R.drawable.logo_bmw),
100+
// contentDescription = ""
101+
// )
102+
// }
103+
104+
}
105+
106+
107+
}
108+
}
109+
}
110+
}
111+
}
112+
}
113+
114+
@Preview(showBackground = true)
115+
@Composable
116+
fun DefaultPreview() {
117+
ComposewaveloadingTheme {
118+
119+
Box {
120+
// WaveLoading(
121+
// Modifier
122+
// .align(Alignment.Center)
123+
// .size(100.dp)
124+
// .border(1.dp, Color.Black)
125+
// )
126+
127+
//
128+
// Image(
129+
// modifier = Modifier.wave(),
130+
// imageVector = Icons.Default.CheckCircle,
131+
// contentDescription = ""
132+
// )
133+
134+
WaveLoading2 {
135+
Image(
136+
imageVector = Icons.Default.CheckCircle,
137+
contentDescription = ""
138+
)
139+
}
140+
141+
}
142+
143+
}
144+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.github.compose.waveloading.ui.theme
2+
3+
import androidx.compose.ui.graphics.Color
4+
5+
val Purple200 = Color(0xFFBB86FC)
6+
val Purple500 = Color(0xFF6200EE)
7+
val Purple700 = Color(0xFF3700B3)
8+
val Teal200 = Color(0xFF03DAC5)

0 commit comments

Comments
 (0)