Skip to content

Commit

Permalink
Merge pull request #160 from gcoleman799/share-feature
Browse files Browse the repository at this point in the history
Fix Share Feature
  • Loading branch information
gcoleman799 authored Jul 29, 2020
2 parents 35b902d + 77350b7 commit 00b047b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion WebView/app/src/main/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<option value="london">London</option>
</select>
<h1 id="title">Location</h1>
<img alt="weather" class="icon" id="icon" src="https://raw.githubusercontent.com/res/drawable/sunny.png" />
<img alt="weather" class="icon" id="icon" src="https://raw.githubusercontent.com/views-widgets-samples/res/drawable/sunny.png" />
<h2 class="currentTemp" id="currentTemp">Current Temp</h2>
<h2 class="shortDescription" id="shortDescription">Short Description</h2>
<p class="longDescription" id="longDescription">Long Description</p>
Expand Down
1 change: 0 additions & 1 deletion WebView/app/src/main/assets/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function getData() {
}).then(function(data) {
var form = document.getElementById("location");
var currentLocation = form.options[form.selectedIndex].value;
console.log(data[currentLocation].description);
document.getElementById("title").innerText = form.options[form.selectedIndex].text;
document.getElementById("currentTemp").innerText = `${data[currentLocation].currentTemp}`+ "\xB0 F";
document.getElementById("shortDescription").innerText = data[currentLocation].description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class MainActivity : AppCompatActivity() {
* origin in this set then it will have the JS object injected into it
* @param onMessageReceived invoked on UI thread with message passed in from JavaScript postMessage() call
*/

private fun createJsObject(
webview: WebView,
jsObjName: String,
Expand Down Expand Up @@ -129,8 +130,8 @@ class MainActivity : AppCompatActivity() {
val binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
val jsObjName = "jsObject"
val allowedOriginRules = setOf<String>("https://gcoleman799.github.io")
val allowedOriginRules = setOf<String>("https://raw.githubusercontent.com")

// Configuring Dark Theme
// *NOTE* : The force dark setting is not persistent. You must call the static
// method every time your app process is started.
Expand Down

0 comments on commit 00b047b

Please sign in to comment.