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
func testTextFieldLimit() { | |
// Set up view before interacting with the text field | |
let storyboard = UIStoryboard(name: "Main", bundle: NSBundle(forClass: self.dynamicType)) | |
let vc = storyboard.instantiateViewControllerWithIdentifier("ViewController") as! ViewController | |
vc.loadView() | |
// Test maximum number of allowable characters | |
let atTheLimitString = String(count: maxNumCharacters, repeatedValue: Character("a")) | |
let atTheLimitResult = vc.textField(vc.textField, shouldChangeCharactersInRange: NSRange(location: 0, length: 0), replacementString: atTheLimitString) | |
XCTAssertTrue(atTheLimitResult, "The text field should allow \(maxNumCharacters) characters") |
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
<string-array name="state_array"> | |
<item>AL</item> | |
<item>AK</item> | |
<item>AZ</item> | |
<item>AR</item> | |
<item>CA</item> | |
<item>CO</item> | |
<item>CT</item> | |
<item>DE</item> | |
<item>FL</item> |
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
<string-array name="months_array"> | |
<item>January</item> | |
<item>February</item> | |
<item>March</item> | |
<item>April</item> | |
<item>May</item> | |
<item>June</item> | |
<item>July</item> | |
<item>August</item> | |
<item>September</item> |
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
<string-array name="days_array"> | |
<item>1</item> | |
<item>2</item> | |
<item>3</item> | |
<item>4</item> | |
<item>5</item> | |
<item>6</item> | |
<item>7</item> | |
<item>8</item> | |
<item>9</item> |
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
.*mytagname﹕ |
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.rentalgeek.android.utils; | |
import android.content.Context; | |
import android.content.DialogInterface; | |
import android.support.v7.app.AlertDialog; | |
/** | |
* Created by rajohns on 9/19/15. | |
* | |
*/ |
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
// Get list of available emulators | |
$ emulator -list-avds | |
// Start an emulator | |
$ emulator -avd <emulator-name> -scale 0.33 | |
// Install app on running emulator | |
$ adb shell | |
$ pm list packages | grep "something in your package name" // This lists package names for all apps currently installed on device that adb is connected to | |
$ exit |
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
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ImageView | |
android:id="@+id/image_view" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<FrameLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ImageView | |
android:id="@+id/background_image_view" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
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
ssnEditText.addTextChangedListener(new TextWatcher() { | |
@Override | |
public void beforeTextChanged(CharSequence s, int start, int count, int after) { | |
} | |
@Override | |
public void onTextChanged(CharSequence s, int start, int before, int count) { | |
// if user is typing string one character at a time | |
if (count == 1) { |