Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/alibaba/atlas into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
关杰 committed Apr 27, 2017
2 parents 2329694 + 93ae286 commit 37a5f75
Show file tree
Hide file tree
Showing 148 changed files with 14,281 additions and 3,859 deletions.
2 changes: 2 additions & 0 deletions atlas-demo/AtlasDemo/app/.gradletasknamecache
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@


21 changes: 18 additions & 3 deletions atlas-demo/AtlasDemo/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,28 @@ android {
vectorDrawables.useSupportLibrary = true
}

// dataBinding{
// enabled=true
// }

dataBinding{
enabled=true
}


buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

// productFlavors {
// dev {
// minSdkVersion 14
// }
//
// beta {
// minSdkVersion 21
// }
// }
}

atlas {
Expand Down Expand Up @@ -67,7 +79,9 @@ atlas {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile('com.taobao.android:atlas_core:5.0.6-rc52@aar') {

transitive = true
}

Expand All @@ -80,6 +94,7 @@ dependencies {
bundleCompile project(':secondbundle')
bundleCompile project(':remotebundle')
bundleCompile project(':publicbundle')
// bundleCompile project(':databindbundle')

compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
Expand Down
20 changes: 20 additions & 0 deletions atlas-demo/AtlasDemo/app/jd-gui.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<configuration>
<gui>
<mainWindow>
<location x='420' y='250' />
<size w='600' h='400' />
<maximize>false</maximize>
</mainWindow>
<lookAndFeel>system</lookAndFeel>
</gui>
<recentFilePaths>
<filePath>/Users/wuzhong/github/atlas/atlas-demo/AtlasDemo/app/build/intermediates/exploded-awb/AtlasDemo/firstbundle/unspecified/jars/classes.jar</filePath>
</recentFilePaths>
<recentDirectories>
<loadPath>/Users/wuzhong/github/atlas/atlas-demo/AtlasDemo/app</loadPath>
<savePath>/Users/wuzhong/github/atlas/atlas-demo/AtlasDemo/app</savePath>
</recentDirectories>
<preferences>
<JdGuiPreferences.errorBackgroundColor>0xFF6666</JdGuiPreferences.errorBackgroundColor>
</preferences>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.taobao.demo.databind;

import android.app.Activity;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.TextView;

import com.taobao.demo.R;
import com.taobao.demo.databinding.AarDatabindMainBinding;


public class DataBundleAarActivity extends Activity {
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.aar_databind_main);

TextView textView = (TextView) findViewById(R.id.xxxxx_aar);

AarDatabindMainBinding binding = DataBindingUtil.setContentView(this, R.layout.aar_databind_main);
final User user = new User("Test", "User");
binding.setUser(user);

EditText editText = (EditText) findViewById(R.id.inputText_aar);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {

}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
System.out.println(s);
user.setFirstName(s.toString());
}

@Override
public void afterTextChanged(Editable s) {

}
});


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.taobao.demo.databind;

import android.databinding.BaseObservable;
import android.databinding.Bindable;

import com.taobao.demo.BR;

/**
* Created by wuzhong on 2016/10/19.
*/

public class User extends BaseObservable {

String firstName;
String lastName;

public User(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}

@Bindable
public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
this.notifyPropertyChanged(BR.firstName);
}

@Bindable
public String getLastName() {
return lastName;
}

public void setLastName(String lastName) {
this.lastName = lastName;
}
}
35 changes: 35 additions & 0 deletions atlas-demo/AtlasDemo/app/src/main/res/layout/aar_databind_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable name="user" type="com.taobao.demo.databind.User"/>
</data>
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/inputText_aar" />


<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{user.firstName}"/>
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@{user.lastName}"/>


<TextView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/xxxxx_aar"
android:text="abcd"
/>

</LinearLayout>
</layout>
5 changes: 4 additions & 1 deletion atlas-demo/AtlasDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ buildscript {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
dependencies {
classpath "com.taobao.android:atlasplugin:2.3.1.rc9"

classpath "com.taobao.android:atlasplugin:2.3.1.rc+"
//classpath "com.taobao.android:atlasplugin:2.3.0.alpha15-SNAPSHOT"

}
}

Expand Down
1 change: 1 addition & 0 deletions atlas-demo/AtlasDemo/buildSrc
1 change: 1 addition & 0 deletions atlas-demo/AtlasDemo/databindbundle/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
47 changes: 47 additions & 0 deletions atlas-demo/AtlasDemo/databindbundle/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apply plugin: 'com.android.library'
apply plugin: 'com.taobao.atlas'

atlas {
bundleConfig{
awbBundle true
}
buildTypes {
debug {
baseApFile project.rootProject.file('app/build/outputs/apk/app-debug.ap')
}
}
}

android {
compileSdkVersion 25
buildToolsVersion '25.0.0'

defaultConfig {
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"


}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

dataBinding{
enabled=true
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
providedCompile project(':middlewarelibrary')
// bundleCompile project(':publicbundle')

providedCompile 'com.android.support:support-v4:25.3.0'
providedCompile 'com.android.support:appcompat-v7:25.1.0'
providedCompile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
}
25 changes: 25 additions & 0 deletions atlas-demo/AtlasDemo/databindbundle/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/guanjie/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
21 changes: 21 additions & 0 deletions atlas-demo/AtlasDemo/databindbundle/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.taobao.databindbundle">

<application
android:allowBackup="true"
android:supportsRtl="true">

<activity
android:name=".databind.DataBundleSampleActivity"
android:theme="@style/AppTheme.NoActionBar"
android:label="databind"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.taobao.databindbundle.databind;

import android.app.Activity;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.TextView;

import com.taobao.databindbundle.R;
import com.taobao.databindbundle.databinding.BundleDatabindMainBinding;


public class DataBundleSampleActivity extends Activity {
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.bundle_databind_main);

TextView textView = (TextView) findViewById(R.id.xxxxx);

BundleDatabindMainBinding binding = DataBindingUtil.setContentView(this, R.layout.bundle_databind_main);
final User user = new User("Test", "User");
binding.setUser(user);

EditText editText = (EditText) findViewById(R.id.inputText);
editText.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {

}

@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
System.out.println(s);
user.setFirstName(s.toString());
}

@Override
public void afterTextChanged(Editable s) {

}
});


}
}
Loading

0 comments on commit 37a5f75

Please sign in to comment.