-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from rmrs/feat/captioning_setting
feat: add captioning setting
- Loading branch information
Showing
13 changed files
with
248 additions
and
62 deletions.
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
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,14 @@ | ||
{ | ||
"printWidth": 80, | ||
"tabWidth": 2, | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "all", | ||
"useTabs": false, | ||
"overrides": [ | ||
{ | ||
"files": "*.json", | ||
"options": { "printWidth": 200 } | ||
} | ||
] | ||
} |
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
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
24 changes: 24 additions & 0 deletions
24
android/src/main/java/io/rumors/reactnativesettings/handlers/CaptioningSettingsHandler.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,24 @@ | ||
package io.rumors.reactnativesettings.handlers; | ||
|
||
import android.content.Context; | ||
import android.view.accessibility.CaptioningManager; | ||
|
||
import io.rumors.reactnativesettings.Constants; | ||
|
||
public class CaptioningSettingsHandler implements SettingsHandler<String> { | ||
private Context mContext; | ||
|
||
public CaptioningSettingsHandler(Context context) { | ||
this.mContext = context; | ||
} | ||
|
||
public String getSetting() { | ||
CaptioningManager captioningManager = (CaptioningManager) mContext.getSystemService(Context.CAPTIONING_SERVICE); | ||
|
||
if (captioningManager.isEnabled()) { | ||
return Constants.ENABLED; | ||
} | ||
|
||
return Constants.DISABLED; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -52,7 +52,8 @@ public String getSetting() { | |
return Constants.DISABLED; | ||
} | ||
else | ||
{ | ||
return Constants.ENABLED; | ||
|
||
} | ||
} | ||
} |
Oops, something went wrong.