loading动画更换

This commit is contained in:
huangjian
2022-07-14 14:35:11 +08:00
parent 78e530c776
commit 84fa1c74e1
30 changed files with 121 additions and 33 deletions

View File

@@ -1,8 +1,11 @@
package com.yizhuan.erban.ui.widget;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import androidx.appcompat.app.AppCompatDialog;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
@@ -29,9 +32,7 @@ public class LoadingDialog extends AppCompatDialog {
setContentView(R.layout.dialog_loading);
setCancelable(false);
setCanceledOnTouchOutside(false);
ivLoading = (ImageView) findViewById(R.id.iv_loading);
Animation animation = AnimationUtils.loadAnimation(context, R.anim.comm_loading);
ivLoading.setAnimation(animation);
animation.start();
ivLoading = findViewById(R.id.iv_loading);
((AnimationDrawable) ivLoading.getDrawable()).start();
}
}

View File

@@ -193,7 +193,8 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
boolean isNeedGiftItem,
boolean isNeedRoomItem,
GiftDialog.OnGiftDialogBtnClickListener listener) {
CommonLoadingDialog loadingDialog = new CommonLoadingDialog(context, "loading...").showDialog();
LoadingDialog loadingDialog = new LoadingDialog(context);
loadingDialog.show();
UserModel.get().getUserInfo(uid)
.compose(RxHelper.bindContext(context))
.subscribe(userInfo -> {

View File

@@ -1,8 +1,10 @@
package com.yizhuan.erban.ui.widget.dialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.Window;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.TextView;
@@ -18,6 +20,7 @@ public class CommonLoadingDialog extends BaseDialog {
private String msg = "加载中...";
private TextView tvTip;
private ImageView ivLoading;
public CommonLoadingDialog(Context context, String tip) {
super(context, R.style.dialog);
@@ -34,6 +37,8 @@ public class CommonLoadingDialog extends BaseDialog {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_progress_dialog);
ivLoading = findViewById(R.id.iv_loading);
((AnimationDrawable) ivLoading.getDrawable()).start();
tvTip = (TextView) findViewById(R.id.tv_tip);
tvTip.setText(msg);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item
android:drawable="@drawable/loading_000"
android:duration="50" />
<item
android:drawable="@drawable/loading_001"
android:duration="50" />
<item
android:drawable="@drawable/loading_002"
android:duration="50" />
<item
android:drawable="@drawable/loading_003"
android:duration="50" />
<item
android:drawable="@drawable/loading_004"
android:duration="50" />
<item
android:drawable="@drawable/loading_005"
android:duration="50" />
<item
android:drawable="@drawable/loading_006"
android:duration="50" />
<item
android:drawable="@drawable/loading_007"
android:duration="50" />
<item
android:drawable="@drawable/loading_008"
android:duration="50" />
<item
android:drawable="@drawable/loading_009"
android:duration="50" />
<item
android:drawable="@drawable/loading_010"
android:duration="50" />
<item
android:drawable="@drawable/loading_011"
android:duration="50" />
<item
android:drawable="@drawable/loading_012"
android:duration="50" />
<item
android:drawable="@drawable/loading_013"
android:duration="50" />
<item
android:drawable="@drawable/loading_014"
android:duration="50" />
<item
android:drawable="@drawable/loading_015"
android:duration="50" />
<item
android:drawable="@drawable/loading_016"
android:duration="50" />
<item
android:drawable="@drawable/loading_017"
android:duration="50" />
<item
android:drawable="@drawable/loading_018"
android:duration="50" />
<item
android:drawable="@drawable/loading_019"
android:duration="50" />
<item
android:drawable="@drawable/loading_020"
android:duration="50" />
<item
android:drawable="@drawable/loading_021"
android:duration="50" />
<item
android:drawable="@drawable/loading_022"
android:duration="50" />
<item
android:drawable="@drawable/loading_023"
android:duration="50" />
</animation-list>

View File

@@ -1,15 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="100dp"
android:layout_height="100dp"
android:background="@drawable/bg_dialog_loading"
tools:background="#000">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_loading"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_width="240dp"
android:layout_height="180dp"
android:scaleType="centerInside"
android:src="@drawable/loading_spinner" />
</RelativeLayout>
android:src="@drawable/anim_loading" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="16dp"
android:text="加载中…"
android:textColor="#ffc9bcf2"
android:textSize="16sp" />
</LinearLayout>

View File

@@ -1,34 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="180dp"
android:layout_height="180dp"
android:orientation="vertical"
android:gravity="center_horizontal"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:background="@color/black_transparent_10"
android:background="@drawable/bg_common_loading_dialog">
android:gravity="center_horizontal"
android:orientation="vertical"
tools:background="@color/black_transparent_10">
<com.yizhuan.erban.common.widget.dialog.LoadingImageView
<ImageView
android:id="@+id/iv_loading_icon"
android:src="@drawable/icon_loading_rotate"
android:scaleType="fitCenter"
android:layout_marginTop="68dp"
android:layout_width="@dimen/dp_26"
android:layout_height="@dimen/dp_26" />
android:layout_width="240dp"
android:layout_height="160dp"
android:src="@drawable/anim_loading" />
<TextView
android:id="@+id/tv_tip"
android:layout_width="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="@string/common_loading_tips"
android:layout_marginTop="@dimen/dp_16"
android:gravity="center_horizontal"
android:paddingLeft="12dp"
android:paddingRight="5dp"
android:singleLine="true"
android:textColor="@color/color_999999"
android:text="@string/common_loading_tips"
android:textColor="#C9BCF2"
android:textSize="14dp" />
</LinearLayout>