kanytu / android-material-drawer-template

An Android template with navigation drawer for material design
Apache License 2.0
674 stars 217 forks source link

Unresponsive Navigation Buttons on API 15, ICS #43

Closed Jonathan727 closed 9 years ago

Jonathan727 commented 9 years ago

This issue is not specific to API 15, it is just most apparent. I'm hoping for a fix that allows me to use the latest libraries.

Issue Description

When user selects an item in the navigation drawer, the item is momentarily highlighted but is not actually navigated to.

video of issue happening

Platforms Affected

I've seen this on several versions of android including 5.1 to some degree. On these platforms, the issue wasn't so severe and it just seemed like I was missing the button more often then before.

I then tried it on an API 15 device (ViewSonic VSD220) and found that I couldn't click any item in the list.

On other platforms I've found it to be a less critical issue as I've said. Tested platforms include API 21, API 22, API 19, API 18, API 16

Work-Around

For my customers, I discovered a temporary work-around is to double-tap the item.

How to Recreate

Clone the android-material-drawer-template repository as is and run on an API 15 device.

Issue Since

d66cd0e905a120914894e947d055bdace8e2dbaa

Fixes

The only fix I've found so far is to roll back the support library version in build.gradle but then you also need to roll back the targetSdkVersion too. However, this breaks calls to viewholder.getAdapterPosition() in NavigationDrawerAdapter. Note that I have ruled out the other changes in commit d66cd0e905a120914894e947d055bdace8e2dbaa (As my project never used those) and the cause is definitely something in the support libraries.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.poliveira.apps.materialtests"
        minSdkVersion 11
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:21.0.3'
    //noinspection GradleDependency
    compile "com.android.support:appcompat-v7:21.0.3"
    compile 'com.android.support:recyclerview-v7:21.0.3'
}
kanytu commented 9 years ago

I fixed this problem on my Android Studio template repo. Since I'm not supporting this repo atm you can check the commit here:

https://github.com/kanytu/Android-studio-material-template/commit/db817f4451b443f2bb54fd83131f809357bacb05

Basically change pressed/selected routines to a drawable instead.

Jonathan727 commented 9 years ago

Works Great! Thank You!

hardikamal commented 9 years ago

@Jonathan727 --- Can you please tell how you solved this issue...

kanytu commented 9 years ago

@hardikamal Probably by using the latest version of the other template since it's working there :)