View CheckableLinearLayout
package com.example.checkableviews; | |
/******************************************************************************* | |
* Copyright 2013 Chris Banes. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
View gist:d17a229bdfc803036c4c
import android.content.Context; | |
import android.content.res.Resources; | |
import android.util.TypedValue; | |
public class UiUtils { | |
private UiUtils() { | |
} | |
public static int getStatusBarHeight(Context context) { |
View build.gradle
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.6.+' | |
} | |
} | |
apply plugin: 'android-library' | |
apply plugin: 'maven' |
View gist:6518622
try { | |
// force to use overflow menu | |
ViewConfiguration config = ViewConfiguration.get(this); | |
Field menuKeyField = ViewConfiguration.class | |
.getDeclaredField("sHasPermanentMenuKey"); | |
if (menuKeyField != null) { | |
menuKeyField.setAccessible(true); | |
menuKeyField.setBoolean(config, false); | |
} | |
} catch (Exception ex) { |