Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

fix dumping jason add toolsAndroid #779

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions constraintlayout/constraintlayout/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,21 @@

</declare-styleable>

<!-- This is the api for logging constraints in JSON5 format -->
<declare-styleable name="LogJson">
<attr name="logJsonTo" format="enum|string">
<enum name="log" value="1" />
<enum name="console" value="2" />
</attr>
<attr name="logJsonMode" format="enum">
<enum name="periodic" value="1" />
<enum name="delayed" value="2" />
<enum name="layout" value="3" />
<enum name="api" value="4" />
</attr>
<attr name="logJsonDelay" format="integer" />
</declare-styleable>

<declare-styleable name="Constraint">
<attr name="android:orientation" />
<attr name="android:id" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ public Transition(@NonNull CorePixelDp dpToPixel) {
mToPixel = dpToPixel;
}

/**
* Create transition with a 1 to 1 DP to pixel (usually used in testing
*/
public Transition() {
this((dp) -> dp);
}

// @TODO: add description
@SuppressWarnings("HiddenTypeParameter")
OnSwipe createOnSwipe() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.constraintlayout.motion.widget.Debug;
import androidx.constraintlayout.motion.widget.MotionLayout;
import androidx.constraintlayout.widget.ConstraintLayout;

Expand Down Expand Up @@ -75,7 +74,7 @@ private void dumpJson() {
if (mLayout instanceof MotionLayout) {
fileName = MotionLayoutToJason.writeJSonToFile((MotionLayout) mLayout, layout_name);
} else {
fileName = ConstraintLayoutToJason.writeJSonToFile(mLayout, layout_name);
fileName = ConstraintLayoutToJason.toFile(mLayout, layout_name);
}
allFiles.add(fileName);
current++;
Expand Down
Loading