UdhayaBalaji / androidannotations

Automatically exported from code.google.com/p/androidannotations
0 stars 0 forks source link

Activity in fullscren mode #127

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Actually is very very painful to put an activity in fullscreen or remove the 
title bar. Just because you have to write those pitiful lines of code : 

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,  
WindowManager.LayoutParams.FLAG_FULLSCREEN);

It will be more convenient if we can use something like this :

@EActivity(layout=R.layout.main, noTitle=true, fullscreen=true)
public class MyActivity {...}

or something like this : 

@EActivity(R.layout.main)
@NoTitle
@FullScreen
public class MyActivity {...}

Original issue reported on code.google.com by mat.boni...@gmail.com on 11 Nov 2011 at 6:17

GoogleCodeExporter commented 8 years ago
Interesting idea.

Maybe this is a little bit too specific, and we shouldn't create an annotation 
for each window feature or flag. So what about this :

@EActivity(R.layout.main)
@WindowFeature(FEATURE_NO_TITLE)
@WindowFlags(flags = FLAG_FULLSCREEN,  mask = FLAG_FULLSCREEN )
@FullScreen
public class MyActivity {...}

(I'm using static imports here)

The idea is to keep the flexibility, but just use annotations instead of method 
calls.

Anyway, ins't it simpler to add this to your activity in your manifest :
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

Original comment by py.ricau on 12 Nov 2011 at 8:44

GoogleCodeExporter commented 8 years ago
So, what's the status of this ? Do you think we should reallly implement that, 
or not?

Original comment by py.ricau on 21 Nov 2011 at 1:35

GoogleCodeExporter commented 8 years ago
Personnally, I vote YES, it should be implemented

Original comment by mathieu.debrito on 21 Nov 2011 at 3:50

GoogleCodeExporter commented 8 years ago
ok, great. But I still don't understand why one would do this in code, rather 
then just doing it in one simple line in the AndroidManifest.xml :-) . Hints?

Original comment by py.ricau on 21 Nov 2011 at 4:01

GoogleCodeExporter commented 8 years ago
Personnally (again), I don't think AndroidManifest should not be allowed to 
change any Activity's layout behavior... 

Original comment by mathieu.debrito on 21 Nov 2011 at 4:41

GoogleCodeExporter commented 8 years ago
I understand your opinion :-) 

Would you rather use :

@NoTitle
@FullScreen

or

@WindowFeature(FEATURE_NO_TITLE)
@WindowFlags(flags = FLAG_FULLSCREEN,  mask = FLAG_FULLSCREEN )

Original comment by py.ricau on 21 Nov 2011 at 6:03

GoogleCodeExporter commented 8 years ago
Hum, I guess I prefer @NoTitle and @FullScreen. But I agree with you for 
keeping the flexibility :
@WindowFeature(FEATURE_NO_TITLE)
@WindowFlags(flags = FLAG_FULLSCREEN,  mask = FLAG_FULLSCREEN )

Would be a better idea ...

Original comment by mathieu.debrito on 21 Nov 2011 at 10:05

GoogleCodeExporter commented 8 years ago
Done in the train, will push tomorrow.

Original comment by py.ricau on 22 Nov 2011 at 9:42

GoogleCodeExporter commented 8 years ago
This issue was closed by revision a3ff17e69c4e.

Original comment by py.ricau on 22 Nov 2011 at 10:49