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
Fix #1152: LessonThumbnailImageView #1554
Conversation
@rt4914 do you have the version of |
Created this gist for reference: https://gist.github.com/rt4914/ea26d973a9a62b682bc93e61c06e71ef |
Thanks. It seems like it turns out Glide supports custom models into custom targets, or known models (e.g. bitmap & drawables) into custom targets & views. It doesn't support custom models into views for some reason, so while I don't like it, it seems like we have to do the SVG -> PictureDrawable conversion instead of just Picture despite that seeming a bit cleaner. While I don't like the new ImageLoader changes, it works & it'll become cleaner once #1039 is fixed. See my commit to this branch for a fix. |
Okay. Thanks for the commit. |
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.
- Story Activity Items and lessons on topic screen not clickable after rotation
Open Story Activity or any screen where we have images and rotate, try scrolling up and down, or just try scrolling a bit fast
kotlin.UninitializedPropertyAccessException: lateinit property thumbnailDownloadUrlTemplate has not been initialized at org.oppia.app.customview.LessonThumbnailImageView.loadImage(LessonThumbnailImageView.kt:78) at org.oppia.app.customview.LessonThumbnailImageView.loadLessonThumbnail(LessonThumbnailImageView.kt:68) at org.oppia.app.customview.LessonThumbnailImageView.checkIfLoadingIsPossible(LessonThumbnailImageView.kt:62) at org.oppia.app.customview.LessonThumbnailImageView.setLessonThumbnail(LessonThumbnailImageView.kt:57) at org.oppia.app.databinding.StoryChapterViewBindingImpl.executeBindings(StoryChapterViewBindingImpl.java:233)
Entering first time into the application, recently played is coming empty.
// works correctly storyProgressTestHelper.markCompletedStoryList(profileId,false) // empty recently played list but view all option available storyProgressTestHelper.markCompletedStoryList(profileId,true) // works correctly storyProgressTestHelper.markOngoingTopicList(profileId,false) // empty recently played list but view all option available storyProgressTestHelper.markOngoingTopicList(profileId,true)
Story Activity in landscape, not showing images
Difference - Recently played difference from home screen and from profile screen
Scrolling recently played list on home screen after coming from the exploration, in order to get a lesson to get added in the recently played list
2020-08-06 11:33:02.706 17369-17369/org.oppia.app E/AndroidRuntime: FATAL EXCEPTION: main Process: org.oppia.app, PID: 17369 java.lang.RuntimeException: Failed to call observer method at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:226) at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeMethodsForEvent(ClassesInfoCache.java:194) at androidx.lifecycle.ClassesInfoCache$CallbackInfo.invokeCallbacks(ClassesInfoCache.java:185) at androidx.lifecycle.ReflectiveGenericLifecycleObserver.onStateChanged(ReflectiveGenericLifecycleObserver.java:37) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.java:361) at androidx.lifecycle.LifecycleRegistry.forwardPass(LifecycleRegistry.java:300) at androidx.lifecycle.LifecycleRegistry.sync(LifecycleRegistry.java:339) at androidx.lifecycle.LifecycleRegistry.moveToState(LifecycleRegistry.java:145) at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent(LifecycleRegistry.java:131) at androidx.fragment.app.Fragment.performStart(Fragment.java:2732) at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:331) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1239) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1398) at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1476) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1541) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2858) at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2818) at androidx.fragment.app.Fragment.performStart(Fragment.java:2736) at androidx.fragment.app.FragmentStateManager.start(FragmentStateManager.java:331) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1239) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1398) at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1476) at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1541) at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2858) at androidx.fragment.app.FragmentManager.dispatchStart(FragmentManager.java:2818) at androidx.fragment.app.FragmentController.dispatchStart(FragmentController.java:258) at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:550) at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:201) at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1391) at android.app.Activity.performStart(Activity.java:7157) at android.app.ActivityThread.handleStartActivity(ActivityThread.java:2937) at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180) at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) Caused by: kotlin.UninitializedPropertyAccessException: lateinit property thumbnailDownloadUrlTemplate has not been initialized at org.oppia.app.customview.LessonThumbnailImageView.loadImage(LessonThumbnailImageView.kt:78) at org.oppia.app.customview.LessonThumbnailImageView.loadLessonThumbnail(LessonThumbnailImageView.kt:68) 2020-08-06 11:33:02.706 17369-17369/org.oppia.app E/AndroidRuntime: at org.oppia.app.customview.LessonThumbnailImageView.checkIfLoadingIsPossible(LessonThumbnailImageView.kt:62) at org.oppia.app.customview.LessonThumbnailImageView.setEntityType(LessonThumbnailImageView.kt:52) at org.oppia.app.databinding.TopicInfoFragmentBindingImpl.executeBindings(TopicInfoFragmentBindingImpl.java:416) at androidx.databinding.ViewDataBinding.executeBindingsInternal(ViewDataBinding.java:473) at androidx.databinding.ViewDataBinding.executePendingBindings(ViewDataBinding.java:445) at androidx.databinding.ViewDataBinding$OnStartListener.onStart(ViewDataBinding.java:1687) at java.lang.reflect.Method.invoke(Native Method) at androidx.lifecycle.ClassesInfoCache$MethodReference.invokeCallback(ClassesInfoCache.java:216) ... 41 more
@anandwana001 The error that you mentioned is something that I was discussing with @BenHenning yesterday but somehow I was not able encounter it again. So, its great that you mentioned it here, we will discuss this in today's meeting. Related to no items visible in Related to difference in items in home screen for promoted stories and recently played screen, that implementation is correct because in Regarding no-thumbnail images in Thanks. |
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.
LGTM, Thanks
cc #1571 |
Explanation
Fixes #1152
This PR create a new class
LessonThumbnailImageView
such that we can use this custom image view in xml files, pass the required information and load the svg/png in imageview.Please go through the entire description and review this PR in this format to make things easier.
Screenshots
How to test
Current develop content
Alpha content
StoryProgressTestHelper
code with https://gist.github.com/rt4914/6f31bae848eca861fa4080f0590d1b85StoryProgressTestHelper
inHomeFragmentPresenter
, usemarkOngoingTopicList
to mark topic partial progress, open navigation drawer -> profile progress -> click on Ongoing Topics item.StoryProgressTestHelper
inHomeFragmentPresenter
, usemarkCompletedStoryList
to mark story progress, open navigation drawer -> profile progress -> click on Completed Stories item.How to review code
Xml Files:
ImageView
toLessonThumbnailImageView
and addapp:entityId
,app:entityType
,app:lessonThumbnail
and removedandroid:src
,android:background
.All other files:
Introduced
StoryHtmlParserEntityType
orTopicHtmlParserEntityType
in files so that we can passentityType
to viewmodels so that we can use it in xml file.Also, introduced
utility
layer changes to support svg rendering.Checklist