1

This is my gradle file

In oreo I am not getting proper output.

This is my output which I am getting in oreo.

I tried to upgrade compileSdkVersion but than I get an error all library must use the same version. Please tell me how to solve this problem.

enter image description here

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '26.0.2'

    defaultConfig {
        applicationId "com.rayvatapps.inspiquo"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 12
        versionName "3.4"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

repositories {
    jcenter()
}

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:22.2.0'
    implementation 'com.android.support:appcompat-v7:22.2.0'
    implementation 'com.android.support:support-v4:22.2.0'
    //cardview
    implementation 'com.android.support:cardview-v7:22.2.0'
    //recyclerview
    implementation 'com.android.support:recyclerview-v7:22.2.0'
    //glide
    implementation 'com.github.bumptech.glide:glide:3.6.0'
    implementation 'de.hdodenhof:circleimageview:1.3.0'
    //voley
    implementation 'com.android.volley:volley:1.0.0'
    //gson
    implementation 'com.google.code.gson:gson:2.6.2'
    //sdp
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    //ripple effect
    implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
    //jsoup
    compile 'org.jsoup:jsoup:1.11.1'
}

xml

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/drawer_layout"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:fitsSystemWindows="true">

    <include layout="@layout/include_list_viewpager"/>


    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header"
        app:menu="@menu/drawer_view"/>

</android.support.v4.widget.DrawerLayout>

Any help would be highly appreciated.

Kara
  • 6,115
  • 16
  • 50
  • 57
Mitesh Makwana
  • 99
  • 1
  • 10
  • Item is getting color from somewhere, check code carefully were you declare pink change it and run again. maybe check your res > values > colors > colorAccent – PriyankVadariya Jun 26 '18 at 05:43
  • it's work fine in all other androids os – Mitesh Makwana Jun 26 '18 at 05:45
  • Update compileSdkVersion and put below code in project gradle subprojects { configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> def requested = details.requested if (requested.group == 'com.android.support') { if (!requested.name.startsWith("multidex")) { details.useVersion '27.1.1' } } } } } – PriyankVadariya Jun 26 '18 at 05:51
  • this isn't compiling issue this is simply a fault in your coding show the java file – Tabish Jun 26 '18 at 10:02
  • your problem was solved here : https://stackoverflow.com/questions/42700908/how-to-change-the-text-and-icon-color-of-selected-menu-item-on-navigation-drawer – abdeddaim ahmed Jul 04 '18 at 15:00

3 Answers3

1

Can you please check you colors in the values folder. Usually the menu is taking the colors from there.

If you cannot figure it out, please post the code from there so we can check what is happening in the colors and from where is coming from.

Best regards,

Dimitar Georgiev

1

In regards to error "error all library must use the same version", do ensure all compileSDK, support libs, build tool use same set of version for eg : 27.x.x

The color of Navigation item can also be controlled by : app:itemTextColor. It is also worth noting the theme used in your app as it can also control the color.See for Android O how is it effecting. Otherwise for Android o can overwrite the itemTextColor.

Abhi
  • 227
  • 2
  • 5
0

Use app:itemIconTint to change color icon, and app:itemTextColor to change text color, inside the NavigationView properties in your xml like this:

<android.support.design.widget.NavigationView
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        android:id="@+id/nav_view"
        app:itemIconTint="@color/material_blue_grey_80"
        app:itemTextColor="@color/material_blue_grey_80"
        app:headerLayout="@layout/drawer_header" />