Permalink
Browse files

Initial Commit.

  • Loading branch information...
0 parents commit 23aaef1a331774ed94bad7550e047a69fbb4b017 @hyone committed Jan 27, 2011
@@ -0,0 +1,6 @@
+project.name=ListLayout
+sbt.version=0.7.4
+project.version=0.1
+def.scala.version=2.7.7
+build.scala.versions=2.8.1
+project.initialize=false
@@ -0,0 +1,19 @@
+import sbt._
+
+trait Defaults {
+ def androidPlatformName = "android-7"
+}
+class ListLayout(info: ProjectInfo) extends ParentProject(info) {
+ override def shouldCheckOutputDirectories = false
+ override def updateAction = task { None }
+
+ lazy val main = project(".", "ListLayout", new MainProject(_))
+ lazy val tests = project("tests", "tests", new TestProject(_), main)
+
+ class MainProject(info: ProjectInfo) extends AndroidProject(info) with Defaults with MarketPublish {
+ val keyalias = "change-me"
+ val scalatest = "org.scalatest" % "scalatest" % "1.0" % "test"
+ }
+
+ class TestProject(info: ProjectInfo) extends AndroidTestProject(info) with Defaults
+}
@@ -0,0 +1,5 @@
+import sbt._
+
+class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
+ val android = "org.scala-tools.sbt" % "sbt-android-plugin" % "0.5.0"
+}
@@ -0,0 +1,12 @@
+<manifest
+android:versionName="0.1" android:versionCode="1" package="com.example.androidtest" xmlns:android="http://schemas.android.com/apk/res/android">
+ <uses-sdk android:minSdkVersion="7"></uses-sdk>
+ <application android:icon="@drawable/app_icon" android:label="@string/app_name">
+ <activity android:label="@string/app_name" android:name=".ListLayoutActivity">
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN"></action>
+ <category android:name="android.intent.category.LAUNCHER"></category>
+ </intent-filter>
+ </activity>
+ </application>
+</manifest>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<TextView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:padding="10dp"
+ android:textSize="16sp">
+</TextView>
@@ -0,0 +1,243 @@
+<resources>
+ <string name="app_name">ListLayout</string>
+ <string-array name="countries_array">
+ <item>Afghanistan</item>
+ <item>Albania</item>
+ <item>Algeria</item>
+ <item>American Samoa</item>
+ <item>Andorra</item>
+ <item>Angola</item>
+ <item>Anguilla</item>
+ <item>Antarctica</item>
+ <item>Antigua and Barbuda</item>
+ <item>Argentina</item>
+ <item>Armenia</item>
+ <item>Aruba</item>
+ <item>Australia</item>
+ <item>Austria</item>
+ <item>Azerbaijan</item>
+ <item>Bahrain</item>
+ <item>Bangladesh</item>
+ <item>Barbados</item>
+ <item>Belarus</item>
+ <item>Belgium</item>
+ <item>Belize</item>
+ <item>Benin</item>
+ <item>Bermuda</item>
+ <item>Bhutan</item>
+ <item>Bolivia</item>
+ <item>Bosnia and Herzegovina</item>
+ <item>Botswana</item>
+ <item>Bouvet Island</item>
+ <item>Brazil</item>
+ <item>British Indian Ocean Territory</item>
+ <item>British Virgin Islands</item>
+ <item>Brunei</item>
+ <item>Bulgaria</item>
+ <item>Burkina Faso</item>
+ <item>Burundi</item>
+ <item>Cote d\'Ivoire</item>
+ <item>Cambodia</item>
+ <item>Cameroon</item>
+ <item>Canada</item>
+ <item>Cape Verde</item>
+ <item>Cayman Islands</item>
+ <item>Central African Republic</item>
+ <item>Chad</item>
+ <item>Chile</item>
+ <item>China</item>
+ <item>Christmas Island</item>
+ <item>Cocos (Keeling) Islands</item>
+ <item>Colombia</item>
+ <item>Comoros</item>
+ <item>Congo</item>
+ <item>Cook Islands</item>
+ <item>Costa Rica</item>
+ <item>Croatia</item>
+ <item>Cuba</item>
+ <item>Cyprus</item>
+ <item>Czech Republic</item>
+ <item>Democratic Republic of the Congo</item>
+ <item>Denmark</item>
+ <item>Djibouti</item>
+ <item>Dominica</item>
+ <item>Dominican Republic</item>
+ <item>East Timor</item>
+ <item>Ecuador</item>
+ <item>Egypt</item>
+ <item>El Salvador</item>
+ <item>Equatorial Guinea</item>
+ <item>Eritrea</item>
+ <item>Estonia</item>
+ <item>Ethiopia</item>
+ <item>Faeroe Islands</item>
+ <item>Falkland Islands</item>
+ <item>Fiji</item>
+ <item>Finland</item>
+ <item>Former Yugoslav Republic of Macedonia</item>
+ <item>France</item>
+ <item>French Guiana</item>
+ <item>French Polynesia</item>
+ <item>French Southern Territories</item>
+ <item>Gabon</item>
+ <item>Georgia</item>
+ <item>Germany</item>
+ <item>Ghana</item>
+ <item>Gibraltar</item>
+ <item>Greece</item>
+ <item>Greenland</item>
+ <item>Grenada</item>
+ <item>Guadeloupe</item>
+ <item>Guam</item>
+ <item>Guatemala</item>
+ <item>Guinea</item>
+ <item>Guinea-Bissau</item>
+ <item>Guyana</item>
+ <item>Haiti</item>
+ <item>Heard Island and McDonald Islands</item>
+ <item>Honduras</item>
+ <item>Hong Kong</item>
+ <item>Hungary</item>
+ <item>Iceland</item>
+ <item>India</item>
+ <item>Indonesia</item>
+ <item>Iran</item>
+ <item>Iraq</item>
+ <item>Ireland</item>
+ <item>Israel</item>
+ <item>Italy</item>
+ <item>Jamaica</item>
+ <item>Japan</item>
+ <item>Jordan</item>
+ <item>Kazakhstan</item>
+ <item>Kenya</item>
+ <item>Kiribati</item>
+ <item>Kuwait</item>
+ <item>Kyrgyzstan</item>
+ <item>Laos</item>
+ <item>Latvia</item>
+ <item>Lebanon</item>
+ <item>Lesotho</item>
+ <item>Liberia</item>
+ <item>Libya</item>
+ <item>Liechtenstein</item>
+ <item>Lithuania</item>
+ <item>Luxembourg</item>
+ <item>Macau</item>
+ <item>Madagascar</item>
+ <item>Malawi</item>
+ <item>Malaysia</item>
+ <item>Maldives</item>
+ <item>Mali</item>
+ <item>Malta</item>
+ <item>Marshall Islands</item>
+ <item>Martinique</item>
+ <item>Mauritania</item>
+ <item>Mauritius</item>
+ <item>Mayotte</item>
+ <item>Mexico</item>
+ <item>Micronesia</item>
+ <item>Moldova</item>
+ <item>Monaco</item>
+ <item>Mongolia</item>
+ <item>Montserrat</item>
+ <item>Morocco</item>
+ <item>Mozambique</item>
+ <item>Myanmar</item>
+ <item>Namibia</item>
+ <item>Nauru</item>
+ <item>Nepal</item>
+ <item>Netherlands</item>
+ <item>Netherlands Antilles</item>
+ <item>New Caledonia</item>
+ <item>New Zealand</item>
+ <item>Nicaragua</item>
+ <item>Niger</item>
+ <item>Nigeria</item>
+ <item>Niue</item>
+ <item>Norfolk Island</item>
+ <item>North Korea</item>
+ <item>Northern Marianas</item>
+ <item>Norway</item>
+ <item>Oman</item>
+ <item>Pakistan</item>
+ <item>Palau</item>
+ <item>Panama</item>
+ <item>Papua New Guinea</item>
+ <item>Paraguay</item>
+ <item>Peru</item>
+ <item>Philippines</item>
+ <item>Pitcairn Islands</item>
+ <item>Poland</item>
+ <item>Portugal</item>
+ <item>Puerto Rico</item>
+ <item>Qatar</item>
+ <item>Reunion</item>
+ <item>Romania</item>
+ <item>Russia</item>
+ <item>Rwanda</item>
+ <item>Sqo Tome and Principe</item>
+ <item>Saint Helena</item>
+ <item>Saint Kitts and Nevis</item>
+ <item>Saint Lucia</item>
+ <item>Saint Pierre and Miquelon</item>
+ <item>Saint Vincent and the Grenadines</item>
+ <item>Samoa</item>
+ <item>San Marino</item>
+ <item>Saudi Arabia</item>
+ <item>Senegal</item>
+ <item>Seychelles</item>
+ <item>Sierra Leone</item>
+ <item>Singapore</item>
+ <item>Slovakia</item>
+ <item>Slovenia</item>
+ <item>Solomon Islands</item>
+ <item>Somalia</item>
+ <item>South Africa</item>
+ <item>South Georgia and the South Sandwich Islands</item>
+ <item>South Korea</item>
+ <item>Spain</item>
+ <item>Sri Lanka</item>
+ <item>Sudan</item>
+ <item>Suriname</item>
+ <item>Svalbard and Jan Mayen</item>
+ <item>Swaziland</item>
+ <item>Sweden</item>
+ <item>Switzerland</item>
+ <item>Syria</item>
+ <item>Taiwan</item>
+ <item>Tajikistan</item>
+ <item>Tanzania</item>
+ <item>Thailand</item>
+ <item>The Bahamas</item>
+ <item>The Gambia</item>
+ <item>Togo</item>
+ <item>Tokelau</item>
+ <item>Tonga</item>
+ <item>Trinidad and Tobago</item>
+ <item>Tunisia</item>
+ <item>Turkey</item>
+ <item>Turkmenistan</item>
+ <item>Turks and Caicos Islands</item>
+ <item>Tuvalu</item>
+ <item>Virgin Islands</item>
+ <item>Uganda</item>
+ <item>Ukraine</item>
+ <item>United Arab Emirates</item>
+ <item>United Kingdom</item>
+ <item>United States</item>
+ <item>United States Minor Outlying Islands</item>
+ <item>Uruguay</item>
+ <item>Uzbekistan</item>
+ <item>Vanuatu</item>
+ <item>Vatican City</item>
+ <item>Venezuela</item>
+ <item>Vietnam</item>
+ <item>Wallis and Futuna</item>
+ <item>Western Sahara</item>
+ <item>Yemen</item>
+ <item>Yugoslavia</item>
+ <item>Zambia</item>
+ <item>Zimbabwe</item>
+ </string-array>
+</resources>
@@ -0,0 +1,31 @@
+package com.example.androidtest
+
+import android.app.ListActivity
+import android.os.Bundle
+import android.widget.AdapterView
+import android.widget.AdapterView.OnItemClickListener
+import android.widget.{ ArrayAdapter, TextView, Toast }
+import android.view.View
+
+
+class ListLayoutActivity extends ListActivity {
+ override def onCreate(savedInstanceState: Bundle) {
+ super.onCreate(savedInstanceState)
+
+ val countries = getResources().getStringArray(R.array.countries_array)
+ setListAdapter(new ArrayAdapter[String](this, R.layout.list_item, countries))
+
+ val lv = getListView()
+ lv.setTextFilterEnabled(true)
+
+ lv.setOnItemClickListener(new OnItemClickListener() {
+ override def onItemClick(parent: AdapterView[_], view: View, position: Int, id: Long) {
+ Toast.makeText(
+ getApplicationContext(),
+ view.asInstanceOf[TextView].getText(),
+ Toast.LENGTH_SHORT
+ ).show()
+ }
+ })
+ }
+}
@@ -0,0 +1,10 @@
+import com.example.androidtest
+import org.scalatest.matchers.ShouldMatchers
+import org.scalatest.Spec
+
+class Specs extends Spec with ShouldMatchers {
+ describe("a spec") {
+ it("should do something") {
+ }
+ }
+}
@@ -0,0 +1,10 @@
+<manifest
+package="com.example.androidtest.tests" xmlns:android="http://schemas.android.com/apk/res/android">
+ <uses-sdk android:minSdkVersion="7"></uses-sdk>
+ <application>
+ <uses-library android:name="android.test.runner"></uses-library>
+ </application>
+ <instrumentation
+ android:label="Tests" android:targetPackage="com.example.androidtest" android:name="android.test.InstrumentationTestRunner">
+</instrumentation>
+</manifest>
@@ -0,0 +1,10 @@
+package com.example.androidtest.tests
+
+import junit.framework.Assert._
+import _root_.android.test.AndroidTestCase
+
+class UnitTests extends AndroidTestCase {
+ def testPackageIsCorrect {
+ assertEquals("com.example.androidtest", getContext.getPackageName)
+ }
+}

0 comments on commit 23aaef1

Please sign in to comment.