Skip to content
This repository was archived by the owner on Aug 16, 2019. It is now read-only.

Commit ac36fcc

Browse files
committed
Initial commit
0 parents  commit ac36fcc

File tree

34 files changed

+1419
-0
lines changed

34 files changed

+1419
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*.iml
2+
.gradle
3+
local.properties
4+
.idea
5+
.DS_Store
6+
build
7+
captures

app/build.gradle

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.1"
6+
7+
defaultConfig {
8+
applicationId "xyz.projectplay.googlemapsbottomsheet"
9+
minSdkVersion 16
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+
compile project(':googlemapsbottomsheet')
25+
testCompile 'junit:junit:4.12'
26+
compile 'com.android.support:appcompat-v7:24.2.0'
27+
compile 'com.google.android.gms:play-services-maps:9.4.0'
28+
compile 'com.google.android.gms:play-services-location:9.4.0'
29+
}

app/proguard-rules.pro

+17
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 /Users/nathan/Library/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+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package xyz.projectplay.googlemapsbottomsheet;
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<resources>
2+
<!--
3+
TODO: Before you run your application, you need a Google Maps API key.
4+
5+
To get one, follow this link, follow the directions and press "Create" at the end:
6+
7+
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=A3:47:70:F4:45:3E:F1:93:CB:90:E2:24:9E:54:F2:38:96:9C:CF:AA%3Bxyz.projectplay.googlemapsbottomsheet
8+
9+
You can also add your credentials to an existing key, using this line:
10+
A3:47:70:F4:45:3E:F1:93:CB:90:E2:24:9E:54:F2:38:96:9C:CF:AA;xyz.projectplay.googlemapsbottomsheet
11+
12+
Alternatively, follow the directions here:
13+
https://developers.google.com/maps/documentation/android/start#get-key
14+
15+
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
16+
string in this file.
17+
-->
18+
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyCnmRFiMzfE1sJSBwEK-WlfTs7p9RMpE_Q
19+
</string>
20+
</resources>

