Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade project's build-time dependencies #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions braille/brailledisplay/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ dependencies {
implementation project(':brailletranslate')
implementation project(':braillecommon')
}

android.namespace 'com.google.android.accessibility.braille.brailledisplay'
4 changes: 1 addition & 3 deletions braille/brailledisplay/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.accessibility.braille.brailledisplay" />
<manifest />
8 changes: 3 additions & 5 deletions braille/brailledisplay/src/phone/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.accessibility.braille.brailledisplay">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-sdk android:targetSdkVersion="31" />

<uses-sdk
android:minSdkVersion="26"
android:targetSdkVersion="31" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- If you need access to FINE location, you must request both ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected void handleMessage(Message msg, OverlayDisplay parent) {
new OnSharedPreferenceChangeListener() {
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (context.getString(R.string.pref_braille_overlay_key).equals(key)) {
if (context.getString(com.google.android.accessibility.braille.common.R.string.pref_braille_overlay_key).equals(key)) {
displayThreadHandler.reportPreferenceChange();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ private int getDuration() {

private final OnSharedPreferenceChangeListener onSharedPreferenceChangeListener =
(SharedPreferences sharedPreferences, String key) -> {
if (key.equals(context.getString(R.string.pref_bd_auto_scroll_duration_key))) {
if (key.equals(context.getString(com.google.android.accessibility.braille.common.R.string.pref_bd_auto_scroll_duration_key))) {
handler.removeCallbacksAndMessages(/* token= */ null);
duration = BrailleUserPreferences.readAutoScrollDuration(context);
handler.postDelayed(runnable, getDuration());
} else if (key.equals(
context.getString(R.string.pref_bd_auto_adjust_duration_enable_key))) {
context.getString(com.google.android.accessibility.braille.common.R.string.pref_bd_auto_adjust_duration_enable_key))) {
autoAdjustDurationEnabled = BrailleUserPreferences.readAutoAdjustDurationEnable(context);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import android.content.Context;
import android.content.SharedPreferences;
import com.google.android.accessibility.braille.brailledisplay.R;
import com.google.android.accessibility.braille.common.BrailleUserPreferences;
import com.google.android.accessibility.braille.common.translate.BrailleLanguages.Code;
import com.google.android.accessibility.braille.translate.BrailleTranslator;
Expand Down Expand Up @@ -118,11 +117,11 @@ public BrailleTranslator getInputTranslator() {

@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if (context.getString(R.string.pref_bd_output_code).equals(key)) {
if (context.getString(com.google.android.accessibility.braille.common.R.string.pref_bd_output_code).equals(key)) {
updateOutputTranslators();
} else if (context.getString(R.string.pref_brailleime_translator_code).equals(key)) {
} else if (context.getString(com.google.android.accessibility.braille.common.R.string.pref_brailleime_translator_code).equals(key)) {
updateInputTranslator();
} else if (context.getString(R.string.pref_braille_contracted_mode).equals(key)) {
} else if (context.getString(com.google.android.accessibility.braille.common.R.string.pref_braille_contracted_mode).equals(key)) {
updateOutputTranslators();
updateInputTranslator();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public static String getFriendlyKeyNamesForCommand(
private static String getDotsDescription(Resources resources, BrailleCharacter brailleCharacter) {
String dotsString = changeToSentence(resources, brailleCharacter.toLocaleString().split(""));
return resources.getQuantityString(
R.plurals.braille_dots, brailleCharacter.getOnCount(), dotsString);
com.google.android.accessibility.braille.common.R.plurals.braille_dots, brailleCharacter.getOnCount(), dotsString);
}

/** Compose words to a sentence. Example: "abcd" -> "a, b, c and d". */
Expand All @@ -109,7 +109,7 @@ private static String changeToSentence(Resources resources, String[] words) {
StringBuilder sentence = new StringBuilder();
sentence.append(words[0]);
for (int i = 1; i < words.length - 1; i++) {
sentence.append(resources.getString(R.string.split_comma, words[i]));
sentence.append(resources.getString(com.google.android.accessibility.braille.common.R.string.split_comma, words[i]));
}
return resources.getString(R.string.bd_commands_delimiter, sentence, words[words.length - 1]);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public void onCreatePreferences(Bundle bundle, String rootKey) {
PreferenceSettingsUtils.addPreferencesFromResource(
this, R.xml.bd_advanced_settings_preferences);
timedMessageDurationPreference =
findPreference(getString(R.string.pref_bd_timed_message_duration_fraction_key));
findPreference(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_timed_message_duration_fraction_key));
blinkingIntervalPreference =
findPreference(getString(R.string.pref_bd_blinking_interval_key));
findPreference(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_blinking_interval_key));
getPreferenceManager()
.getSharedPreferences()
.registerOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
Expand Down Expand Up @@ -93,14 +93,14 @@ private int getQuantity(float number) {

private final OnSharedPreferenceChangeListener onSharedPreferenceChangeListener =
(sharedPreferences, key) -> {
if (key.equals(getString(R.string.pref_bd_blinking_interval_key))) {
if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_blinking_interval_key))) {
BrailleDisplayAnalytics.getInstance(getContext())
.logBlinkRate(BrailleUserPreferences.readBlinkingIntervalMs(getContext()));
} else if (key.equals(getString(R.string.pref_bd_reverse_panning_buttons))) {
} else if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_reverse_panning_buttons))) {
BrailleDisplayAnalytics.getInstance(getContext())
.logReversePanningKey(
BrailleUserPreferences.readReversePanningButtons(getContext()));
} else if (key.equals(getString(R.string.pref_bd_timed_message_duration_fraction_key))) {
} else if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_timed_message_duration_fraction_key))) {
int durationMs =
Math.round(
Float.parseFloat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void onPause() {

private final OnSharedPreferenceChangeListener onSharedPreferenceChangeListener =
(SharedPreferences sharedPreferences, String key) -> {
if (key.equals(getString(R.string.pref_bd_auto_scroll_duration_key))) {
if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_auto_scroll_duration_key))) {
refresh();
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ public boolean onPreferenceClick(Preference preference) {
findPreference(getString(R.string.pref_key_bd_connection_category));

preferredCodesPreference =
findPreference(getString(R.string.pref_brailleime_translator_codes_preferred));
findPreference(getString(com.google.android.accessibility.braille.common.R.string.pref_brailleime_translator_codes_preferred));
preferredCodesPreference.setIntent(new Intent(getContext(), BrailleLanguagesActivity.class));

currentActiveOutputCodePreference = findPreference(getString(R.string.pref_bd_output_code));
currentActiveOutputCodePreference = findPreference(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_output_code));
currentActiveInputCodePreference =
findPreference(getString(R.string.pref_brailleime_translator_code));
brailleGradePreference = findPreference(getString(R.string.pref_braille_contracted_mode));
findPreference(getString(com.google.android.accessibility.braille.common.R.string.pref_brailleime_translator_code));
brailleGradePreference = findPreference(getString(com.google.android.accessibility.braille.common.R.string.pref_braille_contracted_mode));
brailleGradePreference.setIntent(new Intent(getContext(), BrailleGradeActivity.class));

keyBindingsPreference = findPreference(getString(R.string.pref_key_bindings_key));
Expand Down Expand Up @@ -798,12 +798,12 @@ public void onOutputCodeChanged() {
new OnSharedPreferenceChangeListener() {
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(getString(R.string.pref_bd_output_code))) {
if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_bd_output_code))) {
BrailleDisplayAnalytics.getInstance(getContext())
.logBrailleOutputCodeSetting(
BrailleUserPreferences.readCurrentActiveOutputCodeAndCorrect(getContext()),
BrailleUserPreferences.readContractedMode(getContext()));
} else if (key.equals(getString(R.string.pref_brailleime_translator_code))) {
} else if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_brailleime_translator_code))) {
BrailleDisplayAnalytics.getInstance(getContext())
.logBrailleInputCodeSetting(
BrailleUserPreferences.readCurrentActiveInputCodeAndCorrect(getContext()),
Expand All @@ -814,7 +814,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
} else if (key.equals(getString(R.string.pref_key_bd_enabler))) {
BrailleDisplayAnalytics.getInstance(getContext())
.logEnablerSetting(PersistentStorage.isConnectionEnabledByUser(getContext()));
} else if (key.equals(getString(R.string.pref_braille_contracted_mode))) {
} else if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_braille_contracted_mode))) {
updateBrailleGradeSummary();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private void onModelChanged() {
new OnSharedPreferenceChangeListener() {
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(getString(R.string.pref_braille_contracted_mode))) {
if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_braille_contracted_mode))) {
onModelChanged();
}
}
Expand Down
2 changes: 2 additions & 0 deletions braille/brailledisplayanalytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ apply from: "../../shared.gradle"
dependencies {
implementation project(':braillecommon')
}

