Skip to content

Commit cf2238e

Browse files
RSNarafacebook-github-bot
authored andcommitted
Add title to DevMenu
Summary: Before the DevMenu would just open up as a DialogBox. After this change, the DialogBox will have a title. This should help distinguish between the Bridgeless DevMenu and the Bridge DevMenu. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D29071185 fbshipit-source-id: 72533f10b73b36cd890fe152c6de901c867159f2
1 parent 6676d01 commit cf2238e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@
1717
import android.content.IntentFilter;
1818
import android.content.pm.PackageInfo;
1919
import android.content.pm.PackageManager;
20+
import android.graphics.Color;
21+
import android.graphics.Typeface;
2022
import android.hardware.SensorManager;
2123
import android.util.Pair;
24+
import android.view.Gravity;
2225
import android.view.View;
2326
import android.widget.EditText;
27+
import android.widget.TextView;
2428
import android.widget.Toast;
2529
import androidx.annotation.Nullable;
2630
import androidx.annotation.UiThread;
@@ -551,8 +555,18 @@ public void onOptionSelected() {
551555
"Unable to launch dev options menu because react activity " + "isn't available");
552556
return;
553557
}
558+
559+
final TextView textView = new TextView(getApplicationContext());
560+
textView.setText("React Native DevMenu (" + getUniqueTag() + ")");
561+
textView.setPadding(0, 50, 0, 0);
562+
textView.setGravity(Gravity.CENTER);
563+
textView.setTextColor(Color.BLACK);
564+
textView.setTextSize(17);
565+
textView.setTypeface(textView.getTypeface(), Typeface.BOLD);
566+
554567
mDevOptionsDialog =
555568
new AlertDialog.Builder(context)
569+
.setCustomTitle(textView)
556570
.setItems(
557571
options.keySet().toArray(new String[0]),
558572
new DialogInterface.OnClickListener() {

0 commit comments

Comments
 (0)