Skip to content

Instantly share code, notes, and snippets.

@vorobeij
Created April 24, 2018 18:36
Show Gist options
  • Select an option

  • Save vorobeij/432c348929ea71cbe8eab4cd277bbb04 to your computer and use it in GitHub Desktop.

Select an option

Save vorobeij/432c348929ea71cbe8eab4cd277bbb04 to your computer and use it in GitHub Desktop.
webview
rssdetWebView.loadUrl(rssItem.link)
rssdetWebView.webChromeClient = object : WebChromeClient() {
override fun onProgressChanged(view: WebView?,
newProgress: Int) {
progressBar.progress = newProgress
if (progress == 100) progressBar.visibility = View.GONE
else progressBar.visibility = View.VISIBLE
}
}
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="2dp"
app:layout_constraintTop_toBottomOf="@id/rssdetDivBottom"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<WebView
android:id="@+id/rssdetWebView"
android:layout_width="0dp"
android:layout_height="300dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/progressBar" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment