Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan committed Sep 16, 2024
2 parents b952d94 + b90e9ad commit 1e0c33d
Show file tree
Hide file tree
Showing 97 changed files with 888 additions and 689 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Adding secret files
uses: ./.github/actions/add-secret-files
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Adding secret files
uses: ./.github/actions/add-secret-files
Expand All @@ -89,7 +89,7 @@ jobs:
run: ./gradlew assemble${{ env.BUILD_TYPE }}

- name: Upload Android ${{ env.BUILD_TYPE }} Artifacts
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
if: github.event_name == 'push' || github.event_name == 'schedule'
with:
name: androidArtifacts
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
file: huawei/${{ env.BUILD_TYPE_LOWERCASE }}/app-huawei-${{ env.BUILD_TYPE_LOWERCASE }}.apk

- name: Delete Android ${{ env.BUILD_TYPE }} Artifacts
uses: geekyeggo/delete-artifact@v5.0.0
uses: geekyeggo/delete-artifact@v5.1.0
with:
name: androidArtifacts

Expand All @@ -153,7 +153,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Adding secret files
uses: ./.github/actions/add-secret-files
Expand All @@ -173,14 +173,16 @@ jobs:
run: fastlane build${{ env.BUILD_TYPE }}

- name: Upload iOS Debug Artifacts
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
if: github.event_name == 'push'
with:
name: iOSArtifacts
path: ios/CCC_I.ipa
path: |
ios/CCC_I.ipa
ios/CCC_I.app.dSYM.zip
- name: Upload iOS Artifacts
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
if: github.event_name == 'schedule'
with:
name: iOSArtifacts
Expand Down Expand Up @@ -220,7 +222,7 @@ jobs:
fastlane distribute${{ env.BUILD_TYPE }}
- name: Delete iOS ${{ env.BUILD_TYPE }} Artifacts
uses: geekyeggo/delete-artifact@v5.0.0
uses: geekyeggo/delete-artifact@v5.1.0
with:
name: iOSArtifacts

Expand All @@ -235,7 +237,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Test
run: ./gradlew test
Expand All @@ -255,7 +257,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Generate Coverage
run: ./gradlew koverXmlReport
Expand All @@ -273,7 +275,7 @@ jobs:
coverage-reports: build/reports/kover/report.xml

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@v2.3.0
uses: sonarsource/sonarcloud-github-action@v3.0.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand All @@ -298,7 +300,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Detekt & Lint
run: ./gradlew detektAll lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
ProjectAutomations:
uses: Oztechan/Global/.github/workflows/reusable-project.yml@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/.github/workflows/reusable-project.yml@f2926167f4c8103dca1abd9cf2908c83733e1898
with:
project_id: 2
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:

PublishRelease:
uses: Oztechan/Global/.github/workflows/reusable-publish.yml@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/.github/workflows/reusable-publish.yml@f2926167f4c8103dca1abd9cf2908c83733e1898
with:
slack_channel: "ccc-github"
secrets: inherit
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
steps:

- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Adding secret files
uses: ./.github/actions/add-secret-files
Expand All @@ -80,19 +80,19 @@ jobs:
run: ./gradlew :android:app:bundleRelease :backend:app:jar --parallel

- name: Upload Google App Bundle
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: googleBundle
path: android/app/build/outputs/bundle/googleRelease/app-google-release.aab

- name: Upload Huawei App Bundle
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: huaweiBundle
path: android/app/build/outputs/bundle/huaweiRelease/app-huawei-release.aab

- name: Upload Backend Jar
uses: actions/upload-artifact@v4.3.6
uses: actions/upload-artifact@v4.4.0
with:
name: backendJar
path: backend/app/build/libs/app-*.jar
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
status: completed

- name: Delete App Bundle
uses: geekyeggo/delete-artifact@v5.0.0
uses: geekyeggo/delete-artifact@v5.1.0
with:
name: googleBundle

Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:
file-name: "app-huawei-release"

- name: Delete App Bundle
uses: geekyeggo/delete-artifact@v5.0.0
uses: geekyeggo/delete-artifact@v5.1.0
with:
name: huaweiBundle

Expand Down Expand Up @@ -201,7 +201,7 @@ jobs:
SOURCE: "artifact/"

