View 00-gradle-generated.sbt
This file contains 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 characters
val viewserver = Project(id = raw"""viewserver""", base = file(raw"""C:\Users\pfnguyen\src\vs2\viewserver""")).settings( | |
android.Plugin.androidBuildAar:_*).settings( | |
SettingKey[android.Keys.PackagingOptions]("packagingOptions") in config("android") := android.Keys.PackagingOptions(Nil, Nil, Nil), | |
SettingKey[scala.collection.Seq[sbt.Resolver]]("resolvers") ++= List(raw"""https://jcenter.bintray.com/""" at raw"""https://jcenter.bintray.com/""", | |
raw"""https://jcenter.bintray.com/""" at raw"""https://jcenter.bintray.com/""", | |
raw"""file:/C:/Users/pfnguyen/android-sdk-windows/extras/android/m2repository/""" at raw"""file:/C:/Users/pfnguyen/android-sdk-windows/extras/android/m2repository/""", | |
raw"""file:/C:/Users/pfnguyen/android-sdk-windows/extras/google/m2repository/""" at raw"""file:/C:/Users/pfnguyen/android-sdk-windows/extras/google/m2repository/"""), | |
SettingKey[java.lang.String]("platformTarget") in config("android") := raw"""android-21""", | |
SettingKey[java.lang.String]("nam |
View workaround.scala
This file contains 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 characters
// workaround for https://code.google.com/p/android/issues/detail?id=63777 | |
class KitKatDrawerLayout(c: Context) extends DrawerLayout(c) { | |
var baseline = Integer.MAX_VALUE | |
var change = 0 | |
override def fitSystemWindows(insets: Rect) = { | |
val adj = insets.top + insets.bottom | |
baseline = math.min(adj, baseline) | |
if (baseline != Integer.MAX_VALUE && adj > baseline) { |
View email-5.0.0_r6.diff
This file contains 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 characters
diff --git a/Android.mk b/Android.mk | |
index a7dbba5..209e8b8 100644 | |
--- a/Android.mk | |
+++ b/Android.mk | |
@@ -44,6 +44,7 @@ LOCAL_ASSET_DIR := $(LOCAL_PATH)/$(unified_email_dir)/assets | |
LOCAL_AAPT_FLAGS := --auto-add-overlay | |
LOCAL_AAPT_FLAGS += --extra-packages com.android.ex.chips:com.android.mail:com.android.email:com.android.emailcommon:com.android.ex.photo:android.support.v7.appcompat:android.support.v7.gridlayout:com.android.bitmap:com.android.datetimepicker | |
+LOCAL_AAPT_FLAGS += --rename-manifest-package com.android.emailhack | |
View build.sbt
This file contains 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 characters
def loadFromPom(pom: File): Seq[ModuleID] = { | |
import scala.xml._ | |
val root = XML.loadFile(pom) | |
val parent = root \\ "parent" // TODO look up variables in parents | |
(root \\ "dependency") map { n => | |
for { | |
o <- n.child.find(_.label == "groupId") | |
a <- n.child.find(_.label == "artifactId") | |
v <- n.child.find(_.label == "version") | |
} yield ModuleID(o.text, a.text, v.text, |
View 1-conversions.scala
This file contains 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 characters
package com.hanhuy.android | |
import language.implicitConversions | |
package object conversions { | |
implicit def `fn1 to android.nfc.NfcAdapter$CreateNdefMessageCallback`(fn: (android.nfc.NfcEvent) => android.nfc.NdefMessage): android.nfc.NfcAdapter.CreateNdefMessageCallback = new android.nfc.NfcAdapter.CreateNdefMessageCallback { | |
override def createNdefMessage(a: android.nfc.NfcEvent) = fn(a) | |
} | |
implicit def `fn0 to android.nfc.NfcAdapter$CreateNdefMessageCallback`(fn: () => android.nfc.NdefMessage): android.nfc.NfcAdapter.CreateNdefMessageCallback = new android.nfc.NfcAdapter.CreateNdefMessageCallback { |
View 1-usage.scala
This file contains 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 characters
textfield.asScala.onEditorAction((_,id,event) => true) |
View output.txt
This file contains 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 characters
pfnguyen@galactica1:~/src/sbt-key-path-test$ sbt "keypath package test:compile" [info] Loading global plugins from /home/pfnguyen/.sbt/0.13/plugins | |
[info] Loading project definition from /cifs/pfnguyen/src/sbt-key-path-test/project | |
[info] Set current project to sbt-key-path-test (in build file:/cifs/pfnguyen/src/sbt-key-path-test/) | |
[info] Path: compile:package | |
[info] Looking for: compile:package <- test:compile | |
[error] No paths found | |
pfnguyen@galactica1:~/src/sbt-key-path-test$ sbt "keypath package update" | |
[info] Loading global plugins from /home/pfnguyen/.sbt/0.13/plugins | |
[info] Loading project definition from /cifs/pfnguyen/src/sbt-key-path-test/project | |
[info] Set current project to sbt-key-path-test (in build file:/cifs/pfnguyen/src/sbt-key-path-test/) |
View gist:1690765
This file contains 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 characters
object E { | |
class O { | |
val listeners = new ArrayBuffer[E.H] | |
} | |
trait RO { | |
implicit val __ERO__ = new O | |
} | |
type H = PartialFunction[Any,Any] | |
} | |
abstract class E { |
View gist:1762813
This file contains 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 characters
def using[A <: { def close() }](closeable: => A)(f: A => Unit) { | |
var c: Option[A] = None | |
try { | |
c = Option(closeable) | |
c foreach f | |
} finally { | |
c foreach(_.close) | |
} | |
} |
View AndroidConversions.scala
This file contains 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 characters
package com.hanhuy.android.irc | |
import android.app.Activity | |
import android.app.ActionBar | |
import android.content.Intent | |
import android.content.Context | |
import android.content.BroadcastReceiver | |
import android.content.res.Configuration | |
import android.os.AsyncTask | |
import android.os.Build |
OlderNewer