Skip to content

Commit f39a4c9

Browse files
committed
Config deck pager in main activity
1 parent d9d64d4 commit f39a4c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/main/java/com/example/bloder/deck/MainActivity.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@ package com.example.bloder.deck
22

33
import android.os.Bundle
44
import android.support.v7.app.AppCompatActivity
5+
import com.example.lib.Deck
56

67
/**
78
* Created by bloder on 25/08/17.
89
*/
910
class MainActivity : AppCompatActivity() {
1011

12+
private val deckPager by lazy { findViewById<Deck>(R.id.deck_pager) }
13+
1114
override fun onCreate(savedInstanceState: Bundle?) {
1215
super.onCreate(savedInstanceState)
1316
setContentView(R.layout.activity_main)
17+
deckPager.offscreenPageLimit = 5
18+
deckPager.adapter = DeckAdapter(this)
19+
deckPager.useDefaultPadding(this)
1420
}
1521
}

0 commit comments

Comments
 (0)