loading动画更换
@@ -1,8 +1,11 @@
|
|||||||
package com.yizhuan.erban.ui.widget;
|
package com.yizhuan.erban.ui.widget;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatDialog;
|
import androidx.appcompat.app.AppCompatDialog;
|
||||||
|
|
||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@@ -29,9 +32,7 @@ public class LoadingDialog extends AppCompatDialog {
|
|||||||
setContentView(R.layout.dialog_loading);
|
setContentView(R.layout.dialog_loading);
|
||||||
setCancelable(false);
|
setCancelable(false);
|
||||||
setCanceledOnTouchOutside(false);
|
setCanceledOnTouchOutside(false);
|
||||||
ivLoading = (ImageView) findViewById(R.id.iv_loading);
|
ivLoading = findViewById(R.id.iv_loading);
|
||||||
Animation animation = AnimationUtils.loadAnimation(context, R.anim.comm_loading);
|
((AnimationDrawable) ivLoading.getDrawable()).start();
|
||||||
ivLoading.setAnimation(animation);
|
|
||||||
animation.start();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -193,7 +193,8 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
|||||||
boolean isNeedGiftItem,
|
boolean isNeedGiftItem,
|
||||||
boolean isNeedRoomItem,
|
boolean isNeedRoomItem,
|
||||||
GiftDialog.OnGiftDialogBtnClickListener listener) {
|
GiftDialog.OnGiftDialogBtnClickListener listener) {
|
||||||
CommonLoadingDialog loadingDialog = new CommonLoadingDialog(context, "loading...").showDialog();
|
LoadingDialog loadingDialog = new LoadingDialog(context);
|
||||||
|
loadingDialog.show();
|
||||||
UserModel.get().getUserInfo(uid)
|
UserModel.get().getUserInfo(uid)
|
||||||
.compose(RxHelper.bindContext(context))
|
.compose(RxHelper.bindContext(context))
|
||||||
.subscribe(userInfo -> {
|
.subscribe(userInfo -> {
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
package com.yizhuan.erban.ui.widget.dialog;
|
package com.yizhuan.erban.ui.widget.dialog;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.AnimationDrawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
@@ -18,6 +20,7 @@ public class CommonLoadingDialog extends BaseDialog {
|
|||||||
private String msg = "加载中...";
|
private String msg = "加载中...";
|
||||||
|
|
||||||
private TextView tvTip;
|
private TextView tvTip;
|
||||||
|
private ImageView ivLoading;
|
||||||
|
|
||||||
public CommonLoadingDialog(Context context, String tip) {
|
public CommonLoadingDialog(Context context, String tip) {
|
||||||
super(context, R.style.dialog);
|
super(context, R.style.dialog);
|
||||||
@@ -34,6 +37,8 @@ public class CommonLoadingDialog extends BaseDialog {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.layout_progress_dialog);
|
setContentView(R.layout.layout_progress_dialog);
|
||||||
|
ivLoading = findViewById(R.id.iv_loading);
|
||||||
|
((AnimationDrawable) ivLoading.getDrawable()).start();
|
||||||
tvTip = (TextView) findViewById(R.id.tv_tip);
|
tvTip = (TextView) findViewById(R.id.tv_tip);
|
||||||
tvTip.setText(msg);
|
tvTip.setText(msg);
|
||||||
}
|
}
|
||||||
|
BIN
app/src/main/res/drawable-xhdpi/loading_000.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_001.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_002.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_003.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_004.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_005.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_006.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_007.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_008.png
Normal file
After Width: | Height: | Size: 9.6 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_009.png
Normal file
After Width: | Height: | Size: 9.8 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_010.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_011.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_012.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_013.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_014.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_015.png
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_016.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_017.png
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_018.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_019.png
Normal file
After Width: | Height: | Size: 9.9 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_020.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_021.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_022.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
app/src/main/res/drawable-xhdpi/loading_023.png
Normal file
After Width: | Height: | Size: 10 KiB |
77
app/src/main/res/drawable/anim_loading.xml
Normal 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>
|
@@ -1,15 +1,24 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="100dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="100dp"
|
android:layout_gravity="center"
|
||||||
android:background="@drawable/bg_dialog_loading"
|
android:orientation="vertical">
|
||||||
tools:background="#000">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_loading"
|
android:id="@+id/iv_loading"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="240dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="180dp"
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/loading_spinner" />
|
android:src="@drawable/anim_loading" />
|
||||||
</RelativeLayout>
|
|
||||||
|
<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>
|
||||||
|
@@ -1,34 +1,29 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<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"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
tools:background="@color/black_transparent_10"
|
android:gravity="center_horizontal"
|
||||||
android:background="@drawable/bg_common_loading_dialog">
|
android:orientation="vertical"
|
||||||
|
tools:background="@color/black_transparent_10">
|
||||||
|
|
||||||
|
|
||||||
<com.yizhuan.erban.common.widget.dialog.LoadingImageView
|
<ImageView
|
||||||
android:id="@+id/iv_loading_icon"
|
android:id="@+id/iv_loading_icon"
|
||||||
android:src="@drawable/icon_loading_rotate"
|
android:layout_width="240dp"
|
||||||
android:scaleType="fitCenter"
|
android:layout_height="160dp"
|
||||||
android:layout_marginTop="68dp"
|
android:src="@drawable/anim_loading" />
|
||||||
android:layout_width="@dimen/dp_26"
|
|
||||||
android:layout_height="@dimen/dp_26" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_tip"
|
android:id="@+id/tv_tip"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_10"
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
android:text="@string/common_loading_tips"
|
|
||||||
android:gravity="center_horizontal"
|
android:gravity="center_horizontal"
|
||||||
android:paddingLeft="12dp"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="@color/color_999999"
|
android:text="@string/common_loading_tips"
|
||||||
|
android:textColor="#C9BCF2"
|
||||||
android:textSize="14dp" />
|
android:textSize="14dp" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|