Last active
August 29, 2015 13:56
Revisions
-
doridori renamed this gist
Feb 25, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
doridori renamed this gist
Feb 25, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
doridori renamed this gist
Feb 25, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,9 @@ public void onGlobalLayout() Log.d("DISPLAY", content.getWidth() + " x " + content.getHeight()); //we only wanted the first call back so now remove if(Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) getView().getViewTreeObserver().removeGlobalOnLayoutListener(this); else getView().getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); -
doridori revised this gist
Feb 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ //inside a fragment. If in an Activity you could use findViewById(Window.ID_ANDROID_CONTENT); getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override -
doridori revised this gist
Feb 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,4 @@ getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.O //we only wanted the first call back so now remove getView().getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); -
doridori renamed this gist
Feb 25, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
doridori revised this gist
Feb 25, 2014 . No changes.There are no files selected for viewing
-
doridori revised this gist
Feb 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ //inside a fragment. If an Activity you could use findViewById(Window.ID_ANDROID_CONTENT); getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override -
doridori revised this gist
Feb 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ //inside a fragment. If an Activity use... getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override -
doridori revised this gist
Feb 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ //inside a fragment. If an Actvitiy you could use getContentView() getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override -
doridori revised this gist
Feb 25, 2014 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ public void onGlobalLayout() { //do something like measure a view etc View content = getWindow().findViewById(Window.ID_ANDROID_CONTENT); Log.d("DISPLAY", content.getWidth() + " x " + content.getHeight()); //we only wanted the first call back so now remove getView().getViewTreeObserver().removeOnGlobalLayoutListener(this); -
doridori revised this gist
Feb 25, 2014 . 1 changed file with 10 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,12 @@ //inside a fragment getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { //do something like measure a view etc //we only wanted the first call back so now remove getView().getViewTreeObserver().removeOnGlobalLayoutListener(this); } }); -
doridori created this gist
Feb 25, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ //inside a fragment getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { @Override public void onGlobalLayout() { //do something like measure a view etc //we only wanted the first call back so now remove getView().getViewTreeObserver().removeOnGlobalLayoutListener(this); } });