- name: Delete Backend Jar
uses: geekyeggo/delete-artifact@v5.0.0
uses: geekyeggo/delete-artifact@v5.1.0
with:
name: backendJar

Expand All @@ -215,7 +215,7 @@ jobs:
status: ${{ steps.status.outputs.status }}
steps:
- name: Setup Gradle Repo
uses: Oztechan/Global/actions/setup-gradle-repo@007659c3464bb29eeaaed0abfd2822af806dfe1e
uses: Oztechan/Global/actions/setup-gradle-repo@f2926167f4c8103dca1abd9cf2908c83733e1898

- name: Adding secret files
uses: ./.github/actions/add-secret-files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import android.os.StrictMode.ThreadPolicy
import android.os.StrictMode.VmPolicy
import co.touchlab.kermit.Logger
import com.github.submob.logmob.ANRWatchDogHandler
import com.github.submob.logmob.enableCrashlyticsCollection
import com.github.submob.logmob.initLogger
import com.github.submob.logmob.setCrashlyticsCollection
import com.oztechan.ccc.android.app.di.initKoin
import com.oztechan.ccc.client.core.analytics.initAnalytics

Expand All @@ -20,11 +20,9 @@ class Application : Application() {
override fun onCreate() {
super.onCreate()

setCrashlyticsCollection(!BuildConfig.DEBUG)
enableCrashlyticsCollection()

if (!BuildConfig.DEBUG) {
initAnalytics(this)
}
initAnalytics(this)

initLogger()

Expand Down
Binary file modified android/ui/mobile/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.view.View
import android.widget.Button
import androidx.lifecycle.flowWithLifecycle
import androidx.lifecycle.lifecycleScope
import androidx.navigation.fragment.findNavController
import co.touchlab.kermit.Logger
import com.github.submob.basemob.fragment.BaseVBFragment
import com.oztechan.ccc.android.core.ad.AdManager
Expand All @@ -19,7 +20,6 @@ import com.oztechan.ccc.android.ui.mobile.util.copyToClipBoard
import com.oztechan.ccc.android.ui.mobile.util.dataState
import com.oztechan.ccc.android.ui.mobile.util.destroyBanner
import com.oztechan.ccc.android.ui.mobile.util.getFromClipBoard
import com.oztechan.ccc.android.ui.mobile.util.getNavigationResult
import com.oztechan.ccc.android.ui.mobile.util.setBackgroundByName
import com.oztechan.ccc.android.ui.mobile.util.setBannerAd
import com.oztechan.ccc.android.ui.mobile.util.showSnack
Expand Down Expand Up @@ -55,7 +55,6 @@ class CalculatorFragment : BaseVBFragment<FragmentCalculatorBinding>() {
binding.observeStates()
binding.setListeners()
observeEffects()
observeNavigationResults()
}

override fun onResume() {
Expand All @@ -76,14 +75,6 @@ class CalculatorFragment : BaseVBFragment<FragmentCalculatorBinding>() {
super.onDestroyView()
}

private fun observeNavigationResults() = getNavigationResult<String>(
CHANGE_BASE_EVENT,
R.id.calculatorFragment
)?.observe(viewLifecycleOwner) {
Logger.i { "CalculatorFragment observeNavigationResults $it" }
viewModel.event.onBaseChange(it)
}

private fun FragmentCalculatorBinding.initViews() {
adViewContainer.setBannerAd(
adManager = adManager,
Expand Down Expand Up @@ -200,13 +191,15 @@ class CalculatorFragment : BaseVBFragment<FragmentCalculatorBinding>() {
ac.setKeyboardListener()
del.setKeyboardListener()
}

findNavController().addOnDestinationChangedListener { _, navDestination, _ ->
if (navDestination.id == R.id.calculatorFragment) {
onSheetDismissed()
}
}
}

private fun Button.setKeyboardListener() = setOnClickListener {
viewModel.event.onKeyPress(text.toString())
}

companion object {
const val CHANGE_BASE_EVENT = "change_base"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ import com.github.submob.basemob.fragment.BaseVBFragment
import com.oztechan.ccc.android.core.ad.AdManager
import com.oztechan.ccc.android.ui.mobile.BuildConfig
import com.oztechan.ccc.android.ui.mobile.R
import com.oztechan.ccc.android.ui.mobile.content.calculator.CalculatorFragment.Companion.CHANGE_BASE_EVENT
import com.oztechan.ccc.android.ui.mobile.databinding.FragmentCurrenciesBinding
import com.oztechan.ccc.android.ui.mobile.util.destroyBanner
import com.oztechan.ccc.android.ui.mobile.util.hideKeyboard
import com.oztechan.ccc.android.ui.mobile.util.setBannerAd
import com.oztechan.ccc.android.ui.mobile.util.setNavigationResult
import com.oztechan.ccc.android.ui.mobile.util.showSnack
import com.oztechan.ccc.android.ui.mobile.util.visibleIf
import com.oztechan.ccc.client.core.analytics.AnalyticsManager
Expand Down Expand Up @@ -131,12 +129,6 @@ class CurrenciesFragment : BaseVBFragment<FragmentCurrenciesBinding>() {
findNavController().popBackStack()
view?.hideKeyboard()
}

is CurrenciesEffect.ChangeBase -> setNavigationResult(
R.id.calculatorFragment,
viewEffect.newBase,
CHANGE_BASE_EVENT
)
}
}.launchIn(viewLifecycleOwner.lifecycleScope)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ class MainActivity : BaseActivity() {
override fun onResume() {
super.onResume()
Logger.i { "MainActivity onResume" }
viewModel.event.onResume()
viewModel.event.onAppForeground()
}

override fun onPause() {
Logger.i { "MainActivity onPause" }
viewModel.event.onPause()
viewModel.event.onAppBackground()
super.onPause()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package com.oztechan.ccc.android.ui.mobile.content.premium

import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.lifecycle.flowWithLifecycle
Expand All @@ -15,8 +16,8 @@ import com.oztechan.ccc.android.core.billing.BillingEffect
import com.oztechan.ccc.android.core.billing.BillingManager
import com.oztechan.ccc.android.ui.mobile.BuildConfig
import com.oztechan.ccc.android.ui.mobile.R
import com.oztechan.ccc.android.ui.mobile.content.main.MainActivity
import com.oztechan.ccc.android.ui.mobile.databinding.BottomSheetPremiumBinding
import com.oztechan.ccc.android.ui.mobile.util.resolveAndStartIntent
import com.oztechan.ccc.android.ui.mobile.util.showDialog
import com.oztechan.ccc.android.ui.mobile.util.showSnack
import com.oztechan.ccc.android.ui.mobile.util.toOldPurchaseList
Expand Down Expand Up @@ -112,6 +113,7 @@ class PremiumBottomSheet : BaseVBBottomSheetDialogFragment<BottomSheetPremiumBin
} else {
billingManager.acknowledgePurchase()
}

is PremiumEffect.ConsumePurchase -> billingManager.consumePurchase(viewEffect.token)
}
}.launchIn(viewLifecycleOwner.lifecycleScope)
Expand Down Expand Up @@ -156,8 +158,10 @@ class PremiumBottomSheet : BaseVBBottomSheetDialogFragment<BottomSheetPremiumBin
)
}

