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