Android垂直进度条

Lok*_*dra 5 android android-layout android-studio

我该如何在Android中制作这种类型的进度栏。

示例链接 https://dribbble.com/shots/3231407-Progress-Bar-Animated

我想在具有相同设计的android应用程序中创建这种进度条。

小智 6

您可以使用默认进度条,只需将以下代码添加到 xml 中的进度条

style="?android:attr/progressBarStyleHorizontal"
android:rotation="270"
Run Code Online (Sandbox Code Playgroud)


Dil*_*nda 1

检查这个git 存储库。

在此输入图像描述

进度条(XML 组件)

<RelativeLayout
      android:id="@+id/parent_swipeable_view"
      android:layout_width="match_parent"
      android:layout_height="?attr/actionBarSize"
      android:background="@color/colorPrimary">

    <View
        android:id="@id/swipeable_view"
        android:layout_width="?attr/actionBarSize"
        android:layout_height="?attr/actionBarSize"
        android:background="@color/colorAccent"/>

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)

ProgressListener

swipeCoordinator.setProgressListener(new SwipeCoordinator.ProgressListener() {
  @Override public void onProgress(float progress) {
    tvAccepted.setScaleX(progress);
    tvAccepted.setScaleY(progress);
    tvAccepted.setAlpha(progress);
  }
});
Run Code Online (Sandbox Code Playgroud)

希望你在这里得到答案。