<commit_before>package org.pocketcampus.plugin.directory.android.ui;

import org.pocketcampus.R;
import org.pocketcampus.android.platform.sdk.tracker.Tracker;
import org.pocketcampus.android.platform.sdk.utils.LoaderImageView;
import org.pocketcampus.plugin.directory.android.DirectoryResultListView;
import org.pocketcampus.plugin.directory.shared.Person;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class PersonDetailsDialog extends Dialog implements OnClickListener {

	Context ctx_;

	Person displayedPerson_;

	TextView title_;
	TextView fname_;
	TextView lname_;
	TextView mail_;
	TextView office_;
	TextView officePhone_;
	TextView phone_;
	TextView web_;
	TextView ou_;
	
	static int clickCount = 0;

	public PersonDetailsDialog(Context context, Person person) {
		super(context);

		ctx_ = context;
		displayedPerson_ = person;
		

		build();
		setContent(person);
		setClickListener();

	}

	public void loadPicture() {
		LoaderImageView liv = (LoaderImageView) findViewById(R.id.directory_person_details_dialog_photo);
		if (liv == null) {
			Log.d("Directory", "loaderImageView in the layout is null");
			return;
		}

		if (displayedPerson_.pictureUrl != null) {
			liv.setImageDrawable(displayedPerson_.pictureUrl);

			liv.setVisibility(View.VISIBLE);
		} else {
			liv.setVisibility(View.GONE);
		}

	}

	private void build() {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		// setTitle(ctx_.getResources().getString(R.string.directory_person_details_dialog_tile));
		setContentView(R.layout.directory_details_dialog);
		getWindow().setLayout(LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT);
		setCanceledOnTouchOutside(true);
	}

	private void setContent(Person p) {
		title_ = (TextView) findViewById(R.id.directory_person_details_title_dialog);
		title_.setText(p.getFirstName() + " " + p.getLastName());

		// lname_ = (TextView)
		// findViewById(R.id.directory_person_details_dialog_lname);
		// lname_.setText(p.getLastName());
		//
		// fname_ = (TextView)
		// findViewById(R.id.directory_person_details_dialog_fname);
		// fname_.setText(p.getFirstName() + " ");

		mail_ = (TextView) findViewById(R.id.directory_person_details_dialog_mail);
		mail_.setVisibility(visibility(p.isSetEmail()));
		mail_.setText(p.email);

		office_ = (TextView) findViewById(R.id.directory_person_details_dialog_office);
		office_.setVisibility(visibility(p.isSetOffice()));
		office_.setText(p.office);

		phone_ = (TextView) findViewById(R.id.directory_person_details_dialog_phone_number);
		phone_.setVisibility(visibility(p.isSetPrivatePhoneNumber()));
		phone_.setText(p.privatePhoneNumber);

		officePhone_ = (TextView) findViewById(R.id.directory_person_details_dialog_office_phone_number);
		officePhone_.setVisibility(visibility(p.isSetOfficePhoneNumber()));
		officePhone_.setText(p.officePhoneNumber);

		// web_ = (TextView)
		// findViewById(R.id.directory_person_details_dialog_web);
		// web_.setVisibility(visibility(p.isSetWeb()));
		// web_.setText(p.web);

		ou_ = (TextView) findViewById(R.id.directory_person_details_dialog_ou);
		ou_.setVisibility(visibility(p.isSetOrganisationalUnit()));
		String multipleLinesOU = "";
		for (String s : p.OrganisationalUnit) {
			multipleLinesOU += (s + "\n");
			System.out.println(s);
		}
		multipleLinesOU.substring(0, multipleLinesOU.length() - 1);
		ou_.setText(multipleLinesOU);
	}

	private int visibility(boolean hasMail) {
		return hasMail ? View.VISIBLE : View.GONE;
	}

	private void setClickListener() {
		Button mailButton = (Button) findViewById(R.id.directory_imageButton_mail);
		Button phoneButton = (Button) findViewById(R.id.directory_imageButton_call);
		Button mapButton = (Button)findViewById(R.id.directory_imageButton_map);
		Button webButton = (Button) findViewById(R.id.directory_imageButton_web);

		mailButton.setVisibility(visibility(displayedPerson_.isSetEmail()));
		phoneButton.setVisibility(visibility(displayedPerson_.isSetOfficePhoneNumber()));
		System.out.println(mapButton);
		mapButton.setVisibility(visibility(displayedPerson_.isSetOffice()));
		webButton.setVisibility(visibility(displayedPerson_.isSetWeb()));

		mailButton.setOnClickListener(this);
		phoneButton.setOnClickListener(this);
		mapButton.setOnClickListener(this);
		webButton.setOnClickListener(this);
	}
<commit_msg><directory> not ready to open the map for now<commit_after>package org.pocketcampus.plugin.directory.android.ui;

import org.pocketcampus.R;
import org.pocketcampus.android.platform.sdk.tracker.Tracker;
import org.pocketcampus.android.platform.sdk.utils.LoaderImageView;
import org.pocketcampus.plugin.directory.android.DirectoryResultListView;
import org.pocketcampus.plugin.directory.shared.Person;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

public class PersonDetailsDialog extends Dialog implements OnClickListener {

	Context ctx_;

	Person displayedPerson_;

	TextView title_;
	TextView fname_;
	TextView lname_;
	TextView mail_;
	TextView office_;
	TextView officePhone_;
	TextView phone_;
	TextView web_;
	TextView ou_;
	
	static int clickCount = 0;

	public PersonDetailsDialog(Context context, Person person) {
		super(context);

		ctx_ = context;
		displayedPerson_ = person;
		

		build();
		setContent(person);
		setClickListener();

	}

	public void loadPicture() {
		LoaderImageView liv = (LoaderImageView) findViewById(R.id.directory_person_details_dialog_photo);
		if (liv == null) {
			Log.d("Directory", "loaderImageView in the layout is null");
			return;
		}

		if (displayedPerson_.pictureUrl != null) {
			liv.setImageDrawable(displayedPerson_.pictureUrl);

			liv.setVisibility(View.VISIBLE);
		} else {
			liv.setVisibility(View.GONE);
		}

	}

	private void build() {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		// setTitle(ctx_.getResources().getString(R.string.directory_person_details_dialog_tile));
		setContentView(R.layout.directory_details_dialog);
		getWindow().setLayout(LayoutParams.WRAP_CONTENT,
				LayoutParams.WRAP_CONTENT);
		setCanceledOnTouchOutside(true);
	}

	private void setContent(Person p) {
		title_ = (TextView) findViewById(R.id.directory_person_details_title_dialog);
		title_.setText(p.getFirstName() + " " + p.getLastName());

		// lname_ = (TextView)
		// findViewById(R.id.directory_person_details_dialog_lname);
		// lname_.setText(p.getLastName());
		//
		// fname_ = (TextView)
		// findViewById(R.id.directory_person_details_dialog_fname);
		// fname_.setText(p.getFirstName() + " ");

		mail_ = (TextView) findViewById(R.id.directory_person_details_dialog_mail);
		mail_.setVisibility(visibility(p.isSetEmail()));
		mail_.setText(p.email);

		office_ = (TextView) findViewById(R.id.directory_person_details_dialog_office);
		office_.setVisibility(visibility(p.isSetOffice()));
		office_.setText(p.office);

		phone_ = (TextView) findViewById(R.id.directory_person_details_dialog_phone_number);
		phone_.setVisibility(visibility(p.isSetPrivatePhoneNumber()));
		phone_.setText(p.privatePhoneNumber);

		officePhone_ = (TextView) findViewById(R.id.directory_person_details_dialog_office_phone_number);
		officePhone_.setVisibility(visibility(p.isSetOfficePhoneNumber()));
		officePhone_.setText(p.officePhoneNumber);

		// web_ = (TextView)
		// findViewById(R.id.directory_person_details_dialog_web);
		// web_.setVisibility(visibility(p.isSetWeb()));
		// web_.setText(p.web);

		ou_ = (TextView) findViewById(R.id.directory_person_details_dialog_ou);
		ou_.setVisibility(visibility(p.isSetOrganisationalUnit()));
		String multipleLinesOU = "";
		for (String s : p.OrganisationalUnit) {
			multipleLinesOU += (s + "\n");
			System.out.println(s);
		}
		multipleLinesOU.substring(0, multipleLinesOU.length() - 1);
		ou_.setText(multipleLinesOU);
	}

	private int visibility(boolean hasMail) {
		return hasMail ? View.VISIBLE : View.GONE;
	}

	private void setClickListener() {
		Button mailButton = (Button) findViewById(R.id.directory_imageButton_mail);
		Button phoneButton = (Button) findViewById(R.id.directory_imageButton_call);
//		Button mapButton = (Button)findViewById(R.id.directory_imageButton_map);
		Button webButton = (Button) findViewById(R.id.directory_imageButton_web);

		mailButton.setVisibility(visibility(displayedPerson_.isSetEmail()));
		phoneButton.setVisibility(visibility(displayedPerson_.isSetOfficePhoneNumber()));
//		System.out.println(mapButton);
//		mapButton.setVisibility(visibility(displayedPerson_.isSetOffice()));
		webButton.setVisibility(visibility(displayedPerson_.isSetWeb()));

		mailButton.setOnClickListener(this);
		phoneButton.setOnClickListener(this);
//		mapButton.setOnClickListener(this);
		webButton.setOnClickListener(this);
	}

{'fraction_non_alphanumeric': 0.11799286164182238, 'fraction_numerical': 0.0006298551333193366, 'mean_word_length': 5.969275786393562, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5665918', 'n_tokens_mistral': 3178, 'n_tokens_neox': 2839, 'n_words': 442}