Skip to content

New review layout UI for landscape view #4412

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

Merged
merged 5 commits into from
May 15, 2021

Conversation

Ayan-10
Copy link
Contributor

@Ayan-10 Ayan-10 commented May 14, 2021

Description (required)

Fixes #4343

What changes did you make and why?

Elements of ReviewActivity is not visible to user in landscape. I made a different landscape UI for it.

Tests performed (required)

Tested 3.0.0-latest master on Pixel 4 with API level 27.

Screenshots (for UI changes only)

Screenshot_20210513_201557

@codecov-commenter
Copy link

codecov-commenter commented May 14, 2021

Codecov Report

Merging #4412 (f388943) into master (a78fea0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #4412   +/-   ##
=========================================
  Coverage     10.38%   10.38%           
  Complexity      479      479           
=========================================
  Files           342      342           
  Lines         13154    13154           
  Branches       1074     1074           
=========================================
  Hits           1366     1366           
  Misses        11719    11719           
  Partials         69       69           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a78fea0...f388943. Read the comment docs.

@Ayan-10
Copy link
Contributor Author

Ayan-10 commented May 14, 2021

@madhurgupta10 @nicolas-raoul up for review.

Copy link
Member

@nicolas-raoul nicolas-raoul left a comment

Choose a reason for hiding this comment

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

I get this crash everytime I start review in landscape mode, or rotate the screen to landscape on the review activity. Any idea?

05-14 19:26:14.138 20497 20497 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.free.nrw.commons/fr.free.nrw.commons.review.ReviewActivity}: java.lang.IllegalStateException: Required view 'mediaDetailContainer' with ID 2131296619 for field 'mediaDetailContainer' was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3107)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7032)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

@madhurgupta10
Copy link
Collaborator

I get this crash everytime I start review in landscape mode, or rotate the screen to landscape on the review activity. Any idea?

05-14 19:26:14.138 20497 20497 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.free.nrw.commons/fr.free.nrw.commons.review.ReviewActivity}: java.lang.IllegalStateException: Required view 'mediaDetailContainer' with ID 2131296619 for field 'mediaDetailContainer' was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3107)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7032)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
05-14 19:26:14.138 20497 20497 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

This seems related to ButterKnife BindViews, @Ayan-10 can you cross-check if both portrait and landscape layout contain all the ids?

@Ayan-10
Copy link
Contributor Author

Ayan-10 commented May 14, 2021

Sorry for the inconvenience.

@madhurgupta10 @nicolas-raoul I tested the app several times before the PR. Now I rechecked it also. But there is no crash in my emulator as you can see in the screenshot.

@madhurgupta10 I don't think the issue is related to not containing IDs. Otherwise, It will crash on my emulator also and I am sure both portrait and landscape layout contain all the ids.

Screenshot was taken: 6.41 IST

Screenshot_20210514_184106

@Ayan-10
Copy link
Contributor Author

Ayan-10 commented May 14, 2021

@nicolas-raoul @madhurgupta10 But as you are saying the app is crashing on your device. I will try to find the problem as soon as possible and let you know about it. Can you provide me the device API number in which you tested the app?

Thank you.

@nicolas-raoul
Copy link
Member

Thanks! I am on Android version 9.

@Ayan-10
Copy link
Contributor Author

Ayan-10 commented May 14, 2021

@nicolas-raoul It's still not crashing any of my devices. I assumed the issue and did some modifications. Can you please recheck it on your device?

@madhurgupta10
Copy link
Collaborator

I just tested your PR, on my side, I don't have any crashes for both beta and prod.

@nicolas-raoul
Copy link
Member

It still crashes very consistently on my device, even after removing the app's data.

