main #24
| @@ -3,16 +3,16 @@ run-name: ${{ gitea.actor }} is building an Android application | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|       - pipeline-test | ||||
|  | ||||
| jobs: | ||||
|   Build: | ||||
|     runs-on: ubuntu-22.04 | ||||
|     runs-on: ubuntu-24.04 | ||||
|     steps: | ||||
|       - name: Checkout the repo | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Set up JDK 23 | ||||
|         uses: actions/setup-java@v3 | ||||
|         uses: actions/setup-java@v4 | ||||
|         with: | ||||
|           java-version: '23' | ||||
|           distribution: 'temurin' | ||||
| @@ -20,6 +20,13 @@ jobs: | ||||
|         uses: android-actions/setup-android@v3 | ||||
|       - name: Grant execute permission for gradlew | ||||
|         run: chmod +x gradlew | ||||
|       - name: Cache Gradle packages | ||||
|         uses: actions/cache@v3 | ||||
|         with: | ||||
|           path: | | ||||
|             ~/.gradle/caches | ||||
|             ~/.gradle/wrapper | ||||
|           key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||||
|       - name: Build with Gradle | ||||
|         uses: gradle/gradle-build-action@v2 | ||||
|         with: | ||||
|   | ||||
							
								
								
									
										40
									
								
								.gitea/workflows/debug.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								.gitea/workflows/debug.yaml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| name: Gitea Android Builder | ||||
