Skip to content

Instantly share code, notes, and snippets.

View YashishDua's full-sized avatar

Yashish Dua YashishDua

View GitHub Profile
<resources>
<string name="app_name">
My Application
</string>
</resources>
<resources>
<string
name="app_name"
tools:ignore="MissingTranslation">
My Application
</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:shrinkMode="strict" />
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:keep="@layout/used_1,@layout/used_2"
tools:discard="@layout/unused_1" />
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="@tools:sample/lorem" />
#FF4336
#9727BO
#673AB7
class WallFragment : Fragment() {
companion object {
fun newInstance() = WallFragment()
}
private lateinit var fragmentListener: FragmentListener
override fun onAttach(context: Context?) {
super.onAttach(context)
class MainActivity : AppCompatActivity(), FragmentListener {
// ...
override fun handleOnClick() {
// Action to implement
}
}
interface FragmentListener {
fun handleOnClick()
}
class SharedViewModel : ViewModel() {
val data = MutableLiveData<Item>()
fun data(item: Item) {
data.value = item
}
}