1. IT-Security >
  2. Programmierung >
  3. ConstraintLayout 2.0.0 beta 2


ArabicEnglishFrenchGermanGreekItalianJapaneseKoreanPersianPolishPortugueseRussianSpanishTurkishVietnamese

ConstraintLayout 2.0.0 beta 2

RSS Kategorie Pfeil Programmierung vom | Quelle: androidstudio.googleblog.com Direktlink öffnen

We are happy to announce the release of ConstraintLayout 2.0 beta 2. 

It’s available from the google maven repository:
dependencies {
    implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2'
}


or if using the AndroidX packages:
dependencies {
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
}


Documentation is available on https://developer.android.com/reference/android/support/constraint/classes.html

Examples are available on https://github.com/googlesamples/android-ConstraintLayoutExamples

New in Beta 2


Flow

New attributes were added to control the behavior of the last chain, in similar manner to flow_first* attributes:

flow_lastHorizontalStyle : spread|spread_inside|packed
flow_lastVerticalStyle : spread|spread_inside|packed
flow_lastVerticalBias : float
flow_lastHorizontalBias : float

MotionLayout

APIs additions

  • MotionLayout.TransitionListener no longer has the method allowsTransition. This was replaced with the MotionScene.Transition.setEnable
  • Added APIs to construct a MotionScene and Transition programmatically and manipulate them.

Transition ID

You can now name transitions with an ID using the attribute

MotionScene.Transition MotionLayout.getTransition(int id)


<Transition
      android:id="@id/tobigsceen" ...

Transition Disable

Now you can disable and enable Transitions in XML and programmatically. A <Transition> now has an attribute transitionDisable. You can also enable or disable them programmatically with Transition.setEnable(true) and query with Transition.isEnabled().

Important: This replaces the callback “allowsTransition” in the interface MotionLayout.TransitionListener

View Velocity