private fun restartActivity() = activity?.run {
finish()
resolveAndStartIntent(intent)
private fun restartActivity() {
val intent = Intent(requireContext(), MainActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK)
startActivity(intent)
requireActivity().finish()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.github.submob.basemob.adapter.BaseVBRecyclerViewAdapter
import com.oztechan.ccc.android.ui.mobile.databinding.ItemSelectCurrencyBinding
import com.oztechan.ccc.android.ui.mobile.util.setBackgroundByName
import com.oztechan.ccc.client.viewmodel.selectcurrency.SelectCurrencyEvent
import com.oztechan.ccc.client.viewmodel.selectcurrency.model.SelectCurrencyPurpose
import com.oztechan.ccc.common.core.model.Currency

class SelectCurrencyAdapter(
Expand All @@ -30,7 +31,12 @@ class SelectCurrencyAdapter(
override fun onItemBind(item: Currency) = with(itemBinding) {
imgIcon.setBackgroundByName(item.code)
txtSettingItem.text = item.getVariablesOneLine()
root.setOnClickListener { selectCurrencyEvent.onItemClick(item) }
root.setOnClickListener {
selectCurrencyEvent.onItemClick(
item,
SelectCurrencyPurpose.Base
)
}
}
}

Expand Down
Loading

0 comments on commit 1e0c33d

Please sign in to comment.