Skip to content

Commit 414fee2

Browse files
committed
Second Commit
1 parent 3171205 commit 414fee2

File tree

48 files changed

+1254
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1254
-40
lines changed

.gitignore

Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,9 @@
1-
# Built application files
2-
*.apk
3-
*.ap_
4-
5-
# Files for the ART/Dalvik VM
6-
*.dex
7-
8-
# Java class files
9-
*.class
10-
11-
# Generated files
12-
bin/
13-
gen/
14-
out/
15-
16-
# Gradle files
17-
.gradle/
18-
build/
19-
20-
# Local configuration file (sdk path, etc)
21-
local.properties
22-
23-
# Proguard folder generated by Eclipse
24-
proguard/
25-
26-
# Log Files
27-
*.log
28-
29-
# Android Studio Navigation editor temp files
30-
.navigation/
31-
32-
# Android Studio captures folder
33-
captures/
34-
35-
# Intellij
361
*.iml
37-
.idea/workspace.xml
38-
39-
# Keystore files
40-
*.jks
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
/.idea

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1-
# PlaceSearchDialog
1+
2+
Place Search Dialog
3+
==========
4+
A place autocomplete search dialog which uses Google's places API for finding results.
5+
6+
![](preview/sample.png)
7+
![](preview/dialog.png)
8+
![](preview/suggestions.png)
9+
10+
#License
11+
```
12+
Copyright (C) 2016 Code My Brains Out
13+
14+
Licensed under the Apache License, Version 2.0 (the "License");
15+
you may not use this file except in compliance with the License.
16+
You may obtain a copy of the License at
17+
18+
http://www.apache.org/licenses/LICENSE-2.0
19+
20+
Unless required by applicable law or agreed to in writing, software
21+
distributed under the License is distributed on an "AS IS" BASIS,
22+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23+
See the License for the specific language governing permissions and
24+
limitations under the License.
25+
```

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "23.0.3"
6+
7+
defaultConfig {
8+
applicationId "com.codemybrainsout.placesearchdialog"
9+
minSdkVersion 15
10+
targetSdkVersion 24
11+
versionCode 1
12+
versionName "1.0"
13+
}
14+
buildTypes {
15+
release {
16+
minifyEnabled false
17+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18+
}
19+
}
20+
}
21+
22+
dependencies {
23+
compile fileTree(dir: 'libs', include: ['*.jar'])
24+
testCompile 'junit:junit:4.12'
25+
compile 'com.android.support:appcompat-v7:24.1.1'
26+
compile project (":placesearch")
27+
}

app/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in C:\Users\Rahul Juneja\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.codemybrainsout.placesearchdialog;
2+
3+
import android.app.Application;
4+
import android.test.ApplicationTestCase;
5+
6+
/**
7+
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
8+
*/
9+
public class ApplicationTest extends ApplicationTestCase<Application> {
10+
public ApplicationTest() {
11+
super(Application.class);
12+
}
13+
}

app/src/main/AndroidManifest.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.codemybrainsout.placesearchdialog">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
<activity
12+
android:name=".MainActivity"
13+
android:windowSoftInputMode="adjustNothing">
14+
<intent-filter>
15+
<action android:name="android.intent.action.MAIN" />
16+
17+
<category android:name="android.intent.category.LAUNCHER" />
18+
</intent-filter>
19+
</activity>
20+
21+
<meta-data
22+
android:name="com.google.android.geo.API_KEY"
23+
android:value="YOUR_API_KEY" />
24+
25+
</application>
26+
27+
</manifest>

app/src/main/ic_launcher-web.png

18.2 KB
Loading
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package com.codemybrainsout.placesearchdialog;
2+
3+
import android.os.Bundle;
4+
import android.support.design.widget.TextInputEditText;
5+
import android.support.v7.app.AppCompatActivity;
6+
import android.view.MotionEvent;
7+
import android.view.View;
8+
9+
import com.codemybrainsout.placesearch.PlaceSearchDialog;
10+
11+
public class MainActivity extends AppCompatActivity {
12+
13+
TextInputEditText location;
14+
15+
@Override
16+
protected void onCreate(Bundle savedInstanceState) {
17+
super.onCreate(savedInstanceState);
18+
setContentView(R.layout.activity_main);
19+
20+
location = (TextInputEditText) findViewById(R.id.etLocation);
21+
location.setOnTouchListener(new View.OnTouchListener() {
22+
@Override
23+
public boolean onTouch(View view, MotionEvent motionEvent) {
24+
if (motionEvent.getAction() == MotionEvent.ACTION_UP) {
25+
showPlacePickerDialog();
26+
}
27+
return false;
28+
}
29+
});
30+
31+
}
32+
33+
private void showPlacePickerDialog() {
34+
PlaceSearchDialog placeSearchDialog = new PlaceSearchDialog(this, new PlaceSearchDialog.LocationNameListener() {
35+
@Override
36+
public void locationName(String locationName) {
37+
location.setText(locationName);
38+
}
39+
});
40+
placeSearchDialog.show();
41+
}
42+
}
62.6 KB
Loading

0 commit comments

Comments
 (0)