This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 954
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Added simple activity to test how flipper reacts to changes in native UI Reviewed By: passy Differential Revision: D38704012 fbshipit-source-id: 8a593577322922c6f6f0f96dd5cb0761c3035389
- Loading branch information
1 parent
0426966
commit 2fc1ff9
Showing
4 changed files
with
87 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
android/sample/src/main/java/com/facebook/flipper/sample/IncrementActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
package com.facebook.flipper.sample; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.TextView; | ||
|
||
public class IncrementActivity extends Activity { | ||
|
||
int count = 0; | ||
TextView text; | ||
Button button; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_increment); | ||
|
||
text = (TextView) findViewById(R.id.count); | ||
|
||
button = (Button) findViewById(com.facebook.flipper.sample.R.id.btn_inc); | ||
button.setOnClickListener( | ||
new View.OnClickListener() { | ||
@Override | ||
public void onClick(View view) { | ||
IncrementActivity.this.text.setText(String.valueOf(++count)); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".IncrementActivity" | ||
android:orientation="vertical" | ||
> | ||
|
||
|
||
<TextView | ||
android:id="@+id/count" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:text="0" /> | ||
|
||
<Button | ||
android:id="@+id/btn_inc" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:background="@android:color/darker_gray" | ||
android:text="Inc" | ||
android:textColor="@android:color/holo_blue_dark" | ||
/> | ||
</LinearLayout> |