Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,18 @@ public void localeSettings() {
}
}

@ReactMethod
public void appLocaleSettings() {
Intent intent = new Intent(Settings.ACTION_APP_LOCALE_SETTINGS);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
intent.setData(Uri.parse("package:" + reactContext.getPackageName()));

if (intent.resolveActivity(reactContext.getPackageManager()) != null) {
reactContext.startActivity(intent);
}
}

@ReactMethod
public void inputMethodSettings() {
Intent intent = new Intent(Settings.ACTION_INPUT_METHOD_SETTINGS);
Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ declare module "react-native-android-open-settings" {
const bluetoothSettings: () => void;
const dateSettings: () => void;
const localeSettings: () => void;
const appLocaleSettings: () => void;
const inputMethodSettings: () => void;
const displaySettings: () => void;
const securitySettings: () => void;
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ const dateSettings = () => RNAndroidOpenSettings.dateSettings()

const localeSettings = () => RNAndroidOpenSettings.localeSettings()

const appLocaleSettings = () => RNAndroidOpenSettings.appLocaleSettings()

const inputMethodSettings = () => RNAndroidOpenSettings.inputMethodSettings()

const displaySettings = () => RNAndroidOpenSettings.displaySettings()
Expand Down Expand Up @@ -54,6 +56,7 @@ module.exports = {
bluetoothSettings,
dateSettings,
localeSettings,
appLocaleSettings,
inputMethodSettings,
displaySettings,
securitySettings,
Expand Down