<commit_before>package tech.zafrani.companionforpubg.fragments;

import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.View;

import butterknife.BindView;
import tech.zafrani.companionforpubg.PUBGApplication;
import tech.zafrani.companionforpubg.R;
import tech.zafrani.companionforpubg.adapters.ItemTabAdapter;

public class ItemFragment extends BaseFragment {

    public static String TAG = ItemFragment.class.getSimpleName();

    @BindView(R.id.fragment_item_viewpager)
    ViewPager viewPager;

    @BindView(R.id.fragment_item_tablayout)
    TabLayout tabLayout;

    @Override
    protected int getLayoutRes() {
        return R.layout.fragment_item;
    }

    @Override
    public void onViewCreated(final View view, @Nullable final Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        Log.e(getClass().getSimpleName(), PUBGApplication.getInstance().getItems().toString());
        viewPager.setAdapter(new ItemTabAdapter(getChildFragmentManager()));
        tabLayout.setupWithViewPager(viewPager);
        showDisclaimerForFirstTime();
    }

    //todo remove this after data is updated
    private void showDisclaimerForFirstTime() {
        final SharedPreferences preferences = getActivity().getSharedPreferences("temp", Context.MODE_PRIVATE);
        final String hasShown = "hasShown";
        if (preferences.getBoolean(hasShown, false)) {
            return;
        }

        AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
                .setTitle("This is still in beta!")
                .setMessage("Data is not yet finished nor complete. Please help us via Github. Links available in the drawer.")<commit_msg>Added @nullable to Item fragment views<commit_after>package tech.zafrani.companionforpubg.fragments;

import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AlertDialog;
import android.util.Log;
import android.view.View;

import butterknife.BindView;
import tech.zafrani.companionforpubg.PUBGApplication;
import tech.zafrani.companionforpubg.R;
import tech.zafrani.companionforpubg.adapters.ItemTabAdapter;

public class ItemFragment extends BaseFragment {

    public static String TAG = ItemFragment.class.getSimpleName();

    @Nullable
    @BindView(R.id.fragment_item_viewpager)
    ViewPager viewPager;

    @Nullable
    @BindView(R.id.fragment_item_tablayout)
    TabLayout tabLayout;

    @Override
    protected int getLayoutRes() {
        return R.layout.fragment_item;
    }

    @Override
    public void onViewCreated(final View view, @Nullable final Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        Log.e(getClass().getSimpleName(), PUBGApplication.getInstance().getItems().toString());
        if (viewPager != null) {
            viewPager.setAdapter(new ItemTabAdapter(getChildFragmentManager()));
            if(tabLayout != null) {
                tabLayout.setupWithViewPager(viewPager);
            }
        }
        showDisclaimerForFirstTime();
    }

    //todo remove this after data is updated
    private void showDisclaimerForFirstTime() {
        final SharedPreferences preferences = getActivity().getSharedPreferences("temp", Context.MODE_PRIVATE);
        final String hasShown = "hasShown";
        if (preferences.getBoolean(hasShown, false)) {
            return;
        }

        AlertDialog alertDialog = new AlertDialog.Builder(getActivity())
                .setTitle("This is still in beta!")
                .setMessage("Data is not yet finished nor complete. Please help us via Github. Links available in the drawer.")
{'fraction_non_alphanumeric': 0.09066859066859066, 'fraction_numerical': 0.000962000962000962, 'mean_word_length': 3.8192352259559676, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1696671', 'n_tokens_mistral': 1173, 'n_tokens_neox': 1124, 'n_words': 249}