<commit_before>package pt.utl.ist.cmov.bomberman.controllers;

import android.os.Build;
import android.os.Handler;
import android.view.View;

public class FullScreenController implements
		View.OnSystemUiVisibilityChangeListener {

	private final View rootView;

	public FullScreenController(View rootView) {
		this.rootView = rootView;
		setImmersiveMode(true);
	}

	@Override
	public void onSystemUiVisibilityChange(int visibility) {
		if (visibility == 0) {
			mHideHandler.postDelayed(mHideRunnable, 2000);
		}
	}

	private void setImmersiveMode(boolean enabled) {
		int flags = 0;
		final int version = Build.VERSION.SDK_INT;

		if (version >= Build.VERSION_CODES.KITKAT) {
			flags = View.SYSTEM_UI_FLAG_IMMERSIVE
					| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
					| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
					| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
					| View.SYSTEM_UI_FLAG_FULLSCREEN
					| View.SYSTEM_UI_FLAG_LOW_PROFILE
					| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
		} else if (version >= Build.VERSION_CODES.JELLY_BEAN) {
			flags = View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
					| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
					| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
					| View.SYSTEM_UI_FLAG_FULLSCREEN
					| View.SYSTEM_UI_FLAG_LOW_PROFILE
					| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
		} else if (version >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
			flags = View.SYSTEM_UI_FLAG_LOW_PROFILE
					| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
		}

		if (version >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
			rootView.setSystemUiVisibility(flags);
		}
	}

	Handler mHideHandler = new Handler();
	Runnable mHideRunnable = new Runnable() {
		@Override
		public void run() {
			setImmersiveMode(true);
		}
	};

}<commit_msg>we cannot hide nav in older versions, we must put it on low profile<commit_after>package pt.utl.ist.cmov.bomberman.controllers;

import android.os.Build;
import android.os.Handler;
import android.view.View;

public class FullScreenController implements
		View.OnSystemUiVisibilityChangeListener {

	private final View rootView;
	final int androidVersion = Build.VERSION.SDK_INT;

	public FullScreenController(View rootView) {
		this.rootView = rootView;
		hideSystemUI();
	}

	@Override
	public void onSystemUiVisibilityChange(int visibility) {
		if (androidVersion < Build.VERSION_CODES.KITKAT) {
			mHideHandler.postDelayed(mHideRunnable, 5000);
		}
	}

	private void hideSystemUI() {
		int flags = 0;

		if (androidVersion >= Build.VERSION_CODES.KITKAT) {
			flags = View.SYSTEM_UI_FLAG_IMMERSIVE
					| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY
					| View.SYSTEM_UI_FLAG_LAYOUT_STABLE
					| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
					| View.SYSTEM_UI_FLAG_FULLSCREEN
					| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
					| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
					| View.SYSTEM_UI_FLAG_LOW_PROFILE;
		} else if (androidVersion >= Build.VERSION_CODES.JELLY_BEAN) {
			flags = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
					| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
					| View.SYSTEM_UI_FLAG_FULLSCREEN
					| View.SYSTEM_UI_FLAG_LOW_PROFILE;
		} else if (androidVersion >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
			flags = View.SYSTEM_UI_FLAG_LOW_PROFILE;
		}

		if (androidVersion >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
			rootView.setSystemUiVisibility(flags);
		}
	}

	Handler mHideHandler = new Handler();
	Runnable mHideRunnable = new Runnable() {
		@Override
		public void run() {
			hideSystemUI();
		}
	};

}
{'fraction_non_alphanumeric': 0.08359941944847606, 'fraction_numerical': 0.003193033381712627, 'mean_word_length': 4.630718954248366, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 11, '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': '6721018', 'n_tokens_mistral': 1412, 'n_tokens_neox': 1237, 'n_words': 191}