android.namespace 'com.google.android.accessibility.braille.brailledisplay.analytics'
4 changes: 1 addition & 3 deletions braille/brailledisplayanalytics/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.accessibility.braille.brailledisplay.analytics">
</manifest>
<manifest />
2 changes: 2 additions & 0 deletions braille/brailleime/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ dependencies {
implementation project(':brailleimeanalytics')
implementation project(':brailletranslate')
}

android.namespace 'com.google.android.accessibility.brailleime'
4 changes: 1 addition & 3 deletions braille/brailleime/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.accessibility.brailleime" />
<manifest />
7 changes: 2 additions & 5 deletions braille/brailleime/src/phone/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.google.android.accessibility.brailleime">
xmlns:tools="http://schemas.android.com/tools">

<uses-sdk
android:minSdkVersion="26"
android:targetSdkVersion="31" />
<uses-sdk android:targetSdkVersion="31" />

<!-- Required for haptic feedback. -->
<uses-permission android:name="android.permission.VIBRATE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ private void updateNavigationBarColor() {
this,
brailleDisplayConnectedAndNotSuspended
? R.color.braille_keyboard_background
: R.color.google_transparent));
: com.google.android.accessibility.utils.R.color.google_transparent));
}

private boolean isEightDotsBraille() {
Expand Down Expand Up @@ -1455,7 +1455,7 @@ private ImeConnection getImeConnection() {
new OnSharedPreferenceChangeListener() {
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
if (key.equals(getString(R.string.pref_brailleime_translator_code))) {
if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_brailleime_translator_code))) {
Code newCode =
BrailleUserPreferences.readCurrentActiveInputCodeAndCorrect(BrailleIme.this);
if (!brailleDisplayConnectedAndNotSuspended) {
Expand All @@ -1471,7 +1471,7 @@ public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, Strin
keyboardView.refreshInputView();
}
refreshEditBufferAndBrailleDisplay();
} else if (key.equals(getString(R.string.pref_braille_contracted_mode))) {
} else if (key.equals(getString(com.google.android.accessibility.braille.common.R.string.pref_braille_contracted_mode))) {
boolean contractedMode = BrailleUserPreferences.readContractedMode(BrailleIme.this);
if (BrailleUserPreferences.readCurrentActiveInputCodeAndCorrect(BrailleIme.this)
.isSupportsContracted(BrailleIme.this)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ interface CustomOnGestureListener {
dotNumberPaint = new Paint();
dotNumberPaint.setTextAlign(Paint.Align.CENTER);
dotNumberPaint.setTypeface(
Typeface.create(context.getString(R.string.accessibility_font), Typeface.NORMAL));
Typeface.create(context.getString(com.google.android.accessibility.utils.R.string.accessibility_font), Typeface.NORMAL));
float scaleFactor =
Utils.getResourcesFloat(resources, R.dimen.input_plane_dot_number_size_multiplier);
dotNumberPaint.setTextSize(scaleFactor * dotRadius);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ private InputViewCaption(String text) {
textPaint.setTextSize(resources.getDimensionPixelSize(R.dimen.input_view_caption_text_size));
textPaint.setStyle(Paint.Style.FILL_AND_STROKE);
textPaint.setTypeface(
Typeface.create(getContext().getString(R.string.accessibility_font), Typeface.NORMAL));
Typeface.create(getContext().getString(com.google.android.accessibility.utils.R.string.accessibility_font), Typeface.NORMAL));
captionBottomMarginInPixels =
resources.getDimensionPixelOffset(R.dimen.input_view_caption_bottom_margin);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
Preference preference = new Preference(getContext());
preference.setTitle(action.getDescriptionRes(getResources()));
if (action.hasIcon()) {
preference.setLayoutResource(R.layout.braille_common_text_with_icon);
preference.setLayoutResource(com.google.android.accessibility.braille.common.R.layout.braille_common_text_with_icon);
preference.setIcon(action.getIconRes(getContext()));
} else {
preference.setLayoutResource(R.layout.braille_common_text);
preference.setLayoutResource(com.google.android.accessibility.braille.common.R.layout.braille_common_text);
}
preference.setSelectable(false);
if (preferenceCategory != null) {
Expand Down
Loading