Tri-State-Checkbox icon indicating copy to clipboard operation
Tri-State-Checkbox copied to clipboard

Checkbox not rendering

Open svenjacobs opened this issue 5 years ago • 11 comments

Tried out your library but unfortunately the checkbox is not rendered. When I add the android:text attribute I can see the text label but no checkbox. This is on a project with min SDK 23.

svenjacobs avatar Feb 13 '20 07:02 svenjacobs

Kind of the same situation. I ran it in an emulator and the app kept crashing. When I looked at logcat I noticed that it couldn't resolve the reference to Timber, so I added it. After I added it the checkbox in the preview disappeared but the app runs now, obviously without a checkbox.

ricovivid avatar Feb 26 '20 05:02 ricovivid

imho a library should not have a hard dependency on a logging framework like Timber. But it seems this is not the root of the problem...

svenjacobs avatar Feb 26 '20 06:02 svenjacobs

@svenjacobs when you remove the android:text does the checkbox appear? I had a rough time even building and running the solution after I added this library. Up until the time that I added the dependency for Timber like I mentioned before.

ricovivid avatar Feb 26 '20 15:02 ricovivid

@innov83r No, the checkbox does not appear with our without the text attribute.

svenjacobs avatar Feb 26 '20 15:02 svenjacobs

@svenjacobs did you have issues installing and building this library? Because I did.

ricovivid avatar Feb 26 '20 16:02 ricovivid

@sephiroth74 which installation instruction set is the correct one?

  1. The README on your github repo
  2. The instructions at The Android Arsenal

ricovivid avatar Feb 27 '20 04:02 ricovivid

did you have issues installing and building this library

No, I didn't. I didn't even notice that the library depends on Timber. Timber is a transitive dependency so I wonder why it didn't work for you? Unless you have some special Gradle configuration?

svenjacobs avatar Feb 27 '20 09:02 svenjacobs

did you have issues installing and building this library

No, I didn't. I didn't even notice that the library depends on Timber. Timber is a transitive dependency so I wonder why it didn't work for you? Unless you have some special Gradle configuration?

It didn't work because I had the '@aar' suffix on my dependency. I removed it and it let me build. I also started playing around with it a bit and was able to get a checkbox by explicitly showing one via the drawables resource. I'm going to work on implementing the kotlin code to see if I can get it to be selectable. I'll post once I have more news.

ricovivid avatar Feb 28 '20 19:02 ricovivid

I spent some time this weekend and I was able to get a checkbox to display by putting this in my main activity: checkBox1.setChecked(false, false). Without that line I looks like text gets rendered but not the checkbox.

ricovivid avatar Mar 02 '20 04:03 ricovivid

I'm also having difficulty with the checkbox not rendering, even with innov83r's Mar 1 suggestion, even in a completely vanilla project in Android Studio. The install was easy with the android-arsenal instructions.

My Gradle file, for a Java project, SDK <= 28, has: implementation 'com.github.sephiroth74:Tri-State-Checkbox:v1.0.0'

For me what fixed it was making sure to include the style attribute in the layout: <it.sephiroth.android.library.checkbox3state.CheckBox3 android:id="@+id/cb" style="@style/Sephiroth.Widget.Checkbox3"

Sadly, it's still not rendering in my own app...

cschiefe avatar May 04 '20 20:05 cschiefe

Apparently, adding style="@style/Sephiroth.Widget.Checkbox3" in the XML layout definition fixes the issue...

000407 avatar Oct 25 '21 09:10 000407