mirror of
https://github.com/ARMSX2/ARMSX1.git
synced 2026-08-24 16:53:35 -07:00
Add custom font and configure React Native project settings
- Added the Pixel Cyr font to the mobile assets directory. - Created a new React Native configuration file to specify project settings, including Android source directory, app name, and package name. - Configured asset linking for the mobile assets.
This commit is contained in:
@@ -2,6 +2,7 @@ package com.nanodata.armsx;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -36,12 +37,29 @@ public class ARMSXModule extends ReactContextBaseJavaModule {
|
||||
return;
|
||||
}
|
||||
|
||||
forceLandscapeInternal(host);
|
||||
|
||||
Intent intent = new Intent(host, EmulatorActivity.class);
|
||||
intent.putExtra(EmulatorActivity.EXTRA_NATIVE_ARGS, readableArrayToStrings(args));
|
||||
host.startActivity(intent);
|
||||
promise.resolve(true);
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void forceLandscape(Promise promise) {
|
||||
Activity host = getCurrentActivity();
|
||||
if (host == null) {
|
||||
promise.reject("no_activity", "Activity not available");
|
||||
return;
|
||||
}
|
||||
forceLandscapeInternal(host);
|
||||
promise.resolve(true);
|
||||
}
|
||||
|
||||
private void forceLandscapeInternal(@NonNull Activity host) {
|
||||
host.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
||||
}
|
||||
|
||||
private @Nullable String[] readableArrayToStrings(@Nullable ReadableArray array) {
|
||||
if (array == null) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user