<commit_before>package ckmah.mangoreader.fragment;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.william.mangoreader.R;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import ckmah.mangoreader.activity.BrowseMangaActivity;
import ckmah.mangoreader.adapter.CardLayoutAdapter;
import ckmah.mangoreader.adapter.GenreTextAdapter;
import ckmah.mangoreader.database.Manga;
import ckmah.mangoreader.parse.MangaEden;
import retrofit.Callback;
import retrofit.Response;
import retrofit.Retrofit;

public class BrowseMangaFragment extends Fragment {

    private View rootView;
    private View contentView;

    private CardLayoutAdapter updatesCardAdapter;
    private CardLayoutAdapter popularCardAdapter;
    private CardLayoutAdapter alphabetCardAdapter;

    private SwipeRefreshLayout swipeRefreshLayout;

    // In-memory list of all manga, period
    public static List<Manga> allManga = new ArrayList<>();

    public BrowseMangaFragment() {
        // Required empty public constructor
    }

    private static BrowseMangaFragment instance;

    public static BrowseMangaFragment getInstance() {
        if (instance == null) {
            instance = new BrowseMangaFragment();
        }
        return instance;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, final ViewGroup container,
                             Bundle savedInstanceState) {

        rootView = inflater.inflate(R.layout.fragment_browse_manga_fancy, container, false);
        contentView = rootView.findViewById(R.id.browse_content);
        initSwipeRefresh();
        initRecyclerViews();

        if (allManga.size() > 0) {
            // If allManga is already populated, just display them
            sortAdapterData();

        } else {
            contentView.setVisibility(View.GONE);<commit_msg>Hide placeholders when not refreshing<commit_after>package ckmah.mangoreader.fragment;

import android.app.Activity;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.william.mangoreader.R;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import ckmah.mangoreader.activity.BrowseMangaActivity;
import ckmah.mangoreader.adapter.CardLayoutAdapter;
import ckmah.mangoreader.adapter.GenreTextAdapter;
import ckmah.mangoreader.database.Manga;
import ckmah.mangoreader.parse.MangaEden;
import retrofit.Callback;
import retrofit.Response;
import retrofit.Retrofit;

public class BrowseMangaFragment extends Fragment {

    private View rootView;
    private View contentView;

    private CardLayoutAdapter updatesCardAdapter;
    private CardLayoutAdapter popularCardAdapter;
    private CardLayoutAdapter alphabetCardAdapter;

    private SwipeRefreshLayout swipeRefreshLayout;

    // In-memory list of all manga, period
    public static List<Manga> allManga = new ArrayList<>();

    public BrowseMangaFragment() {
        // Required empty public constructor
    }

    private static BrowseMangaFragment instance;

    public static BrowseMangaFragment getInstance() {
        if (instance == null) {
            instance = new BrowseMangaFragment();
        }
        return instance;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, final ViewGroup container,
                             Bundle savedInstanceState) {

        rootView = inflater.inflate(R.layout.fragment_browse_manga_fancy, container, false);
        contentView = rootView.findViewById(R.id.browse_content);
        initSwipeRefresh();
        initRecyclerViews();

        if (allManga.size() > 0) {
            // If allManga is already populated, just display them and hide the placeholders
            sortAdapterData();
            replacePlaceholders();
        } else {
            contentView.setVisibility(View.GONE);
{'fraction_non_alphanumeric': 0.08008573655494934, 'fraction_numerical': 0.002338269680436477, 'mean_word_length': 3.837888784165881, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '679611', 'n_tokens_mistral': 1477, 'n_tokens_neox': 1410, 'n_words': 318}