public void getViewVelocity(View view, float posOnViewX, float posOnViewY, float[] returnVelocity, int type) {

Accessing the Velocity of an animating view. You can get the velocity a view is moving at.
It takes the coordinate on the view and returns the velocity of the view.
There are 4 types of velocities it can return. It can return static or dynamic, pre or post layout.

The static velocity does not incorporate the actual motion driven by touch.


public final static int VELOCITY_POST_LAYOUT = 0;
public final static int VELOCITY_LAYOUT = 1;
public final static int VELOCITY_STATIC_POST_LAYOUT = 2;
public final static int VELOCITY_STATIC_LAYOUT = 3;

To aid in understanding how to use it, we have included a utility view MotionTelltales based on MockView but showing the velocity of 25 points on the view.




Key Trigger redirection


Now a KeyTrigger can trigger a method on another view using the attribute triggerReceiver.

<KeyTrigger
     motion:triggerReceiver="@+id/view" ...

Bugfixes


Several issues where fixed in beta 2:


Motion Layout nested scrolling issue 133624931
Alpha 4 Layout Weights not working properly 130580479
ConstraintLayout does not respect minHeight with wrap_content 130437914
[MotionLayout] getProgress() Value Gets Reset When The Container Layout Animates. 112521093
[MotionLayout] Fragments in ViewPager sometimes are not drawn 123379505
MotionLayout animation does not work inside fragment 122929956
ConstraintLayout:2.0.0-alpha4 no longer preserves view scaling properly with MotionLayout 130115829
Child view not centered when ConstraintLayout size changes 133273843
[ConstraintLayout 2.0.0-alpha5] Regression in MotionLayout when scrolling a scrollable view 131572132
Height of nested constraint layout child not measured correctly in ConstraintLayout 2.0.0-alpha4+ (including beta1) 133202039
[ConstraintLayout 2.0.0-alpha5] Regression in MotionLayout modifying a ConstraintSet 131874827
Constrain Layout 2.0.0 Alpha 4 to Beta 1 134841040
Flow verticalAlign="baseline" not working 134533710
ConstraintLayout Group and Barrier is not working in dynamic feature module. 133032779
ConstraintLayout:2.0.0-alpha4 MotionLayout does not respect parent padding 130561744
app:showPaths crashes on transition with a duration smaller than 16 ms 134086361
PlaceHolder doesn't display 132951221
[MotionLayout] Migrate MotionLayout to NestledScrolling3 and override functionality 128914828
Maybe useless code in MotionLayout class 131532235
Placeholder emptyVisibility attribute is incorrect 131747094
Barrier is ignored 132651309
Request to programmatically change autoTransition 132878306
Handle Snackbar + FAB with MotionLayout 133541548
Problem when trying to wrap chains of width-constrained views 134137982
MotionLayout animating incorrectly when used in a recyclerview 118289003
Animatinos in recyclerview end in unexpected states 118289936
TextView is clipped when using nested ConstraintLayouts and constraintDimensionRatio 134082517
android:gravity does not work as expected in ConstraintLayout 2.0.0-alpha4+ (including beta1) 132651320
2.0 B1 bug / changed behavior 133465553
ConstraintLayout does not measure height correctly when using wrap_content and layout_constrainedHeight is set to true. 132314169
ConstraintLayout will not wrap TextView to the correct height when using wrap_content and app:layout_constrainedHeight="true" 123551995
Buttons in Flow has text aligned to left (and alignment behaves strange) 133809201
adding constarint from kotlin is not respected in beta , works fine in alpha2 version 133184664
When the View referenced by Flow has a child View, the layout is wrong. 133092993
Flow does not work well with 0dp 133326448
MotionLayout not triggering animation after scrolling a list 122676392
Setting MotionScene in code to MotionLayout (Not working same as if we set layoutDescription in MotionLayout in xml) 116674308
Allow KeyTrigger to call methods on a different view 132457332
Constraint not respected when using the ID of the parent instead of `parent` in XML. 133201550
...

Webseite öffnen Komplette Webseite öffnen

Newsbewertung

Kommentiere zu ConstraintLayout 2.0.0 beta 2






Ähnliche Beiträge

  • 1. Understanding the performance benefits of using ConstraintLayout vom 542.17 Punkte ic_school_black_18dp
    Posted by Takeshi Hagikura, Developer Programs Engineer Since announcing ConstraintLayout at Google I/O last year, we've continued to improve the layout's stability and layout editor support. We've also added new features specific to ConstraintLayou
  • 2. ConstraintLayout 2.0.0 beta 2 vom 477.47 Punkte ic_school_black_18dp
    We are happy to announce the release of ConstraintLayout 2.0 beta 2. It’s available from the google maven repository: dependencies {    implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta2'} or if using the AndroidX packages: dependencies {    implementation 'androidx.cons
  • 3. Android Studio 2.3 vom 126.51 Punkte ic_school_black_18dp
    By Jamal Eason, Product Manager, Android Android Studio 2.3 is available to download today. The focus for this release is quality improvements across the IDE. We are grateful for all your feedback so far. We are committed to continuing to invest in making Android Studio fast & seamless for the millions of Android app developers
  • 4. Android Q Beta 2 update vom 121 Punkte ic_school_black_18dp
    Posted by Dave Burke, VP of Engineering A few weeks ago we Introduced Android Q Beta, a first look at the next version of Android. Along with new privacy features for users, Android Q adds new capabilities for developers - like enhancements for foldables, new APIs for connectivity, new media codecs and camera capabilities, NNAPI extensions,
  • 5. Android Q Beta 2 update vom 121 Punkte ic_school_black_18dp
    Posted by Dave Burke, VP of Engineering A few weeks ago we Introduced Android Q Beta, a first look at the next version of Android. Along with new privacy features for users, Android Q adds new capabilities for developers - like enhancements for foldables, new APIs for connectivity, new media codecs and camera capabilities, NNAPI extensions,
  • 6. What’s New in Android: Q Beta 3 & More vom 117.33 Punkte ic_school_black_18dp
    Posted by Dave Burke, VP, Engineering Today Android is celebrating two amazing milestones. It’s Android’s version 10! And today, Android is running on more than 2.5B active Android devices. With Android Q, we’ve focused on three themes: innovation, security and privacy, and digital wellbeing. We want to hel
  • 7. What’s New in Android: Q Beta 3 & More vom 117.33 Punkte ic_school_black_18dp
    Posted by Dave Burke, VP, Engineering Today Android is celebrating two amazing milestones. It’s Android’s version 10! And today, Android is running on more than 2.5B active Android devices. With Android Q, we’ve focused on three themes: innovation, security and privacy, and digital wellbeing. We want to hel
  • 8. What’s new in Android P Beta vom 102.67 Punkte ic_school_black_18dp
    Posted By Dave Burke, VP of Engineering Earlier today we unveiled a beta version of Android P, the next release of Android. Android P puts AI at the core of the operating system and focuses on intelligent and simple experiences. You can read more about the new user features here. For developers, Android P beta offers a range of ways to take advantage of these new smarts, especially when i
  • 9. Android Q Beta 5 Update vom 102.67 Punkte ic_school_black_18dp
    Posted by Dave Burke, VP of Engineering Android Q Beta 5 launches today! Today we're rolling out Beta 5, bringing Android Q Beta very close to the system behaviors you'll see in the final release. Developer APIs were already finalized in the previous update. So, now is the time to test your apps for compatibility
  • 10. Android Q Beta 5 Update vom 102.67 Punkte ic_school_black_18dp
    Posted by Dave Burke, VP of Engineering Android Q Beta 5 launches today! Today we're rolling out Beta 5, bringing Android Q Beta very close to the system behaviors you'll see in the final release. Developer APIs were already finalized in the previous update. So, now is the time to test your apps for compatibility
  • 11. Android P Beta 2 and final APIs! vom 99 Punkte ic_school_black_18dp
    Posted By Dave Burke, VP of Engineering Four weeks ago at Google I/O we released the first beta version of Android P, putting AI at the core of the operating system and focusing on intelligent and simple experiences. We talked about some of Android's newest features in the keynotes and went deep on the developer APIs during the breakouts. If you missed the lives
  • 12. Android Studio 2.2 vom 94.29 Punkte ic_school_black_18dp
    By Jamal Eason, Product Manager, Android Android Studio 2.2 is available to download today. Previewed at Google I/O 2016, Android Studio 2.2 is the latest release of our IDE used by millions of Android developers around the world. Packed with enhancements, this release has three