This commit is contained in:
Mariotaku Lee 2017-09-03 18:05:56 +08:00
parent b919d50965
commit b017e520ac
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
3 changed files with 22 additions and 14 deletions

View File

@ -62,7 +62,7 @@ before_script:
- ./travis/scripts/test_private_files.sh - ./travis/scripts/test_private_files.sh
script: script:
- ./gradlew clean build --stacktrace - ./gradlew clean build --stacktrace --no-daemon
after_failure: after_failure:
- ./travis/scripts/upload_error_logs.sh - ./travis/scripts/upload_error_logs.sh

View File

@ -1,3 +1,2 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xmx6144m -XX:+HeapDumpOnOutOfMemoryError
kotlin.incremental=true kotlin.incremental=true

View File

@ -51,10 +51,7 @@ import android.support.v7.app.AlertDialog
import android.support.v7.app.AppCompatDelegate import android.support.v7.app.AppCompatDelegate
import android.support.v7.widget.TintTypedArray import android.support.v7.widget.TintTypedArray
import android.util.SparseIntArray import android.util.SparseIntArray
import android.view.Gravity import android.view.*
import android.view.KeyEvent
import android.view.MenuItem
import android.view.View
import android.view.View.OnClickListener import android.view.View.OnClickListener
import android.view.View.OnLongClickListener import android.view.View.OnLongClickListener
import android.view.ViewGroup.MarginLayoutParams import android.view.ViewGroup.MarginLayoutParams
@ -333,6 +330,12 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
super.onDestroy() super.onDestroy()
} }
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
// Pass any configuration change to the drawer toggle
drawerToggle.onConfigurationChanged(newConfig)
}
override fun onAttachFragment(fragment: Fragment?) { override fun onAttachFragment(fragment: Fragment?) {
super.onAttachFragment(fragment) super.onAttachFragment(fragment)
updateActionsButton() updateActionsButton()
@ -390,6 +393,11 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
return true return true
} }
override fun onCreateOptionsMenu(menu: Menu): Boolean {
super.onCreateOptionsMenu(menu)
return false
}
override fun getSystemWindowInsets(caller: Fragment, insets: Rect): Boolean { override fun getSystemWindowInsets(caller: Fragment, insets: Rect): Boolean {
if (caller === leftDrawerFragment) return super.getSystemWindowInsets(caller, insets) if (caller === leftDrawerFragment) return super.getSystemWindowInsets(caller, insets)
if (mainTabs == null || homeContent == null) return false if (mainTabs == null || homeContent == null) return false
@ -526,9 +534,10 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
return super.handleKeyboardShortcutRepeat(handler, keyCode, repeatCount, event, metaState) return super.handleKeyboardShortcutRepeat(handler, keyCode, repeatCount, event, metaState)
} }
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean { override fun dispatchKeyEvent(event: KeyEvent): Boolean {
when (keyCode) { when (event.keyCode) {
KeyEvent.KEYCODE_MENU -> { KeyEvent.KEYCODE_MENU -> {
if (event.action != KeyEvent.ACTION_UP) return true
if (isDrawerOpen) { if (isDrawerOpen) {
homeMenu.closeDrawers() homeMenu.closeDrawers()
} else { } else {
@ -536,6 +545,12 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
} }
return true return true
} }
}
return super.dispatchKeyEvent(event)
}
override fun onKeyUp(keyCode: Int, event: KeyEvent): Boolean {
when (keyCode) {
KeyEvent.KEYCODE_BACK -> { KeyEvent.KEYCODE_BACK -> {
if (isDrawerOpen) { if (isDrawerOpen) {
homeMenu.closeDrawers() homeMenu.closeDrawers()
@ -572,12 +587,6 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
val tabs: List<SupportTabSpec> val tabs: List<SupportTabSpec>
get() = pagerAdapter.tabs get() = pagerAdapter.tabs
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
// Pass any configuration change to the drawer toggle
drawerToggle.onConfigurationChanged(newConfig)
}
override var controlBarOffset: Float override var controlBarOffset: Float
get() { get() {
if (mainTabs.columns > 1) { if (mainTabs.columns > 1) {