Skip to content

Commit 37a5f75

Browse files
author
关杰
committed
Merge branch 'dev' of https://github.com/alibaba/atlas into dev
2 parents 2329694 + 93ae286 commit 37a5f75

File tree

148 files changed

+14281
-3859
lines changed

Some content is hidden

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

148 files changed

+14281
-3859
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+

atlas-demo/AtlasDemo/app/build.gradle

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,28 @@ android {
2222
vectorDrawables.useSupportLibrary = true
2323
}
2424

25-
// dataBinding{
26-
// enabled=true
27-
// }
25+
26+
dataBinding{
27+
enabled=true
28+
}
29+
2830

2931
buildTypes {
3032
release {
3133
minifyEnabled false
3234
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3335
}
3436
}
37+
38+
// productFlavors {
39+
// dev {
40+
// minSdkVersion 14
41+
// }
42+
//
43+
// beta {
44+
// minSdkVersion 21
45+
// }
46+
// }
3547
}
3648

3749
atlas {
@@ -67,7 +79,9 @@ atlas {
6779

6880
dependencies {
6981
compile fileTree(dir: 'libs', include: ['*.jar'])
82+
7083
compile('com.taobao.android:atlas_core:5.0.6-rc52@aar') {
84+
7185
transitive = true
7286
}
7387

@@ -80,6 +94,7 @@ dependencies {
8094
bundleCompile project(':secondbundle')
8195
bundleCompile project(':remotebundle')
8296
bundleCompile project(':publicbundle')
97+
// bundleCompile project(':databindbundle')
8398

8499
compile 'com.android.support:appcompat-v7:25.1.0'
85100
compile 'com.android.support:design:25.1.0'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<configuration>
2+
<gui>
3+
<mainWindow>
4+
<location x='420' y='250' />
5+
<size w='600' h='400' />
6+
<maximize>false</maximize>
7+
</mainWindow>
8+
<lookAndFeel>system</lookAndFeel>
9+
</gui>
10+
<recentFilePaths>
11+
<filePath>/Users/wuzhong/github/atlas/atlas-demo/AtlasDemo/app/build/intermediates/exploded-awb/AtlasDemo/firstbundle/unspecified/jars/classes.jar</filePath>
12+
</recentFilePaths>
13+
<recentDirectories>
14+
<loadPath>/Users/wuzhong/github/atlas/atlas-demo/AtlasDemo/app</loadPath>
15+
<savePath>/Users/wuzhong/github/atlas/atlas-demo/AtlasDemo/app</savePath>
16+
</recentDirectories>
17+
<preferences>
18+
<JdGuiPreferences.errorBackgroundColor>0xFF6666</JdGuiPreferences.errorBackgroundColor>
19+
</preferences>
20+
</configuration>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
package com.taobao.demo.databind;
2+
3+
import android.app.Activity;
4+
import android.databinding.DataBindingUtil;
5+
import android.os.Bundle;
6+
import android.text.Editable;
7+
import android.text.TextWatcher;
8+
import android.widget.EditText;
9+
import android.widget.TextView;
10+
11+
import com.taobao.demo.R;
12+
import com.taobao.demo.databinding.AarDatabindMainBinding;
13+
14+
15+
public class DataBundleAarActivity extends Activity {
16+
/**
17+
* Called when the activity is first created.
18+
*/
19+
@Override
20+
public void onCreate(Bundle savedInstanceState) {
21+
22+
super.onCreate(savedInstanceState);
23+
24+
setContentView(R.layout.aar_databind_main);
25+
26+
TextView textView = (TextView) findViewById(R.id.xxxxx_aar);
27+
28+
AarDatabindMainBinding binding = DataBindingUtil.setContentView(this, R.layout.aar_databind_main);
29+
final User user = new User("Test", "User");
30+
binding.setUser(user);
31+
32+
EditText editText = (EditText) findViewById(R.id.inputText_aar);
33+
editText.addTextChangedListener(new TextWatcher() {
34+
@Override
35+
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
36+
37+
}
38+
39+
@Override
40+
public void onTextChanged(CharSequence s, int start, int before, int count) {
41+
System.out.println(s);
42+
user.setFirstName(s.toString());
43+
}
44+
45+
@Override
46+
public void afterTextChanged(Editable s) {
47+
48+
}
49+
});
50+
51+
52+
}
53+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.taobao.demo.databind;
2+
3+
import android.databinding.BaseObservable;
4+
import android.databinding.Bindable;
5+
6+
import com.taobao.demo.BR;
7+
8+
/**
9+
* Created by wuzhong on 2016/10/19.
10+
*/
11+
12+
public class User extends BaseObservable {
13+
14+
String firstName;
15+
String lastName;
16+
17+
public User(String firstName, String lastName) {
18+
this.firstName = firstName;
19+
this.lastName = lastName;
20+
}
21+
22+
@Bindable
23+
public String getFirstName() {
24+
return firstName;
25+
}
26+
27+
public void setFirstName(String firstName) {
28+
this.firstName = firstName;
29+
this.notifyPropertyChanged(BR.firstName);
30+
}
31+
32+
@Bindable
33+
public String getLastName() {
34+
return lastName;
35+
}
36+
37+
public void setLastName(String lastName) {
38+
this.lastName = lastName;
39+
}
40+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layout
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:android="http://schemas.android.com/apk/res/android">
5+
<data>
6+
<variable name="user" type="com.taobao.demo.databind.User"/>
7+
</data>
8+
<LinearLayout
9+
android:orientation="vertical"
10+
android:layout_width="match_parent"
11+
android:layout_height="match_parent">
12+
13+
<EditText
14+
android:layout_width="match_parent"
15+
android:layout_height="wrap_content"
16+
android:id="@+id/inputText_aar" />
17+
18+
19+
<TextView android:layout_width="wrap_content"
20+
android:layout_height="wrap_content"
21+
android:text="@{user.firstName}"/>
22+
<TextView android:layout_width="wrap_content"
23+
android:layout_height="wrap_content"
24+
android:text="@{user.lastName}"/>
25+
26+
27+
<TextView
28+
android:layout_width="fill_parent"
29+
android:layout_height="fill_parent"
30+
android:id="@+id/xxxxx_aar"
31+
android:text="abcd"
32+
/>
33+
34+
</LinearLayout>
35+
</layout>

atlas-demo/AtlasDemo/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ buildscript {
1010
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
1111
}
1212
dependencies {
13-
classpath "com.taobao.android:atlasplugin:2.3.1.rc9"
13+
14+
classpath "com.taobao.android:atlasplugin:2.3.1.rc+"
15+
//classpath "com.taobao.android:atlasplugin:2.3.0.alpha15-SNAPSHOT"
16+
1417
}
1518
}
1619

atlas-demo/AtlasDemo/buildSrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../atlas-gradle-plugin/atlas-plugin/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'com.taobao.atlas'
3+
4+
atlas {
5+
bundleConfig{
6+
awbBundle true
7+
}
8+
buildTypes {
9+
debug {
10+
baseApFile project.rootProject.file('app/build/outputs/apk/app-debug.ap')
11+
}
12+
}
13+
}
14+
15+
android {
16+
compileSdkVersion 25
17+
buildToolsVersion '25.0.0'
18+
19+
defaultConfig {
20+
minSdkVersion 14
21+
targetSdkVersion 25
22+
versionCode 1
23+
versionName "1.0"
24+
25+
26+
}
27+
buildTypes {
28+
release {
29+
minifyEnabled false
30+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
31+
}
32+
}
33+
34+
dataBinding{
35+
enabled=true
36+
}
37+
}
38+
39+
dependencies {
40+
compile fileTree(dir: 'libs', include: ['*.jar'])
41+
providedCompile project(':middlewarelibrary')
42+
// bundleCompile project(':publicbundle')
43+
44+
providedCompile 'com.android.support:support-v4:25.3.0'
45+
providedCompile 'com.android.support:appcompat-v7:25.1.0'
46+
providedCompile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
47+
}

0 commit comments

Comments
 (0)