This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function updateAll(){ | |
updateBxPrice(); | |
updateDcrPrice(); | |
updateUSDtoBAHT(); | |
updateRig(); | |
updateStat(); | |
updateHashflare(); | |
} | |
function updateRig(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript"> | |
function someMethodOnAndroid() { | |
WebViewJS.someMethodOnAndroid('<html>'+document.getElementsByTagName('html')[0].innerHTML+'</html>'); | |
} | |
</script> | |
</head> | |
<body> | |
<input type="button" value="Say hello" onClick="someMethodOnAndroid()" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun changeHintInput() { | |
webview.loadUrl("javascript:" + | |
"var input = document.getElementById('lst-ib');" + | |
"var placeholder = document.createAttribute('placeholder');" + | |
"placeholder.value = 'The Khaeng placeholder';" + | |
"input.setAttributeNode(placeholder);") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
webview.loadUrl( | |
"javascript:$WEBVIEW_JS.onHeight(document.body.getBoundingClientRect().height)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JavascriptInterface | |
fun onHeight(height: Float) { | |
runOnUiThread { | |
printHeightOnWebView(height) | |
} | |
} | |
... | |
private fun printHeightOnWebView(height: Float) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity | |
: AppCompatActivity() { | |
companion object { | |
val WEBVIEW_JS = "WebViewJS" | |
} | |
private val webViewClient: WebViewClient = object : WebViewClient() { | |
override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ slide_in_from_right.xml ] | |
<?xml version="1.0" encoding="utf-8"?> | |
<set> | |
<translate xmlns:android="http://schemas.android.com/apk/res/android" | |
android:duration="@integer/fragment_transition_time" | |
android:fromXDelta="100%" | |
android:interpolator="@android:anim/decelerate_interpolator" | |
android:toXDelta="0" /> | |
</set> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<corners android:radius="30dp"/> | |
<solid android:color="@android:color/black"/> | |
</shape> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="@color/colorAccent"> | |
<item | |
android:id="@android:id/mask" | |
android:drawable="@drawable/lollipop_round_primary_mask"/> | |
<item> | |
<selector> | |
<item android:drawable="@drawable/lollipop_round_primary_focused" | |
android:state_focused="true" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<font-family xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
tools:ignore="UnusedAttribute"> | |
<font | |
android:font="@font/productsans_regular" | |
android:fontStyle="normal" | |
android:fontWeight="400" |