-
-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
balloon content always has radius.. #220
Comments
Hi, could you build and test using the demo project? |
@skydoves that my codes below: class CustomListBalloonFactory : Balloon.Factory() {
override fun create(context: Context, lifecycle: LifecycleOwner?): Balloon {
return Balloon.Builder(context)
.setLayout(R.layout.common_layout_custom_list)
.setWidth(BalloonSizeSpec.WRAP)
.setHeight(BalloonSizeSpec.WRAP)
.setPaddingTop(4)
.setPaddingBottom(4)
.setArrowOrientation(ArrowOrientation.TOP)
.setArrowPositionRules(ArrowPositionRules.ALIGN_ANCHOR)
.setArrowPosition(0.5f)
.setArrowSize(6)
.setCornerRadius(4f)
.setMarginRight(8)
.setBackgroundColorResource(android.R.color.white)
.setBalloonAnimation(BalloonAnimation.FADE)
.setDismissWhenShowAgain(true)
.setDismissWhenTouchOutside(true)
.setDismissWhenOverlayClicked(true)
.setLifecycleOwner(lifecycle)
.build()
}
} common_layout_custom.xml: <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/common_color_ffffff"
android:orientation="vertical"
>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list_recyclerView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:overScrollMode="never"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/common_balloon_item"
/>
</LinearLayout> common_balloon_item.xml: <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:gravity="center_vertical"
android:layout_height="@dimen/common_dp_36"
android:background="?attr/selectableItemBackground"
android:orientation="horizontal"
android:paddingLeft="@dimen/common_dp_8"
android:paddingRight="@dimen/common_dp_8"
>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/item_custom_icon"
android:layout_width="@dimen/common_dp_27"
android:layout_height="@dimen/common_dp_27"
android:layout_gravity="center_vertical"
android:layout_marginEnd="@dimen/common_dp_10"
android:layout_marginRight="@dimen/common_dp_10"
android:scaleType="centerInside"
tools:src="@tools:sample/avatars"
/>
<TextView
android:id="@+id/item_custom_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textColor="@color/common_color_333333"
android:textSize="@dimen/common_sp_14"
tools:text="@tools:sample/full_names"
/>
</LinearLayout> almost the same as you demo, just remove some padding setting that not need in my case |
Hmm, that's weird. Or how about adding the below style to your theme? <item name="colorControlHighlight">@color/colorPrimary</item> |
@skydoves ...it's worked ..!! |
Great! :) |
@skydoves Oh..I'm sorry ...i just revert my code...actually..it's not work ....when i add |
if i called setCornerRadius(0f) ..both balloon and it's content has no radius |
Hi, could you please describe your specific issue again? |
it's right, |
@skydoves seems the issue is i don't know wether it is a issue or just you wanna design like this..but it's really a wired phenomena if user set background to balloon content . looking forward your better solution. |
It looks like when |
@skydoves em... /** corner radius for the clipping corners. */
@Px private var _radius: Float = 0f
var radius: Float
@Px get() = _radius
set(@Dp value) {
_radius = value.dp
invalidate()
} you are right...issue is here... |
A new stable |
happened in Latest version
just create a list as balloon content ,then add
android:background="?attr/selectableItemBackground"
on list item for click background statushowever, when i click first item or last item ..radius limit ripple background
that not expected .. only wanna radius on balloon not for content
The text was updated successfully, but these errors were encountered: