Июль 2022

Weather App JetPack Compose #5: ListItem

https://youtu.be/BcQMiLcY49A UI.kt import androidx.compose.foundation.layout.*import androidx.compose.foundation.shape.RoundedCornerShapeimport androidx.compose.material.Cardimport androidx.compose.material.Textimport androidx.compose.runtime.Composableimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.text.TextStyleimport androidx.compose.ui.text.font.FontStyleimport androidx.compose.ui.tooling.preview.Previewimport androidx.compose.ui.unit.dpimport androidx.compose.ui.unit.spimport coil.compose.AsyncImageimport com.meter_alc_rgb.weatherappcomposey.ui.theme.BlueLight@Preview(showBackground = true)@Composablefun ListItem() { Card( modifier =… Подробнее »Weather App JetPack Compose #5: ListItem

Weather app #13 : Парсинг массива с прогнозом

MainFragment import android.Manifestimport android.os.Bundleimport android.util.Logimport androidx.fragment.app.Fragmentimport android.view.LayoutInflaterimport android.view.Viewimport android.view.ViewGroupimport android.widget.Toastimport androidx.activity.result.ActivityResultLauncherimport androidx.activity.result.contract.ActivityResultContractsimport androidx.fragment.app.FragmentActivityimport com.android.volley.Requestimport com.android.volley.toolbox.StringRequestimport com.android.volley.toolbox.Volleyimport com.google.android.material.tabs.TabLayoutMediatorimport com.meter_alc_rgb.weatherappcursey.Rimport com.meter_alc_rgb.weatherappcursey.adapters.VpAdapterimport com.meter_alc_rgb.weatherappcursey.adapters.WeatherModelimport com.meter_alc_rgb.weatherappcursey.databinding.FragmentMainBindingimport org.json.JSONObjectconst val API_KEY =… Подробнее »Weather app #13 : Парсинг массива с прогнозом

Weather app #12 : Парсинг полученных данных

MainFragment import android.Manifestimport android.os.Bundleimport android.util.Logimport androidx.fragment.app.Fragmentimport android.view.LayoutInflaterimport android.view.Viewimport android.view.ViewGroupimport android.widget.Toastimport androidx.activity.result.ActivityResultLauncherimport androidx.activity.result.contract.ActivityResultContractsimport androidx.fragment.app.FragmentActivityimport com.android.volley.Requestimport com.android.volley.toolbox.StringRequestimport com.android.volley.toolbox.Volleyimport com.google.android.material.tabs.TabLayoutMediatorimport com.meter_alc_rgb.weatherappcursey.Rimport com.meter_alc_rgb.weatherappcursey.adapters.VpAdapterimport com.meter_alc_rgb.weatherappcursey.adapters.WeatherModelimport com.meter_alc_rgb.weatherappcursey.databinding.FragmentMainBindingimport org.json.JSONObjectconst val API_KEY =… Подробнее »Weather app #12 : Парсинг полученных данных

WeatherApp #11: Получение данный с Weather API

MainFragment import android.Manifestimport android.content.Contextimport android.content.Intentimport android.content.pm.PackageManagerimport android.location.Geocoderimport android.location.Locationimport android.location.LocationManagerimport android.os.Bundleimport android.os.Looperimport android.provider.Settingsimport android.util.Logimport androidx.fragment.app.Fragmentimport android.view.LayoutInflaterimport android.view.Viewimport android.view.ViewGroupimport android.widget.Toastimport androidx.activity.result.ActivityResultLauncherimport androidx.activity.result.contract.ActivityResultContractsimport androidx.appcompat.app.AppCompatActivityimport androidx.core.app.ActivityCompatimport androidx.fragment.app.FragmentActivityimport androidx.fragment.app.activityViewModelsimport com.android.volley.Requestimport… Подробнее »WeatherApp #11: Получение данный с Weather API

WeatherApp #10: RecyclerView Adapter – Part 2

https://youtu.be/FXpjYefbrTI WeatherAdapter.kt import android.view.LayoutInflaterimport android.view.Viewimport android.view.ViewGroupimport androidx.recyclerview.widget.DiffUtilimport androidx.recyclerview.widget.ListAdapterimport androidx.recyclerview.widget.RecyclerViewimport com.meter_alc_rgb.weatherappcursey.Rimport com.meter_alc_rgb.weatherappcursey.databinding.ListItemBindingclass WeatherAdapter : ListAdapter<WeatherModel, WeatherAdapter.Holder>(Comparator()) { class Holder(view: View) : RecyclerView.ViewHolder(view){ val binding = ListItemBinding.bind(view)… Подробнее »WeatherApp #10: RecyclerView Adapter – Part 2

Weather App JetPack Compose #4: TabLayout

https://youtu.be/7rWzhoa3Pbc MainScreen.kt import androidx.compose.foundation.Imageimport androidx.compose.foundation.layout.*import androidx.compose.foundation.shape.RoundedCornerShapeimport androidx.compose.material.*import androidx.compose.runtime.Composableimport androidx.compose.runtime.rememberCoroutineScopeimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.draw.alphaimport androidx.compose.ui.draw.clipimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.layout.ContentScaleimport androidx.compose.ui.res.painterResourceimport androidx.compose.ui.text.TextStyleimport androidx.compose.ui.tooling.preview.Previewimport androidx.compose.ui.unit.dpimport androidx.compose.ui.unit.spimport coil.compose.AsyncImageimport com.google.accompanist.pager.ExperimentalPagerApiimport com.google.accompanist.pager.HorizontalPagerimport com.google.accompanist.pager.pagerTabIndicatorOffsetimport com.google.accompanist.pager.rememberPagerStateimport… Подробнее »Weather App JetPack Compose #4: TabLayout

WeatherApp #9: RecyclerView Adapter – Part 1

WeatherAdapter import android.view.Viewimport androidx.recyclerview.widget.ListAdapterimport androidx.recyclerview.widget.RecyclerViewimport com.meter_alc_rgb.weatherappcursey.databinding.ListItemBindingclass WeatherAdapter : ListAdapter<WeatherModel, WeatherAdapter.Holder>() { class Holder(view: View) : RecyclerView.ViewHolder(view){ val binding = ListItemBinding.bind(view) fun bind(item: WeatherModel) = with(binding){… Подробнее »WeatherApp #9: RecyclerView Adapter – Part 1

Weather app Jetpack Compose #3

MainScreen.kt import androidx.compose.foundation.Imageimport androidx.compose.foundation.layout.*import androidx.compose.material.Cardimport androidx.compose.material.Iconimport androidx.compose.material.IconButtonimport androidx.compose.material.Textimport androidx.compose.runtime.Composableimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifierimport androidx.compose.ui.draw.alphaimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.layout.ContentScaleimport androidx.compose.ui.res.painterResourceimport androidx.compose.ui.text.TextStyleimport androidx.compose.ui.tooling.preview.Previewimport androidx.compose.ui.unit.dpimport androidx.compose.ui.unit.spimport coil.compose.AsyncImageimport com.meter_alc_rgb.weatherappcomposey.Rimport com.meter_alc_rgb.weatherappcomposey.ui.theme.BlueLight@Preview(showBackground = true)@Composablefun MainScreen()… Подробнее »Weather app Jetpack Compose #3