wjc
2025-04-10 e0ca0f4d1d079557fbb2367d8ca18f5d75f36235
app/src/main/java/com/hdl/photovoltaic/widget/LoadingDialog.java
@@ -1,14 +1,14 @@
package com.hdl.photovoltaic.widget;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.base.BaseDialog;
@@ -29,12 +29,20 @@
        setCancelable(true);//系统后退可以取消
        setCanceledOnTouchOutside(false);
        setContentView(R.layout.loading_alert);
        content = (TextView) findViewById(R.id.load_content_tv);
        WindowManager.LayoutParams params = getWindow().getAttributes();
        params.width = WindowManager.LayoutParams.WRAP_CONTENT;
        params.height = WindowManager.LayoutParams.WRAP_CONTENT;
        getWindow().setAttributes(params);
        try {
            content = (TextView) findViewById(R.id.load_content_tv);
            ImageView imageView = (ImageView) findViewById(R.id.load_pb);
            WindowManager.LayoutParams params = getWindow().getAttributes();
            params.width = WindowManager.LayoutParams.WRAP_CONTENT;
            params.height = WindowManager.LayoutParams.WRAP_CONTENT;
            getWindow().setAttributes(params);
            Glide.with(context)
//                .asBitmap() // 强制作为静态图片加载
                    .load(R.drawable.loading)
                    .into(imageView);
//        content.setText(R.string.device_加载中);
        } catch (Exception e) {
        }
    }
    public void setText(String mes) {