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
struct Webview: UIViewControllerRepresentable { | |
let url: URL | |
func makeUIViewController(context: Context) -> WebviewController { | |
let webviewController = WebviewController() | |
let request = URLRequest(url: self.url, cachePolicy: .returnCacheDataElseLoad) | |
webviewController.webview.load(request) | |
return webviewController |
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
@NonNull | |
public ViewTarget<ImageView, TranscodeType> into(@NonNull ImageView view) { | |
Util.assertMainThread(); | |
Preconditions.checkNotNull(view); | |
BaseRequestOptions<?> requestOptions = this; | |
if (!requestOptions.isTransformationSet() | |
&& requestOptions.isTransformationAllowed() | |
&& view.getScaleType() != null) { | |
// Clone in this method so that if we use this RequestBuilder to load into a View and then |
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
val targetFrag = ArtistDetailFragment.newInstance(it.artist, it.view.transitionName, it.view.width, it.view.height, it.imageUrl).apply { | |
sharedElementEnterTransition = MaterialContainerTransform() | |
} | |
supportFragmentManager.commit(true) { | |
addSharedElement(it.view, it.view.transitionName) | |
replace(R.id.content, targetFrag) | |
addToBackStack(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
@Override | |
public void onTransitionEnd(@NonNull Transition transition) { | |
removeListener(this); | |
if (holdAtEndEnabled) { | |
// Keep drawable showing and views hidden (useful for Activity return transitions) | |
return; | |
} | |
// Show the actual views at the end of the transition | |
startView.setAlpha(1); | |
endView.setAlpha(1); |
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
private fun runAnimation(isReverse: Boolean): AnimatorSet { | |
val values = if (isReverse) { | |
floatArrayOf(1f, 0f) | |
} else { | |
floatArrayOf(0f, 1f) | |
} | |
val animatorList = listOf( | |
ValueAnimator.ofFloat(*values).apply { | |
addUpdateListener { | |
colorBgFraction = it.animatedValue as Float |
NewerOlder