View AppDelegate.swift
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 UIKit | |
import shared | |
class IOSInterceptor: Interceptor { | |
func intercept(httpRequestBuilder: Ktor_client_coreHttpRequestBuilder) { | |
let headers = httpRequestBuilder.headers | |
headers.set(name: "IOS", value: "HEADER") | |
} | |
} |
View SimpleDecorator.kt
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
fun main() { | |
val capitalizeDec = decorateCapitalize(::capitalize) | |
val text = capitalizeDec("HeLLo") | |
print(text) | |
} | |
fun capitalize(hello: String): String { | |
return hello.capitalize() | |
} |
View ArmenianIfElseTest.kt
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
fun main(args: Array<String>) { | |
val առաջինՊայման: Բուլյան = ճիշտԷ | |
val երկրորդՊայման: Բուլյան = սխալԷ | |
val երրորդՊայման: Բուլյան = ճիշտԷ | |
եթե(առաջինՊայման) { | |
առաջինՄեթոդ() | |
} այլապես եթե(երկրորդՊայման) { | |
երկրորդՄեթոդ() |
View VideoFragment.kt
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
videoMotionLayout.addTransitionListener(object : MotionLayout.TransitionListener { | |
override fun onTransitionChange(motionLayout: MotionLayout?, startId: Int, endId: Int, progress: Float) { | |
val mainActivity = activity as MainActivity | |
mainActivity.mainMotionLayout.progress = Math.abs(progress) | |
} | |
override fun onTransitionCompleted(motionLayout: MotionLayout?, currentId: Int) { | |
} | |
}) |
View main_scene.xml
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
<?xml version="1.0" encoding="utf-8"?> | |
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<Transition | |
app:constraintSetEnd="@id/collapsed" | |
app:constraintSetStart="@id/expanded"> | |
<KeyFrameSet> | |
<KeyAttribute |
View activity_main.xml
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
<?xml version="1.0" encoding="utf-8"?> | |
<MotionLayout ... > | |
<com.google.android.material.bottomnavigation.BottomNavigationView | |
android:id="@+id/bottomNavigationView" | |
android:layout_width="match_parent" | |
android:layout_height="55dp" | |
app:elevation="10dp" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintEnd_toEndOf="parent" |
View SingleViewTouchableMotionLayout.kt
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 SingleViewTouchableMotionLayout(context: Context, attributeSet: AttributeSet? = null) : MotionLayout(context, attributeSet) { | |
private val viewToDetectTouch by lazy { | |
findViewById<View>(R.id.videoViewContainer) //TODO move to Attributes | |
} | |
private val viewRect = Rect() | |
private var touchStarted = false | |
init { | |
setTransitionListener(object : MotionLayout.TransitionListener { |
View activity_main.xml
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/mainMotionLayout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<FrameLayout | |
android:id="@+id/container" | |
android:layout_width="match_parent" |
View youtube_scene.xml
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
<?xml version="1.0" encoding="utf-8"?> | |
<MotionScene xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto"> | |
<Transition | |
app:constraintSetEnd="@id/expanded" | |
app:constraintSetStart="@id/collapsed"> | |
<OnSwipe | |
app:dragDirection="dragUp"/> |
View video_fragment.xml
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
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.motion.widget.MotionLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/videoMotionLayout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/transparent"> | |
<ImageView | |
android:id="@+id/videoViewContainer" |
NewerOlder