Skip to content

Commit

Permalink
PERA-1379 Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsinsar committed Jan 11, 2025
1 parent c859c19 commit 485158b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/com/algorand/android/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ class MainActivity :
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme)
super.onCreate(savedInstanceState)
mainViewModel.initAppCache(lifecycle)
mainViewModel.setDeepLinkHandlerListener(deepLinkHandlerListener)
autoLockManager.setListener(autoLockManagerListener)
setupCoreActionsTabBarView()
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/java/com/algorand/android/MainViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package com.algorand.android

import android.content.SharedPreferences
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.asLiveData
import androidx.lifecycle.viewModelScope
Expand Down Expand Up @@ -50,6 +51,7 @@ import com.algorand.android.utils.exceptions.TransactionConfirmationAwaitExcepti
import com.algorand.android.utils.exceptions.TransactionIdNullException
import com.algorand.android.utils.findAllNodes
import com.algorand.android.utils.sendErrorLog
import com.algorand.common.cache.domain.usecase.InitializeAppCache
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -79,7 +81,8 @@ class MainViewModel @Inject constructor(
private val accountDetailCacheManager: AccountDetailCacheManager,
private val nodeRepository: NodeRepository,
accountCacheStatusUseCase: AccountCacheStatusUseCase,
private val autoLockManagerUseCase: AutoLockManagerUseCase
private val autoLockManagerUseCase: AutoLockManagerUseCase,
private val initializeAppCache: InitializeAppCache
) : BaseViewModel() {

// TODO: Replace this with Flow whenever have time
Expand All @@ -106,6 +109,12 @@ class MainViewModel @Inject constructor(
initializeTutorial()
}

fun initAppCache(lifecycle: Lifecycle) {
viewModelScope.launch {
initializeAppCache(lifecycle)
}
}

fun shouldAppLocked(): Boolean {
return autoLockManagerUseCase.shouldAppLocked()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import java.math.BigDecimal

interface AccountItemConfigurationMapper {

@Suppress("LongParameterList")
operator fun invoke(
accountAddress: String,
accountDisplayName: AccountDisplayName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ internal object AccountSortingModule {
fun provideGetAccountSortingTypeIdentifier(repository: AccountSortingRepository): GetAccountSortingTypeIdentifier {
return GetAccountSortingTypeIdentifier(repository::getAccountSortPreference)
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
package com.algorand.android.accountcore.ui.accountsorting.di
/*
* Copyright 2022 Pera Wallet, LDA
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/

package com.algorand.android.modules.accountsorting.di

import com.algorand.android.modules.accountsorting.domain.usecase.GetAccountSortingTypeIdentifier
import com.algorand.android.modules.accountsorting.ui.domain.mapper.AccountAndAssetAccountListItemMapper
Expand All @@ -20,7 +32,8 @@ import com.algorand.android.modules.accountsorting.ui.domain.usecase.implementat
import com.algorand.android.modules.accountsorting.ui.domain.usecase.implementation.GetFilteredSortedAccountListWhichNotBackedUpUseCase
import com.algorand.android.modules.accountsorting.ui.domain.usecase.implementation.GetSortedAccountsByPreferenceUseCase
import com.algorand.android.modules.accountsorting.ui.domain.usecase.implementation.SortAccountsBySortingPreferenceUseCase
import dagger.*
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ internal class BaseAccountAndAssetListItemMapperImpl @Inject constructor() : Bas
override fun invoke(itemConfiguration: AccountItemConfiguration): BaseAccountAndAssetListItem.AccountListItem {
return BaseAccountAndAssetListItem.AccountListItem(itemConfiguration)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent

@Suppress("TooManyFunctions")
@Module
@InstallIn(SingletonComponent::class)
internal object ParityModule {
Expand Down

0 comments on commit 485158b

Please sign in to comment.