This file contains 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
// DifferentModule.kt file | |
// ERROR: numberThree is not visible because this file is in a different module than Internal.kt | |
// ERROR: numberEight is not visible because User() is in a different module than Internal.kt | |
private const val numberEleven = numberThree.plus(User().numberEight) |
This file contains 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
// Private.kt file | |
// Visible just inside this file | |
private const val numberThree = 3 | |
// Visible just inside this file | |
private class User() { | |
// Visible just inside the user class | |
private val numberEight = numberThree.plus(5) | |
} |
This file contains 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
public class User { | |
private String name; | |
private int age; | |
public User(String name, int age) { | |
this.name = name; | |
this.age = age; | |
} |
This file contains 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
val steveJobs= User("Steve Jobs", 56) | |
fun print() { | |
val (name, age) = steveJobs | |
println("$name, $age years of age") // prints "Steve Jobs, 56 years of age" | |
steveJobs.component1() // name | |
steveJobs.component2() // age | |
} |
This file contains 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
val steveJobs= User("Steve Jobs", 56) | |
val steveJobsToday= steveJobs.copy(age = 63) |
This file contains 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
data class User( | |
val name: String, | |
val surname: String = "", | |
val address: String = "") { | |
class Builder { | |
private lateinit var name : String | |
private var surname : String = "" | |
private var address : String = "" |
This file contains 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
@Entity(tableName = "Users") | |
data class UserRM( | |
@PrimaryKey | |
@ColumnInfo(name = "id") | |
val id: Int, | |
@ColumnInfo(name = "name") | |
val name: String, |
This file contains 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
data class User(val name: String, val age: Int) { | |
var address : String = "" | |
} |
This file contains 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 android.content.Context; | |
import android.support.annotation.NonNull; | |
import android.support.annotation.Nullable; | |
import android.support.design.widget.TabLayout; | |
import android.util.AttributeSet; | |
import android.widget.LinearLayout; | |
public class AdaptiveTabLayout extends TabLayout | |
{ | |
private boolean mGravityAndModeSeUpNeeded = true; |
This file contains 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
(...) | |
mSupportMapFragment = (OnScrollableContainerMapFragment) getChildFragmentManager() | |
.findFragmentById(R.id.fragment_map); | |
mSupportMapFragment | |
.setOnTouchListener(new OnScrollableContainerMapFragment.OnTouchListener() { | |
@Override | |
public void onStartScrollingMap() { | |
mScrollView.requestDisallowInterceptTouchEvent(true); | |
} |