Skip to content

Commit

Permalink
Added Library
Browse files Browse the repository at this point in the history
  • Loading branch information
jineshfrancs committed Jan 4, 2017
1 parent 0303aab commit 90dc600
Show file tree
Hide file tree
Showing 18 changed files with 137 additions and 12 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.android.gms:play-services-maps:9.6.1'
testCompile 'junit:junit:4.12'
compile project(':lib')
}
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.jinesh.themedgooglemap">

<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
Expand All @@ -13,7 +14,8 @@
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyAx8XKAj35CyQ9SClpWP7UhYu2bILqI2K4" />
android:value="AIzaSyDPH_u2j72MW33nwJ120HA_2xV20V5GZuI" />

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
import android.support.v7.app.AppCompatActivity;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;

import test.jinesh.lib.GoogleMapStyler;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
((MapFragment) getFragmentManager().findFragmentById(
((SupportMapFragment) getSupportFragmentManager().findFragmentById(
R.id.vM_apnrm_map)).getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
Expand Down Expand Up @@ -41,6 +43,7 @@ public void onMapReady(GoogleMap googleMap) {
.setAllWaterTextStrokeAlpha(-20)
.build();
boolean success = googleMap.setMapStyle(googleMapStyler.getMapStyleOptions());
googleMap.setBuildingsEnabled(true);
}
});

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<fragment
android:id="@+id/vM_apnrm_map"
android:name="com.google.android.gms.maps.MapFragment"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</RelativeLayout>
Expand Down
9 changes: 7 additions & 2 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorPrimary">#304ffe</color>
<color name="colorPrimaryDark">#304ffe</color>
<color name="colorAccent">#FF4081</color>

<color name="red">#b71c1c</color>
Expand Down Expand Up @@ -34,4 +34,9 @@
<color name="transitstationtext">#d59563</color>
<color name="water">#17263c</color>
<color name="waterlabel">#515c6d</color>

<color name="sea">#46BCEC</color>
<color name="mainBack">#ECECEC</color>
<color name="road">#D9D9D9</color>
<color name="label">#616161</color>
</resources>
6 changes: 4 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ buildscript {
// in the individual module build.gradle files
}
}

repositories {
mavenCentral()
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
32 changes: 32 additions & 0 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.google.android.gms:play-services-maps:9.6.1'
testCompile 'junit:junit:4.12'
}
17 changes: 17 additions & 0 deletions lib/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\Users\jinesh\AppData\Local\Android\Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package test.jinesh.lib;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("test.jinesh.lib.test", appContext.getPackageName());
}
}
8 changes: 8 additions & 0 deletions lib/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="test.jinesh.lib">

<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package test.jinesh.themedgooglemap;
package test.jinesh.lib;

import android.content.Context;
import android.support.annotation.ColorInt;
Expand Down Expand Up @@ -125,7 +125,7 @@ private void setMapStyleOptions(MapStyleOptions mapStyleOptions) {
/**
* Builder class to generate the map style
*/
static class Builder {
public static class Builder {
/**
* Map style to be applied
*/
Expand Down
3 changes: 3 additions & 0 deletions lib/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">Lib</string>
</resources>
17 changes: 17 additions & 0 deletions lib/src/test/java/test/jinesh/lib/ExampleUnitTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package test.jinesh.lib;

import org.junit.Test;

import static org.junit.Assert.*;

/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include ':app'
include ':app', ':lib'

0 comments on commit 90dc600

Please sign in to comment.