RobertApikyan / SegmentedControl

Android SegmentedControl + multi row support
Apache License 2.0
162 stars 30 forks source link

Segmentedcontrol not work in AndroidStudio 3.4 #19

Closed varshilshah29 closed 5 years ago

varshilshah29 commented 5 years ago

Today, I update my android studio from 3.3 to 3.4. In 3.3 version my application is working fine but at the same time, I am facing an issue.

Error: cannot access ComponentFrameLayout class file for view_component.lib_android.com.view_component.base_view.layouts.ComponentFrameLayout not found

I am not able to hide segmentedcontrol

error: cannot find symbol method setVisibility(int)

My Code :

<segmented_control.widget.custom.android.com.segmentedcontrol.SegmentedControl android:id="@+id/rchtype_control" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="@dimen/_10sdp" app:columnCount="2" app:distributeEvenly="true" app:radius="@dimen/_12sdp" app:segments="@array/RchType" app:textVerticalPadding="@dimen/_6sdp" />

rchType = (SegmentedControl) findViewById(R.id.rchtype_control);

rchType.setVisibility(View.GONE); - Error show here

RobertApikyan commented 5 years ago

Could you provide project level and app level .gradle files

varshilshah29 commented 5 years ago

Project Level: gradle

buildscript { repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.4.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath 'com.google.gms:google-services:4.2.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects { repositories { google() jcenter() maven { url "https://jitpack.io" } } }

task clean(type: Delete) { delete rootProject.buildDir } ext { // Sdk and tools minSdkVersion = 21 targetSdkVersion = 28 compileSdkVersion = 28 buildToolsVersion = '28.0.3'

// App dependencies
supportLibraryVersion = '28.0.0'
sdpVersion = '1.0.6'
gsonVersion = '2.8.0'
calligraphyVersion = '2.2.0'
glideVersion = '3.7.0'

rx2FastAndroidNetworking = '1.0.1'

roomVersion = '1.1.1'
archLifecycleVersion = '1.1.1'

dagger2Version = '2.8'
rxjava2Version = '2.0.6'
rxandroidVersion = '2.0.1'
butterKnifeVersion = '8.6.0'
greenDaoVersion = '3.2.0'
placeholderviewVersion = '0.6.1'
debugDBVersion = '1.0.3'
timberVersion = '4.5.1'

//Test dependencies
junitVersion = '4.12'
espressoVersion = '2.2.2'
mockitoVersion = '2.7.1'

}

App Level: gradle

apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services'

android { compileSdkVersion rootProject.ext.compileSdkVersion buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
    applicationId "com.novitytech.rechargewalenew"
    minSdkVersion rootProject.ext.minSdkVersion
    targetSdkVersion rootProject.ext.targetSdkVersion
    versionCode 6
    versionName "1.6"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}

}

dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion" implementation "com.android.support:design:$rootProject.supportLibraryVersion" implementation 'com.google.firebase:firebase-messaging:17.5.0' testImplementation 'junit:junit:4.12' implementation "com.intuit.sdp:sdp-android:$rootProject.sdpVersion" implementation "com.intuit.ssp:ssp-android:$rootProject.sdpVersion" implementation "com.android.support:recyclerview-v7:$rootProject.supportLibraryVersion" implementation "com.android.support:cardview-v7:$rootProject.supportLibraryVersion" implementation "com.amitshekhar.android:rx2-android-networking:$rootProject.rx2FastAndroidNetworking" implementation 'com.squareup.picasso:picasso:2.71828' implementation 'com.ss.bannerslider:bannerslider:2.0.0' implementation 'de.hdodenhof:circleimageview:3.0.0'

// Room components - Database
implementation "android.arch.persistence.room:runtime:$rootProject.roomVersion"
annotationProcessor "android.arch.persistence.room:compiler:$rootProject.roomVersion"
androidTestImplementation "android.arch.persistence.room:testing:$rootProject.roomVersion"

// Lifecycle components implementation "android.arch.lifecycle:extensions:$rootProject.archLifecycleVersion" annotationProcessor "android.arch.lifecycle:compiler:$rootProject.archLifecycleVersion"

implementation project(path: ':awesomedialoglib')
implementation 'com.github.vontell:IndicatorBinder:v0.1.3-alpha'

// font
implementation "uk.co.chrisjenx:calligraphy:$rootProject.calligraphyVersion"

//Segmented Button
implementation project(path: ':segmentedcontrolmodule')
//Buttons
implementation 'com.github.sabujak-sabujak:RoundedButton:v0.1.1'

//Geo location
implementation 'com.github.mumayank:AirLocation:1.2'
implementation 'com.google.android.gms:play-services-location:16.0.0'

//file chooser
implementation project(path: ':filepicker')
implementation project(path: ':TableFixHeaders')

implementation 'com.allattentionhere:fabulousfilter:0.0.5'
implementation 'com.google.android:flexbox:1.0.0'

//Date Range picker
implementation 'com.borax12.materialdaterangepicker:library:1.9'

//Permissions
implementation project(path: ':permissions')

}

RobertApikyan commented 5 years ago

instead of adding the segmented control as a separate module, try to apply following changes

add to project level gradle file

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

add to app level gradle file

implementation 'com.github.RobertApikyan:SegmentedControl:1.1.0'

remove this line from you current app level gradle file

//Segmented Button implementation project(path: ':segmentedcontrolmodule')

varshilshah29 commented 5 years ago

I already tried with this dependencies but the problem is the same

Please check screenshot for more info.

IMG-20190418-WA0000

RobertApikyan commented 5 years ago

Hi, try this version implementation 'com.github.RobertApikyan:SegmentedControl:1.1.3' if something went wrong, please let me know

varshilshah29 commented 5 years ago

Hi, Robert

I checked the library's new version and it's working fine.

Thank you so much.

On Sun, Apr 21, 2019, 1:23 AM Robert notifications@github.com wrote:

Closed #19 https://github.com/RobertApikyan/SegmentedControl/issues/19.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/RobertApikyan/SegmentedControl/issues/19#event-2289720793, or mute the thread https://github.com/notifications/unsubscribe-auth/AE46PXEGGEXW6VIG2M2TUPTPRNYFFANCNFSM4HG2JA2A .

DineeshPadippurakkal commented 1 week ago

implementation 'com.ss.bannerslider:bannerslider:2.0.0'

Failed to resolve: com.ss.bannerslider:bannerslider:1.6 Show in Project Structure dialog Affected Modules: app