app/src/main/AndroidManifest.xml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="xyz.projectplay.googlemapsbottomsheetexample">
4+
5+
<!--
6+
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
7+
Google Maps Android API v2, but you must specify either coarse or fine
8+
location permissions for the 'MyLocation' functionality.
9+
-->
10+
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
11+
12+
<application
13+
android:allowBackup="true"
14+
android:icon="@mipmap/ic_launcher"
15+
android:label="@string/app_name"
16+
android:supportsRtl="true"
17+
android:theme="@style/AppTheme">
18+
19+
<!--
20+
The API key for Google Maps-based APIs is defined as a string resource.
21+
(See the file "res/values/google_maps_api.xml").
22+
Note that the API key is linked to the encryption key used to sign the APK.
23+
You need a different API key for each encryption key, including the release key that is used to
24+
sign the APK for publishing.
25+
You can define the keys for the debug and release targets in src/debug/ and src/release/.
26+
-->
27+
<meta-data
28+
android:name="com.google.android.geo.API_KEY"
29+
android:value="@string/google_maps_key" />
30+
31+
<activity
32+
android:name="xyz.projectplay.googlemapsbottomsheetexample.MapsActivity"
33+
android:label="@string/title_activity_maps">
34+
<intent-filter>
35+
<action android:name="android.intent.action.MAIN" />
36+
37+
<category android:name="android.intent.category.LAUNCHER" />
38+
</intent-filter>
39+
</activity>
40+
</application>
41+
42+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
package xyz.projectplay.googlemapsbottomsheetexample;
2+
3+
import android.os.Bundle;
4+
import android.support.v4.app.FragmentActivity;
5+
6+
import com.google.android.gms.maps.CameraUpdateFactory;
7+
import com.google.android.gms.maps.GoogleMap;
8+
import com.google.android.gms.maps.OnMapReadyCallback;
9+
import com.google.android.gms.maps.SupportMapFragment;
10+
import com.google.android.gms.maps.model.LatLng;
11+
import com.google.android.gms.maps.model.MarkerOptions;
12+
13+
import xyz.projectplay.googlemapsbottomsheet.GoogleMapsBottomSheetBehavior;
14+
15+
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {
16+
17+
private GoogleMap mMap;
18+
private GoogleMapsBottomSheetBehavior behavior;
19+
20+
@Override
21+
protected void onCreate(Bundle savedInstanceState) {
22+
super.onCreate(savedInstanceState);
23+
setContentView(R.layout.activity_maps);
24+
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
25+
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
26+
.findFragmentById(R.id.map);
27+
mapFragment.getMapAsync(this);
28+
29+
behavior = new GoogleMapsBottomSheetBehavior(this, null);
30+
}
31+
32+
33+
/**
34+
* Manipulates the map once available.
35+
* This callback is triggered when the map is ready to be used.
36+
* This is where we can add markers or lines, add listeners or move the camera. In this case,
37+
* we just add a marker near Sydney, Australia.
38+
* If Google Play services is not installed on the device, the user will be prompted to install
39+
* it inside the SupportMapFragment. This method will only be triggered once the user has
40+
* installed Google Play services and returned to the app.
41+
*/
42+
@Override
43+
public void onMapReady(GoogleMap googleMap) {
44+
mMap = googleMap;
45+
46+
// Add a marker in Sydney and move the camera
47+
LatLng sydney = new LatLng(-34, 151);
48+
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
49+
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
50+
}
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:map="http://schemas.android.com/apk/res-auto"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:id="@+id/map"
5+
android:name="com.google.android.gms.maps.SupportMapFragment"
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
tools:context="xyz.projectplay.googlemapsbottomsheetexample.MapsActivity" />
3.34 KB
Loading
2.15 KB
Loading
4.73 KB
Loading
7.54 KB
Loading
10.2 KB
Loading

app/src/main/res/values/colors.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#3F51B5</color>
4+
<color name="colorPrimaryDark">#303F9F</color>
5+
<color name="colorAccent">#FF4081</color>
6+
</resources>

app/src/main/res/values/strings.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<resources>
2+
<string name="app_name">Google Maps Bottom Sheet</string>
3+
<string name="title_activity_maps">Map</string>
4+
</resources>

app/src/main/res/values/styles.xml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<resources>
2+
3+
<!-- Base application theme. -->
4+
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
5+
<!-- Customize your theme here. -->
6+
<item name="colorPrimary">@color/colorPrimary</item>
7+
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
8+
<item name="colorAccent">@color/colorAccent</item>
9+
</style>
10+
11+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<resources>
2+
<!--
3+
TODO: Before you release your application, you need a Google Maps API key.
4+
5+
To do this, you can either add your release key credentials to your existing
6+
key, or create a new key.
7+
8+
Note that this file specifies the API key for the release build target.
9+
If you have previously set up a key for the debug target with the debug signing certificate,
10+
you will also need to set up a key for your release certificate.
11+
12+
Follow the directions here:
13+
14+
https://developers.google.com/maps/documentation/android/signup
15+
16+
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
17+
string in this file.
18+
-->
19+
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
20+
AIzaSyCnmRFiMzfE1sJSBwEK-WlfTs7p9RMpE_Q
21+
</string>
22+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package xyz.projectplay.googlemapsbottomsheet;
2+
3+
import org.junit.Test;
4+
5+
import static org.junit.Assert.*;
6+
7+
/**
8+
* To work on unit tests, switch the Test Artifact in the Build Variants view.
9+
*/
10+
public class ExampleUnitTest {
11+
@Test
12+
public void addition_isCorrect() throws Exception {
13+
assertEquals(4, 2 + 2);
14+
}
15+
}

build.gradle

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
3+
buildscript {
4+
repositories {
5+
jcenter()
6+
}
7+
dependencies {
8+
classpath 'com.android.tools.build:gradle:2.1.3'
9+
10+
// NOTE: Do not place your application dependencies here; they belong
11+
// in the individual module build.gradle files
12+
}
13+
}
14+
15+
allprojects {
16+
repositories {
17+
jcenter()
18+
}
19+
}
20+
21+
task clean(type: Delete) {
22+
delete rootProject.buildDir
23+
}

googlemapsbottomsheet/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

googlemapsbottomsheet/build.gradle

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
apply plugin: 'com.android.library'
2+
3+
android {
4+
compileSdkVersion 24
5+
buildToolsVersion "24.0.1"
6+
7+
defaultConfig {
8+
minSdkVersion 16
9+
targetSdkVersion 24
10+
versionCode 1
11+
versionName "1.0"
12+
}
13+
buildTypes {
14+
release {
15+
minifyEnabled false
16+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17+
}
18+
}
19+
}
20+
21+
dependencies {
22+
compile fileTree(dir: 'libs', include: ['*.jar'])
23+
testCompile 'junit:junit:4.12'
24+
compile 'com.android.support:appcompat-v7:24.2.0'
25+
compile 'com.android.support:design:24.2.0'
26+
}
+17
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 /Users/nathan/Library/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+
#}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package xyz.projectplay.googlemapsbottomsheet;
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+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="xyz.projectplay.googlemapsbottomsheet">
3+
4+
<application android:allowBackup="true"
5+
android:label="@string/app_name"
6+
android:supportsRtl="true">
7+
8+
</application>
9+
10+
</manifest>

0 commit comments

Comments
 (0)