This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import io.gitlab.arturbosch.detekt.api.CodeSmell | |
| import io.gitlab.arturbosch.detekt.api.Config | |
| import io.gitlab.arturbosch.detekt.api.Debt | |
| import io.gitlab.arturbosch.detekt.api.Entity | |
| import io.gitlab.arturbosch.detekt.api.Issue | |
| import io.gitlab.arturbosch.detekt.api.Rule | |
| import io.gitlab.arturbosch.detekt.api.Severity | |
| import io.gitlab.arturbosch.detekt.api.internal.RequiresTypeResolution | |
| import org.jetbrains.kotlin.builtins.isSuspendFunctionType |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hamurcuabi.bogo | |
| import androidx.compose.foundation.Canvas | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.Column | |
| import androidx.compose.foundation.layout.fillMaxSize | |
| import androidx.compose.foundation.layout.fillMaxWidth | |
| import androidx.compose.material.MaterialTheme | |
| import androidx.compose.runtime.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.os.Bundle | |
| import android.widget.ProgressBar | |
| import android.widget.TextView | |
| import androidx.activity.viewModels | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.core.view.isVisible | |
| class MainActivity : AppCompatActivity() { | |
| private val mainViewModel: MainViewModel by viewModels() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.hamurcuabi.myapplication | |
| import android.content.Context | |
| import android.graphics.Typeface | |
| import android.util.AttributeSet | |
| import android.view.LayoutInflater | |
| import android.view.View | |
| import android.widget.FrameLayout | |
| import androidx.core.view.isVisible | |
| import com.hamurcuabi.myapplication.databinding.ViewCustomToolbarBinding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HomeFragment : Fragment(), | |
| OnBackPressedDelegation by OnBackPressedDelegationImpl() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| registerOnBackPressedDelegation(activity, this.lifecycle) { | |
| // OnBackPressed fired!!! | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class OnBackPressedDelegationImpl : OnBackPressedDelegation, DefaultLifecycleObserver { | |
| private val onBackPressedCallback = object : OnBackPressedCallback(true) { | |
| override fun handleOnBackPressed() { | |
| onBackPressed.invoke() | |
| } | |
| } | |
| private var fragmentActivity: FragmentActivity? = null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface OnBackPressedDelegation { | |
| fun registerOnBackPressedDelegation( | |
| fragmentActivity: FragmentActivity?, | |
| lifecycle: Lifecycle, | |
| onBackPressed: () -> Unit | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class HomeFragment : Fragment() { | |
| private val onBackPressedCallback = object : OnBackPressedCallback(true) { | |
| override fun handleOnBackPressed() { | |
| // On back pressed | |
| } | |
| } | |
| override fun onResume() { | |
| super.onResume() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import android.app.Activity | |
| import androidx.activity.result.ActivityResultLauncher | |
| import androidx.activity.result.contract.ActivityResultContracts | |
| import androidx.appcompat.app.AppCompatActivity | |
| import androidx.core.app.ActivityCompat.shouldShowRequestPermissionRationale | |
| import androidx.fragment.app.Fragment | |
| object PermissionUtil { |
NewerOlder