Skip to content

Commit 46b11a3

Browse files
committed
Base project for Dev Sprint Gustavo Santorio #2
1 parent 1e3a435 commit 46b11a3

File tree

70 files changed

+1939
-0
lines changed

Some content is hidden

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

70 files changed

+1939
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
id 'kotlin-kapt'
5+
id 'com.google.secrets_gradle_plugin' version '0.4'
6+
}
7+
8+
android {
9+
compileSdk 31
10+
11+
defaultConfig {
12+
applicationId "com.devpass.spaceapp"
13+
minSdk 21
14+
targetSdk 31
15+
versionCode 1
16+
versionName "1.0"
17+
18+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
19+
}
20+
21+
def localProperties = new Properties()
22+
localProperties.load(new FileInputStream(rootProject.file("local.properties")))
23+
24+
flavorDimensions "type"
25+
productFlavors {
26+
prod {
27+
dimension "type"
28+
buildConfigField 'String', 'BASE_URL', '"prod.prod.com"'
29+
}
30+
dev {
31+
dimension "type"
32+
buildConfigField 'String', 'BASE_URL', '"https://api.spacexdata.com/v4/"'
33+
manifestPlaceholders = [MAPS_API_KEY: localProperties["maps_api_key"]]
34+
}
35+
}
36+
37+
buildTypes {
38+
release {
39+
// Enables code shrinking, obfuscation, and optimization for only
40+
// your project's release build type.
41+
minifyEnabled true
42+
43+
// Enables resource shrinking, which is performed by the
44+
// Android Gradle plugin.
45+
shrinkResources true
46+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
47+
}
48+
debug {
49+
minifyEnabled false
50+
}
51+
}
52+
53+
compileOptions {
54+
sourceCompatibility JavaVersion.VERSION_11
55+
targetCompatibility JavaVersion.VERSION_11
56+
}
57+
kotlinOptions {
58+
jvmTarget = '11'
59+
}
60+
buildFeatures {
61+
viewBinding true
62+
}
63+
}
64+
65+
dependencies {
66+
def lifecycle_version = "2.4.1"
67+
68+
implementation 'androidx.core:core-ktx:1.7.0'
69+
implementation 'androidx.appcompat:appcompat:1.3.0'
70+
implementation 'androidx.activity:activity-ktx:1.4.0'
71+
implementation 'com.google.android.material:material:1.4.0'
72+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
73+
testImplementation 'junit:junit:4.13.2'
74+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
75+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
76+
77+
//Maps
78+
implementation 'com.google.android.gms:play-services-maps:18.0.2'
79+
80+
//Lifecycle
81+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
82+
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
83+
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
84+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.devpass.spaceapp
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.devpass.spaceapp", appContext.packageName)
23+
}
24+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.devpass.spaceapp">
4+
5+
<uses-permission android:name="android.permission.INTERNET"/>
6+
7+
<application
8+
android:name=".App"
9+
android:allowBackup="true"
10+
android:icon="@mipmap/ic_launcher"
11+
android:label="@string/app_name"
12+
android:roundIcon="@mipmap/ic_launcher_round"
13+
android:supportsRtl="true"
14+
android:theme="@style/Theme.SpaceApp">
15+
16+
<meta-data
17+
android:name="com.google.android.geo.API_KEY"
18+
android:value="${MAPS_API_KEY}"/>
19+
20+
<activity
21+
android:name="com.devpass.spaceapp.presentation.launchList.LaunchListActivity"
22+
android:exported="true">
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN" />
25+
26+
<category android:name="android.intent.category.LAUNCHER" />
27+
</intent-filter>
28+
</activity>
29+
30+
<activity
31+
android:name=".presentation.LaunchpadDetailsActivity"
32+
android:exported="true"/>
33+
34+
<meta-data
35+
android:name="preloaded_fonts"
36+
android:resource="@array/preloaded_fonts" />
37+
</application>
38+
39+
</manifest>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.devpass.spaceapp
2+
3+
import android.app.Application
4+
5+
class App : Application(){
6+
override fun onCreate() {
7+
super.onCreate()
8+
}
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.devpass.spaceapp.data.api
2+
3+
interface SpaceXAPIService {
4+
5+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.devpass.spaceapp.presentation
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.fragment.app.Fragment
8+
import com.devpass.spaceapp.databinding.FragmentDetailsBinding
9+
10+
class FragmentDetails: Fragment() {
11+
12+
private var binding: FragmentDetailsBinding? = null
13+
14+
override fun onCreateView(
15+
inflater: LayoutInflater, container: ViewGroup?,
16+
savedInstanceState: Bundle?
17+
): View? {
18+
// Inflate the layout for this fragment
19+
binding = FragmentDetailsBinding.inflate(inflater, container, false)
20+
return binding?.root
21+
}
22+
23+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
24+
super.onViewCreated(view, savedInstanceState)
25+
}
26+
27+
override fun onDestroyView() {
28+
super.onDestroyView()
29+
binding?.root
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.devpass.spaceapp.presentation
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.fragment.app.Fragment
8+
import com.devpass.spaceapp.databinding.FragmentLaunchpadBinding
9+
10+
class FragmentLaunchpad : Fragment() {
11+
12+
private var binding: FragmentLaunchpadBinding? = null
13+
14+
override fun onCreateView(
15+
inflater: LayoutInflater, container: ViewGroup?,
16+
savedInstanceState: Bundle?
17+
): View? {
18+
// Inflate the layout for this fragment
19+
binding = FragmentLaunchpadBinding.inflate(inflater, container, false)
20+
return binding?.root
21+
}
22+
23+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
24+
super.onViewCreated(view, savedInstanceState)
25+
}
26+
27+
override fun onDestroyView() {
28+
super.onDestroyView()
29+
binding?.root
30+
}
31+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.devpass.spaceapp.presentation
2+
3+
import android.os.Bundle
4+
import android.view.LayoutInflater
5+
import android.view.View
6+
import android.view.ViewGroup
7+
import androidx.fragment.app.Fragment
8+
import com.devpass.spaceapp.databinding.FragmentRocketBinding
9+
10+
class FragmentRocket : Fragment() {
11+
12+
private var binding: FragmentRocketBinding? = null
13+
14+
override fun onCreateView(
15+
inflater: LayoutInflater, container: ViewGroup?,
16+
savedInstanceState: Bundle?
17+
): View? {
18+
// Inflate the layout for this fragment
19+
binding = FragmentRocketBinding.inflate(inflater, container, false)
20+
return binding?.root
21+
}
22+
23+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
24+
super.onViewCreated(view, savedInstanceState)
25+
}
26+
27+
override fun onDestroyView() {
28+
super.onDestroyView()
29+
binding?.root
30+
}
31+
}

0 commit comments

Comments
 (0)