package cc.winboll.studio.powerbell.unittest;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import cc.winboll.studio.libappbase.GlobalApplication;
import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.powerbell.R;
import android.widget.Button;
import cc.winboll.studio.powerbell.MainActivity;
import android.content.Intent;

/**
 * @Author ZhanGSKen&豆包大模型<zhangsken@qq.com>
 * @Date 2025/11/19 18:16
 * @Describe BackgroundViewTestFragment
 */
public class BackgroundViewTestFragment extends Fragment {

    public static final String TAG = "BackgroundViewTestFragment";

	View mainView;

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
		//super.onCreateView(inflater, container, savedInstanceState);

		// 非调试状态就结束本线程
		if (!GlobalApplication.isDebugging()) {
			Thread.currentThread().destroy();
		}

		mainView = inflater.inflate(R.layout.fragment_test_backgroundview, container, false);
		
		((Button)mainView.findViewById(R.id.btn_main_activity)).setOnClickListener(new View.OnClickListener(){

				@Override
				public void onClick(View v) {
					getActivity().startActivity(new Intent(getActivity(), MainActivity.class));
				}
			});

		ToastUtils.show(String.format("%s onCreate", TAG));
		return mainView;
	}
}
