Skip to content

Create Shared Elements Transition from All/RoomSessionsFragment to SessionDetailFragment#564

Open
e10dokup wants to merge 6 commits into
DroidKaigi:masterfrom
e10dokup:feature/450_session_transition
Open

Create Shared Elements Transition from All/RoomSessionsFragment to SessionDetailFragment#564
e10dokup wants to merge 6 commits into
DroidKaigi:masterfrom
e10dokup:feature/450_session_transition

Conversation

@e10dokup

@e10dokup e10dokup commented Feb 3, 2018

Copy link
Copy Markdown
Contributor

Issue

Overview (Required)

  • Create Shared Elements Transition
    • All/RoomSessionsFragment to SessionDetailFragment
    • SpeakersSummaryLayout will be set to Shared Element

(以下日本語で失礼します)

SessionDetailFrgamentからAll/RoomSessionsFragmentへの戻りのTransactionを実装したかったのですが、SessionDetailActivityのViewPagerに入るSessionDetailFragmentのSessionが全セッションとなっているため、RoomSessionsFragmentとリストの整合性がうまく取れず綺麗に遷移できなかったため、現状は戻りに関してはアニメーションをしないようにしています…。

Links

Screenshot

Before After

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setEnterSharedElementCallback(sharedElementCallback)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected blank line(s) before “}”

}
}


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Needless blank line(s)

fun findFragmentByPosition(viewPager: ViewPager, position: Int): SessionDetailFragment {
return instantiateItem(viewPager, position) as SessionDetailFragment
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected blank line(s) before “}”

}

fun start(activity: Activity, session: Session, sharedElement: Pair<View, String>) {
val options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElement)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Exceeded max line length (100)

putExtra(EXTRA_TRANSITION_NAME, sharedElement.second)
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected blank line(s) before “}”

@takahirom

Copy link
Copy Markdown
Member

👀

@Inject lateinit var viewModelFactory: ViewModelProvider.Factory
@Inject lateinit var drawerMenu: DrawerMenu

private var backPressed = false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please comment why this need 🙏

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will not be needed..., I will remove this on next commit. Thanks.


binding.toolbar.setNavigationOnClickListener { activity?.finish() }

binding.speakerSummary.viewTreeObserver.addOnPreDrawListener(

@takahirom takahirom Feb 3, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private val sharedElementCallback = object : SharedElementCallback() {

@takahirom takahirom Feb 3, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question 🙋
SharedElementCallback is not contained API Level 19.
Is this not crash on API Level 19?


binding.toolbar.setNavigationOnClickListener { activity?.finish() }

binding.speakerSummary.viewTreeObserver.addOnPreDrawListener(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ViewModelProviders.of(activity!!, viewModelFactory).get(SessionDetailViewModel::class.java)
}

val speakerSummary: SpeakersSummaryLayout

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nits] Do you use this property?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I forgot to remove this property..., I will remove on next commit.

@e10dokup e10dokup force-pushed the feature/450_session_transition branch from ceddbbe to f0b84f5 Compare February 4, 2018 04:23
@e10dokup e10dokup force-pushed the feature/450_session_transition branch from f0b84f5 to 1d73ffe Compare February 4, 2018 04:28
@e10dokup

e10dokup commented Feb 4, 2018

Copy link
Copy Markdown
Contributor Author

@takahirom @rkowase Thanks for your reviews! I added fix commits to respond your comments.

@e10dokup e10dokup force-pushed the feature/450_session_transition branch from e73e923 to dd9b57c Compare February 4, 2018 04:34
@e10dokup e10dokup force-pushed the feature/450_session_transition branch from dd9b57c to 17d0220 Compare February 4, 2018 04:35
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
initViewTransitions(view)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected blank line(s) before “}”

@takahirom

Copy link
Copy Markdown
Member

I'm sorry.
I am thinking about this PR. 🤔

@e10dokup

e10dokup commented Feb 5, 2018

Copy link
Copy Markdown
Contributor Author

@takahirom Thanks. I'm sorry I create poor PR...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Assigned] Add animating speaker icon in ActivityTransition from a session list screen to a session detail screen

4 participants