package com.navinfo.outdoor.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.WebActivity;
import com.navinfo.outdoor.base.BaseFragment;

/**
 * 关于页面的fragment
 */
public class AboutFragment extends BaseFragment implements View.OnClickListener {
    private ImageView ivAboutFinish;
    private RelativeLayout rlAbout;
    private RelativeLayout rlServe;
    private RelativeLayout rlPrivilege;

    public static AboutFragment newInstance(Bundle bundle) {
        AboutFragment fragment = new AboutFragment();
        fragment.setArguments(bundle);
        return fragment;
    }
    @Override
    protected int getLayout() {
        return R.layout.about_fragment;
    }

    @Override
    protected void initData() {
        super.initData();
    }

    @Override
    protected void initView() {
        super.initView();
        rlAbout = findViewById(R.id.rl_about);
        rlAbout.setOnClickListener(this::onClick);
        rlServe = findViewById(R.id.rl_serve);
        rlServe.setOnClickListener(this::onClick);
        rlPrivilege = findViewById(R.id.rl_privilege);
        rlPrivilege.setOnClickListener(this::onClick);
        ivAboutFinish =findViewById(R.id.iv_about_finish);
        ivAboutFinish.setOnClickListener(this::onClick);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.iv_about_finish:
                getActivity().finish();
                break;
            case R.id.rl_about:
                Intent intent = new Intent(getContext(), WebActivity.class);
                startActivity(intent);
                break;
            case R.id.rl_serve:
                Intent serveIntent = new Intent(getContext(), WebActivity.class);
                startActivity(serveIntent);
                break;
            case R.id.rl_privilege:
                Intent privilegeIntent = new Intent(getContext(), WebActivity.class);
                startActivity(privilegeIntent);
                break;
        }
    }
}
