<commit_before>package net.yasme.android.ui;

import android.app.ListFragment;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;

import net.yasme.android.R;
import net.yasme.android.asyncTasks.GetChatListTask;
import net.yasme.android.asyncTasks.GetProfileDataTask;
import net.yasme.android.asyncTasks.UpdateDBTask;
import net.yasme.android.controller.NotifiableFragment;
import net.yasme.android.controller.NotifyFragmentParameter;
import net.yasme.android.controller.ObserverRegistry;
import net.yasme.android.entities.Chat;

import java.util.ArrayList;

/**
 * Created by martin on 21.06.2014.
 */
public class ChatListFragment extends ListFragment implements NotifiableFragment<NotifyFragmentParameter> {

       private AbstractYasmeActivity activity;
       private ArrayList<Chat> chatRooms = new ArrayList<Chat>();
       private ChatListAdapter adapter;

       public ChatListFragment() {

       }

       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           activity = (AbstractYasmeActivity)getActivity();
           adapter = new ChatListAdapter(activity, R.layout.chatlist_item, chatRooms);
           setListAdapter(adapter);

            //Register at observer
           //ChatListParam test = new ChatListParam(null);
           ObserverRegistry.getRegistry(ObserverRegistry.Observers.CHATLISTFRAGMENT).register(this);

           new GetProfileDataTask(activity.getApplicationContext(), this, activity.storage)
                   .execute(Long.toString(activity.getUserId()), activity.getAccessToken(),
                           activity.getUserMail());

           //Aktualisiert die Datenbank auf den aktuellen Stand des Servers
           new UpdateDBTask(activity.getApplicationContext(), activity.storage)
                   .execute(Long.toString(activity.getUserId()), activity.getAccessToken());
           //Laedt die Liste aller Chats von der Datenbank in das Fragment<commit_msg>fixed some merge errors<commit_after>package net.yasme.android.ui;

import android.app.ListFragment;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ListView;

import net.yasme.android.R;
import net.yasme.android.asyncTasks.GetChatListTask;
import net.yasme.android.asyncTasks.GetProfileDataTask;
import net.yasme.android.asyncTasks.UpdateDBTask;
import net.yasme.android.controller.NotifiableFragment;
import net.yasme.android.controller.NotifyFragmentParameter;
import net.yasme.android.controller.ObserverRegistry;
import net.yasme.android.entities.Chat;

import java.util.ArrayList;

/**
 * Created by martin on 21.06.2014.
 */
public class ChatListFragment extends ListFragment implements NotifiableFragment<NotifyFragmentParameter> {

       private AbstractYasmeActivity activity;
       private ArrayList<Chat> chatRooms = new ArrayList<Chat>();
       private ChatListAdapter adapter;

       public ChatListFragment() {

       }

       @Override
       public void onCreate(Bundle savedInstanceState) {
           super.onCreate(savedInstanceState);
           activity = (AbstractYasmeActivity)getActivity();
           adapter = new ChatListAdapter(activity, R.layout.chatlist_item, chatRooms);
           setListAdapter(adapter);

            //Register at observer
           //ChatListParam test = new ChatListParam(null);
           ObserverRegistry.getRegistry(ObserverRegistry.Observers.CHATLISTFRAGMENT).register(this);

           //holt vor allem den Namen des Users ab
           new GetProfileDataTask(activity.storage).execute();
           //Aktualisiert die Datenbank auf den aktuellen Stand des Servers
           new UpdateDBTask(activity.getApplicationContext(), activity.storage)
                   .execute(Long.toString(activity.getUserId()), activity.getAccessToken());
           //Laedt die Liste aller Chats von der Datenbank in das Fragment
{'fraction_non_alphanumeric': 0.08798017348203221, 'fraction_numerical': 0.003965303593556382, 'mean_word_length': 3.6390804597701147, 'pattern_counts': {'":': 0, '<': 9, '<?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': '137232', 'n_tokens_mistral': 1081, 'n_tokens_neox': 1051, 'n_words': 227}