diff options
Diffstat (limited to 'sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt index 4197b6d..5107e18 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt @@ -1,10 +1,35 @@ +/* + * Copyright 2018 Allan Wang + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package ca.allanwang.kau.sample import android.app.Activity import android.os.Bundle import ca.allanwang.kau.internal.KauBaseActivity -import ca.allanwang.kau.swipe.* -import ca.allanwang.kau.utils.* +import ca.allanwang.kau.swipe.SWIPE_EDGE_BOTTOM +import ca.allanwang.kau.swipe.SWIPE_EDGE_LEFT +import ca.allanwang.kau.swipe.SWIPE_EDGE_RIGHT +import ca.allanwang.kau.swipe.SWIPE_EDGE_TOP +import ca.allanwang.kau.swipe.kauSwipeFinish +import ca.allanwang.kau.swipe.kauSwipeOnCreate +import ca.allanwang.kau.swipe.kauSwipeOnDestroy +import ca.allanwang.kau.utils.darken +import ca.allanwang.kau.utils.navigationBarColor +import ca.allanwang.kau.utils.rndColor +import ca.allanwang.kau.utils.startActivity +import ca.allanwang.kau.utils.statusBarColor import kotlinx.android.synthetic.main.activity_swipe.* /** @@ -24,8 +49,8 @@ class SwipeActivity : KauBaseActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_swipe) listOf(swipe_from_left, swipe_from_right, swipe_from_top, swipe_from_bottom) - .zip(listOf(SWIPE_EDGE_LEFT, SWIPE_EDGE_RIGHT, SWIPE_EDGE_TOP, SWIPE_EDGE_BOTTOM)) - .forEach { (button, edge) -> button.setOnClickListener { startActivityWithEdge(edge) } } + .zip(listOf(SWIPE_EDGE_LEFT, SWIPE_EDGE_RIGHT, SWIPE_EDGE_TOP, SWIPE_EDGE_BOTTOM)) + .forEach { (button, edge) -> button.setOnClickListener { startActivityWithEdge(edge) } } val flag = intent.getIntExtra(SWIPE_EDGE, -1) swipe_toolbar.title = when (flag) { SWIPE_EDGE_LEFT -> "Left Edge Swipe" @@ -54,4 +79,4 @@ class SwipeActivity : KauBaseActivity() { override fun onBackPressed() { kauSwipeFinish() } -}
\ No newline at end of file +} |