package com.navinfo.outdoor.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;


import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.base.BaseFragment;


/**
 * 发现的Fragment
 * 2021-5-25
 */
public class FindFragment extends BaseFragment implements View.OnClickListener{

    private LinearLayout linear_task_prefecture;//任务专区
    private LinearLayout linear_task_explain;//任务说明
    private LinearLayout linearEnd;
    private LinearLayout linear_event_prefecture;

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

    @Override
    protected void initView() {
        super.initView();
        linear_event_prefecture = findViewById(R.id.linear_event_prefecture);
        linear_event_prefecture.setOnClickListener(this::onClick);
        linear_task_prefecture =findViewById(R.id.linear_task_prefecture);
        linear_task_prefecture.setOnClickListener(this::onClick);
        linear_task_explain =findViewById(R.id.linear_task_explain);
        linear_task_explain.setOnClickListener(this::onClick);
        linearEnd = findViewById(R.id.linear_end);
        linearEnd.setOnClickListener(this::onClick);
    }

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

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.linear_task_prefecture:
                Intent prefectureIntent = new Intent(getActivity(), FragmentManagement.class);
                prefectureIntent.putExtra("tag", 7);
                startActivity(prefectureIntent);
                break;
            case R.id.linear_task_explain:
                Intent explainIntent = new Intent(getActivity(), FragmentManagement.class);
                explainIntent.putExtra("tag", 8);
                startActivity(explainIntent);
                break;
            case R.id.linear_event_prefecture:
                Intent eventIntent = new Intent(getActivity(), FragmentManagement.class);
                eventIntent.putExtra("tag",9);
                startActivity(eventIntent);
                break;
            case R.id.linear_end:
                Intent endIntent = new Intent(getActivity(), FragmentManagement.class);
                endIntent.putExtra("tag", 11);
                startActivity(endIntent);
                break;

        }
    }
}
