Giter VIP home page Giter VIP logo

books_library_app's People

Contributors

kaushiknsanji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

books_library_app's Issues

Settings Screen crashing on screen rotation

The Settings in this app has been setup to adjust the parameters used in generating the Search URL of the Google Books API, embedding the search keyword entered by the user, for the Book to be searched. This has been designed using the android.support.v7.preference.Preference.

settings_error

The Setting screen can be launched by going over to the overflow menu in the main activity, and then by clicking on the "Search Settings" menu as shown in the above GIF. After the Settings screen is launched, just rotate the device screen, and the following error will be seen in the logs -

10-26 20:13:11.091 3966-3987/com.example.kaushiknsanji.bookslibrary D/OpenGLRenderer: endAllActiveAnimators on 0x8d267a80 (MenuPopupWindow$MenuDropDownListView) with handle 0x8d7a2c20
10-26 20:13:13.998 3966-3966/com.example.kaushiknsanji.bookslibrary D/AndroidRuntime: Shutting down VM
                                                                                      
                                                                                      
                                                                                      --------- beginning of crash
10-26 20:13:13.999 3966-3966/com.example.kaushiknsanji.bookslibrary E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                      Process: com.example.kaushiknsanji.bookslibrary, PID: 3966
                                                                                      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.kaushiknsanji.bookslibrary/com.example.kaushiknsanji.bookslibrary.settings.SearchSettingsActivity}: java.lang.IllegalStateException: Derived class did not call super.onRestoreInstanceState()
                                                                                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
                                                                                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
                                                                                          at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4519)
                                                                                          at android.app.ActivityThread.-wrap19(ActivityThread.java)
                                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1483)
                                                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                          at android.os.Looper.loop(Looper.java:154)
                                                                                          at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                          at java.lang.reflect.Method.invoke(Native Method)
                                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
                                                                                       Caused by: java.lang.IllegalStateException: Derived class did not call super.onRestoreInstanceState()
                                                                                          at android.support.v7.preference.Preference.dispatchRestoreInstanceState(Preference.java:1726)
                                                                                          at android.support.v7.preference.PreferenceGroup.dispatchRestoreInstanceState(PreferenceGroup.java:395)
                                                                                          at android.support.v7.preference.PreferenceGroup.dispatchRestoreInstanceState(PreferenceGroup.java:395)
                                                                                          at android.support.v7.preference.Preference.restoreHierarchyState(Preference.java:1706)
                                                                                          at android.support.v7.preference.PreferenceFragmentCompat.onActivityCreated(PreferenceFragmentCompat.java:343)
                                                                                          at android.support.v4.app.Fragment.performActivityCreated(Fragment.java:2201)
                                                                                          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1326)
                                                                                          at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
                                                                                          at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
                                                                                          at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManager.java:2900)
                                                                                          at android.support.v4.app.FragmentController.dispatchActivityCreated(FragmentController.java:201)
                                                                                          at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:603)
                                                                                          at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
                                                                                          at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
                                                                                          at android.app.Activity.performStart(Activity.java:6696)
                                                                                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2628)
                                                                                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726) 
                                                                                          at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4519) 
                                                                                          at android.app.ActivityThread.-wrap19(ActivityThread.java) 
                                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1483) 
                                                                                          at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                                          at android.os.Looper.loop(Looper.java:154) 
                                                                                          at android.app.ActivityThread.main(ActivityThread.java:6119) 
                                                                                          at java.lang.reflect.Method.invoke(Native Method) 
                                                                                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) 
                                                                                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) 

Let me know how to solve this issue.

Title and Author Text in Details screen can at times occupy the entire screen

For some of the Books, the Title Text and the Author Text can be more than 2 lines which can overflow the content area, rendering the scrollable content (following the Author Text) inaccessible.

The scenario can occur like below -

detail_title_problem
detail_title_landscape_problem

This needs to be fixed using some kind of TextView that can expand/collapse, onClick for larger content.

ConstraintLayout Performance varying with different Android versions

The ConstraintLayout used in the items shown by the RecyclerView of the ViewPager is showing a variance in the performance of Measure-Layout-Draw. We can observe that the RecyclerView is pretty janky when the app is used on Android 5 OS. It appears very smooth when the app is used on Android 7 OS.

Performance in Android 7

android7_perf

As seen in the above GIF, there is a smooth flow in the scrolling and also when transitioning to the other tab in the ViewPager. Below are the details of Measure-Layout-Draw performance retrieved through the Android Monitor.

Layout performance of the complete view

Grid View Performance

List View Performance

ViewPager Performance

Performance in Android 5

android5_perf

As seen in the above GIF, when user scrolls some frames are lost or it starts to jank. Below are the details of Measure-Layout-Draw performance retrieved through the Android Monitor.

Layout performance of the complete view

Grid View Performance

List View Performance

ViewPager Performance

From the above performance evaluation, it can be observed that the Draw time in Android 5 is double the Draw time taken in Android 7.

When testing this (in Android 5), the below Info log line from Android system appears during scrolling at times -

10-26 20:48:35.899 5512-5512/com.example.kaushiknsanji.bookslibrary I/Choreographer: Skipped 38 frames!  The application may be doing too much work on its main thread.

These are the test results obtained through Android Emulation of Nexus 5X with Android 7 and Android 5. Emulation was accelerated with Hardware acceleration. The janky problem was also observed on a device (Sony Xperia Z1) runnning on Android 5.1.1.

Couple of things I would like to know on this -

  1. Why there is a difference in ConstraintLayout Performance on different Android versions?
  2. How to fix this issue for Android versions having the said problem?

Progress Bar Animation not appearing as designed

When the user searches for a Book, the search query request is sent to the Google Books API and the response is parsed for the Books data. During this process of loading the books data, a custom progress bar will be displayed in the BookSearchActivity. This is implemented using the animation-list / AnimationDrawable. The animation-list has a total of 11 drawable items displayed with a time frame of 100ms (for each drawable in the list). These drawables are line drawables which has a line with solid background and a dashed line as its foreground, and each drawable item in the list varies its left padding for the dashed line. These drawable items look like these, in the same order as mentioned in progress bar.

step1
step2
step3
step4
step5
step6
step7
step8
step9
step10
step11

Progress Bar Appearance in Android 7

progress_loading_android7

As seen in the above GIF, there is no dashed appearance of the dash line used as a foreground in the layer list of the drawables. The left padding is shown successively to increase as expected.

Progress Bar Appearance in Android 5

progress_loading_android5

As seen in the above GIF, there is no dashed appearance of the dash line used as a foreground in the layer list of the drawables and also no proper successive increase of left padding shown. Instead, the animation appears like a lightning bolt moving from left to right.

These are the test results obtained through Android Emulation of Nexus 5X with Android 7 and Android 5. Emulation was accelerated with Hardware acceleration.

Couple of things I would like to know on this -

  1. Why there is a difference in the Animation shown on different Android versions?
  2. Why there is no dashed appearance in the line drawables?
  3. How to make this to work on all Android versions with proper animation like in the result of Android 7 along with the appearance of dashed line in the output?

The Title Text in Details screen is not showing any ellipse for larger content

In the Details screen, it is observed that the Title Text is not displaying any ellipsis for the content that is larger than the MaxLines property set on it.

This is happening due to the Spannable text in place which is being used to resize the Subtitle if present in the Title Text.

This can be fixed using a SpannableStringBuilder and finalizing the Text set on the TextView with a BufferType as NORMAL.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.