<style name="TopSheet_DialogAnimation">
<item name="android:windowEnterAnimation">@anim/slide_out_from_top</item>
<item name="android:windowExitAnimation">@anim/slide_back_to_top</item>
</style>
This file contains 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 org.gradle.api.tasks.testing.logging.TestExceptionFormat | |
import org.gradle.api.tasks.testing.logging.TestLogEvent | |
import groovy.time.TimeCategory | |
import java.util.Date | |
/** | |
* based on the groovy code by lwasyl: | |
* https://gist.github.com/lwasyl/f5b2b4ebe9e348ebbd8ee4cb995f8362 | |
*/ | |
var testResults by extra(mutableListOf<TestOutcome>()) // Container for tests summaries |
This file contains 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 groovy.time.TimeCategory | |
import org.gradle.api.tasks.testing.logging.TestExceptionFormat | |
import org.gradle.api.tasks.testing.logging.TestLogEvent | |
rootProject { | |
ext.testsResults = [] // Container for tests summaries | |
allprojects { project -> | |
tasks.withType(Test) { testTask -> |
This file contains 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 DetailsFragment : BaseFragment(R.layout.fragment_details) { | |
lateinit val viewModel: DetailsViewModel | |
// ... | |
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onVewCreated(view, savedInstanceState) | |
// Assumed that viewModel initialized here |
This file contains 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 android.app.Application | |
import android.content.ComponentCallbacks | |
import android.content.Context | |
import android.content.res.Configuration | |
import android.os.Build | |
import android.os.Bundle | |
import java.util.Locale | |
private const val LANGUAGE_RU = "ru" |
This file contains 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 androidx.annotation.MainThread | |
import androidx.lifecycle.MutableLiveData | |
import java.util.LinkedList | |
import java.util.Queue | |
/** | |
* Класс-очередь для обработки временных событий, не являющихся частью View | |
* Например, показ SnackBar с сообщением или ошибкой. | |
*/ | |
class EventsQueue : MutableLiveData<Queue<Event>>() { |
This file contains 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 ViewModelFactory @Inject constructor( | |
private val providers: Map<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>> | |
) : ViewModelProvider.Factory { | |
override fun <T : ViewModel> create(modelClass: Class<T>): T { | |
val provider = providers[modelClass] | |
?: providers.asIterable().find { modelClass.isAssignableFrom(it.key) }?.value | |
?: error("Unknown ViewModel class $modelClass") | |
return try { |
This file contains 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
/** | |
* Инфлейт ViewBinding заданного типа [T]. | |
* | |
* В качестве родителя используется [ViewGroup], по умолчанию view прикрепляется к корню родителя. | |
* **ВАЖНО!** Для инфлейта вьюх с `merge` в корне нужно использовать только этот метод. | |
*/ | |
inline fun <reified T : ViewBinding> ViewGroup.inflateViewBinding( | |
context: Context = this.context, | |
attachToRoot: Boolean = true | |
): T { |
This file contains 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 SwiftUI | |
import PlaygroundSupport | |
extension Double { | |
func toRadians() -> Double { | |
return self * Double.pi / 180 | |
} | |
func toCGFloat() -> CGFloat { | |
return CGFloat(self) |
- Close Android File Transfer
- Open Activity Monitor and kill “Android File Transfer Agent”
- Go to where you installed “Android File Transfer.app” (I have it under /Applications)
- Ctrl+click –> “Show package contents”
- Go to Contents/Resources
- Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
- Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
NewerOlder