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

Move homepage URL to a resValue in build config #1020

Merged
merged 1 commit into from
Sep 27, 2023
Merged
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 app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ android {
buildConfigField "String[]", "SPEECH_SERVICES", "{ com.igalia.wolvic.speech.SpeechServices.MEETKAI }"
buildConfigField "Boolean", "SUPPORTS_SYSTEM_NOTIFICATIONS", "false"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resValue 'string', 'HOMEPAGE_URL', "https://wolvic.com/start"
externalNativeBuild {
cmake {
cppFlags "-std=c++14 -fexceptions -frtti -Werror" +
Expand Down Expand Up @@ -369,6 +370,7 @@ android {
buildConfigField "Boolean", "FXA_USE_CHINA_SERVER", "true"
buildConfigField "Boolean", "WEBVIEW_IN_PHONE_UI", "true"
buildConfigField "Boolean", "CN_FIRST_RUN_IN_PHONE_UI", "true"
resValue 'string', 'HOMEPAGE_URL', 'about:blank'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public void setInputMode(int aTouchMode) {
public String getHomepage() {
return mPrefs.getString(
mContext.getString(R.string.settings_key_homepage),
mContext.getString(R.string.homepage_url));
mContext.getString(R.string.HOMEPAGE_URL));
}

public void setHomepage(String aHomepage) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ public void setRegion(String aRegion) {

public String getHomeUri() {
String homepage = SettingsStore.getInstance(mContext).getHomepage();
if (homepage.equals(mContext.getString(R.string.homepage_url)) && mState.mRegion != null) {
if (homepage.equals(mContext.getString(R.string.HOMEPAGE_URL)) && mState.mRegion != null) {
homepage = homepage + "?region=" + mState.mRegion;
}
return homepage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected void updateUI() {
mBinding.startWithPassthroughSwitch.setVisibility(View.GONE);
}

mDefaultHomepageUrl = getContext().getString(R.string.homepage_url);
mDefaultHomepageUrl = getContext().getString(R.string.HOMEPAGE_URL);

mBinding.homepageEdit.setHint1(getContext().getString(R.string.homepage_hint, getContext().getString(R.string.app_name)));
mBinding.homepageEdit.setDefaultFirstValue(mDefaultHomepageUrl);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public static boolean isAboutPage(@Nullable String url) {
}

public static boolean isContentFeed(Context aContext, @Nullable String url) {
String feed = aContext.getString(R.string.homepage_url);
String feed = aContext.getString(R.string.HOMEPAGE_URL);
return UrlUtils.getHost(feed).equalsIgnoreCase(UrlUtils.getHost(url));
}

Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/values/non_L10n.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<string name="app_name" translatable="false">Wolvic</string>
<string name="bug_report_url" translatable="false">github.com/Igalia/wolvic/issues</string>
<!-- You can test a local file using: "resource://android/assets/webvr/index.html" -->
<string name="homepage_url" translatable="false">https://wolvic.com/start</string>
<string name="settings_key_homepage" translatable="false">settings_homepage</string>
<string name="settings_key_crash" translatable="false">settings_crash</string>
<string name="settings_key_locale" translatable="false">settings_locale</string>
Expand Down