20 мая, 2022

Weather App Jetpack Compose #1

MainActivity import android.content.Contextimport android.os.Bundleimport android.util.Logimport androidx.activity.ComponentActivityimport androidx.activity.compose.setContentimport androidx.compose.foundation.backgroundimport androidx.compose.foundation.layout.*import androidx.compose.material.Buttonimport androidx.compose.material.MaterialThemeimport androidx.compose.material.Surfaceimport androidx.compose.material.Textimport androidx.compose.runtime.Composableimport androidx.compose.runtime.MutableStateimport androidx.compose.runtime.mutableStateOfimport androidx.compose.runtime.rememberimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.tooling.preview.Previewimport androidx.compose.ui.unit.dpimport com.android.volley.Requestimport com.android.volley.toolbox.StringRequestimport com.android.volley.toolbox.Volleyimport com.meter_alc_rgb.wetherappcompose.ui.theme.WetherAppComposeThemeimport org.json.JSONObjectconst val API_KEY = “Ваш API ключь”class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { WetherAppComposeTheme { // A surface container using the ‘background’ color from the theme Surface( modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background ) { Greeting(“London”, this) }… Подробнее »Weather App Jetpack Compose #1