diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml
deleted file mode 100644
index 50b6ecd4..00000000
--- a/android/sample/AndroidManifest.xml
+++ /dev/null
@@ -1,48 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/sample/debug.keystore b/android/sample/debug.keystore
deleted file mode 100644
index 3df12b5d..00000000
Binary files a/android/sample/debug.keystore and /dev/null differ
diff --git a/android/sample/debug.keystore.properties b/android/sample/debug.keystore.properties
deleted file mode 100644
index 3c06c8e4..00000000
--- a/android/sample/debug.keystore.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-key.alias=androiddebugkey
-key.store.password=android
-key.alias.password=android
diff --git a/android/sample/res/menu/action_bar_benchmark.xml b/android/sample/res/menu/action_bar_benchmark.xml
deleted file mode 100644
index 618f6f37..00000000
--- a/android/sample/res/menu/action_bar_benchmark.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
diff --git a/android/sample/res/menu/action_bar_home.xml b/android/sample/res/menu/action_bar_home.xml
deleted file mode 100644
index 9fb78394..00000000
--- a/android/sample/res/menu/action_bar_home.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
diff --git a/gradle.properties b/gradle.properties
index 45186d88..b79bac31 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -7,6 +7,8 @@
# Project-wide Gradle settings.
+android.useAndroidX=true
+
org.gradle.jvmargs=-Xmx1536M
VERSION_NAME=1.19.0
diff --git a/sample/build.gradle b/sample/build.gradle
new file mode 100644
index 00000000..63fc1c1f
--- /dev/null
+++ b/sample/build.gradle
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+
+apply plugin: 'com.android.application'
+
+android {
+ namespace 'com.facebook.yoga.sample'
+
+ compileSdkVersion rootProject.compileSdkVersion
+ buildToolsVersion rootProject.buildToolsVersion
+ ndkVersion rootProject.ndkVersion
+
+ defaultConfig {
+ minSdkVersion rootProject.minSdkVersion
+ targetSdkVersion rootProject.targetSdkVersion
+ }
+
+ compileOptions {
+ targetCompatibility rootProject.targetCompatibilityVersion
+ sourceCompatibility rootProject.sourceCompatibilityVersion
+ }
+}
+
+dependencies {
+ implementation project(':yoga-layout')
+ implementation("androidx.appcompat:appcompat:1.6.1")
+ implementation("com.facebook.soloader:soloader:0.10.4")
+}
diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..fd53d599
--- /dev/null
+++ b/sample/src/main/AndroidManifest.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/sample/java/com/facebook/samples/yoga/BenchmarkActivity.java b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkActivity.java
similarity index 85%
rename from android/sample/java/com/facebook/samples/yoga/BenchmarkActivity.java
rename to sample/src/main/java/com/facebook/yoga/sample/BenchmarkActivity.java
index d336ad98..bbccee52 100644
--- a/android/sample/java/com/facebook/samples/yoga/BenchmarkActivity.java
+++ b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkActivity.java
@@ -5,23 +5,23 @@
* LICENSE file in the root directory of this source tree.
*/
-package com.facebook.samples.yoga;
+package com.facebook.yoga.sample;
import android.content.Intent;
import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v4.app.FragmentPagerAdapter;
-import android.support.v4.app.FragmentManager;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentTransaction;
-import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
+import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
-import android.view.Menu;
-import android.support.v7.app.ActionBar;
-import com.facebook.samples.yoga.R;
+import androidx.appcompat.app.ActionBar;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.fragment.app.Fragment;
+import androidx.fragment.app.FragmentManager;
+import androidx.fragment.app.FragmentPagerAdapter;
+import androidx.fragment.app.FragmentTransaction;
+import androidx.viewpager.widget.ViewPager;
+
import com.facebook.yoga.android.YogaViewLayoutFactory;
public class BenchmarkActivity extends AppCompatActivity {
@@ -33,21 +33,24 @@ public class BenchmarkActivity extends AppCompatActivity {
setContentView(R.layout.benchmark_select_layout);
- ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
+ ViewPager viewPager = findViewById(R.id.viewpager);
viewPager.setAdapter(new PagerAdapter(getSupportFragmentManager()));
final ActionBar actionBar = getSupportActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
ActionBar.TabListener tabListener = new ActionBar.TabListener() {
+ @Override
public void onTabSelected(ActionBar.Tab tab, FragmentTransaction ft) {
- ViewPager viewPager = (ViewPager) findViewById(R.id.viewpager);
+ ViewPager viewPager = findViewById(R.id.viewpager);
viewPager.setCurrentItem(tab.getPosition());
}
+ @Override
public void onTabUnselected(ActionBar.Tab tab, FragmentTransaction ft) {
}
+ @Override
public void onTabReselected(ActionBar.Tab tab, FragmentTransaction ft) {
}
};
diff --git a/android/sample/java/com/facebook/samples/yoga/BenchmarkAggregator.java b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkAggregator.java
similarity index 97%
rename from android/sample/java/com/facebook/samples/yoga/BenchmarkAggregator.java
rename to sample/src/main/java/com/facebook/yoga/sample/BenchmarkAggregator.java
index 55fd042b..c1507f78 100644
--- a/android/sample/java/com/facebook/samples/yoga/BenchmarkAggregator.java
+++ b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkAggregator.java
@@ -5,17 +5,14 @@
* LICENSE file in the root directory of this source tree.
*/
-package com.facebook.samples.yoga;
+package com.facebook.yoga.sample;
import java.io.File;
-import java.io.FileWriter;
import java.io.PrintWriter;
import java.lang.Math;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.LinkedList;
import java.util.List;
-import java.text.DateFormat;
import java.util.Date;
import android.content.Context;
diff --git a/android/sample/java/com/facebook/samples/yoga/BenchmarkFragment.java b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkFragment.java
similarity index 82%
rename from android/sample/java/com/facebook/samples/yoga/BenchmarkFragment.java
rename to sample/src/main/java/com/facebook/yoga/sample/BenchmarkFragment.java
index d29aa572..949a08a4 100644
--- a/android/sample/java/com/facebook/samples/yoga/BenchmarkFragment.java
+++ b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkFragment.java
@@ -5,25 +5,26 @@
* LICENSE file in the root directory of this source tree.
*/
-package com.facebook.samples.yoga;
+package com.facebook.yoga.sample;
-import java.util.Random;
import android.os.Bundle;
-import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
-import android.widget.ArrayAdapter;
-import android.widget.AdapterView;
-import com.facebook.samples.yoga.R;
+import androidx.fragment.app.Fragment;
+
import com.facebook.yoga.android.YogaLayout;
+import java.util.Random;
+
public class BenchmarkFragment extends Fragment implements AdapterView.OnItemSelectedListener {
private LayoutInflater mInflater;
@@ -58,17 +59,17 @@ public class BenchmarkFragment extends Fragment implements AdapterView.OnItemSel
@Override
public View onCreateView(
- LayoutInflater inflater,
- ViewGroup container,
- Bundle savedInstanceState) {
+ LayoutInflater inflater,
+ ViewGroup container,
+ Bundle savedInstanceState) {
mInflater = inflater;
rootLayout = (YogaLayout) inflater.inflate(
- R.layout.benchmark_fragment,
- container,
- false);
+ R.layout.benchmark_fragment,
+ container,
+ false);
- Spinner benchmarkSelect = (Spinner) rootLayout.findViewById(R.id.benchmarkSelect);
+ Spinner benchmarkSelect = rootLayout.findViewById(R.id.benchmarkSelect);
String[] items = new String[]{"Basic", "Typical", "Nested"};
ArrayAdapter adapter = new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, items);
benchmarkSelect.setAdapter(adapter);
@@ -104,11 +105,11 @@ public class BenchmarkFragment extends Fragment implements AdapterView.OnItemSel
}
private void updatePreview() {
- LinearLayout previewLayout = (LinearLayout) rootLayout.findViewById(R.id.preview);
- View v = mInflater.inflate(yogaLayout, rootLayout, false);
+ LinearLayout previewLayout = rootLayout.findViewById(R.id.preview);
+ View v = mInflater.inflate(yogaLayout, rootLayout, false);
v.setLayoutParams(new LinearLayout.LayoutParams(
- LinearLayout.LayoutParams.MATCH_PARENT,
- LinearLayout.LayoutParams.MATCH_PARENT));
+ LinearLayout.LayoutParams.MATCH_PARENT,
+ LinearLayout.LayoutParams.MATCH_PARENT));
previewLayout.removeAllViews();
previewLayout.addView(v);
}
diff --git a/android/sample/java/com/facebook/samples/yoga/BenchmarkInflate.java b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkInflate.java
similarity index 65%
rename from android/sample/java/com/facebook/samples/yoga/BenchmarkInflate.java
rename to sample/src/main/java/com/facebook/yoga/sample/BenchmarkInflate.java
index 265b03af..35fe3718 100644
--- a/android/sample/java/com/facebook/samples/yoga/BenchmarkInflate.java
+++ b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkInflate.java
@@ -5,40 +5,31 @@
* LICENSE file in the root directory of this source tree.
*/
-package com.facebook.samples.yoga;
+package com.facebook.yoga.sample;
import android.os.Bundle;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
-import android.widget.TextView;
-import android.widget.Button;
import android.view.ViewGroup;
-import android.util.Log;
-import com.facebook.samples.yoga.R;
+import android.widget.Button;
+import android.widget.TextView;
public class BenchmarkInflate extends BenchmarkFragment {
@Override
- public View onCreateView(
- LayoutInflater inflater,
- ViewGroup container,
- Bundle savedInstanceState) {
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
- Button b = (Button) rootLayout.findViewById(R.id.btn);
- b.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- startBenchmark();
- }
- });
+ Button b = rootLayout.findViewById(R.id.btn);
+ b.setOnClickListener(v -> startBenchmark());
return rootLayout;
}
protected void startBenchmark() {
LayoutInflater inflater = LayoutInflater.from(getActivity());
- TextView textView = (TextView) rootLayout.findViewById(R.id.text);
+ TextView textView = rootLayout.findViewById(R.id.text);
final int ITERATIONS = 500;
@@ -57,14 +48,14 @@ public class BenchmarkInflate extends BenchmarkFragment {
}
textView.setText(
- yogaInflationAggregator.toString()+
- "\n"+
- linearInflationAggregator.toString());
+ yogaInflationAggregator.toString() +
+ "\n" +
+ linearInflationAggregator.toString());
Log.i(
- "YogaLayoutBenchmark",
- yogaInflationAggregator.toString()+
- "\n"+
- linearInflationAggregator.toString());
+ "YogaLayoutBenchmark",
+ yogaInflationAggregator.toString() +
+ "\n" +
+ linearInflationAggregator.toString());
rootLayout.invalidate();
}
}
diff --git a/android/sample/java/com/facebook/samples/yoga/BenchmarkLayout.java b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkLayout.java
similarity index 60%
rename from android/sample/java/com/facebook/samples/yoga/BenchmarkLayout.java
rename to sample/src/main/java/com/facebook/yoga/sample/BenchmarkLayout.java
index 8d3a71cc..b674d5dd 100644
--- a/android/sample/java/com/facebook/samples/yoga/BenchmarkLayout.java
+++ b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkLayout.java
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
-package com.facebook.samples.yoga;
+package com.facebook.yoga.sample;
import android.os.Bundle;
import android.util.Log;
@@ -14,34 +14,25 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
-import com.facebook.samples.yoga.R;
-
-import java.util.Random;
public class BenchmarkLayout extends BenchmarkFragment {
@Override
public View onCreateView(
- LayoutInflater inflater,
- ViewGroup container,
- Bundle savedInstanceState) {
+ LayoutInflater inflater,
+ ViewGroup container,
+ Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
- Button b = (Button) rootLayout.findViewById(R.id.btn);
- b.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- startBenchmark();
- }
- });
+ Button b = rootLayout.findViewById(R.id.btn);
+ b.setOnClickListener(v -> startBenchmark());
return rootLayout;
}
protected void startBenchmark() {
LayoutInflater inflater = LayoutInflater.from(getActivity());
- TextView textView = (TextView) rootLayout.findViewById(R.id.text);
- Random random = new Random();
+ TextView textView = rootLayout.findViewById(R.id.text);
final int ITERATIONS = 500;
@@ -53,11 +44,11 @@ public class BenchmarkLayout extends BenchmarkFragment {
randomizeText(yogaView);
randomizeText(linearView);
yogaView.measure(
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
linearView.measure(
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
yogaInflationAggregator.startTrace();
yogaView.layout(0, 0, yogaView.getMeasuredWidth(), yogaView.getMeasuredHeight());
yogaInflationAggregator.endTrace();
@@ -67,13 +58,13 @@ public class BenchmarkLayout extends BenchmarkFragment {
}
textView.setText(
- yogaInflationAggregator.toString()+
- "\n"+
- linearInflationAggregator.toString());
+ yogaInflationAggregator +
+ "\n" +
+ linearInflationAggregator);
Log.i(
- "YogaLayoutBenchmark",
- yogaInflationAggregator.toString()+
- "\n"+
- linearInflationAggregator.toString());
+ "YogaLayoutBenchmark",
+ yogaInflationAggregator +
+ "\n" +
+ linearInflationAggregator);
}
}
diff --git a/android/sample/java/com/facebook/samples/yoga/BenchmarkMeasure.java b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkMeasure.java
similarity index 64%
rename from android/sample/java/com/facebook/samples/yoga/BenchmarkMeasure.java
rename to sample/src/main/java/com/facebook/yoga/sample/BenchmarkMeasure.java
index b34f7b57..61276eb9 100644
--- a/android/sample/java/com/facebook/samples/yoga/BenchmarkMeasure.java
+++ b/sample/src/main/java/com/facebook/yoga/sample/BenchmarkMeasure.java
@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
-package com.facebook.samples.yoga;
+package com.facebook.yoga.sample;
import android.os.Bundle;
import android.util.Log;
@@ -14,7 +14,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
-import com.facebook.samples.yoga.R;
import java.util.Random;
@@ -22,18 +21,13 @@ public class BenchmarkMeasure extends BenchmarkFragment {
@Override
public View onCreateView(
- LayoutInflater inflater,
- ViewGroup container,
- Bundle savedInstanceState) {
+ LayoutInflater inflater,
+ ViewGroup container,
+ Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
- Button b = (Button) rootLayout.findViewById(R.id.btn);
- b.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- startBenchmark();
- }
- });
+ Button b = rootLayout.findViewById(R.id.btn);
+ b.setOnClickListener(v -> startBenchmark());
return rootLayout;
}
@@ -54,25 +48,25 @@ public class BenchmarkMeasure extends BenchmarkFragment {
randomizeText(linearView);
yogaMeasureAggregator.startTrace();
yogaView.measure(
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
yogaMeasureAggregator.endTrace();
linearMeasureAggregator.startTrace();
linearView.measure(
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
- View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY),
+ View.MeasureSpec.makeMeasureSpec(1000, View.MeasureSpec.EXACTLY));
linearMeasureAggregator.endTrace();
}
textView.setText(
- yogaMeasureAggregator.toString()+
- "\n"+
- linearMeasureAggregator.toString());
+ yogaMeasureAggregator.toString() +
+ "\n" +
+ linearMeasureAggregator.toString());
Log.i(
- "YogaLayoutBenchmark",
- yogaMeasureAggregator.toString()+
- "\n"+
- linearMeasureAggregator.toString());
+ "YogaLayoutBenchmark",
+ yogaMeasureAggregator.toString() +
+ "\n" +
+ linearMeasureAggregator.toString());
yogaMeasureAggregator.dump(getActivity());
linearMeasureAggregator.dump(getActivity());
diff --git a/android/sample/java/com/facebook/samples/yoga/MainActivity.java b/sample/src/main/java/com/facebook/yoga/sample/MainActivity.java
similarity index 82%
rename from android/sample/java/com/facebook/samples/yoga/MainActivity.java
rename to sample/src/main/java/com/facebook/yoga/sample/MainActivity.java
index 4cb78b83..5d5e5210 100644
--- a/android/sample/java/com/facebook/samples/yoga/MainActivity.java
+++ b/sample/src/main/java/com/facebook/yoga/sample/MainActivity.java
@@ -5,22 +5,23 @@
* LICENSE file in the root directory of this source tree.
*/
-package com.facebook.samples.yoga;
+package com.facebook.yoga.sample;
import android.content.Intent;
import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
import android.view.LayoutInflater;
+import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
-import android.view.Menu;
-import com.facebook.samples.yoga.R;
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+
import com.facebook.soloader.SoLoader;
import com.facebook.yoga.android.YogaViewLayoutFactory;
/**
- * An activity to show off Yoga in Android. This activity shows a simple layout (defined in
+ * An activity to show off Yoga in Android. This activity shows a simple layout (defined in
* {@code main_layout.xml}) that shows off the awesome functionality of the Yoga layout engine
* as well as some optimisations on layout systems that it facilitates.
*/
@@ -43,7 +44,7 @@ public class MainActivity extends AppCompatActivity {
}
@Override
- public boolean onOptionsItemSelected(MenuItem item) {
+ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
// There is only one option
Intent intent = new Intent(this, BenchmarkActivity.class);
startActivity(intent);
diff --git a/android/sample/res/drawable/action_bar_background.xml b/sample/src/main/res/drawable/action_bar_background.xml
similarity index 100%
rename from android/sample/res/drawable/action_bar_background.xml
rename to sample/src/main/res/drawable/action_bar_background.xml
diff --git a/android/sample/res/drawable/ic_launcher.png b/sample/src/main/res/drawable/ic_launcher.png
similarity index 100%
rename from android/sample/res/drawable/ic_launcher.png
rename to sample/src/main/res/drawable/ic_launcher.png
diff --git a/android/sample/res/drawable/sample_children_background.xml b/sample/src/main/res/drawable/sample_children_background.xml
similarity index 100%
rename from android/sample/res/drawable/sample_children_background.xml
rename to sample/src/main/res/drawable/sample_children_background.xml
diff --git a/android/sample/res/layout/benchmark_fragment.xml b/sample/src/main/res/layout/benchmark_fragment.xml
similarity index 83%
rename from android/sample/res/layout/benchmark_fragment.xml
rename to sample/src/main/res/layout/benchmark_fragment.xml
index 6f9bdbd9..a2c98fdf 100644
--- a/android/sample/res/layout/benchmark_fragment.xml
+++ b/sample/src/main/res/layout/benchmark_fragment.xml
@@ -1,17 +1,17 @@
diff --git a/android/sample/res/layout/benchmark_layout_1_linear.xml b/sample/src/main/res/layout/benchmark_layout_1_linear.xml
similarity index 100%
rename from android/sample/res/layout/benchmark_layout_1_linear.xml
rename to sample/src/main/res/layout/benchmark_layout_1_linear.xml
diff --git a/android/sample/res/layout/benchmark_layout_2.xml b/sample/src/main/res/layout/benchmark_layout_2.xml
similarity index 70%
rename from android/sample/res/layout/benchmark_layout_2.xml
rename to sample/src/main/res/layout/benchmark_layout_2.xml
index 49022e0e..579818c6 100644
--- a/android/sample/res/layout/benchmark_layout_2.xml
+++ b/sample/src/main/res/layout/benchmark_layout_2.xml
@@ -1,102 +1,102 @@
diff --git a/android/sample/res/layout/benchmark_layout_2_linear.xml b/sample/src/main/res/layout/benchmark_layout_2_linear.xml
similarity index 98%
rename from android/sample/res/layout/benchmark_layout_2_linear.xml
rename to sample/src/main/res/layout/benchmark_layout_2_linear.xml
index f77426f3..c29d81bf 100644
--- a/android/sample/res/layout/benchmark_layout_2_linear.xml
+++ b/sample/src/main/res/layout/benchmark_layout_2_linear.xml
@@ -1,7 +1,6 @@
diff --git a/android/sample/res/layout/benchmark_layout_3_linear.xml b/sample/src/main/res/layout/benchmark_layout_3_linear.xml
similarity index 100%
rename from android/sample/res/layout/benchmark_layout_3_linear.xml
rename to sample/src/main/res/layout/benchmark_layout_3_linear.xml
diff --git a/android/sample/res/layout/benchmark_select_layout.xml b/sample/src/main/res/layout/benchmark_select_layout.xml
similarity index 86%
rename from android/sample/res/layout/benchmark_select_layout.xml
rename to sample/src/main/res/layout/benchmark_select_layout.xml
index d3de70a0..a30e9a63 100644
--- a/android/sample/res/layout/benchmark_select_layout.xml
+++ b/sample/src/main/res/layout/benchmark_select_layout.xml
@@ -1,5 +1,5 @@
-
@@ -18,120 +18,120 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/sample_children_background"
- yoga:yg_marginHorizontal="10dp"
- yoga:yg_marginTop="5dp"
- yoga:yg_flexDirection="row"
- yoga:yg_alignItems="center"
+ app:yg_marginHorizontal="10dp"
+ app:yg_marginTop="5dp"
+ app:yg_flexDirection="row"
+ app:yg_alignItems="center"
>
diff --git a/sample/src/main/res/menu/action_bar_benchmark.xml b/sample/src/main/res/menu/action_bar_benchmark.xml
new file mode 100644
index 00000000..69331d37
--- /dev/null
+++ b/sample/src/main/res/menu/action_bar_benchmark.xml
@@ -0,0 +1,8 @@
+
+
diff --git a/sample/src/main/res/menu/action_bar_home.xml b/sample/src/main/res/menu/action_bar_home.xml
new file mode 100644
index 00000000..747b5049
--- /dev/null
+++ b/sample/src/main/res/menu/action_bar_home.xml
@@ -0,0 +1,8 @@
+
+
diff --git a/android/sample/res/values/colors.xml b/sample/src/main/res/values/colors.xml
similarity index 100%
rename from android/sample/res/values/colors.xml
rename to sample/src/main/res/values/colors.xml
diff --git a/android/sample/res/values/strings.xml b/sample/src/main/res/values/strings.xml
similarity index 92%
rename from android/sample/res/values/strings.xml
rename to sample/src/main/res/values/strings.xml
index 8b884c57..85407052 100644
--- a/android/sample/res/values/strings.xml
+++ b/sample/src/main/res/values/strings.xml
@@ -30,4 +30,6 @@
name="child_5_text"
description="Placeholder text for the fifth element in the layout"
>Who are you?
+ Home
+ Benchmark
diff --git a/android/sample/res/values/styles.xml b/sample/src/main/res/values/styles.xml
similarity index 100%
rename from android/sample/res/values/styles.xml
rename to sample/src/main/res/values/styles.xml
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 6ecad0ff..ab788d30 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -7,8 +7,10 @@
plugins { id("com.gradle.enterprise").version("3.7.1") }
-include(":yoga", ":yoga-layout")
+include(":sample", ":yoga", ":yoga-layout")
+
project(":yoga").projectDir = file("java")
+
project(":yoga-layout").projectDir = file("android")
rootProject.name = "yoga-github"
@@ -17,4 +19,4 @@ rootProject.name = "yoga-github"
// you can configure your custom Gradle Enterprise instance
if (file("./gradle/gradle-enterprise.gradle.kts").exists()) {
apply(from = "./gradle/gradle-enterprise.gradle.kts")
-}
\ No newline at end of file
+}