Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Commit 2a8adf1

Browse files
authored
import dev project for Compose (#185)
1 parent 8c1464d commit 2a8adf1

Some content is hidden

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

44 files changed

+1311
-0
lines changed
Lines changed: 15 additions & 0 deletions
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

projects/ComposeConstraintLayout/.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
5+
6+
def compose_version = '1.0.0-beta02'
7+
8+
android {
9+
compileSdkVersion 30
10+
buildToolsVersion "30.0.3"
11+
12+
defaultConfig {
13+
applicationId "androidx.constaitnlayout.experiments.template"
14+
minSdkVersion 21
15+
targetSdkVersion 30
16+
versionCode 1
17+
versionName "1.0"
18+
19+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
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+
33+
buildFeatures {
34+
compose true
35+
buildConfig false
36+
}
37+
38+
packagingOptions {
39+
exclude 'META-INF/AL2.0'
40+
exclude 'META-INF/LGPL2.1'
41+
}
42+
43+
kotlinOptions {
44+
jvmTarget = JavaVersion.VERSION_1_8.toString()
45+
useIR = true
46+
}
47+
48+
composeOptions {
49+
kotlinCompilerVersion "1.4.31"
50+
kotlinCompilerExtensionVersion compose_version
51+
}
52+
53+
}
54+
55+
dependencies {
56+
57+
implementation project(':core')
58+
implementation project(':compose')
59+
60+
implementation "androidx.activity:activity-compose:1.3.0-alpha04"
61+
62+
implementation "androidx.compose.material:material:$compose_version"
63+
implementation "androidx.compose.ui:ui:$compose_version"
64+
implementation "androidx.compose.ui:ui-unit:$compose_version"
65+
implementation "androidx.compose.ui:ui-util:$compose_version"
66+
implementation "androidx.compose.foundation:foundation-layout:$compose_version"
67+
implementation "androidx.compose.foundation:foundation:$compose_version"
68+
implementation "androidx.compose.ui:ui-test:$compose_version"
69+
70+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
71+
implementation 'androidx.core:core-ktx:1.3.1'
72+
implementation 'androidx.appcompat:appcompat:1.2.0'
73+
implementation 'com.google.android.material:material:1.2.1'
74+
implementation project(path: ':constraintlayout')
75+
implementation 'androidx.compose.ui:ui-tooling:1.0.0-beta02'
76+
testImplementation 'junit:junit:4.13'
77+
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
78+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
79+
}
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.example.constraintlayout
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.example.developertemplate", appContext.packageName)
23+
}
24+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.example.constraintlayout">
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.DeveloperTemplate">
12+
<activity android:name="com.example.constraintlayout.MainActivity">
13+
<intent-filter>
14+
<action android:name="android.intent.action.MAIN" />
15+
16+
<category android:name="android.intent.category.LAUNCHER" />
17+
</intent-filter>
18+
</activity>
19+
</application>
20+
21+
</manifest>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.example.constraintlayout
2+
3+
import androidx.appcompat.app.AppCompatActivity
4+
import android.os.Bundle
5+
import androidx.activity.compose.setContent
6+
import androidx.constraintlayout.compose.Screen2
7+
8+
class MainActivity : AppCompatActivity() {
9+
override fun onCreate(savedInstanceState: Bundle?) {
10+
super.onCreate(savedInstanceState)
11+
setContent {
12+
Screen2()
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)