package com.swiftcleaner.chovey.view.fragment;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatButton;
import androidx.fragment.app.Fragment;

import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.swiftcleaner.chovey.business.newAdmob.AdmobHelps;
import com.swiftcleaner.chovey.R;
import com.swiftcleaner.chovey.view.activity.GuideActivity2;

import io.reactivex.rxjava3.annotations.Nullable;

public class GuideTwoFragment extends Fragment {

    private AppCompatButton buttonNext;
    private FrameLayout nativeView;
    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_guide_two, container, false);
        buttonNext = view.findViewById(R.id.two_button);
        nativeView = view.findViewById(R.id.fl_ad);



        buttonNext.setOnClickListener(v -> {
            // 通知Activity切换到下一个页面
//            if (getActivity() instanceof GuideActivity2) {
//                ((GuideActivity2) getActivity()).nextPage();
//            }
        });
        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
        Log.d("showNativeAd","111");
//        AdmobHelps.INSTANCE.showNativeAd(requireActivity(),nativeView,R.layout.layout_ad_native_small,AdmobHelps.INSTANCE.isShowAdNativeBottom(),false);
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        buttonNext = null;
    }
}