зеркало из https://github.com/mozilla/pjs.git
bug 600214 - Use string resources for android java files r=mwu a=blocking-fennec
This commit is contained in:
Родитель
9eb7468940
Коммит
8b50ba131e
|
@ -138,9 +138,8 @@ abstract public class GeckoApp
|
||||||
int version = Integer.parseInt(versionStr);
|
int version = Integer.parseInt(versionStr);
|
||||||
|
|
||||||
if (version < getMinCPUVersion()) {
|
if (version < getMinCPUVersion()) {
|
||||||
showErrorDialog("This device does not meet the " +
|
showErrorDialog(
|
||||||
"minimum system requirements for " +
|
getString(R.string.incompatable_cpu_error));
|
||||||
getAppName() + ".");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -155,8 +154,9 @@ abstract public class GeckoApp
|
||||||
|
|
||||||
if (!useLaunchButton)
|
if (!useLaunchButton)
|
||||||
mProgressDialog =
|
mProgressDialog =
|
||||||
ProgressDialog.show(GeckoApp.this, "", getAppName() +
|
ProgressDialog.show(GeckoApp.this, "",
|
||||||
" is loading", true);
|
getString(R.string.splash_screen_label),
|
||||||
|
true);
|
||||||
// Load our JNI libs; we need to do this before launch() because
|
// Load our JNI libs; we need to do this before launch() because
|
||||||
// setInitialSize will be called even before Gecko is actually up
|
// setInitialSize will be called even before Gecko is actually up
|
||||||
// and running.
|
// and running.
|
||||||
|
@ -164,7 +164,7 @@ abstract public class GeckoApp
|
||||||
|
|
||||||
if (useLaunchButton) {
|
if (useLaunchButton) {
|
||||||
final Button b = new Button(this);
|
final Button b = new Button(this);
|
||||||
b.setText("Launch");
|
b.setText("Launch"); // don't need to localize
|
||||||
b.setOnClickListener(new Button.OnClickListener() {
|
b.setOnClickListener(new Button.OnClickListener() {
|
||||||
public void onClick (View v) {
|
public void onClick (View v) {
|
||||||
// hide the button so we can't be launched again
|
// hide the button so we can't be launched again
|
||||||
|
|
|
@ -80,6 +80,8 @@ GARBAGE += \
|
||||||
gecko.ap_ \
|
gecko.ap_ \
|
||||||
gecko-unaligned.apk \
|
gecko-unaligned.apk \
|
||||||
gecko-unsigned-unaligned.apk \
|
gecko-unsigned-unaligned.apk \
|
||||||
|
res/values/strings.xml \
|
||||||
|
R.java \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
GARBAGE_DIRS += res libs dist classes
|
GARBAGE_DIRS += res libs dist classes
|
||||||
|
@ -136,6 +138,9 @@ endif
|
||||||
|
|
||||||
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
|
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
|
||||||
|
|
||||||
|
DEFAULT_BRANDPATH = $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/en-US/brand.dtd
|
||||||
|
DEFAULT_STRINGSPATH = android_strings.dtd
|
||||||
|
|
||||||
include $(topsrcdir)/config/rules.mk
|
include $(topsrcdir)/config/rules.mk
|
||||||
|
|
||||||
# Override the Java settings with some specific android settings
|
# Override the Java settings with some specific android settings
|
||||||
|
@ -170,10 +175,10 @@ $(RES_DRAWABLE_HDPI):
|
||||||
$(NSINSTALL) -D res/drawable-hdpi
|
$(NSINSTALL) -D res/drawable-hdpi
|
||||||
cp $(topsrcdir)/mobile/app/android/drawable-hdpi/* res/drawable-hdpi/
|
cp $(topsrcdir)/mobile/app/android/drawable-hdpi/* res/drawable-hdpi/
|
||||||
|
|
||||||
R.java: $(MOZ_APP_ICON) $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI)
|
R.java: $(MOZ_APP_ICON) $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI) res/values/strings.xml $(LOCALIZED_STRINGS_XML) AndroidManifest.xml
|
||||||
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -J . --custom-package org.mozilla.gecko
|
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -J . --custom-package org.mozilla.gecko
|
||||||
|
|
||||||
gecko.ap_: AndroidManifest.xml res/drawable/icon.png res/drawable-hdpi/icon.png $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI)
|
gecko.ap_: AndroidManifest.xml res/drawable/icon.png res/drawable-hdpi/icon.png $(RES_DRAWABLE) $(RES_DRAWABLE_HDPI) res/values/strings.xml $(LOCALIZED_STRINGS_XML)
|
||||||
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
|
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
|
||||||
|
|
||||||
libs/armeabi/%: $(DIST)/lib/%
|
libs/armeabi/%: $(DIST)/lib/%
|
||||||
|
@ -209,3 +214,10 @@ endif
|
||||||
$(MOZ_APP_NAME).apk: gecko-unaligned.apk
|
$(MOZ_APP_NAME).apk: gecko-unaligned.apk
|
||||||
$(ZIPALIGN) -f -v 4 gecko-unaligned.apk $@
|
$(ZIPALIGN) -f -v 4 gecko-unaligned.apk $@
|
||||||
|
|
||||||
|
res/values/strings.xml: FORCE
|
||||||
|
mkdir -p res/values
|
||||||
|
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
|
||||||
|
-DBRANDPATH="$(DEFAULT_BRANDPATH)" \
|
||||||
|
-DSTRINGSPATH="$(DEFAULT_STRINGSPATH)" \
|
||||||
|
$(srcdir)/strings.xml.in \
|
||||||
|
> $@
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
<!ENTITY splash_screen_label "&brandShortName; is loading">
|
||||||
|
<!ENTITY incompatable_cpu_error "This device does not meet the minimum system requirements for &brandShortName;.">
|
|
@ -0,0 +1,10 @@
|
||||||
|
#filter substitution
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE resources [
|
||||||
|
#includesubst @BRANDPATH@
|
||||||
|
#includesubst @STRINGSPATH@
|
||||||
|
]>
|
||||||
|
<resources>
|
||||||
|
<string name="splash_screen_label">&splash_screen_label;</string>
|
||||||
|
<string name="incompatable_cpu_error">&incompatable_cpu_error;</string>
|
||||||
|
</resources>
|
Загрузка…
Ссылка в новой задаче