Skip to content

Instantly share code, notes, and snippets.

Dorian Cussen doridori

Block or report user

Report or block doridori

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@doridori
doridori / ViewTreeObserver_Ex.java
Last active Aug 29, 2015
Grabbing content view dimensions via ViewTreeObserver - all Display methods have no guarantee if they will include system and status bars in height
View ViewTreeObserver_Ex.java
//inside a fragment. If in an Activity you could use findViewById(Window.ID_ANDROID_CONTENT);
getView().getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener()
{
@Override
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());
@doridori
doridori / convertLocalizable.rb
Last active Dec 13, 2015 — forked from florianmski/convertLocalizable.rb
sub non alpha chars out - this could be done much better with regex
View convertLocalizable.rb
#!/usr/bin/ruby
# based on https://github.com/tmurakam/cashflow/blob/0a01ac9e0350dfb04979986444244f8daf4cb5a8/android/convertStrings.rb
# support comments and Converter such as "%@", "%d", "%0.1f"...
# in your directory : ./main.rb Localizable.strings
file = File.open("strings.xml", "w");
file.puts "<?xml version=\"1.0\" encoding=\"utf-8\"?>"
file.puts "<resources>"
You can’t perform that action at this time.