Skip to content

Commit

Permalink
main
Browse files Browse the repository at this point in the history
  • Loading branch information
Deliner committed Sep 5, 2020
1 parent dc8576b commit 9ece89e
Show file tree
Hide file tree
Showing 13 changed files with 206 additions and 14 deletions.
23 changes: 18 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ android {
targetSdkVersion 30
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -30,8 +28,23 @@ dependencies {
implementation 'androidx.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'

implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.multidex:multidex:2.0.1'

implementation "com.mikepenz:materialdrawer:8.1.5"
implementation "com.mikepenz:materialdrawer-nav:8.1.5"
implementation "com.mikepenz:materialdrawer-iconics:8.1.5"
implementation "com.mikepenz:iconics-core:5.0.3"

implementation 'com.mikepenz:google-material-typeface:3.0.1.2.original@aar'
implementation 'com.mikepenz:fontawesome-typeface:5.3.1.2-kotlin@aar'
implementation 'com.mikepenz:octicons-typeface:3.2.0.4@aar'

implementation 'com.camerakit:camerakit:1.0.0-beta3.11'
implementation 'com.camerakit:jpegkit:0.1.0'
}
24 changes: 24 additions & 0 deletions app/src/debug/res/values/google_maps_api.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<resources>
<!--
TODO: Before you run your application, you need a Google Maps API key.
To get one, follow this link, follow the directions and press "Create" at the end:
https://console.developers.google.com/flows/enableapi?apiid=maps_android_backend&keyType=CLIENT_SIDE_ANDROID&r=30:41:27:37:31:6A:FA:71:F6:8A:F8:31:7A:CC:10:8C:17:E4:BA:91%3Bcom.deliner.mosfauna
You can also add your credentials to an existing key, using these values:
Package name:
com.deliner.mosfauna
SHA-1 certificate fingerprint:
30:41:27:37:31:6A:FA:71:F6:8A:F8:31:7A:CC:10:8C:17:E4:BA:91
Alternatively, follow the directions here:
https://developers.google.com/maps/documentation/android/start#get-key
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyD3oXlNXgu8RHRrhtJFr2FZSX4aR-4L_64</string>
</resources>
30 changes: 27 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,42 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.deliner.mosfauna">

<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the "MyLocation" functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<application
android:name=".system.MosFaunaApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/FaunaTheme">

<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

<activity
android:name=".MapsActivity"
android:label="@string/title_activity_maps"></activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/com/deliner/mosfauna/GreetActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.deliner.mosfauna

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class GreetActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
17 changes: 17 additions & 0 deletions app/src/main/java/com/deliner/mosfauna/JoinActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.deliner.mosfauna

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class JoinActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// setContentView(R.layout.activity_main)






}
}
11 changes: 11 additions & 0 deletions app/src/main/java/com/deliner/mosfauna/LoginActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.deliner.mosfauna

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
}
43 changes: 43 additions & 0 deletions app/src/main/java/com/deliner/mosfauna/MapsActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.deliner.mosfauna

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle

import com.google.android.gms.maps.CameraUpdateFactory
import com.google.android.gms.maps.GoogleMap
import com.google.android.gms.maps.OnMapReadyCallback
import com.google.android.gms.maps.SupportMapFragment
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.MarkerOptions

class MapsActivity : AppCompatActivity(), OnMapReadyCallback {

private lateinit var mMap: GoogleMap

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_maps)
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
val mapFragment = supportFragmentManager
.findFragmentById(R.id.map) as SupportMapFragment
mapFragment.getMapAsync(this)
}

/**
* Manipulates the map once available.
* This callback is triggered when the map is ready to be used.
* This is where we can add markers or lines, add listeners or move the camera. In this case,
* we just add a marker near Sydney, Australia.
* If Google Play services is not installed on the device, the user will be prompted to install
* it inside the SupportMapFragment. This method will only be triggered once the user has
* installed Google Play services and returned to the app.
*/
override fun onMapReady(googleMap: GoogleMap) {
mMap = googleMap

// Add a marker in Sydney and move the camera
val sydney = LatLng(-34.0, 151.0)
mMap.addMarker(MarkerOptions().position(sydney).title("Marker in Sydney"))
mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney))
}
}
6 changes: 6 additions & 0 deletions app/src/main/java/com/deliner/mosfauna/system/MosFaunaApp.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.deliner.mosfauna.system

import androidx.multidex.MultiDexApplication

class MosFaunaApp: MultiDexApplication() {
}
9 changes: 9 additions & 0 deletions app/src/main/res/layout/activity_maps.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapsActivity" />
10 changes: 7 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#6200EE</color>
<color name="colorPrimaryDark">#3700B3</color>
<color name="colorAccent">#03DAC5</color>
<color name="colorPrimary">#626D4F</color>
<color name="colorPrimaryDark">#505942</color>
<color name="colorPrimaryLight">#FFFFFF</color>
<color name="colorAccent">#A4C78F</color>
<!-- overwrite the selected colors because the primary color is to dark -->
<color name="material_drawer_selected_text">#A4C78F</color>
<color name="material_drawer_dark_selected_text">#A4C78F</color>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">MOSFAUNA</string>
<string name="title_activity_maps">Map</string>
</resources>
15 changes: 12 additions & 3 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->

<style name="FaunaTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorOnPrimary">#FFFFFF</item>

<item name="colorOnSecondary">#FFFFFF</item>
<item name="backgroundColor">#FFFFFF</item>

<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle</item>

<item name="android:windowTranslucentStatus">true</item>
<item name="windowActionModeOverlay">true</item>
</style>

</resources>
20 changes: 20 additions & 0 deletions app/src/release/res/values/google_maps_api.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<resources>
<!--
TODO: Before you release your application, you need a Google Maps API key.
To do this, you can either add your release key credentials to your existing
key, or create a new key.
Note that this file specifies the API key for the release build target.
If you have previously set up a key for the debug target with the debug signing certificate,
you will also need to set up a key for your release certificate.
Follow the directions here:
https://developers.google.com/maps/documentation/android/signup
Once you have your key (it starts with "AIza"), replace the "google_maps_key"
string in this file.
-->
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">YOUR_KEY_HERE</string>
</resources>

0 comments on commit 9ece89e

Please sign in to comment.