Skip to content

Commit

Permalink
feat: 🎸 [DSY-1544] Adding second rn module to app
Browse files Browse the repository at this point in the history
  • Loading branch information
mlcsouza committed Oct 20, 2020
1 parent 4329d21 commit 408b472
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 9 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])

implementation(name: 'rnsample-release', ext: 'aar')
implementation(name: 'rnsamplefixed-release', ext: 'aar')

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
Expand Down
Binary file added android/app/libs/rnsamplefixed-release.aar
Binary file not shown.
7 changes: 6 additions & 1 deletion android/app/src/main/java/com/natura/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.example.rnsample.RNSampleActivity
import com.example.rnsamplefixed.RNSampleFixedActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
Expand All @@ -16,8 +17,12 @@ class MainActivity : AppCompatActivity() {
startActivity(Intent(this, NativeIconsActivity::class.java))
}

reactNative1button.setOnClickListener {
reactNative1Button.setOnClickListener {
startActivity(Intent(this, RNSampleActivity::class.java))
}

reactNative2Button.setOnClickListener {
startActivity(Intent(this, RNSampleFixedActivity::class.java))
}
}
}
20 changes: 15 additions & 5 deletions android/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -10,21 +11,30 @@
android:id="@+id/nativebutton"
android:layout_width="?sizeHugeXXX"
android:layout_height="wrap_content"
android:layout_marginBottom="?spacingSmall"
android:text="@string/native_button_label"
app:layout_constraintBottom_toTopOf="@+id/reactNative1button"
app:layout_constraintBottom_toTopOf="@+id/reactNative1Button"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent" />

<Button
android:id="@+id/reactNative1button"
android:id="@+id/reactNative1Button"
android:layout_width="?sizeHugeXXX"
android:layout_height="wrap_content"
android:layout_marginBottom="?spacingSmall"
android:text="@string/react_native1_button_label"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<Button
android:id="@+id/reactNative2Button"
android:layout_width="?sizeHugeXXX"
android:layout_height="wrap_content"
android:text="@string/react_native2_button_label"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/reactNative1Button" />

</androidx.constraintlayout.widget.ConstraintLayout>
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 408b472

Please sign in to comment.