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.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion"
implementation 'com.github.mfietz:fyydlin:v0.5.0' implementation 'com.github.mfietz:fyydlin:v0.5.0'
implementation 'com.github.ByteHamster:SearchPreference:v2.0.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.github.xabaras:RecyclerViewSwipeDecorator:1.3'
implementation 'com.annimon:stream:1.2.2' 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.bumptech.glide.request.RequestOptions;
import com.google.android.material.snackbar.Snackbar; import com.google.android.material.snackbar.Snackbar;
import com.skydoves.balloon.ArrowOrientation; import com.skydoves.balloon.ArrowOrientation;
import com.skydoves.balloon.ArrowOrientationRules;
import com.skydoves.balloon.Balloon; import com.skydoves.balloon.Balloon;
import com.skydoves.balloon.BalloonAnimation; import com.skydoves.balloon.BalloonAnimation;
import de.danoeh.antennapod.R; import de.danoeh.antennapod.R;
@ -191,9 +192,11 @@ public class ItemFragment extends Fragment {
== View.LAYOUT_DIRECTION_RTL; == View.LAYOUT_DIRECTION_RTL;
Balloon balloon = new Balloon.Builder(getContext()) Balloon balloon = new Balloon.Builder(getContext())
.setArrowOrientation(ArrowOrientation.TOP) .setArrowOrientation(ArrowOrientation.TOP)
.setArrowOrientationRules(ArrowOrientationRules.ALIGN_FIXED)
.setArrowPosition(0.25f + ((isLocaleRtl ^ offerStreaming) ? 0f : 0.5f)) .setArrowPosition(0.25f + ((isLocaleRtl ^ offerStreaming) ? 0f : 0.5f))
.setWidthRatio(1.0f) .setWidthRatio(1.0f)
.isRtlSupport(true) .setMarginLeft(8)
.setMarginRight(8)
.setBackgroundColor(ThemeUtils.getColorFromAttr(getContext(), R.attr.colorSecondary)) .setBackgroundColor(ThemeUtils.getColorFromAttr(getContext(), R.attr.colorSecondary))
.setBalloonAnimation(BalloonAnimation.OVERSHOOT) .setBalloonAnimation(BalloonAnimation.OVERSHOOT)
.setLayout(R.layout.popup_bubble_view) .setLayout(R.layout.popup_bubble_view)

View File

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