This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javaCompileOptions { | |
annotationProcessorOptions { | |
arguments = mapOf( | |
"room.schemaLocation" to "$projectDir/schemas", | |
"room.incremental" to "true", | |
"room.expandProjection" to "true" | |
) | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ColumnInfo(name = "name") | |
val name: String? = "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Room.databaseBuilder(appContext, AppDatabase.class, "Sample.db") | |
.createFromAsset("database/myapp.db") | |
.build() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TabLayoutMediator(tabLayout, viewPager) { tab, position -> | |
when (position) { | |
0 -> tab.text = "Home" | |
1 -> tab.text = "School" | |
} | |
}.attach() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
private lateinit var viewPager: ViewPager2 | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
viewPager = findViewById(R.id.my_view_pager) | |
val tabLayout = findViewById<TabLayout>(R.id.tabs) | |
val pagerAdapter = ScreenSlidePagerAdapter(this) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<androidx.viewpager2.widget.ViewPager2 | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:id="@+id/my_view_pager" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | |
plugins { | |
id("com.android.application") | |
kotlin("android") | |
kotlin("android.extensions") | |
} | |
android { | |
compileSdkVersion(29) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tasks { | |
withType<KotlinCompile> { | |
kotlinOptions.jvmTarget = "1.8" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kotlinOptions { | |
jvmTarget = "1.8" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildTypes { | |
getByName("release") { | |
isMinifyEnabled = true | |
proguardFiles( | |
getDefaultProguardFile("proguard-android-optimize.txt"), | |
"proguard-rules.pro" | |
) | |
} | |
} |
NewerOlder