| run-name: ${{ gitea.actor }} is building an Android application | ||||
| on: | ||||
|   push: | ||||
|     tags: | ||||
|       - "*" | ||||
|  | ||||
| jobs: | ||||
|   Build: | ||||
|     runs-on: ubuntu-24.04 | ||||
|     steps: | ||||
|       - name: Checkout the repo | ||||
|         uses: actions/checkout@v4 | ||||
|       - name: Set up JDK 23 | ||||
|         uses: actions/setup-java@v4 | ||||
|         with: | ||||
|           java-version: '23' | ||||
|           distribution: 'temurin' | ||||
|       - name: Set up Android SDK | ||||
|         uses: android-actions/setup-android@v3 | ||||
|       - name: Grant execute permission for gradlew | ||||
|         run: chmod +x gradlew | ||||
|       - name: Cache Gradle packages | ||||
|         uses: actions/cache@v3 | ||||
|         with: | ||||
|           path: | | ||||
|             ~/.gradle/caches | ||||
|             ~/.gradle/wrapper | ||||
|           key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||||
|       - name: Build with Gradle | ||||
|         uses: gradle/gradle-build-action@v2 | ||||
|         with: | ||||
|           arguments: assembleDebug | ||||
|       - name: Upload .apk Artifact | ||||
|         uses: actions/upload-artifact@v3 | ||||
|         with: | ||||
|           name: android-app-apk | ||||
|           path: app/build/outputs/apk/debug/*.apk | ||||
|       - name: Status | ||||
|         run: echo "This job's status is ${{ job.status }}." | ||||
| @@ -7,10 +7,9 @@ import androidx.activity.compose.setContent | ||||
| import androidx.compose.foundation.background | ||||
| import androidx.compose.foundation.layout.Box | ||||
| import androidx.compose.foundation.layout.Column | ||||
| import androidx.compose.foundation.layout.PaddingValues | ||||
| import androidx.compose.foundation.layout.fillMaxSize | ||||
| import androidx.compose.foundation.layout.Spacer | ||||
| import androidx.compose.foundation.layout.height | ||||
| import androidx.compose.foundation.layout.padding | ||||
| import androidx.compose.foundation.magnifier | ||||
| import androidx.compose.foundation.rememberScrollState | ||||
| import androidx.compose.foundation.verticalScroll | ||||
| import androidx.compose.material.icons.Icons | ||||
| @@ -39,7 +38,6 @@ import androidx.compose.ui.graphics.Color | ||||
| import androidx.compose.ui.input.nestedscroll.nestedScroll | ||||
| import androidx.compose.ui.text.style.TextOverflow | ||||
| import androidx.compose.ui.tooling.preview.Preview | ||||
| import androidx.compose.ui.unit.TextUnit | ||||
| import androidx.compose.ui.unit.dp | ||||
| import androidx.compose.ui.unit.sp | ||||
| import com.patrykandpatrick.vico.compose.cartesian.CartesianChartHost | ||||
| @@ -51,14 +49,12 @@ import com.patrykandpatrick.vico.compose.cartesian.layer.rememberLine | ||||
| import com.patrykandpatrick.vico.compose.cartesian.layer.rememberLineCartesianLayer | ||||
| import com.patrykandpatrick.vico.compose.cartesian.rememberCartesianChart | ||||
| import com.patrykandpatrick.vico.compose.cartesian.rememberVicoZoomState | ||||
| import com.patrykandpatrick.vico.compose.common.component.rememberLineComponent | ||||
| import com.patrykandpatrick.vico.compose.common.component.rememberTextComponent | ||||
| import com.patrykandpatrick.vico.compose.common.component.shapeComponent | ||||
| import com.patrykandpatrick.vico.compose.common.fill | ||||
| import com.patrykandpatrick.vico.compose.common.shape.rounded | ||||
| import com.patrykandpatrick.vico.compose.common.vicoTheme | ||||
| import com.patrykandpatrick.vico.core.cartesian.Zoom | ||||
| import com.patrykandpatrick.vico.core.cartesian.axis.BaseAxis | ||||
| import com.patrykandpatrick.vico.core.cartesian.axis.HorizontalAxis | ||||
| import com.patrykandpatrick.vico.core.cartesian.axis.VerticalAxis | ||||
| import com.patrykandpatrick.vico.core.cartesian.data.CartesianChartModelProducer | ||||
| @@ -71,15 +67,10 @@ import com.patrykandpatrick.vico.core.common.component.LineComponent | ||||
| import com.patrykandpatrick.vico.core.common.component.TextComponent | ||||
| import com.patrykandpatrick.vico.core.common.shape.CorneredShape | ||||
| import ru.vendetti.bitcoin_summarizer.ui.theme.BitcoinSummarizerTheme | ||||
| import ru.vendetti.bitcoin_summarizer.ui.theme.EnglishViolet | ||||
| import ru.vendetti.bitcoin_summarizer.ui.theme.Flame | ||||
| import ru.vendetti.bitcoin_summarizer.ui.theme.Green2 | ||||
| import java.text.DateFormat | ||||
| import java.text.DecimalFormat | ||||
| import java.text.SimpleDateFormat | ||||
| import java.time.format.DateTimeFormatter | ||||
| import java.util.Date | ||||
| import kotlin.math.roundToInt | ||||
|  | ||||
| class MainActivity : ComponentActivity() { | ||||
|     override fun onCreate(savedInstanceState: Bundle?) { | ||||
| @@ -125,14 +116,14 @@ fun CryptoScreen() { | ||||
|  | ||||
|     LaunchedEffect(fearGreedDataList) { | ||||
|         modelProducer.runTransaction { | ||||
|             var numberValues = Array<Int>(fearGreedDataList.count()) { | ||||
|             var numberValues = Array(fearGreedDataList.count()) { | ||||
|                 index -> | ||||
|                     fearGreedDataList[fearGreedDataList.count() - index - 1] | ||||
|                         .value.toInt() | ||||
|             } | ||||
|  | ||||
|             if(numberValues.isEmpty()) | ||||
|                 numberValues = Array<Int>(1) {0} | ||||
|                 numberValues = Array(1) {0} | ||||
|  | ||||
|             lineSeries { series(numberValues.toList()) } | ||||
|         } | ||||
| @@ -159,7 +150,7 @@ fun CryptoScreen() { | ||||
|                 ), | ||||
|                 title = { | ||||
|                     Text( | ||||
|                         "Bitcoin Summarizer!", | ||||
|                         "Bitcoin Summarizer", | ||||
|                         maxLines = 1, | ||||
|                         overflow = TextOverflow.Ellipsis | ||||
|                     ) | ||||
| @@ -220,7 +211,7 @@ fun CryptoScreen() { | ||||
|                             label = rememberAxisLabelComponent(MaterialTheme.colorScheme.onPrimary) | ||||
|                         ), | ||||
|                         bottomAxis = HorizontalAxis.rememberBottom( | ||||
|                             title = "last $fearGreedIndexDaysCount days", | ||||
|                             title = "последние $fearGreedIndexDaysCount дней", | ||||
|                             titleComponent = rememberTextComponent(MaterialTheme.colorScheme.onPrimary), | ||||
|                             line = rememberAxisLineComponent(fill(MaterialTheme.colorScheme.onPrimary)), | ||||
|                             label = rememberAxisLabelComponent(MaterialTheme.colorScheme.onPrimary) | ||||
| @@ -229,7 +220,7 @@ fun CryptoScreen() { | ||||
|                             remember { | ||||
|                                 HorizontalLine( | ||||
|                                     y = { 25.toDouble() }, | ||||
|                                     line = LineComponent(fill(Flame), 2f), | ||||
|                                     line = LineComponent(fill(Flame), 1f), | ||||
|                                     labelComponent = TextComponent( | ||||
|                                         background = | ||||
|                                         shapeComponent( | ||||
| @@ -240,14 +231,14 @@ fun CryptoScreen() { | ||||
|                                             ) | ||||
|                                         ), | ||||
|                                     ), | ||||
|                                     label = { "Fear" }, | ||||
|                                     label = { "Страх" }, | ||||
|                                     verticalLabelPosition = Position.Vertical.Top | ||||
|                                 ) | ||||
|                             }, | ||||
|                             remember { | ||||
|                                 HorizontalLine( | ||||
|                                     y = { 70.toDouble() }, | ||||
|                                     line = LineComponent(fill(Green2), 2f), | ||||
|                                     line = LineComponent(fill(Green2), 1f), | ||||
|                                     labelComponent = TextComponent( | ||||
|                                         background = | ||||
|                                         shapeComponent( | ||||
| @@ -258,7 +249,7 @@ fun CryptoScreen() { | ||||
|                                             ) | ||||
|                                         ), | ||||
|                                     ), | ||||
|                                     label = { "Greed" }, | ||||
|                                     label = { "Жадность" }, | ||||
|                                     verticalLabelPosition = Position.Vertical.Bottom | ||||
|                                 ) | ||||
|                             } | ||||
| @@ -267,13 +258,16 @@ fun CryptoScreen() { | ||||
|                     modelProducer = modelProducer, | ||||
|                 ) | ||||
|                 /* Fear Greed Chart End */ | ||||
|                 Spacer(modifier = Modifier.height(16.dp)) | ||||
|                 HorizontalDivider(thickness = 2.dp) | ||||
|                 Spacer(modifier = Modifier.height(16.dp)) | ||||
|                 Text( | ||||
|                     "Данные о Биткойне", | ||||
|                     "Данные о Биткоине", | ||||
|                     modifier = Modifier | ||||
|                         .align(alignment = Alignment.CenterHorizontally), | ||||
|                     fontSize = 24.sp | ||||
|                 ) | ||||
|                 Spacer(modifier = Modifier.height(16.dp)) | ||||
|                 val formatter = DecimalFormat("0.00") | ||||
|                 Text("Текущая цена: \n \$ ${formatter.format(bitcoinTicker.priceUsd.toFloat())}\n") | ||||
|                 Text("Суточный оборот: \n \$ ${bitcoinTicker.volume24hUsd}\n") | ||||
| @@ -293,12 +287,14 @@ fun CryptoScreen() { | ||||
|                 Text("Время последнего обновления: \n ${humanDate}\n") | ||||
|  | ||||
|                 HorizontalDivider(thickness = 2.dp) | ||||
|                 Spacer(modifier = Modifier.height(16.dp)) | ||||
|                 Text( | ||||
|                     "Глобальные данные", | ||||
|                     modifier = Modifier | ||||
|                         .align(alignment = Alignment.CenterHorizontally), | ||||
|                     fontSize = 24.sp | ||||
|                 ) | ||||
|                 Spacer(modifier = Modifier.height(16.dp)) | ||||
|                 Text("Общая капитализация крипторынка: \n \$ ${globalData.totalMarketCapUsd}\n") | ||||
|                 Text("Всего тикеров: \n ${globalData.activeCryptocurrencies}\n") | ||||
|                 Text("Суточный оборот всех криптовалют: \n \$ ${globalData.total24hVolumeUsd}\n") | ||||
|   | ||||
| @@ -20,4 +20,6 @@ kotlin.code.style=official | ||||
| # Enables namespacing of each library's R class so that its R class includes only the | ||||
| # resources declared in the library itself and none from the library's dependencies, | ||||
| # thereby reducing the size of the R class for that library | ||||
| android.nonTransitiveRClass=true | ||||
| android.nonTransitiveRClass=true | ||||
| org.gradle.caching=true | ||||
| org.gradle.parallel=true | ||||
		Reference in New Issue
	
	Block a user