-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of https://github.com/alibaba/atlas into dev
- Loading branch information
Showing
148 changed files
with
14,281 additions
and
3,859 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
53 changes: 53 additions & 0 deletions
53
atlas-demo/AtlasDemo/app/src/main/java/com/taobao/demo/databind/DataBundleAarActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
|
||
} | ||
}); | ||
|
||
|
||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
atlas-demo/AtlasDemo/app/src/main/java/com/taobao/demo/databind/User.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
35
atlas-demo/AtlasDemo/app/src/main/res/layout/aar_databind_main.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../atlas-gradle-plugin/atlas-plugin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
21
atlas-demo/AtlasDemo/databindbundle/src/main/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
53 changes: 53 additions & 0 deletions
53
...bindbundle/src/main/java/com/taobao/databindbundle/databind/DataBundleSampleActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
|
||
} | ||
}); | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.