├── .gitignore ├── LICENSE ├── NOTICE ├── README.md ├── notes ├── 0.1.1.markdown ├── 0.1.2.markdown ├── 0.1.3.markdown ├── 0.1.4.markdown ├── 0.1.markdown └── about.markdown ├── project ├── build.scala └── plugins.sbt ├── src ├── main │ ├── AndroidManifest.xml │ ├── original-assets │ │ ├── gist-it-logo.png │ │ ├── gist-it-logo.xcf │ │ ├── gist-it-logo_128.png │ │ ├── octocat.xcf │ │ └── send-flow.xcf │ ├── res │ │ ├── drawable-hdpi │ │ │ └── gist_it_logo.png │ │ ├── drawable-mdpi │ │ │ └── gist_it_logo.png │ │ ├── drawable │ │ │ ├── drop_shadow_down.xml │ │ │ ├── octocat_bg.xml │ │ │ ├── octocat_big.png │ │ │ └── private_gist.png │ │ ├── layout-land │ │ │ └── gist_row.xml │ │ ├── layout │ │ │ ├── gist_row.xml │ │ │ ├── login.xml │ │ │ └── upload_gist.xml │ │ ├── menu │ │ │ └── menu.xml │ │ ├── values │ │ │ ├── acra.xml │ │ │ ├── colors.xml │ │ │ ├── keys.xml │ │ │ └── strings.xml │ │ └── xml │ │ │ └── authenticator.xml │ └── scala │ │ └── com │ │ └── zegoggles │ │ └── gist │ │ ├── Api.scala │ │ ├── App.scala │ │ ├── AuthenticatorService.scala │ │ ├── Gist.scala │ │ ├── GistList.scala │ │ ├── Implicits.scala │ │ ├── JsonModel.scala │ │ ├── Logger.scala │ │ ├── LoggingWebViewClient.scala │ │ ├── Login.scala │ │ ├── UploadGist.scala │ │ ├── User.scala │ │ └── Utils.scala └── test │ └── scala │ └── com │ └── zegoggles │ └── gist │ ├── ApiSpec.scala │ ├── GistSpec.scala │ ├── JsonModelSpec.scala │ ├── UserSpec.scala │ └── UtilsSpec.scala └── tests └── src └── main ├── AndroidManifest.xml └── res └── values └── strings.xml /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | lib_managed 3 | src_managed 4 | project/boot 5 | project/plugins/project 6 | gen 7 | .idea 8 | *.iml 9 | *.swp 10 | tmp 11 | tags 12 | keys_market.xml 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2011 Jan Berkel 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | gist-it 2 | Copyright 2011 Jan Berkel 3 | 4 | acra - Application Crash Report for Android 5 | Copyright 2010 Emmanuel Astier & Kevin Gaudin 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [gist-it][] 2 | 3 | ![icon][] 4 | 5 | Open source Android gist API client written in Scala. 6 | 7 | The Android app uses the new [github api][] to provide a "send to gist" 8 | feature for most applications which have a "Send" or "Share" menu. 9 | 10 | Check the following screenshot to get an idea of the flow (this example uses the 11 | [ColorNote Notepad][] app) 12 | 13 | ![flow][] 14 | 15 | By default gists are created anonymously - you can add your github account 16 | using Android's "Accounts & Sync" settings or follow the instructions in the 17 | gist app itself. 18 | 19 | With an associated account you also have the ability to edit existing gists - 20 | Use "Load gist" from the menu, make changes and upload it again. 21 | 22 | ## Usage from other apps 23 | 24 | If your are developing an Android app and want to make use of the gist api you 25 | can do so with intents. At the moment there are two actions exposed: 26 | 27 | ### picking/loading a gist 28 | 29 | Intent intent = new Intent("com.zegoggles.gist.PICK"); 30 | intent.putExtra("load_gist", false); // load gist content, defaults to true 31 | startActivityForResult(intent, 0) 32 | 33 | ### uploading a gist 34 | 35 | startActivityForResult(new Intent("com.zegoggles.gist.UPLOAD") 36 | .putExtra(Intent.EXTRA_TEXT, "text123") 37 | .putExtra("public", false) 38 | .putExtra("description", "testing gist upload via intent"), 0); 39 | 40 | ## Building from source 41 | 42 | You need [sbt][] (simple-build-tool, >= 0.11.2 ) in order to 43 | build the project, 44 | 45 | $ export ANDROID_HOME=/path/to/sdk # or ANDROID_SDK_{HOME,ROOT} 46 | $ sbt android:package-debug 47 | 48 | To run tests: 49 | 50 | $ sbt test 51 | 52 | Pull requests welcome, especially the design needs some love (hint, hint). 53 | 54 | ## Credits / License 55 | 56 | See LICENSE. Post it graphic by [christianalm][]. 57 | 58 | [![][FlattrButton]][FlattrLink] 59 | 60 | [gist-it]: https://market.android.com/details?id=com.zegoggles.gist 61 | [gist]: https://github.com/blog/118-here-s-the-gist-of-it 62 | [github api]: http://developer.github.com/v3/gists/ 63 | [ColorNote Notepad]: https://market.android.com/details?id=com.socialnmobile.dictapps.notepad.color.note 64 | [sbt]: http://code.google.com/p/simple-build-tool/ 65 | [sbt-android-plugin]: https://github.com/jberkel/android-plugin 66 | [flow]: https://github.com/downloads/jberkel/gist-it/send_flow.png 67 | [icon]: https://github.com/downloads/jberkel/gist-it/gist-it-logo_128.png 68 | [christianalm]: http://graphicriver.net/user/cristianalm 69 | [FlattrLink]: https://flattr.com/thing/304054/gist-it 70 | [FlattrButton]: http://api.flattr.com/button/button-static-50x60.png 71 | -------------------------------------------------------------------------------- /notes/0.1.1.markdown: -------------------------------------------------------------------------------- 1 | * Fix for Android 2.1 2 | -------------------------------------------------------------------------------- /notes/0.1.2.markdown: -------------------------------------------------------------------------------- 1 | * Accidentally released with wrong keys 2 | * Changed app logo (not allowed to use octocat) 3 | -------------------------------------------------------------------------------- /notes/0.1.3.markdown: -------------------------------------------------------------------------------- 1 | * Fix for Android 2.1 2 | -------------------------------------------------------------------------------- /notes/0.1.4.markdown: -------------------------------------------------------------------------------- 1 | * Fix for Honeycomb / ICS 2 | -------------------------------------------------------------------------------- /notes/0.1.markdown: -------------------------------------------------------------------------------- 1 | * Initial release: send files to gist, edit existing gists 2 | 3 | * Load/upload gists from other apps via intents 4 | -------------------------------------------------------------------------------- /notes/about.markdown: -------------------------------------------------------------------------------- 1 | [gist-it][1] is an open source Android [gist][2] API client written in Scala 2 | ([Android Market link][3]). 3 | 4 | [1]: https://github.com/jberkel/gist-it 5 | [2]: https://gist.github.com/ 6 | [3]: https://market.android.com/details?id=com.zegoggles.gist 7 | -------------------------------------------------------------------------------- /project/build.scala: -------------------------------------------------------------------------------- 1 | import sbt._ 2 | import Keys._ 3 | import AndroidKeys._ 4 | import Github._ 5 | 6 | object General { 7 | val settings = Defaults.defaultSettings ++ Seq ( 8 | version := "0.1.4", 9 | versionCode := 5, 10 | organization := "com.zegoggles", 11 | scalaVersion := "2.8.1" // 2.9.1 fail with DEXOPT install errors 12 | ) 13 | 14 | val androidSettings = 15 | settings ++ 16 | Seq ( 17 | platformName := "android-10" 18 | ) 19 | 20 | val androidProjectSettings = 21 | androidSettings ++ 22 | AndroidProject.androidSettings 23 | 24 | val androidFullProjectSettings = 25 | androidProjectSettings ++ 26 | TypedResources.settings ++ 27 | AndroidMarketPublish.settings ++ 28 | AndroidManifestGenerator.settings ++ 29 | Github.settings 30 | } 31 | 32 | object AndroidBuild extends Build { 33 | // MainProject 34 | lazy val app = Project ( 35 | "gist-it", 36 | file("."), 37 | settings = General.androidFullProjectSettings ++ Seq ( 38 | keyalias in Android := "jberkel", 39 | libraryDependencies ++= Seq( 40 | "org.acra" % "acra" % "4.2.3" 41 | //"com.github.jbrechtel" %% "robospecs" % "0.1-SNAPSHOT" % "test" 42 | ), 43 | compileOrder := CompileOrder.JavaThenScala, 44 | useProguard in Android := true, 45 | githubRepo in Android := "gist-it", 46 | cachePasswords in Android := true, 47 | resolvers ++= Seq( 48 | MavenRepository("acra release repository", "http://acra.googlecode.com/svn/repository/releases"), 49 | MavenRepository("robospecs snapshots", "http://jbrechtel.github.com/repo/snapshots"), 50 | MavenRepository("scala tools snapshots", "http://scala-tools.org/repo-snapshots") 51 | ) 52 | ) ++ AndroidInstall.settings 53 | ) 54 | } 55 | -------------------------------------------------------------------------------- /project/plugins.sbt: -------------------------------------------------------------------------------- 1 | resolvers ++= Seq( 2 | Resolver.file(System.getProperty("user.home") + "/.ivy2/local"), 3 | Resolver.url("scalasbt snapshots", new 4 | URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-snapshots"))(Resolver.ivyStylePatterns) 5 | ) 6 | 7 | addSbtPlugin("org.scala-sbt" % "sbt-android-plugin" % "0.6.1-SNAPSHOT") 8 | -------------------------------------------------------------------------------- /src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 50 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 61 | 62 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /src/main/original-assets/gist-it-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/original-assets/gist-it-logo.png -------------------------------------------------------------------------------- /src/main/original-assets/gist-it-logo.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/original-assets/gist-it-logo.xcf -------------------------------------------------------------------------------- /src/main/original-assets/gist-it-logo_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/original-assets/gist-it-logo_128.png -------------------------------------------------------------------------------- /src/main/original-assets/octocat.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/original-assets/octocat.xcf -------------------------------------------------------------------------------- /src/main/original-assets/send-flow.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/original-assets/send-flow.xcf -------------------------------------------------------------------------------- /src/main/res/drawable-hdpi/gist_it_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/res/drawable-hdpi/gist_it_logo.png -------------------------------------------------------------------------------- /src/main/res/drawable-mdpi/gist_it_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/res/drawable-mdpi/gist_it_logo.png -------------------------------------------------------------------------------- /src/main/res/drawable/drop_shadow_down.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | -------------------------------------------------------------------------------- /src/main/res/drawable/octocat_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/res/drawable/octocat_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/res/drawable/octocat_big.png -------------------------------------------------------------------------------- /src/main/res/drawable/private_gist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jberkel/gist-it/04949cbcac210a6e5ffa663570f8c7d0deed05a3/src/main/res/drawable/private_gist.png -------------------------------------------------------------------------------- /src/main/res/layout-land/gist_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /src/main/res/layout/gist_row.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 15 | -------------------------------------------------------------------------------- /src/main/res/layout/login.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /src/main/res/layout/upload_gist.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 13 | 14 | 17 | 18 | 25 | 26 | 34 | 35 | 43 | 44 | 53 | 54 | 55 | 60 | 61 | 62 | 63 | 78 | 79 | 94 | 95 | 96 | 112 | 113 | 121 | 122 | 132 | 133 | 143 | 144 | 145 | 146 | 147 | 152 | 158 | 159 |