MVP #14
| @@ -1,7 +1,7 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:tools="http://schemas.android.com/tools"> | ||||
|  | ||||
|     <uses-permission android:name="android.permission.INTERNET" /> | ||||
|     <application | ||||
|         android:allowBackup="true" | ||||
|         android:dataExtractionRules="@xml/data_extraction_rules" | ||||
|   | ||||
| @@ -2,14 +2,10 @@ package ru.vendetti.bitcoin_summarizer | ||||
|  | ||||
| import com.google.gson.annotations.SerializedName | ||||
|  | ||||
| // Обёртка для данных | ||||
| // Данные | ||||
| data class GlobalResponse( | ||||
|     val data: GlobalData | ||||
| ) | ||||
|  | ||||
| // Сами данные | ||||
| data class GlobalData( | ||||
|     @SerializedName("active_cryptocurrencies") val activeCryptocurrencies: String, | ||||
|     @SerializedName("active_currencies") val activeCryptocurrencies: String, | ||||
|     @SerializedName("total_market_cap_usd") val totalMarketCapUsd: String, | ||||
|     @SerializedName("total_24h_volume_usd") val total24hVolumeUsd: String | ||||
|     @SerializedName("total_24h_volume_usd") val total24hVolumeUsd: String, | ||||
|     @SerializedName("bitcoin_percentage_of_market_cap") val bitcoinPercentageOfMarketCap: String | ||||
| ) | ||||
| @@ -3,7 +3,6 @@ package ru.vendetti.bitcoin_summarizer | ||||
| import android.os.Bundle | ||||
| import androidx.activity.ComponentActivity | ||||
| import androidx.activity.compose.setContent | ||||
| import androidx.activity.enableEdgeToEdge | ||||
| import androidx.compose.foundation.layout.Column | ||||
| import androidx.compose.foundation.layout.Spacer | ||||
| import androidx.compose.foundation.layout.fillMaxSize | ||||
| @@ -26,7 +25,6 @@ import ru.vendetti.bitcoin_summarizer.ui.theme.BitcoinSummarizerTheme | ||||
| class MainActivity : ComponentActivity() { | ||||
|     override fun onCreate(savedInstanceState: Bundle?) { | ||||
|         super.onCreate(savedInstanceState) | ||||
|         enableEdgeToEdge() | ||||
|         setContent { | ||||
|             BitcoinSummarizerTheme { | ||||
|                 CryptoScreen() | ||||
| @@ -55,7 +53,7 @@ fun CryptoScreen() { | ||||
|  | ||||
|         // Запрос глобальных данных | ||||
|         val globalResponse = cryptoRepository.fetchGlobalData() | ||||
|         globalData = globalResponse?.data?.let { data -> | ||||
|         globalData = globalResponse?.let { data -> | ||||
|             "Активных криптовалют: ${data.activeCryptocurrencies}\nРыночная капитализация: ${data.totalMarketCapUsd}\n24h Объем: ${data.total24hVolumeUsd}" | ||||
|         } ?: "Ошибка загрузки глобальных данных" | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user