Update Balloon library (#5584)

This commit is contained in:
Taco 2022-01-04 05:37:26 -05:00 committed by GitHub
parent 8568226468
commit 6154c8a282
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 29 deletions

View File

@ -155,7 +155,7 @@ dependencies {
implementation "com.github.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion"
implementation 'com.github.mfietz:fyydlin:v0.5.0'
implementation 'com.github.ByteHamster:SearchPreference:v2.0.0'
implementation 'com.github.skydoves:balloon:1.1.5'
implementation 'com.github.skydoves:balloon:1.4.0'
implementation 'com.github.xabaras:RecyclerViewSwipeDecorator:1.3'
implementation 'com.annimon:stream:1.2.2'

View File

@ -22,6 +22,7 @@ import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.google.android.material.snackbar.Snackbar;
import com.skydoves.balloon.ArrowOrientation;
import com.skydoves.balloon.ArrowOrientationRules;
import com.skydoves.balloon.Balloon;
import com.skydoves.balloon.BalloonAnimation;
import de.danoeh.antennapod.R;
@ -191,9 +192,11 @@ public class ItemFragment extends Fragment {
== View.LAYOUT_DIRECTION_RTL;
Balloon balloon = new Balloon.Builder(getContext())
.setArrowOrientation(ArrowOrientation.TOP)
.setArrowOrientationRules(ArrowOrientationRules.ALIGN_FIXED)
.setArrowPosition(0.25f + ((isLocaleRtl ^ offerStreaming) ? 0f : 0.5f))
.setWidthRatio(1.0f)
.isRtlSupport(true)
.setMarginLeft(8)
.setMarginRight(8)
.setBackgroundColor(ThemeUtils.getColorFromAttr(getContext(), R.attr.colorSecondary))
.setBalloonAnimation(BalloonAnimation.OVERSHOOT)
.setLayout(R.layout.popup_bubble_view)

View File

@ -1,40 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:layout_width="match_parent"
android:textColor="?attr/colorOnSecondary"
android:layout_height="wrap_content"
android:lines="3"
android:id="@+id/balloon_message"/>
android:id="@+id/balloon_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="?attr/colorOnSecondary"
android:lines="3" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="end">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="4dp"
android:gravity="end">
<Button
style="@style/Widget.MaterialComponents.Button.TextButton"
android:textColor="?attr/colorOnSecondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/no"
android:id="@+id/balloon_button_negative"/>
android:id="@+id/balloon_button_negative"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:textColor="?attr/colorOnSecondary"
android:text="@string/no"
style="@style/Widget.MaterialComponents.Button.TextButton" />
<Button
style="@style/Widget.MaterialComponents.Button.TextButton"
android:textColor="?attr/colorOnSecondary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/yes"
android:id="@+id/balloon_button_positive"/>
android:id="@+id/balloon_button_positive"
android:layout_width="wrap_content"
android:layout_height="36dp"
android:textColor="?attr/colorOnSecondary"
android:text="@string/yes"
style="@style/Widget.MaterialComponents.Button.TextButton" />
</LinearLayout>
</LinearLayout>