<commit_before>package app.ddf.danskdatahistoriskforening;

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.HorizontalScrollView;
import android.widget.TextView;

import org.json.JSONException;
import org.json.JSONObject;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;


public class ItemDetails extends Fragment {

    private String detailsURI;
    private TextView itemheadlineView;
    private HorizontalScrollView imageScrollView;
    private TextView itemdescriptionView;
    private TextView receivedView;
    private TextView datingFromView;
    private TextView datingToView;
    private TextView donatorView;
    private TextView producerView;
    private TextView postNummerView;
    protected Item currentItem;

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

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

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View layout = inflater.inflate(R.layout.fragment_item_details, container, false);

        itemheadlineView = (TextView) layout.findViewById(R.id.itemheadline);
        imageScrollView = (HorizontalScrollView) layout.findViewById(R.id.imageScrollView);
        itemdescriptionView = (TextView) layout.findViewById(R.id.itemdescription);
        receivedView = (TextView) layout.findViewById(R.id.received);
        datingFromView = (TextView) layout.findViewById(R.id.datingFrom);
        datingToView = (TextView) layout.findViewById(R.id.datingTo);
        donatorView = (TextView) layout.findViewById(R.id.donator);
        producerView = (TextView) layout.findViewById(R.id.producer);
        postNummerView = (TextView) layout.findViewById(R.id.postNummer);

        return layout;
    }

    public void setDetailsURI(String detailsURI){
        this.detailsURI = detailsURI;

        new AsyncTask<String, Void, Item>() {
            @Override
            protected Item doInBackground(String ... params) {
                return new tempDAO().getDetailsFromBackEnd(params[0]);
            }

            @Override
            protected void onPostExecute(Item data) {
                if (data != null){
                    currentItem = data;
                    // felterne udfyld felterne
                    itemheadlineView.setText(currentItem.getItemHeadline());
                    // TODO handle billeder og lyd
                    itemdescriptionView.setText(currentItem.getItemDescription());
                    receivedView.setText(((currentItem.getItemRecievedAsString() == null) ? null : currentItem.getItemRecievedAsString()));
                    datingFromView.setText(((currentItem.getItemDatingFromAsString() == null) ? null : currentItem.getItemDatingFromAsString()));
                    datingToView.setText(((currentItem.getItemDatingToAsString() == null) ? null : currentItem.getItemDatingToAsString()));
                    donatorView.setText(currentItem.getDonator());
                    producerView.setText(currentItem.getProducer());
                    postNummerView.setText(currentItem.getPostalCode());
                }
            }
        }.execute(detailsURI);

    }

    public String getDetailsURI(){
        return this.detailsURI;
    }
}<commit_msg>#2 Added to do<commit_after>package app.ddf.danskdatahistoriskforening;

import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.HorizontalScrollView;
import android.widget.TextView;

import org.json.JSONException;
import org.json.JSONObject;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;


public class ItemDetails extends Fragment {

    private String detailsURI;
    private TextView itemheadlineView;
    private HorizontalScrollView imageScrollView;
    private TextView itemdescriptionView;
    private TextView receivedView;
    private TextView datingFromView;
    private TextView datingToView;
    private TextView donatorView;
    private TextView producerView;
    private TextView postNummerView;
    protected Item currentItem;

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

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

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View layout = inflater.inflate(R.layout.fragment_item_details, container, false);

        itemheadlineView = (TextView) layout.findViewById(R.id.itemheadline);
        imageScrollView = (HorizontalScrollView) layout.findViewById(R.id.imageScrollView);
        itemdescriptionView = (TextView) layout.findViewById(R.id.itemdescription);
        receivedView = (TextView) layout.findViewById(R.id.received);
        datingFromView = (TextView) layout.findViewById(R.id.datingFrom);
        datingToView = (TextView) layout.findViewById(R.id.datingTo);
        donatorView = (TextView) layout.findViewById(R.id.donator);
        producerView = (TextView) layout.findViewById(R.id.producer);
        postNummerView = (TextView) layout.findViewById(R.id.postNummer);

        return layout;
    }

    public void setDetailsURI(String detailsURI){
        this.detailsURI = detailsURI;

        new AsyncTask<String, Void, Item>() {
            @Override
            protected Item doInBackground(String ... params) {
                return new tempDAO().getDetailsFromBackEnd(params[0]);
            }

            @Override
            protected void onPostExecute(Item data) {
                if (data != null){
                    currentItem = data;
                    // felterne udfyld felterne
                    itemheadlineView.setText(currentItem.getItemHeadline());
                    // TODO handle billeder og lyd
                    itemdescriptionView.setText(currentItem.getItemDescription());
                    receivedView.setText(((currentItem.getItemRecievedAsString() == null) ? null : currentItem.getItemRecievedAsString()));
                    datingFromView.setText(((currentItem.getItemDatingFromAsString() == null) ? null : currentItem.getItemDatingFromAsString()));
                    datingToView.setText(((currentItem.getItemDatingToAsString() == null) ? null : currentItem.getItemDatingToAsString()));
                    donatorView.setText(currentItem.getDonator());
                    producerView.setText(currentItem.getProducer());
                    postNummerView.setText(currentItem.getPostalCode());
                } else {
                    //TODO ERROR HANDLING FOR data = null
                }
            }
        }.execute(detailsURI);

    }

    public String getDetailsURI(){
        return this.detailsURI;
    }
}
{'fraction_non_alphanumeric': 0.08888277380297194, 'fraction_numerical': 0.0006879471656576775, 'mean_word_length': 2.8137460650577126, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1919276', 'n_tokens_mistral': 1895, 'n_tokens_neox': 1805, 'n_words': 370}