Skip to content
This repository was archived by the owner on Jul 11, 2025. It is now read-only.

Commit 00b047b

Browse files
authored
Merge pull request #160 from gcoleman799/share-feature
Fix Share Feature
2 parents 35b902d + 77350b7 commit 00b047b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

WebView/app/src/main/assets/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<option value="london">London</option>
2929
</select>
3030
<h1 id="title">Location</h1>
31-
<img alt="weather" class="icon" id="icon" src="https://raw.githubusercontent.com/res/drawable/sunny.png" />
31+
<img alt="weather" class="icon" id="icon" src="https://raw.githubusercontent.com/views-widgets-samples/res/drawable/sunny.png" />
3232
<h2 class="currentTemp" id="currentTemp">Current Temp</h2>
3333
<h2 class="shortDescription" id="shortDescription">Short Description</h2>
3434
<p class="longDescription" id="longDescription">Long Description</p>

WebView/app/src/main/assets/main.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function getData() {
3030
}).then(function(data) {
3131
var form = document.getElementById("location");
3232
var currentLocation = form.options[form.selectedIndex].value;
33-
console.log(data[currentLocation].description);
3433
document.getElementById("title").innerText = form.options[form.selectedIndex].text;
3534
document.getElementById("currentTemp").innerText = `${data[currentLocation].currentTemp}`+ "\xB0 F";
3635
document.getElementById("shortDescription").innerText = data[currentLocation].description;

WebView/app/src/main/java/com/android/samples/webviewdemo/MainActivity.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class MainActivity : AppCompatActivity() {
8282
* origin in this set then it will have the JS object injected into it
8383
* @param onMessageReceived invoked on UI thread with message passed in from JavaScript postMessage() call
8484
*/
85+
8586
private fun createJsObject(
8687
webview: WebView,
8788
jsObjName: String,
@@ -129,8 +130,8 @@ class MainActivity : AppCompatActivity() {
129130
val binding = ActivityMainBinding.inflate(layoutInflater)
130131
setContentView(binding.root)
131132
val jsObjName = "jsObject"
132-
val allowedOriginRules = setOf<String>("https://gcoleman799.github.io")
133-
133+
val allowedOriginRules = setOf<String>("https://raw.githubusercontent.com")
134+
134135
// Configuring Dark Theme
135136
// *NOTE* : The force dark setting is not persistent. You must call the static
136137
// method every time your app process is started.

0 commit comments

Comments
 (0)