Слайд 3

Activity_main.xml

Activity_main.xml
android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_baseline_create_new_folder_24" android:layout_gravity="end|bottom" android:layout_margin="16dp" tools:ignore="MissingConstraints" />

Слайд 4

MainActivity.kt

class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main)

MainActivity.kt class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState)
button_simple.setOnClickListener { Snackbar.make( it, "Hello Snackbar!", Snackbar.LENGTH_SHORT ).show() } button_action.setOnClickListener { root_layout.setBackgroundColor(Color.YELLOW) Snackbar.make( root_layout, "We changes app background color.", Snackbar.LENGTH_LONG // ).setAction( "Undo" ) { root_layout.setBackgroundColor(Color.parseColor("#f2f2f2")) }.show() }
Имя файла: Android.pptx
Количество просмотров: 29
Количество скачиваний: 0