├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── cn │ │ └── feng │ │ └── constraintlayoutsample │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── cn │ │ │ └── feng │ │ │ └── constraintlayoutsample │ │ │ ├── activity │ │ │ ├── CircularRevealHelperActivity.kt │ │ │ ├── ComposeMultipleHelperActivity.kt │ │ │ ├── FlyInHelperActivity.kt │ │ │ ├── LayerActivity.kt │ │ │ └── MainActivity.kt │ │ │ ├── adapter │ │ │ └── BaseRecyclerAdapter.java │ │ │ ├── helps │ │ │ ├── CircularRevealHelper.kt │ │ │ ├── CircularRevealHelper2.kt │ │ │ ├── ExampleFlyinBounceHelper.kt │ │ │ ├── FlipRevealHelper.kt │ │ │ ├── Flyin2Helper.kt │ │ │ ├── FlyinHelper.kt │ │ │ └── MetaballsDecorator.kt │ │ │ └── utils │ │ │ └── ViewExtensions.kt │ └── res │ │ ├── drawable-hdpi │ │ ├── ic_accessibility_new.png │ │ ├── ic_accessible.png │ │ ├── ic_airline_seat_individual_suite.png │ │ ├── ic_airline_seat_recline_normal.png │ │ ├── ic_directions_bike.png │ │ ├── ic_directions_car.png │ │ ├── ic_directions_run.png │ │ └── ic_directions_walk.png │ │ ├── drawable-mdpi │ │ ├── ic_accessibility_new.png │ │ ├── ic_accessible.png │ │ ├── ic_airline_seat_individual_suite.png │ │ ├── ic_airline_seat_recline_normal.png │ │ ├── ic_directions_bike.png │ │ ├── ic_directions_car.png │ │ ├── ic_directions_run.png │ │ └── ic_directions_walk.png │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable-xhdpi │ │ ├── ic_accessibility_new.png │ │ ├── ic_accessible.png │ │ ├── ic_airline_seat_individual_suite.png │ │ ├── ic_airline_seat_recline_normal.png │ │ ├── ic_directions_bike.png │ │ ├── ic_directions_car.png │ │ ├── ic_directions_run.png │ │ └── ic_directions_walk.png │ │ ├── drawable-xxhdpi │ │ ├── ic_accessibility_new.png │ │ ├── ic_accessible.png │ │ ├── ic_airline_seat_individual_suite.png │ │ ├── ic_airline_seat_recline_normal.png │ │ ├── ic_directions_bike.png │ │ ├── ic_directions_car.png │ │ ├── ic_directions_run.png │ │ └── ic_directions_walk.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_accessibility_new.png │ │ ├── ic_accessible.png │ │ ├── ic_airline_seat_individual_suite.png │ │ ├── ic_airline_seat_recline_normal.png │ │ ├── ic_directions_bike.png │ │ ├── ic_directions_car.png │ │ ├── ic_directions_run.png │ │ └── ic_directions_walk.png │ │ ├── drawable │ │ ├── background.jpeg │ │ ├── batman.jpg │ │ ├── daxiao.png │ │ ├── frame.xml │ │ ├── ic_launcher_background.xml │ │ └── mario.jpg │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── activity_main1.xml │ │ ├── activity_main2.xml │ │ ├── activity_main3.xml │ │ ├── activity_main4.xml │ │ ├── activity_main5.xml │ │ ├── activity_main6.xml │ │ ├── layout_helper_circular_reveal.xml │ │ ├── layout_helper_metables_decorator.xml │ │ ├── layout_hepler_fly_in.xml │ │ ├── layout_layer.xml │ │ ├── layout_multiple_helper.xml │ │ ├── motion_01_basic.xml │ │ ├── motion_01_cl_end.xml │ │ ├── motion_01_cl_start.xml │ │ ├── motion_02.xml │ │ ├── motion_04_imagefilter.xml │ │ ├── motion_05_imagefilter.xml │ │ ├── motion_06.xml │ │ └── motion_07.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── scene_01.xml │ │ ├── scene_02.xml │ │ ├── scene_04.xml │ │ ├── scene_05.xml │ │ ├── scene_06.xml │ │ └── scene_07.xml │ └── test │ └── java │ └── cn │ └── feng │ └── constraintlayoutsample │ └── ExampleUnitTest.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ConstraintLayout 2.0 新特性详解及实战 2 | https://juejin.im/post/5d0c46246fb9a07ec9561573 3 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | apply plugin: 'kotlin-android' 4 | 5 | apply plugin: 'kotlin-android-extensions' 6 | 7 | android { 8 | compileSdkVersion 28 9 | defaultConfig { 10 | applicationId "cn.feng.constraintlayoutsample" 11 | minSdkVersion 19 12 | targetSdkVersion 28 13 | versionCode 1 14 | versionName "1.0" 15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 16 | } 17 | buildTypes { 18 | release { 19 | minifyEnabled false 20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 21 | } 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(dir: 'libs', include: ['*.jar']) 27 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 28 | implementation 'com.android.support:appcompat-v7:28.0.0' 29 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 30 | testImplementation 'junit:junit:4.12' 31 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 32 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 33 | 34 | 35 | implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1' 36 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 37 | implementation 'com.android.support:design:28.0.0' 38 | } 39 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 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 22 | -------------------------------------------------------------------------------- /app/src/androidTest/java/cn/feng/constraintlayoutsample/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintlayoutsample 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.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.getTargetContext() 22 | assertEquals("cn.feng.constraintlayoutsample", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/activity/CircularRevealHelperActivity.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.activity 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import cn.feng.constraintlayoutsample.R 6 | 7 | class CircularRevealHelperActivity : AppCompatActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | setContentView(R.layout.layout_helper_circular_reveal) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/activity/ComposeMultipleHelperActivity.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.activity 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import cn.feng.constraintlayoutsample.R 6 | 7 | class ComposeMultipleHelperActivity : AppCompatActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | setContentView(R.layout.layout_multiple_helper) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/activity/FlyInHelperActivity.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.activity 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import cn.feng.constraintlayoutsample.R 6 | 7 | class FlyInHelperActivity : AppCompatActivity() { 8 | 9 | override fun onCreate(savedInstanceState: Bundle?) { 10 | super.onCreate(savedInstanceState) 11 | setContentView(R.layout.layout_hepler_fly_in) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/activity/LayerActivity.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.activity 2 | 3 | import android.animation.ValueAnimator 4 | import android.os.Bundle 5 | import android.support.v7.app.AppCompatActivity 6 | import cn.feng.constraintlayoutsample.R 7 | import kotlinx.android.synthetic.main.layout_layer.* 8 | 9 | class LayerActivity : AppCompatActivity() { 10 | 11 | override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | setContentView(R.layout.layout_layer) 14 | 15 | button8.setOnClickListener { 16 | 17 | val anim = ValueAnimator.ofFloat(0f, 360f) 18 | anim.duration = 300 19 | anim.addUpdateListener { animation -> 20 | val angle = animation.animatedValue as Float 21 | layer.rotation = angle 22 | layer.scaleX = 1 + (180 - Math.abs(angle - 180)) / 20f 23 | layer.scaleY = 1 + (180 - Math.abs(angle - 180)) / 20f 24 | 25 | 26 | var shift_x = 500 * Math.sin(Math.toRadians((angle * 5).toDouble())).toFloat() 27 | var shift_y = 500 * Math.sin(Math.toRadians((angle * 7).toDouble())).toFloat() 28 | layer.translationX = shift_x 29 | layer.translationY = shift_y 30 | } 31 | anim.duration = 4000 32 | anim.start() 33 | } 34 | 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/activity/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.activity 2 | 3 | import android.content.Intent 4 | import android.os.Bundle 5 | import android.support.constraint.ConstraintProperties 6 | import android.support.constraint.ConstraintSet 7 | import android.support.v7.app.AppCompatActivity 8 | import android.support.v7.widget.DividerItemDecoration 9 | import cn.feng.constraintlayoutsample.R 10 | import cn.feng.constraintlayoutsample.adapter.BaseRecyclerAdapter 11 | import kotlinx.android.synthetic.main.activity_main.* 12 | 13 | class MainActivity : AppCompatActivity() { 14 | private val mData = arrayOf("LayerActivity", "CircularRevealHelper", "FlyInHelper", "ComposeMultipleHelper") 15 | 16 | 17 | override fun onCreate(savedInstanceState: Bundle?) { 18 | super.onCreate(savedInstanceState) 19 | setContentView(R.layout.activity_main) 20 | 21 | 22 | rv.addItemDecoration(DividerItemDecoration(this, DividerItemDecoration.VERTICAL)) 23 | rv.adapter = object : BaseRecyclerAdapter(mData.toList()) { 24 | override fun getItemLayoutId(viewType: Int): Int { 25 | return android.R.layout.simple_list_item_1 26 | } 27 | 28 | override fun convert(viewHolder: BaseVH, viewType: Int, data: String, position: Int) { 29 | viewHolder.setText(android.R.id.text1, data) 30 | viewHolder.itemView.setOnClickListener { 31 | when (position) { 32 | 0 -> startActivity(Intent(this@MainActivity, LayerActivity::class.java)) 33 | 1 -> startActivity(Intent(this@MainActivity, CircularRevealHelperActivity::class.java)) 34 | 2 -> startActivity(Intent(this@MainActivity, FlyInHelperActivity::class.java)) 35 | 3 -> startActivity(Intent(this@MainActivity, ComposeMultipleHelperActivity::class.java)) 36 | } 37 | } 38 | } 39 | 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/adapter/BaseRecyclerAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintlayoutsample.adapter; 2 | 3 | import android.support.annotation.DrawableRes; 4 | import android.support.annotation.IdRes; 5 | import android.support.annotation.LayoutRes; 6 | import android.support.annotation.NonNull; 7 | import android.support.annotation.StringRes; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.util.SparseArray; 10 | import android.view.LayoutInflater; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | import android.widget.ImageView; 14 | import android.widget.TextView; 15 | 16 | import java.util.List; 17 | 18 | public abstract class BaseRecyclerAdapter extends RecyclerView.Adapter { 19 | List mDataList; 20 | 21 | public BaseRecyclerAdapter(List dataList) { 22 | mDataList = dataList; 23 | } 24 | 25 | public BaseRecyclerAdapter() { 26 | } 27 | 28 | @NonNull 29 | @Override 30 | public BaseVH onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { 31 | return BaseVH.get(parent, getItemLayoutId(viewType)); 32 | } 33 | 34 | @Override 35 | public void onBindViewHolder(@NonNull BaseVH holder, int position) { 36 | convert(holder, getItemViewType(position), mDataList.get(position), position); 37 | } 38 | 39 | 40 | public abstract @LayoutRes 41 | int getItemLayoutId(int viewType); 42 | 43 | public abstract void convert(BaseVH viewHolder, int viewType, T data, int position); 44 | 45 | @Override 46 | public int getItemCount() { 47 | if (mDataList == null) { 48 | return 0; 49 | } 50 | return mDataList.size(); 51 | } 52 | 53 | 54 | public void setData(List dataList) { 55 | mDataList = dataList; 56 | notifyDataSetChanged(); 57 | } 58 | 59 | 60 | public static class BaseVH extends RecyclerView.ViewHolder { 61 | private final View mItemView; 62 | private SparseArray mViews; 63 | 64 | public BaseVH(View itemView) { 65 | super(itemView); 66 | mItemView = itemView; 67 | mViews = new SparseArray<>(); 68 | } 69 | 70 | public static BaseVH get(ViewGroup parent, @LayoutRes int itemLayoutId) { 71 | return new BaseVH(LayoutInflater.from(parent.getContext()).inflate(itemLayoutId, parent, false)); 72 | } 73 | 74 | 75 | public T getView(@IdRes int viewId) { 76 | View view = mViews.get(viewId); 77 | if (view == null) { 78 | view = mItemView.findViewById(viewId); 79 | mViews.put(viewId, view); 80 | } 81 | return (T) view; 82 | } 83 | 84 | 85 | public void setText(@IdRes int viewId, String text) { 86 | TextView view = getView(viewId); 87 | view.setText(text); 88 | } 89 | 90 | public void setText(@IdRes int viewId, @StringRes int textRes) { 91 | setText(viewId, itemView.getContext().getString(textRes)); 92 | } 93 | 94 | 95 | public void setImage(@IdRes int viewId, @DrawableRes int imgRes){ 96 | ImageView view = getView(viewId); 97 | view.setImageResource(imgRes); 98 | } 99 | 100 | public View getItemView() { 101 | return mItemView; 102 | } 103 | 104 | @Override 105 | public String toString() { 106 | return itemView.toString(); 107 | } 108 | } 109 | 110 | 111 | public void remove(int position) { 112 | mDataList.remove(position); 113 | notifyItemRemoved(position); 114 | } 115 | 116 | public void add(T t, int position) { 117 | mDataList.add(position, t); 118 | notifyItemInserted(position); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/helps/CircularRevealHelper.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.helps 2 | 3 | import android.content.Context 4 | import android.os.Build 5 | import android.support.constraint.ConstraintHelper 6 | import android.support.constraint.ConstraintLayout 7 | import android.util.AttributeSet 8 | import android.view.ViewAnimationUtils 9 | 10 | class CircularRevealHelper @JvmOverloads constructor( 11 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 12 | ) : ConstraintHelper(context, attrs, defStyleAttr) { 13 | 14 | override fun updatePostLayout(container: ConstraintLayout) { 15 | super.updatePostLayout(container) 16 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 17 | val views = getViews(container) 18 | for (view in views) { 19 | val anim = ViewAnimationUtils.createCircularReveal(view, view.width / 2, 20 | view.height / 2, 0f, 21 | Math.hypot((view.height / 2).toDouble(), (view.width / 2).toDouble()).toFloat()) 22 | anim.duration = 3000 23 | anim.start() 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/helps/CircularRevealHelper2.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.helps 2 | 3 | import android.content.Context 4 | import android.os.Build 5 | import android.support.constraint.ConstraintLayout 6 | import android.support.constraint.helper.Layer 7 | import android.util.AttributeSet 8 | import android.view.ViewAnimationUtils 9 | 10 | class CircularRevealHelper2 @JvmOverloads constructor( 11 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 12 | ) : Layer(context, attrs, defStyleAttr) { 13 | 14 | // override fun updatePostLayout(container: ConstraintLayout) { 15 | // super.updatePostLayout(container) 16 | // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 17 | // var centerPoint = calculateCenterPoint(container) 18 | // val anim = ViewAnimationUtils.createCircularReveal(this, centerPoint.x.toInt(), 19 | // centerPoint.y.toInt(), 0f, 20 | // Math.hypot(centerPoint.x.toDouble(), centerPoint.y.toDouble()).toFloat()) 21 | // anim.duration = 3000 22 | // anim.start() 23 | // } 24 | // } 25 | 26 | 27 | override fun updatePostLayout(container: ConstraintLayout) { 28 | super.updatePostLayout(container) 29 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 30 | val anim = ViewAnimationUtils.createCircularReveal(this, (left + right) / 2, 31 | (top + bottom) / 2, 0f, 32 | Math.hypot(((left + right) / 2 - left).toDouble(), ((top + bottom) / 2 - top).toDouble()).toFloat()) 33 | anim.duration = 3000 34 | anim.start() 35 | } 36 | } 37 | 38 | 39 | // private fun calculateCenterPoint(container: ConstraintLayout?): PointF { 40 | // var leftMin: Float = Float.MAX_VALUE 41 | // var topMin = Float.MAX_VALUE 42 | // var rightMax = Float.MIN_VALUE 43 | // var bottomMax = Float.MIN_VALUE 44 | // 45 | // 46 | // val views = getViews(container) 47 | // for (view in views) { 48 | // leftMin = if (view.left < leftMin) view.left.toFloat() else leftMin 49 | // topMin = if (view.top < topMin) view.top.toFloat() else topMin 50 | // rightMax = if (view.right > rightMax) view.right.toFloat() else rightMax 51 | // bottomMax = if (view.bottom > bottomMax) view.bottom.toFloat() else bottomMax 52 | // } 53 | // Log.d("FlyinHelper2", "leftMin:$leftMin topMin:$topMin rightMax:$rightMax bottomMax:$bottomMax") 54 | // 55 | // return PointF((rightMax + leftMin) / 2, (bottomMax + topMin) / 2) 56 | // } 57 | 58 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/helps/ExampleFlyinBounceHelper.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.helps 2 | 3 | import android.animation.ObjectAnimator 4 | import android.content.Context 5 | import android.support.constraint.ConstraintHelper 6 | import android.support.constraint.ConstraintLayout 7 | import android.util.AttributeSet 8 | 9 | class ExampleFlyinBounceHelper @JvmOverloads constructor( 10 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 11 | ) : ConstraintHelper(context, attrs, defStyleAttr) { 12 | private var mContainer: ConstraintLayout? = null 13 | 14 | override fun updatePreLayout(container: ConstraintLayout) { 15 | if (mContainer !== container) { 16 | val views = getViews(container) 17 | for (view in views) { 18 | val animator = ObjectAnimator.ofFloat(view, "translationX", -2000f, 0f).setDuration(1000) 19 | animator.start() 20 | } 21 | } 22 | mContainer = container 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/helps/FlipRevealHelper.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.helps 2 | 3 | import android.animation.ObjectAnimator 4 | import android.content.Context 5 | import android.support.constraint.ConstraintHelper 6 | import android.support.constraint.ConstraintLayout 7 | import android.util.AttributeSet 8 | 9 | 10 | class FlipRevealHelper @JvmOverloads constructor( 11 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 12 | ) : ConstraintHelper(context, attrs, defStyleAttr) { 13 | 14 | 15 | override fun updatePostLayout(container: ConstraintLayout?) { 16 | super.updatePostLayout(container) 17 | val views = getViews(container) 18 | for (view in views) { 19 | val animator = ObjectAnimator.ofFloat(view, "rotationY", 90f, 0f).setDuration(3000) 20 | animator.start() 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/helps/Flyin2Helper.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.helps 2 | 3 | import android.animation.ValueAnimator 4 | import android.content.Context 5 | import android.graphics.PointF 6 | import android.support.constraint.ConstraintLayout 7 | import android.support.constraint.helper.Layer 8 | import android.util.AttributeSet 9 | import android.util.Log 10 | 11 | class Flyin2Helper @JvmOverloads constructor( 12 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 13 | ) : Layer(context, attrs, defStyleAttr) { 14 | 15 | 16 | override fun updatePostLayout(container: ConstraintLayout) { 17 | Log.d("FlyinHelper", "updatePostLayout") 18 | super.updatePostLayout(container) 19 | val centerPoint = PointF(((left + right) / 2).toFloat(), ((top + bottom) / 2).toFloat()) 20 | 21 | 22 | val animator = ValueAnimator.ofFloat(0f, 1f).setDuration(1000) 23 | animator.addUpdateListener { animation -> 24 | val animatedFraction = animation.animatedFraction 25 | updateTranslation(centerPoint, animatedFraction, container) 26 | } 27 | animator.start() 28 | } 29 | 30 | private fun updateTranslation(centerPoint: PointF, animatedFraction: Float, container: ConstraintLayout) { 31 | 32 | val views = getViews(container) 33 | for (view in views) { 34 | 35 | val viewCenterX = (view.left + view.right) / 2 36 | val viewCenterY = (view.top + view.bottom) / 2 37 | 38 | 39 | val startTranslationX = if (viewCenterX < centerPoint.x) -2000f else 2000f 40 | val startTranslationY = if (viewCenterY < centerPoint.y) -2000f else 2000f 41 | 42 | 43 | view.translationX = (1 - animatedFraction) * startTranslationX 44 | view.translationY = (1 - animatedFraction) * startTranslationY 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/helps/FlyinHelper.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.helps 2 | 3 | import android.animation.ValueAnimator 4 | import android.content.Context 5 | import android.graphics.PointF 6 | import android.support.constraint.ConstraintHelper 7 | import android.support.constraint.ConstraintLayout 8 | import android.util.AttributeSet 9 | import android.util.Log 10 | 11 | class FlyinHelper @JvmOverloads constructor( 12 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 13 | ) : ConstraintHelper(context, attrs, defStyleAttr) { 14 | 15 | override fun updatePreLayout(container: ConstraintLayout?) { 16 | super.updatePreLayout(container) 17 | Log.d("FlyinHelper", "updatePreLayout") 18 | 19 | } 20 | 21 | override fun updatePostLayout(container: ConstraintLayout) { 22 | Log.d("FlyinHelper", "updatePostLayout") 23 | super.updatePostLayout(container) 24 | val centerPoint = calculateCenterPoint(container) 25 | val animator = ValueAnimator.ofFloat(0f, 1f).setDuration(1000) 26 | animator.addUpdateListener { animation -> 27 | val animatedFraction = animation.animatedFraction 28 | updateTranslation(centerPoint, animatedFraction, container) 29 | } 30 | animator.start() 31 | } 32 | 33 | private fun updateTranslation(centerPoint: PointF, animatedFraction: Float, container: ConstraintLayout) { 34 | 35 | val views = getViews(container) 36 | for (view in views) { 37 | 38 | val viewCenterX = (view.left + view.right) / 2 39 | val viewCenterY = (view.top + view.bottom) / 2 40 | 41 | 42 | val startTranslationX = if (viewCenterX < centerPoint.x) -2000f else 2000f 43 | val startTranslationY = if (viewCenterY < centerPoint.y) -2000f else 2000f 44 | 45 | 46 | view.translationX = (1 - animatedFraction) * startTranslationX 47 | view.translationY = (1 - animatedFraction) * startTranslationY 48 | } 49 | } 50 | 51 | private fun calculateCenterPoint(container: ConstraintLayout?): PointF { 52 | var leftMin: Float = Float.MAX_VALUE 53 | var topMin = Float.MAX_VALUE 54 | var rightMax = Float.MIN_VALUE 55 | var bottomMax = Float.MIN_VALUE 56 | 57 | 58 | val views = getViews(container) 59 | for (view in views) { 60 | leftMin = if (view.left < leftMin) view.left.toFloat() else leftMin 61 | topMin = if (view.top < topMin) view.top.toFloat() else topMin 62 | rightMax = if (view.right > rightMax) view.right.toFloat() else rightMax 63 | bottomMax = if (view.bottom > bottomMax) view.bottom.toFloat() else bottomMax 64 | } 65 | Log.d("FlyinHelper", "leftMin:$leftMin topMin:$topMin rightMax:$rightMax bottomMax:$bottomMax") 66 | 67 | return PointF((rightMax + leftMin) / 2, (bottomMax + topMin) / 2) 68 | } 69 | 70 | 71 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/helps/MetaballsDecorator.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.helps 2 | 3 | import android.animation.ValueAnimator 4 | import android.content.Context 5 | import android.graphics.Canvas 6 | import android.graphics.Color 7 | import android.graphics.Paint 8 | import android.support.constraint.ConstraintHelper 9 | import android.support.constraint.ConstraintLayout 10 | import android.util.AttributeSet 11 | import android.view.View 12 | import cn.feng.constraintLayout2.utils.dp2Px 13 | import cn.feng.constraintlayoutsample.R 14 | 15 | class MetaballsDecorator @JvmOverloads constructor( 16 | context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0 17 | ) : ConstraintHelper(context, attrs, defStyleAttr) { 18 | private lateinit var mContainer: ConstraintLayout 19 | private var mPaint: Paint = Paint(Paint.ANTI_ALIAS_FLAG) 20 | 21 | private var mPaint2: Paint = Paint(Paint.ANTI_ALIAS_FLAG) 22 | 23 | init { 24 | mPaint.color = Color.RED 25 | mPaint.style = Paint.Style.FILL_AND_STROKE 26 | 27 | 28 | mPaint2.color = Color.BLUE 29 | mPaint2.style = Paint.Style.FILL_AND_STROKE 30 | mPaint2.strokeWidth = 10f 31 | 32 | } 33 | 34 | 35 | override fun updatePostLayout(container: ConstraintLayout) { 36 | mContainer = container 37 | } 38 | 39 | 40 | fun startAnim() { 41 | val animator = ValueAnimator.ofFloat(0f, 1f).setDuration(5000) 42 | animator.addUpdateListener { animation -> 43 | val animatedFraction = animation.animatedFraction 44 | update(animatedFraction) 45 | } 46 | animator.start() 47 | } 48 | 49 | private fun update(fraction: Float) { 50 | val views = getViews(mContainer) 51 | var centerView = mContainer.findViewById(R.id.img_directions_bike) 52 | for (referencedView in views) { 53 | if (referencedView.tag == "centerView") { 54 | continue 55 | } 56 | var translationXDistance = (centerView.left + centerView.width / 2) - (referencedView.left + referencedView.width / 2) 57 | var translationYDistance = (centerView.top + centerView.height / 2) - (referencedView.top + referencedView.height / 2) 58 | 59 | referencedView.translationX = translationXDistance * fraction 60 | referencedView.translationY = translationYDistance * fraction 61 | 62 | referencedView.scaleX = 1 - fraction 63 | referencedView.scaleY = 1 - fraction 64 | 65 | invalidate() 66 | } 67 | } 68 | 69 | 70 | override fun onDraw(canvas: Canvas) { 71 | 72 | super.onDraw(canvas) 73 | val views = getViews(mContainer) 74 | for (referencedView in views) { 75 | canvas.drawCircle(((referencedView.left + referencedView.right) / 2 + referencedView.translationX), 76 | ((referencedView.top + referencedView.bottom) / 2 + referencedView.translationY), 77 | Math.hypot((referencedView.width * referencedView.scaleX / 2).toDouble(), (referencedView.height * referencedView.scaleY / 2).toDouble()).toFloat()+dp2Px(10f), 78 | mPaint) 79 | } 80 | } 81 | 82 | 83 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/feng/constraintlayoutsample/utils/ViewExtensions.kt: -------------------------------------------------------------------------------- 1 | package cn.feng.constraintLayout2.utils 2 | 3 | import android.content.res.Resources 4 | import android.text.Spannable 5 | import android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE 6 | import android.util.Log 7 | import android.util.TypedValue 8 | import android.view.View 9 | 10 | 11 | inline fun View.onLayoutChange(crossinline action: () -> Unit) { 12 | addOnLayoutChangeListener(object : View.OnLayoutChangeListener { 13 | override fun onLayoutChange(v: View?, left: Int, top: Int, right: Int, bottom: Int, oldLeft: Int, oldTop: Int, oldRight: Int, oldBottom: Int) { 14 | removeOnLayoutChangeListener(this) 15 | action() 16 | } 17 | 18 | }) 19 | } 20 | 21 | inline fun T.logi(message: String) = Log.i(T::class.java.simpleName, message) 22 | 23 | 24 | inline operator fun Spannable.plusAssign(span: Any) = 25 | setSpan(span, 0, length, SPAN_INCLUSIVE_EXCLUSIVE) 26 | 27 | 28 | inline fun T.dp2Px(dp: Float): Float { 29 | return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().displayMetrics) 30 | 31 | } 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_accessibility_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_accessibility_new.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_accessible.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_accessible.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_airline_seat_individual_suite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_airline_seat_individual_suite.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_airline_seat_recline_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_airline_seat_recline_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_directions_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_directions_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_directions_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_directions_car.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_directions_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_directions_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_directions_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-hdpi/ic_directions_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_accessibility_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_accessibility_new.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_accessible.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_accessible.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_airline_seat_individual_suite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_airline_seat_individual_suite.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_airline_seat_recline_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_airline_seat_recline_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_directions_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_directions_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_directions_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_directions_car.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_directions_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_directions_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_directions_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-mdpi/ic_directions_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_accessibility_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_accessibility_new.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_accessible.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_accessible.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_airline_seat_individual_suite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_airline_seat_individual_suite.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_airline_seat_recline_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_airline_seat_recline_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_directions_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_directions_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_directions_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_directions_car.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_directions_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_directions_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_directions_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xhdpi/ic_directions_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_accessibility_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_accessibility_new.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_accessible.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_accessible.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_airline_seat_individual_suite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_airline_seat_individual_suite.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_airline_seat_recline_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_airline_seat_recline_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_directions_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_directions_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_directions_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_directions_car.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_directions_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_directions_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_directions_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxhdpi/ic_directions_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_accessibility_new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_accessibility_new.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_accessible.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_accessible.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_airline_seat_individual_suite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_airline_seat_individual_suite.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_airline_seat_recline_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_airline_seat_recline_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_directions_bike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_directions_bike.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_directions_car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_directions_car.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_directions_run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_directions_run.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_directions_walk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable-xxxhdpi/ic_directions_walk.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/background.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable/background.jpeg -------------------------------------------------------------------------------- /app/src/main/res/drawable/batman.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable/batman.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/daxiao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable/daxiao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/frame.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/mario.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/feng0403/ConstraintLayoutSamples/1c7a972ed0a85a2e2cfc7825729af20c775b6bbe/app/src/main/res/drawable/mario.jpg -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main1.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 22 | 23 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main2.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 21 | 22 | 32 | 33 | 44 | 45 | 55 | 56 | 65 | 66 | 75 | 76 | 82 | 83 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main3.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 22 | 23 | 33 | 34 | 44 | 45 | 55 | 56 | 63 | 64 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main4.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 20 | 21 | 28 | 29 | 36 | 37 | 43 | 44 | 50 | 51 | 61 | 62 | 74 | 75 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main5.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 24 | 25 | 29 | 30 | 34 | 35 | 39 | 40 | 41 | 45 | 46 | 50 | 51 | 55 | 56 | 57 | 61 | 62 | 66 | 67 | 71 | 72 | 76 | 77 | 83 | 84 | 88 | 89 | 95 | 96 | 110 | 111 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main6.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 23 | 24 | 28 | 29 | 33 | 34 | 38 | 39 | 40 | 44 | 45 | 49 | 50 | 54 | 55 | 59 | 60 | 64 | 65 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_helper_circular_reveal.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 18 | 19 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_helper_metables_decorator.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 15 | 16 | 26 | 27 | 36 | 37 | 38 | 48 | 49 | 50 | 60 | 61 | 62 |