Skip to content

Commit 0abe32e

Browse files
committed
first commit
0 parents  commit 0abe32e

Some content is hidden

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

50 files changed

+1820
-0
lines changed

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
!gradle/wrapper/gradle-wrapper.jar
16+
*.war
17+
*.nar
18+
*.ear
19+
*.zip
20+
*.tar.gz
21+
*.rar
22+
23+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
24+
hs_err_pid*
25+
26+
# Built application files
27+
*.apk
28+
*.ap_
29+
*.aab
30+
31+
# Files for the ART/Dalvik VM
32+
*.dex
33+
34+
# Java class files
35+
*.class
36+
37+
# Generated files
38+
bin/
39+
gen/
40+
out/
41+
release/
42+
43+
# Gradle files
44+
.gradle/
45+
build/
46+
47+
# Local configuration file (sdk path, etc)
48+
local.properties
49+
50+
# Proguard folder generated by Eclipse
51+
proguard/
52+
53+
# Log Files
54+
*.log
55+
56+
# Android Studio Navigation editor temp files
57+
.navigation/
58+
59+
# Android Studio captures folder
60+
captures/
61+
62+
# IntelliJ
63+
*.iml
64+
.idea/workspace.xml
65+
.idea/tasks.xml
66+
.idea/gradle.xml
67+
.idea/assetWizardSettings.xml
68+
.idea/misc.xml
69+
.idea/runConfigurations.xml
70+
.idea/dictionaries
71+
.idea/libraries
72+
.idea/encodings.xml
73+
.idea/jarRepositories.xml
74+
# Android Studio 3 in .gitignore file.
75+
.idea/caches
76+
.idea/modules.xml
77+
# Comment next line if keeping position of elements in Navigation Editor is relevant for you
78+
.idea/navEditor.xml
79+
.idea/jarRepositories.xml
80+
81+
# Keystore files
82+
# Uncomment the following lines if you do not want to check your keystore files in.
83+
#*.jks
84+
#*.keystore
85+
keystore.crypt
86+
googlekey*.crypt
87+
88+
# External native build folder generated in Android Studio 2.2 and later
89+
.externalNativeBuild
90+
91+
# Google Services (e.g. APIs or Firebase)
92+
# google-services.json
93+
94+
# Freeline
95+
freeline.py
96+
freeline/
97+
freeline_project_description.json
98+
99+
# fastlane
100+
fastlane/report.xml
101+
fastlane/Preview.html
102+
fastlane/screenshots
103+
fastlane/test_output
104+
fastlane/readme.md
105+
106+
# Version control
107+
vcs.xml
108+
109+
# lint
110+
lint/intermediates/
111+
lint/generated/
112+
lint/outputs/
113+
lint/tmp/
114+
lint/reports/
115+
116+
*.DS_STORE
117+
118+
#secrets (TODO: add yours here)
119+
*.keystore
120+
121+
gradle.properties
122+
/.idea/compiler.xml

app/build.gradle

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
compileSdk 32
8+
9+
defaultConfig {
10+
applicationId "com.cupsofcode.recomposition_examples"
11+
minSdk 23
12+
targetSdk 32
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
vectorDrawables {
18+
useSupportLibrary true
19+
}
20+
}
21+
22+
buildTypes {
23+
release {
24+
minifyEnabled false
25+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26+
}
27+
}
28+
compileOptions {
29+
sourceCompatibility JavaVersion.VERSION_1_8
30+
targetCompatibility JavaVersion.VERSION_1_8
31+
}
32+
kotlinOptions {
33+
jvmTarget = '1.8'
34+
}
35+
buildFeatures {
36+
compose true
37+
}
38+
composeOptions {
39+
kotlinCompilerExtensionVersion compose_version
40+
}
41+
packagingOptions {
42+
resources {
43+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
44+
}
45+
}
46+
}
47+
48+
dependencies {
49+
50+
implementation 'androidx.core:core-ktx:1.7.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+
testImplementation 'junit:junit:4.13.2'
57+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
58+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
59+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
60+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
61+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
62+
}

app/proguard-rules.pro

+21
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.cupsofcode.recomposition_examples
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.cupsofcode.recomposition_examples", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
package="com.cupsofcode.recomposition_examples">
5+
6+
<application
7+
android:allowBackup="true"
8+
android:dataExtractionRules="@xml/data_extraction_rules"
9+
android:fullBackupContent="@xml/backup_rules"
10+
android:icon="@mipmap/ic_launcher"
11+
android:label="@string/app_name"
12+
android:roundIcon="@mipmap/ic_launcher_round"
13+
android:supportsRtl="true"
14+
android:theme="@style/Theme.Recomposition_examples"
15+
tools:targetApi="31">
16+
<activity
17+
android:name=".MainActivity"
18+
android:exported="true"
19+
android:label="@string/app_name"
20+
android:theme="@style/Theme.Recomposition_examples">
21+
<intent-filter>
22+
<action android:name="android.intent.action.MAIN" />
23+
24+
<category android:name="android.intent.category.LAUNCHER" />
25+
</intent-filter>
26+
</activity>
27+
</application>
28+
29+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.cupsofcode.recomposition_examples
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.compose.foundation.layout.*
7+
import androidx.compose.material.MaterialTheme
8+
import androidx.compose.material.Surface
9+
import androidx.compose.runtime.*
10+
import androidx.compose.ui.Modifier
11+
import com.cupsofcode.recomposition_examples.ui.theme.*
12+
import kotlinx.coroutines.delay
13+
14+
class MainActivity : ComponentActivity() {
15+
override fun onCreate(savedInstanceState: Bundle?) {
16+
super.onCreate(savedInstanceState)
17+
setContent {
18+
Recomposition_examplesTheme {
19+
// A surface container using the 'background' color from the theme
20+
Surface(
21+
modifier = Modifier.fillMaxSize(),
22+
color = MaterialTheme.colors.background
23+
) {
24+
Tip1()
25+
}
26+
}
27+
}
28+
}
29+
}

0 commit comments

Comments
 (0)