-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create Shared Elements Transition from All/RoomSessionsFragment to SessionDetailFragment #564
base: master
Are you sure you want to change the base?
Create Shared Elements Transition from All/RoomSessionsFragment to SessionDetailFragment #564
Conversation
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
setEnterSharedElementCallback(sharedElementCallback) | ||
} | ||
|
There was a problem hiding this comment.
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 “}” |
@@ -83,9 +121,11 @@ class SessionDetailActivity : | |||
} | |||
} | |||
|
|||
|
There was a problem hiding this comment.
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 | ||
} | ||
|
There was a problem hiding this comment.
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(context: Context, session: Session) { | ||
context.startActivity(createIntent(context, session.id)) | ||
} | ||
|
||
fun start(activity: Activity, session: Session, sharedElement: Pair<View, String>) { | ||
val options = ActivityOptionsCompat.makeSceneTransitionAnimation(activity, sharedElement) |
There was a problem hiding this comment.
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) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
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 “}” |
👀 |
@@ -32,6 +40,8 @@ class SessionDetailActivity : | |||
@Inject lateinit var viewModelFactory: ViewModelProvider.Factory | |||
@Inject lateinit var drawerMenu: DrawerMenu | |||
|
|||
private var backPressed = false |
There was a problem hiding this comment.
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 🙏
There was a problem hiding this comment.
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.
@@ -75,6 +83,26 @@ class SessionDetailFragment : Fragment(), Injectable { | |||
} | |||
|
|||
binding.toolbar.setNavigationOnClickListener { activity?.finish() } | |||
|
|||
binding.speakerSummary.viewTreeObserver.addOnPreDrawListener( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an extension method to ViewExt?
fun View.addOnetimeOnPreDrawListener(listener:()->Unit)
} | ||
|
||
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | ||
private val sharedElementCallback = object : SharedElementCallback() { |
There was a problem hiding this comment.
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?
@@ -75,6 +83,26 @@ class SessionDetailFragment : Fragment(), Injectable { | |||
} | |||
|
|||
binding.toolbar.setNavigationOnClickListener { activity?.finish() } | |||
|
|||
binding.speakerSummary.viewTreeObserver.addOnPreDrawListener( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -34,6 +39,9 @@ class SessionDetailFragment : Fragment(), Injectable { | |||
ViewModelProviders.of(activity!!, viewModelFactory).get(SessionDetailViewModel::class.java) | |||
} | |||
|
|||
val speakerSummary: SpeakersSummaryLayout |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
ceddbbe
to
f0b84f5
Compare
f0b84f5
to
1d73ffe
Compare
@takahirom @rkowase Thanks for your reviews! I added fix commits to respond your comments. |
e73e923
to
dd9b57c
Compare
dd9b57c
to
17d0220
Compare
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | ||
initViewTransitions(view) | ||
} | ||
|
There was a problem hiding this comment.
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 “}” |
I'm sorry. |
@takahirom Thanks. I'm sorry I create poor PR... |
Issue
Overview (Required)
(以下日本語で失礼します)
SessionDetailFrgamentからAll/RoomSessionsFragmentへの戻りのTransactionを実装したかったのですが、SessionDetailActivityのViewPagerに入るSessionDetailFragmentのSessionが全セッションとなっているため、RoomSessionsFragmentとリストの整合性がうまく取れず綺麗に遷移できなかったため、現状は戻りに関してはアニメーションをしないようにしています…。
Links
Screenshot