Commit a517d5bb authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Add animations.

parent b5e6e327
...@@ -5,6 +5,7 @@ import android.content.Context ...@@ -5,6 +5,7 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import android.webkit.WebView
import android.webkit.WebViewClient import android.webkit.WebViewClient
import chat.rocket.android.R import chat.rocket.android.R
import kotlinx.android.synthetic.main.activity_web_view.* import kotlinx.android.synthetic.main.activity_web_view.*
...@@ -40,7 +41,7 @@ class WebViewActivity : AppCompatActivity() { ...@@ -40,7 +41,7 @@ class WebViewActivity : AppCompatActivity() {
if (web_view.canGoBack()) { if (web_view.canGoBack()) {
web_view.goBack() web_view.goBack()
} else { } else {
super.onBackPressed() finishActivity()
} }
} }
...@@ -48,7 +49,7 @@ class WebViewActivity : AppCompatActivity() { ...@@ -48,7 +49,7 @@ class WebViewActivity : AppCompatActivity() {
toolbar.title = getString(R.string.title_legal_terms) toolbar.title = getString(R.string.title_legal_terms)
toolbar.setNavigationIcon(R.drawable.ic_close_white_24dp) toolbar.setNavigationIcon(R.drawable.ic_close_white_24dp)
toolbar.setNavigationOnClickListener { toolbar.setNavigationOnClickListener {
finish() finishActivity()
} }
} }
...@@ -58,4 +59,9 @@ class WebViewActivity : AppCompatActivity() { ...@@ -58,4 +59,9 @@ class WebViewActivity : AppCompatActivity() {
web_view.webViewClient = WebViewClient() web_view.webViewClient = WebViewClient()
web_view.loadUrl(webPageUrl) web_view.loadUrl(webPageUrl)
} }
private fun finishActivity() {
super.onBackPressed()
overridePendingTransition(R.anim.hold, R.anim.slide_down)
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="800"
android:fromYDelta="0.0%p"
android:toYDelta="0.0%p" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="350"
android:fromYDelta="0.0%"
android:toYDelta="100.0%" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="350"
android:fromYDelta="100.0%"
android:toYDelta="0.0%" />
</set>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment