Skip to content

Commit

Permalink
Merge pull request #584 from nimblehq/release/3.29.0
Browse files Browse the repository at this point in the history
Release - 3.29.0
  • Loading branch information
ryan-conway authored Aug 8, 2024
2 parents 142a13c + ecbd6e1 commit 1d2a443
Show file tree
Hide file tree
Showing 17 changed files with 198 additions and 8 deletions.
35 changes: 35 additions & 0 deletions .cicdtemplate/.github/workflows/config/changelog-release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"categories": [
{
"title": "## ✨ Features",
"labels": [
"type : feature"
],
"empty_content": "N/A"
},
{
"title": "## 🐛 Bug fixes",
"labels": [
"type : bug"
],
"empty_content": "N/A"
},
{
"title": "## 🧹 Chores",
"labels": [
"type : chore"
],
"empty_content": "N/A"
},
{
"title": "## Others",
"exclude_labels": [
"type : feature",
"type : bug",
"type : chore",
"type : release"
]
}
],
"max_pull_requests": 200
}
25 changes: 25 additions & 0 deletions .cicdtemplate/.github/workflows/create_release_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Create the Release pull request

on:
workflow_dispatch:

jobs:
create_release_pull_request:
name: Create the Release pull request
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check out the latest code
uses: actions/checkout@v4

- name: Read the current version
id: version
run: echo "version=$(perl -nle 'print $1 if /ANDROID_VERSION_NAME = \"(.*)\"$/' buildSrc/src/main/java/Versions.kt)" >> $GITHUB_OUTPUT

- uses: nimblehq/github-actions-workflows/[email protected]
with:
release_version: ${{ steps.version.outputs.version }}
changelog_configuration: ".github/workflows/config/changelog-release.json"
assignee: bot-nimble
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Team
# @ryan-conway is the Team Lead and the others are team members
* @AVI5HEK @chornerman @doannimble @hoangnguyen92dn @kaungkhantsoe @luongvo @lydiasama @manh-t @minhnimble @ryan-conway @sleepylee @thiennguyen0196 @toby-thanathip @Wadeewee
* @AVI5HEK @chornerman @doannimble @hoangnguyen92dn @Johnsonmaung @kaungkhantsoe @luongvo @manh-t @minhnimble @ryan-conway @sleepylee @thiennguyen0196 @toby-thanathip

# Engineering Leads
CODEOWNERS @nimblehq/engineering-leads
35 changes: 35 additions & 0 deletions .github/workflows/config/changelog-release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"categories": [
{
"title": "## ✨ Features",
"labels": [
"type : feature"
],
"empty_content": "N/A"
},
{
"title": "## 🐛 Bug fixes",
"labels": [
"type : bug"
],
"empty_content": "N/A"
},
{
"title": "## 🧹 Chores",
"labels": [
"type : chore"
],
"empty_content": "N/A"
},
{
"title": "## Others",
"exclude_labels": [
"type : feature",
"type : bug",
"type : chore",
"type : release"
]
}
],
"max_pull_requests": 200
}
28 changes: 28 additions & 0 deletions .github/workflows/create_release_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create the Release pull request

on:
workflow_dispatch:

jobs:
create_release_pull_request:
name: Create the Release pull request
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Check out the latest code
uses: actions/checkout@v4

- name: Read the current version
id: version
uses: christian-draeger/[email protected]
with:
path: "version.properties"
properties: "templateScriptVersion"

- uses: nimblehq/github-actions-workflows/[email protected]
with:
release_version: ${{ steps.version.outputs.templateScriptVersion }}
changelog_configuration: ".github/workflows/config/changelog-release.json"
assignee: bot-nimble
3 changes: 2 additions & 1 deletion sample-compose/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ dependencies {
implementation("androidx.compose.material:material")

implementation("androidx.navigation:navigation-compose:${Versions.COMPOSE_NAVIGATION_VERSION}")
implementation("com.google.accompanist:accompanist-permissions:${Versions.ACCOMPANIST_PERMISSIONS_VERSION}")
implementation("com.google.accompanist:accompanist-permissions:${Versions.ACCOMPANIST_VERSION}")
implementation("com.google.accompanist:accompanist-systemuicontroller:${Versions.ACCOMPANIST_VERSION}")

implementation("androidx.datastore:datastore-preferences:${Versions.ANDROIDX_DATASTORE_PREFERENCES_VERSION}")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package co.nimblehq.sample.compose.ui.base

import androidx.compose.runtime.Composable
import androidx.compose.ui.res.colorResource
import co.nimblehq.sample.compose.R
import co.nimblehq.sample.compose.util.setStatusBarColor

@Composable
fun BaseScreen(
isDarkStatusBarIcons: Boolean? = null,
content: @Composable () -> Unit,
) {
if (isDarkStatusBarIcons != null) {
setStatusBarColor(
color = colorResource(id = R.color.statusBarColor),
darkIcons = isDarkStatusBarIcons,
)
}

content()
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import co.nimblehq.sample.compose.extensions.collectAsEffect
import co.nimblehq.sample.compose.extensions.showToast
import co.nimblehq.sample.compose.lib.IsLoading
import co.nimblehq.sample.compose.ui.base.BaseDestination
import co.nimblehq.sample.compose.ui.base.BaseScreen
import co.nimblehq.sample.compose.ui.common.AppBar
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.showToast
Expand All @@ -28,6 +29,8 @@ fun HomeScreen(
viewModel: HomeViewModel = hiltViewModel(),
navigator: (destination: BaseDestination) -> Unit,
isResultOk: Boolean = false,
) = BaseScreen(
isDarkStatusBarIcons = true,
) {
val context = LocalContext.current
viewModel.error.collectAsEffect { e -> e.showToast(context) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import co.nimblehq.sample.compose.R
import co.nimblehq.sample.compose.ui.base.BaseDestination
import co.nimblehq.sample.compose.ui.base.BaseScreen
import co.nimblehq.sample.compose.ui.base.KeyResultOk
import co.nimblehq.sample.compose.ui.common.AppBar
import co.nimblehq.sample.compose.ui.theme.AppTheme.dimensions
Expand All @@ -25,6 +26,8 @@ fun SecondScreen(
viewModel: SecondViewModel = hiltViewModel(),
navigator: (destination: BaseDestination) -> Unit,
id: String,
) = BaseScreen(
isDarkStatusBarIcons = false,
) {
SecondScreenContent(
id = id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.ui.tooling.preview.Preview
import androidx.hilt.navigation.compose.hiltViewModel
import co.nimblehq.sample.compose.R
import co.nimblehq.sample.compose.ui.base.BaseDestination
import co.nimblehq.sample.compose.ui.base.BaseScreen
import co.nimblehq.sample.compose.ui.common.AppBar
import co.nimblehq.sample.compose.ui.models.UiModel
import co.nimblehq.sample.compose.ui.theme.ComposeTheme
Expand All @@ -23,6 +24,8 @@ fun ThirdScreen(
viewModel: ThirdViewModel = hiltViewModel(),
navigator: (destination: BaseDestination) -> Unit,
model: UiModel?,
) = BaseScreen(
isDarkStatusBarIcons = true,
) {
ThirdScreenContent(data = model)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package co.nimblehq.sample.compose.util

import android.annotation.SuppressLint
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.graphics.Color
import com.google.accompanist.systemuicontroller.rememberSystemUiController

@SuppressLint("ComposableNaming")
@Composable
fun setStatusBarColor(
color: Color,
darkIcons: Boolean,
) {
val systemUiController = rememberSystemUiController()
LaunchedEffect(key1 = darkIcons) {
systemUiController.setStatusBarColor(
color = color,
darkIcons = darkIcons,
)
}
}
2 changes: 1 addition & 1 deletion sample-compose/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="greenChristi">#FF669900</color>
<color name="statusBarColor">#FF669900</color>
</resources>
2 changes: 1 addition & 1 deletion sample-compose/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:statusBarColor">@color/greenChristi</item>
<item name="android:statusBarColor">@color/statusBarColor</item>
</style>
</resources>
4 changes: 2 additions & 2 deletions sample-compose/buildSrc/src/main/java/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ object Versions {
const val ANDROID_TARGET_SDK_VERSION = 33

const val ANDROID_VERSION_CODE = 1
const val ANDROID_VERSION_NAME = "3.27.0"
const val ANDROID_VERSION_NAME = "3.29.0"

// Dependencies (Alphabet sorted)
const val ACCOMPANIST_PERMISSIONS_VERSION = "0.30.1"
const val ACCOMPANIST_VERSION = "0.30.1"
const val ANDROID_COMMON_KTX_VERSION = "0.1.1"
const val ANDROID_CRYPTO_VERSION = "1.0.0"
const val ANDROIDX_CORE_KTX_VERSION = "1.10.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package co.nimblehq.template.compose.ui.base

import androidx.compose.runtime.Composable

@Composable
fun BaseScreen(
// TODO Base parameters to request on all screens here
content: @Composable () -> Unit,
) {
// TODO Base logic for all screens here

content()
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.lifecycle.compose.collectAsStateWithLifecycle
import co.nimblehq.template.compose.R
import co.nimblehq.template.compose.extensions.collectAsEffect
import co.nimblehq.template.compose.ui.base.BaseDestination
import co.nimblehq.template.compose.ui.base.BaseScreen
import co.nimblehq.template.compose.ui.models.UiModel
import co.nimblehq.template.compose.ui.showToast
import co.nimblehq.template.compose.ui.theme.AppTheme.dimensions
Expand All @@ -28,7 +29,7 @@ import timber.log.Timber
fun HomeScreen(
viewModel: HomeViewModel = hiltViewModel(),
navigator: (destination: BaseDestination) -> Unit,
) {
) = BaseScreen {
val context = LocalContext.current
viewModel.error.collectAsEffect { e -> e.showToast(context) }
viewModel.navigator.collectAsEffect { destination -> navigator(destination) }
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
kotlinVersion=1.6.21
kscriptVersion=4.0.3
templateScriptVersion=3.27.0
templateScriptVersion=3.29.0

0 comments on commit 1d2a443

Please sign in to comment.