Fanidan 4-amaliy mashg’ulot
Download 1.54 Mb.
|
4-amaliy. Mobile
316-20 guruh talabasi Burxonov Karomatillo Mobil ilovalarni ishlab chiqish fanidan 4-amaliy mashg’ulot Sayohat ilovasi: Bu mehmonxona qidirish va bron qilish ilovasi, marshrutni rejalashtirish ilovasi, mahalliy restoran qidiruvi ilovasi va boshqalar boʻlishi mumkin. git clone https://github.com/googlecodelabs/maps-platform-101-android.git android:name="com.google.android.gms.maps.SupportMapFragment" xmlns:app="http://schemas.android.com/apk/res-auto"> android:title="@string/normal_map" app:showAsAction="never" /> android:title="@string/hybrid_map" app:showAsAction="never" /> android:title="@string/satellite_map" app:showAsAction="never" /> android:title="@string/terrain_map" app:showAsAction="never" /> In strings.xml, add resources for the title attributes in order to resolve the errors. ... In MapsActivity, override the onCreateOptionsMenu() method and inflate the menu from the map_options resource file. override fun onCreateOptionsMenu(menu: Menu?): Boolean { val inflater = menuInflater inflater.inflate(R.menu.map_options, menu) return true } In MapsActivity.kt, override the onOptionsItemSelected() method. Change the map type using map-type constants to reflect the user's selection. override fun onOptionsItemSelected(item: MenuItem) = when (item.itemId) { // Change the map type based on the user's selection. R.id.normal_map -> { map.mapType = GoogleMap.MAP_TYPE_NORMAL true } R.id.hybrid_map -> { map.mapType = GoogleMap.MAP_TYPE_HYBRID true } R.id.satellite_map -> { map.mapType = GoogleMap.MAP_TYPE_SATELLITE true } R.id.terrain_map -> { map.mapType = GoogleMap.MAP_TYPE_TERRAIN true } else -> super.onOptionsItemSelected(item) } Download 1.54 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling