vikramkakkar / SublimeNavigationView

...is a complete rewrite of NavigationView (from Design Support library) that enables - usage of Checkboxes, Switches & Badges as menu items - XML definition - Parcelable menus - collapsible/expandable menu-groups - multiple menus - custom styling.
Apache License 2.0
309 stars 42 forks source link

Menu items have pink text color on Android O #30

Open alashow opened 7 years ago

alashow commented 7 years ago

Hey.

I noticed that my app navigation menu have weird pinkish text color on menu items. I installed SublimeNavigationView app from Play Store to check if the issue with the library.

Screenshot

Update

Here is a warning log:

W/ResourceType: Invalid package identifier when getting bag for resource number 0xffffffff
06-13 20:38:01.041 29042-29042/tm.my.app W/Resources: ColorStateList android:color/text_color_primary has unresolved theme attributes! Consider using Resources.getColorStateList(int, Theme) or Context.getColorStateList(int).
 java.lang.RuntimeException
     at android.content.res.Resources.getColorStateList(Resources.java:990)
     at com.appeaser.sublimenavigationviewlibrary.TextViewStyleProfile.setDefaultItemTextColor(TextViewStyleProfile.java:149)
     at com.appeaser.sublimenavigationviewlibrary.TextViewStyleProfile.getTextColor(TextViewStyleProfile.java:117)
     at com.appeaser.sublimenavigationviewlibrary.SublimeSubheaderItemView.initialize(SublimeSubheaderItemView.java:70)
     at com.appeaser.sublimenavigationviewlibrary.SublimeMenuPresenter$MenuViewSubHeaderHolder.initialize(SublimeMenuPresenter.java:263)
     at com.appeaser.sublimenavigationviewlibrary.SublimeMenuPresenter$MenuRecyclerAdapter.onBindViewHolder(SublimeMenuPresenter.java:401)
     at com.appeaser.sublimenavigationviewlibrary.SublimeMenuPresenter$MenuRecyclerAdapter.onBindViewHolder(SublimeMenuPresenter.java:347)
     at android.support.v7.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6474)
     at android.support.v7.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6507)
     at android.support.v7.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5450)
     at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5716)
     at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5555)
     at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5551)
     at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2211)
     at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1538)
     at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1498)
     at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:591)
     at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3691)
     at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3408)
     at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3960)
     at android.view.View.layout(View.java:19393)
     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
     at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
     at android.view.View.layout(View.java:19393)
     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1214)
     at android.view.View.layout(View.java:19393)
     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
     at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
     at android.view.View.layout(View.java:19393)
     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
     at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
     at android.view.View.layout(View.java:19393)
     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
     at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
     at android.view.View.layout(View.java:19393)
     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791)
     at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635)
     at android.widget.LinearLayout.onLayout(LinearLayout.java:1544)
     at android.view.View.layout(View.java:19393)
     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
     at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
     at com.android.internal.policy.DecorView.onLayout(DecorView.java:736)
     at android.view.View.layout(View.java:19393)
06-13 20:38:01.041 29042-29042/tm.my.app W/Resources:     at android.view.ViewGroup.layout(ViewGroup.java:6022)
     at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2480)
     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2199)
     at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1385)
     at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6722)
     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:886)
     at android.view.Choreographer.doCallbacks(Choreographer.java:698)
     at android.view.Choreographer.doFrame(Choreographer.java:633)
     at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:872)
     at android.os.Handler.handleCallback(Handler.java:769)
     at android.os.Handler.dispatchMessage(Handler.java:98)
     at android.os.Looper.loop(Looper.java:164)
     at android.app.ActivityThread.main(ActivityThread.java:6540)
     at java.lang.reflect.Method.invoke(Native Method)
     at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
trevortirrell commented 7 years ago

I've also noticed that ever since I installed Oreo my menu items are pink in at least 2 of my apps that I have installed. ???

alashow commented 7 years ago

You can use this build to fix it:

compile 'com.github.alashow:SublimeNavigationView:0.0.1'
Rushi96 commented 6 years ago

change compileSdkVersion to

compileSdkVersion 25 and the below dependencies(if exist) to below mentioned versions

compile 'com.android.support:design:25.3.0'
compile 'com.android.support:support-v4:25.3.0'
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:cardview-v7:25.3.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.android.support:palette-v7:25.3.0'
VerumCH commented 6 years ago

@alashow Nice work on the fix. Compiling to your version of the project breaks Instant Run on Android Studio (at least for version 3.0), however. I would make an issue for it but yours doesn't have issues enabled. I'll grab the error message when I get a chance.

Update

Here's the error message:

Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> Unexpected inputs: ImmutableJarInput{name=com.appeaser.sublimenavigationviewlibrary:sublimenavigationviewlibrary:0.0.1, file=/<project path>/app/build/intermediates/transforms/desugar/debug/40.jar, contentTypes=CLASSES, scopes=EXTERNAL_LIBRARIES, status=REMOVED}

Second Update

Interestingly, by following the path in the error message, I was able to find a fix. The #.jar files in that folder went from 1.jar ... 39.jar, 41.jar, and renaming 41.jar to 40.jar allowed the project to launch with Instant Run enabled. Then it immediately removed 40.jar and put 41.jar back, but it continues to launch fine with Instant Run.

I was interested in what was happening, so I tried switching back to compiling with 'com.appeaser.sublimenavigationviewlibrary:sublimenavigationviewlibrary:0.0.1' and Instant Run broke again - it was looking for 41.jar now, but instead there was 42.jar. I immediately switched back to compiling with 'com.github.alashow:SublimeNavigationView:0.0.1' and Instant Run worked again (it found 42.jar), but now it's 43.jar instead of 42.jar. Every switch increments the number of the .jar (but only that one, the rest still end at 39.jar), and for some reason sometimes it breaks the reference that Instant Run keeps.

So ultimately it may be an issue with Android Studio/its Instant Run feature involving switching between two versions of the same repository, but I'm not really sure. It doesn't look like it's an issue directly caused by one version of this repo or the other. It could also have something to do with switching between compiling the repo via jitpack and compiling directly from maven.

At this point it's just something to keep an eye on if you switch to the forked version.

alashow commented 6 years ago

@vNocturnus it was working fine on my end. You should try clearing project or/and removing all build folders.

kainaspatel commented 6 years ago

@Rushi96 : your solution is working for me (Y). can you pl explain briefly what is the actual logic behind this!