wjc
2025-05-07 b9cc7390e8e8ce64c41c26fb369c98ce669d660c
app/src/main/java/com/hdl/photovoltaic/widget/LoadingDialog.java
@@ -1,8 +1,6 @@
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;
@@ -31,17 +29,20 @@
        setCancelable(true);//系统后退可以取消
        setCanceledOnTouchOutside(false);
        setContentView(R.layout.loading_alert);
        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)
        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);
                    .load(R.drawable.loading)
                    .into(imageView);
//        content.setText(R.string.device_加载中);
        } catch (Exception e) {
        }
    }
    public void setText(String mes) {