Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.os.Bundle
import android.webkit.ValueCallback
import androidx.core.app.ActivityCompat
import to.dev.dev_android.R
import to.dev.dev_android.base.BuildConfig
import to.dev.dev_android.base.activity.BaseActivity
import to.dev.dev_android.databinding.ActivityMainBinding

Expand Down Expand Up @@ -47,7 +48,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>(), CustomWebChromeClient.
}

private fun navigateToHome() {
binding.webView.loadUrl(resources.getString(R.string.main_url))
binding.webView.loadUrl(BuildConfig.baseUrl)
}

override fun onBackPressed() {
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<resources>
<string name="app_name">DEV Community</string>

<string name="main_url">https://dev.to</string>
</resources>
6 changes: 6 additions & 0 deletions baseui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ android {
}

buildTypes {
debug {
resValue("string", "baseUrl", "\"https://dev.to\"")
buildConfigField("String", "baseUrl", "\"https://dev.to\"")
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
resValue("string", "baseUrl", "\"https://dev.to\"")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is resValue needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resValue has been added so that when in future the baseUrl needs to be referred from resource files, it is already available to do so.

buildConfigField("String", "baseUrl", "\"https://dev.to\"")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can be made cleaner with:

Suggested change
buildConfigField("String", "baseUrl", "\"https://dev.to\"")
buildConfigField("String", "baseUrl", '"https://dev.to"')

}
}

Expand Down