Skip to content

Commit

Permalink
(AUTOMATIC) Exporting changes for github
Browse files Browse the repository at this point in the history
  • Loading branch information
hagbard committed Mar 12, 2015
1 parent 9b946f3 commit 3b8e488
Show file tree
Hide file tree
Showing 71 changed files with 3,072 additions and 2,801 deletions.
7 changes: 2 additions & 5 deletions android/README
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ http://tools.android.com/tech-docs/new-build-system
http://www.gradle.org/


Prerequisite dependencies for using Gradle
------------------------------------------
Prerequisite dependencies for using Gradle with Android
-------------------------------------------------------
Android Studio: https://developer.android.com/sdk/index.html
or
Android SDK Tools: https://developer.android.com/sdk/index.html#Other

Set the ANDROID_HOME environment variable to the root of the SDK.

Remember to run the "android" SDK tools utility as root/admin to allow it
permission to install new packages (ie, "sudo ./android sdk").

Install the following packages:
* Tools/Android SDK Build-tools (Rev. 19.1)
* Android 4.4.2 (API 19)
Expand Down
29 changes: 27 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright (C) 2015 Google Inc.
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

buildscript {
repositories {
mavenCentral()
Expand All @@ -10,9 +26,18 @@ buildscript {

apply plugin: 'com.android.library'

tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

dependencies {
compile project(':common')
}

android {
// If these are modified, update the README to reflect the new versions
// and update any related settings in the AdroidManifest.xml file.
/* If these are modified, update the README to reflect the new versions *
* and update any related settings in the AdroidManifest.xml file. */
compileSdkVersion 19
buildToolsVersion '19.1.0'
}

8 changes: 4 additions & 4 deletions android/src/androidTest/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />

android:minSdkVersion="9"
android:targetSdkVersion="21" />
<!--
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.android.i18n.addressinput" />

-->
<uses-permission android:name="android.permission.INTERNET" />

<application
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

package com.android.i18n.addressinput;

import com.android.i18n.addressinput.testing.TestActivity;
import com.google.i18n.addressinput.common.AddressData;
import com.google.i18n.addressinput.common.AddressField;
import com.google.i18n.addressinput.common.FormOptions;
import com.google.i18n.addressinput.common.SimpleClientCacheManager;

import android.app.ProgressDialog;
import android.content.Context;
Expand All @@ -28,6 +31,8 @@
import android.widget.Spinner;
import android.widget.TextView;

import com.android.i18n.addressinput.testing.TestActivity;

/**
* Test class for {@link AddressWidgetUiComponentProvider}.
*/
Expand All @@ -51,7 +56,7 @@ protected void setUp() throws Exception {
AddressData.Builder builder = new AddressData.Builder()
.setCountry("US")
.setLanguageCode("en")
.setAddressLine1("1098 Alta Ave")
.setAddress("1098 Alta Ave")
.setAdminArea("CA");
address = builder.build();
context = getActivity();
Expand All @@ -62,7 +67,7 @@ public void testCustomWidgets() {
customTextViewCounter = 0;
customProgressDialogCounter = 0;
componentProvider = new TestComponentProvider(context);
widget = new AddressWidget(context, container, new FormOptions.Builder().build(),
widget = new AddressWidget(context, container, new FormOptions(),
new SimpleClientCacheManager(), componentProvider);
widget.renderFormWithSavedAddress(address);

Expand Down Expand Up @@ -107,7 +112,7 @@ private class CustomSpinner extends Spinner {
}
}

private class CustomArrayAdapter<String> extends ArrayAdapter {
private class CustomArrayAdapter<String> extends ArrayAdapter<String> {
CustomArrayAdapter(Context context, int id) {
super(context, id);
}
Expand All @@ -118,28 +123,33 @@ private class TestComponentProvider extends AddressWidgetUiComponentProvider {
super(context);
}

@Override
protected TextView createUiLabel(CharSequence label, AddressField.WidthType widthType) {
TextView result = new TextView(context);
result.setText(label);
AddressWidgetUiComponentProviderTest.this.increaseTextViewCounter();
return result;
}

@Override
protected EditText createUiTextField(AddressField.WidthType widthType) {
return new CustomEditText(context);
}

@Override
protected Spinner createUiPickerSpinner(AddressField.WidthType widthType) {
return new CustomSpinner(context);
}

@Override
protected ArrayAdapter<String> createUiPickerAdapter(AddressField.WidthType widthType) {
ArrayAdapter<String> result = new CustomArrayAdapter<String>(
context, android.R.layout.simple_spinner_item);
result.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
return result;
}

@Override
protected ProgressDialog getUiActivityIndicatorView() {
AddressWidgetUiComponentProviderTest.this.increaseProgressDialogCounter();
return super.getUiActivityIndicatorView();
Expand Down
Loading

0 comments on commit 3b8e488

Please sign in to comment.