Skip to content

Instantly share code, notes, and snippets.

@devilmac
devilmac / FullScreeImmersiveFragment.java
Last active November 23, 2015 14:58
How to set fullscreen/immersive mode efficiently in Android
public class FullScreeImmersiveFragment extends Fragment {
// This variable save calculated UI flags used in setSystemUiVisibility method
// Default value means UI visibility in normal mode
int savedUiFlags = -1;
public FullScreeImmersiveFragment() {
}
@devilmac
devilmac / how_translate_gradle_project_for_Eclipse
Last active August 29, 2015 14:03
How to translate Gradle library to allow you to add it on your Eclipse project.
Hi all,
yesterday I had to deal a difficult question, that is how to load a Gradle library project on Eclipse without third party tools or similar.
As you already know, Eclipse is unable to load a Gradle project, but there is something that I'm sure someone don't know: Gradle itself can "translate" a project to make it able for Eclipse! Let's see how.
First of all, you have to add an environment variable that point to your Android SDK root folder. Done this, reboot your computer to apply the change. If this wouldn't work, add to the root folder's project a "local.properties" file containing this line: sdk.dir=pathToAndroidSDK.
Second step: you have to open the build.gradle file of the library (the file where you specify all specific attributes of the library) and add this line:
apply plugin: 'eclipse'