05-15 09:47:41.920 20457 20604 D OkHttp  : <-- 200 https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2&generator=allimages&gaisort=timestamp&gaidir=older&prop=imageinfo&iiprop=url|extmetadata|user&&iiurlwidth=640&iiextmetadatafilter=DateTime|Categories|GPSLatitude|GPSLongitude|ImageDescription|DateTimeOriginal|Artist|LicenseShortName|LicenseUrl&gaiuser=Syced&gailimit=10&gaicontinue=20210429002723|KYOEI_boat_in_Kisarazu_port_3.jpg&continue=gaicontinue|| (704ms, unknown-length body)
05-15 09:47:41.933 20457 20604 D OkHttp  : --> GET https://commons.wikimedia.org/w/api.php?format=json&action=wbgetentities&props=labels&languagefallback=1&ids=M104592924%7CM104592981%7CM104593030%7CM104593084%7CM104593128%7CM104593186%7CM104593235%7CM104593274%7CM104593321%7CM104593364
05-15 09:47:41.936 20457 20604 D CookieManager: Domain:commons.wikimedia.org
05-15 09:47:41.961  5633  5729 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = de.danoeh.antennapod,userId = 0
05-15 09:47:41.961  5633  5729 D API test: getContainerInfo: value is 
05-15 09:47:41.961  5633  5729 D ApplicationPolicy: isStatusBarNotificationAllowedAsUser: packageName = de.danoeh.antennapod,userId = 0
05-15 09:47:41.961  5633  5729 D API test: getContainerInfo: value is 
05-15 09:47:41.980  7726 18058 D RecentsTaskLoadPlan: lastReportedWindowingMode is not exist.
05-15 09:47:41.993  7726 18058 I chatty  : uid=10110(com.sec.android.app.launcher) Binder:7726_C identical 10 lines
05-15 09:47:41.993  7726 18058 D RecentsTaskLoadPlan: lastReportedWindowingMode is not exist.
05-15 09:47:41.993 20457 20457 D AndroidRuntime: Shutting down VM
05-15 09:47:41.993  7726 18058 D RecentsTaskLoadPlan: lastReportedWindowingMode is not exist.
05-15 09:47:41.996 20457 20457 E AndroidRuntime: FATAL EXCEPTION: main
05-15 09:47:41.996 20457 20457 E AndroidRuntime: Process: fr.free.nrw.commons, PID: 20457
05-15 09:47:41.996 20457 20457 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.free.nrw.commons/fr.free.nrw.commons.review.ReviewActivity}: java.lang.IllegalStateException: Required view 'mediaDetailContainer' with ID 2131296619 for field 'mediaDetailContainer' was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3107)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:214)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7032)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: Caused by: java.lang.IllegalStateException: Required view 'mediaDetailContainer' with ID 2131296619 for field 'mediaDetailContainer' was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at butterknife.internal.Utils.findRequiredView(Utils.java:88)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at butterknife.internal.Utils.findRequiredViewAsType(Utils.java:100)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at fr.free.nrw.commons.review.ReviewActivity_ViewBinding.<init>(ReviewActivity_ViewBinding.java:42)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance0(Native Method)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at butterknife.ButterKnife.bind(ButterKnife.java:170)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at butterknife.ButterKnife.bind(ButterKnife.java:99)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at fr.free.nrw.commons.review.ReviewActivity.onCreate(ReviewActivity.java:108)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:7327)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.Activity.performCreate(Activity.java:7318)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3087)
05-15 09:47:41.996 20457 20457 E AndroidRuntime: 	... 11 more
05-15 09:47:41.994  7726 18058 D RecentsTaskLoadPlan: lastReportedWindowingMode is not exist.
05-15 09:47:41.997 20457 20457 E ACRA    : ACRA caught a RuntimeException for fr.free.nrw.commons
05-15 09:47:41.997 20457 20457 E ACRA    : java.lang.RuntimeException: Unable to start activity ComponentInfo{fr.free.nrw.commons/fr.free.nrw.commons.review.ReviewActivity}: java.lang.IllegalStateException: Required view 'mediaDetailContainer' with ID 2131296619 for field 'mediaDetailContainer' was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.

@Ayan-10
Copy link
Contributor Author

Ayan-10 commented May 15, 2021

As I can see in the log, There is a mediaDetailContainer in your local repo. But in my master branch, there is no such ID anywhere in the ReviewActivity and I also searched on ReviewActivity_ViewBinding there is no such ID exists.

But I get it @nicolas-raoul @madhurgupta10 . Someone added some code in the review layout very recently. So that part of the code was not present in my local repo. This is the reason for not crashing in my device and @madhurgupta10 's device because we don't have the very recent changes in our repo.

I will fix it as soon as possible.

@Ayan-10
Copy link
Contributor Author

Ayan-10 commented May 15, 2021

@nicolas-raoul @madhurgupta10 Hope now it's not crashing.

@nicolas-raoul
Copy link
Member

It works great now, thanks! :-)

@nicolas-raoul nicolas-raoul merged commit b6ffe9f into commons-app:master May 15, 2021
ashishkumar468 pushed a commit to ashishkumar468/apps-android-commons that referenced this pull request Jul 5, 2021
* ReviewActivity landscape layout created successfully

* Minor issues fixed

* minor modification

* crash fixed
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.

ReviewActivity is barely visible in Landscape Mode
4 participants