Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: puuuuh/ingress-map
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.0
Choose a base ref
...
head repository: puuuuh/ingress-map
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 3,894 additions and 791 deletions.
  1. +1 −0 .envrc
  2. +1 −0 .gitignore
  3. +5 −1 README.md
  4. +60 −24 app/build.gradle
  5. +2 −4 app/src/androidTest/java/com/puuuuh/ingressmap/ExampleInstrumentedTest.kt
  6. +4 −0 app/src/debug/res/values/google_maps_api.xml
  7. +57 −9 app/src/main/AndroidManifest.xml
  8. BIN app/src/main/ic_launcher-playstore.png
  9. +42 −0 app/src/main/java/com/puuuuh/ingressmap/Application.kt
  10. +301 −0 app/src/main/java/com/puuuuh/ingressmap/MainActivity.kt
  11. +16 −0 app/src/main/java/com/puuuuh/ingressmap/model/CustomLinkFile.kt
  12. +30 −0 app/src/main/java/com/puuuuh/ingressmap/model/FieldData.kt
  13. +48 −0 app/src/main/java/com/puuuuh/ingressmap/model/GameEntity.kt
  14. +37 −0 app/src/main/java/com/puuuuh/ingressmap/model/LinkData.kt
  15. +31 −0 app/src/main/java/com/puuuuh/ingressmap/model/Mod.kt
  16. +49 −0 app/src/main/java/com/puuuuh/ingressmap/model/PlayerInfo.kt
  17. +22 −0 app/src/main/java/com/puuuuh/ingressmap/model/Point.kt
  18. +97 −0 app/src/main/java/com/puuuuh/ingressmap/model/PortalData.kt
  19. +27 −0 app/src/main/java/com/puuuuh/ingressmap/model/Resonator.kt
  20. +0 −28 app/src/main/java/com/puuuuh/ingressmap/repository/AuthInterceptor.kt
  21. +80 −0 app/src/main/java/com/puuuuh/ingressmap/repository/CustomPoints.kt
  22. +152 −183 app/src/main/java/com/puuuuh/ingressmap/repository/IngressApiRepo.kt
  23. +76 −0 app/src/main/java/com/puuuuh/ingressmap/repository/Places.kt
  24. +82 −0 app/src/main/java/com/puuuuh/ingressmap/repository/Portals.kt
  25. +9 −14 app/src/main/java/com/puuuuh/ingressmap/repository/S2CellsRepo.kt
  26. +149 −27 app/src/main/java/com/puuuuh/ingressmap/settings/Settings.kt
  27. +30 −0 app/src/main/java/com/puuuuh/ingressmap/utils/AuthInterceptor.kt
  28. +59 −0 app/src/main/java/com/puuuuh/ingressmap/utils/Bounds.kt
  29. +13 −0 app/src/main/java/com/puuuuh/ingressmap/utils/Point.kt
  30. +41 −0 app/src/main/java/com/puuuuh/ingressmap/utils/PortalIcons.kt
  31. +24 −0 app/src/main/java/com/puuuuh/ingressmap/utils/Throttle.kt
  32. +12 −0 app/src/main/java/com/puuuuh/ingressmap/view/IconsSettingsFragment.kt
  33. +22 −21 app/src/main/java/com/puuuuh/ingressmap/view/Login.kt
  34. +0 −46 app/src/main/java/com/puuuuh/ingressmap/view/MainActivity.kt
  35. +411 −141 app/src/main/java/com/puuuuh/ingressmap/view/Map.kt
  36. +322 −0 app/src/main/java/com/puuuuh/ingressmap/view/OsmMap.kt
  37. +115 −21 app/src/main/java/com/puuuuh/ingressmap/view/PortalInfo.kt
  38. +41 −0 app/src/main/java/com/puuuuh/ingressmap/view/SettingsFragment.kt
  39. +1 −0 app/src/main/java/com/puuuuh/ingressmap/viewmodel/Factory.kt
  40. +28 −0 app/src/main/java/com/puuuuh/ingressmap/viewmodel/Login.kt
  41. +354 −152 app/src/main/java/com/puuuuh/ingressmap/viewmodel/Map.kt
  42. +7 −3 app/src/main/java/com/puuuuh/ingressmap/viewmodel/PortalInfo.kt
  43. BIN app/src/main/res/drawable-hdpi/ic_blue_portal.png
  44. BIN app/src/main/res/drawable-hdpi/ic_green_portal.png
  45. BIN app/src/main/res/drawable-hdpi/ic_white_portal.png
  46. BIN app/src/main/res/drawable-mdpi/ic_blue_portal.png
  47. BIN app/src/main/res/drawable-mdpi/ic_green_portal.png
  48. BIN app/src/main/res/drawable-mdpi/ic_white_portal.png
  49. BIN app/src/main/res/drawable-xhdpi/ic_blue_portal.png
  50. BIN app/src/main/res/drawable-xhdpi/ic_green_portal.png
  51. BIN app/src/main/res/drawable-xhdpi/ic_white_portal.png
  52. BIN app/src/main/res/drawable-xxhdpi/ic_blue_portal.png
  53. BIN app/src/main/res/drawable-xxhdpi/ic_green_portal.png
  54. BIN app/src/main/res/drawable-xxhdpi/ic_white_portal.png
  55. BIN app/src/main/res/drawable-xxxhdpi/ic_blue_portal.png
  56. BIN app/src/main/res/drawable-xxxhdpi/ic_green_portal.png
  57. BIN app/src/main/res/drawable-xxxhdpi/ic_white_portal.png
  58. +10 −0 app/src/main/res/drawable/ic_baseline_brush_24.xml
  59. +10 −0 app/src/main/res/drawable/ic_baseline_delete_outline_24.xml
  60. +10 −0 app/src/main/res/drawable/ic_baseline_folder_open_24.xml
  61. +10 −0 app/src/main/res/drawable/ic_baseline_image_24.xml
  62. +10 −0 app/src/main/res/drawable/ic_baseline_map_24.xml
  63. +10 −0 app/src/main/res/drawable/ic_baseline_save_24.xml
  64. +10 −0 app/src/main/res/drawable/ic_baseline_search_24.xml
  65. +10 −0 app/src/main/res/drawable/ic_baseline_settings_24.xml
  66. +10 −0 app/src/main/res/drawable/ic_baseline_settings_overscan_24.xml
  67. +12 −0 app/src/main/res/drawable/ic_menu_camera.xml
  68. +9 −0 app/src/main/res/drawable/ic_menu_gallery.xml
  69. +9 −0 app/src/main/res/drawable/ic_menu_slideshow.xml
  70. +10 −0 app/src/main/res/drawable/ic_my_location_24.xml
  71. BIN app/src/main/res/drawable/ic_portal.png
  72. +16 −13 app/src/main/res/layout/activity_main.xml
  73. +0 −37 app/src/main/res/layout/activity_map.xml
  74. +22 −0 app/src/main/res/layout/app_bar_main.xml
  75. +20 −0 app/src/main/res/layout/content_main.xml
  76. +85 −0 app/src/main/res/layout/fragment_map.xml
  77. +37 −0 app/src/main/res/layout/fragment_osmmap.xml
  78. +91 −0 app/src/main/res/layout/nav_header_main.xml
  79. +215 −13 app/src/main/res/layout/portal_info_fragment.xml
  80. +16 −0 app/src/main/res/layout/search_switch.xml
  81. +20 −0 app/src/main/res/menu/drawer_map.xml
  82. +11 −22 app/src/main/res/menu/main_menu.xml
  83. +2 −2 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
  84. +2 −2 app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
  85. BIN app/src/main/res/mipmap-hdpi/ic_launcher.png
  86. BIN app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
  87. BIN app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  88. BIN app/src/main/res/mipmap-mdpi/ic_launcher.png
  89. BIN app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
  90. BIN app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  91. BIN app/src/main/res/mipmap-xhdpi/ic_launcher.png
  92. BIN app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
  93. BIN app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  94. BIN app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  95. BIN app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
  96. BIN app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  97. BIN app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  98. BIN app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
  99. BIN app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  100. +29 −0 app/src/main/res/navigation/navgraph_map.xml
  101. BIN app/src/main/res/res/drawable-hdpi/ic_blue_marked.png
  102. BIN app/src/main/res/res/drawable-mdpi/ic_blue_marked.png
  103. BIN app/src/main/res/res/drawable-xhdpi/ic_blue_marked.png
  104. BIN app/src/main/res/res/drawable-xxhdpi/ic_blue_marked.png
  105. BIN app/src/main/res/res/drawable-xxxhdpi/ic_blue_marked.png
  106. +9 −0 app/src/main/res/values-night/styles.xml
  107. +0 −1 app/src/main/res/values/.gitignore
  108. +1 −3 app/src/main/res/values/colors.xml
  109. +5 −2 app/src/main/res/values/dimens.xml
  110. +4 −0 app/src/main/res/values/ic_launcher_background.xml
  111. +2 −2 app/src/main/res/values/portal_info_strings.xml
  112. +56 −9 app/src/main/res/values/strings.xml
  113. +7 −4 app/src/main/res/values/styles.xml
  114. +121 −0 app/src/main/res/xml/icons_preferences.xml
  115. +60 −0 app/src/main/res/xml/root_preferences.xml
  116. +4 −0 app/src/release/res/values/google_maps_api.xml
  117. +1 −2 app/src/test/java/com/puuuuh/ingressmap/ExampleUnitTest.kt
  118. +3 −3 build.gradle
  119. +43 −0 flake.lock
  120. +18 −0 flake.nix
  121. +2 −2 gradle/wrapper/gradle-wrapper.properties
  122. BIN keychain.jks
  123. +4 −0 singing.properties.example
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,3 +12,4 @@
/captures
.externalNativeBuild
.cxx
singing.properties
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
WIP
[![bitrise pipeline](https://app.bitrise.io/app/6234c240315de307.svg?token=QKbdCwKUbyjSHCdN-Wmluw "bitrise pipeline")](https://app.bitrise.io/app/6234c240315de307.svg?token=QKbdCwKUbyjSHCdN-Wmluw)

Download apk: [Telegram channel](https://t.me/ingressmapci)

WIP
84 changes: 60 additions & 24 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,67 +1,103 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: "kotlin-kapt"

android {
signingConfigs {
release {
storeFile file('/home/puh/Documents/keychain/android.jks')
storePassword ANDROID_STORE_PASSWORD
keyAlias 'Key0'
keyPassword ANDROID_KEY_PASSWORD
}
}
compileSdkVersion 29
compileSdkVersion 30
buildToolsVersion "29.0.3"

defaultConfig {
applicationId "com.puuuuh.ingressmap"
minSdkVersion 21
targetSdkVersion 29
versionCode 2
versionName "0.2.0"
minSdkVersion 24
targetSdkVersion 30
versionCode 3
versionName '0.3.0'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.release
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.release
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}

kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation "androidx.fragment:fragment-ktx:1.3.0-rc01"
implementation "androidx.fragment:fragment-ktx:1.2.5"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.libraries.places:places:2.2.0'
implementation 'com.google.android.libraries.places:places:2.4.0'
implementation 'io.sgr:s2-geometry-library-java:1.0.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2"

implementation "androidx.room:room-runtime:2.2.6"
implementation 'androidx.preference:preference:1.1.1'
kapt "androidx.room:room-compiler:2.2.6"
implementation "androidx.room:room-ktx:2.2.6"


implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.2'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.2'
implementation 'androidx.preference:preference-ktx:1.1.1'

implementation 'org.osmdroid:osmdroid-android:6.1.8'
implementation 'com.github.MKergall:osmbonuspack:6.6.0'

implementation 'com.getbase:floatingactionbutton:1.10.1'

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

implementation "com.github.skydoves:colorpickerpreference:2.0.5"
}

// https://gist.github.com/Takhion/8245967
Properties props = new Properties()
def propFile = file(new File('signing.properties'))
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))
if (props != null &&
props.containsKey('STORE_FILE') &&
props.containsKey('STORE_PASSWORD') &&
props.containsKey('KEY_ALIAS') &&
props.containsKey('KEY_PASSWORD')) {
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
android.signingConfigs.release.keyAlias = props['KEY_ALIAS']
android.signingConfigs.release.keyPassword = props['KEY_PASSWORD']
} else {
println 'signing.properties found but some entries are missing'
android.buildTypes.release.signingConfig = null
}
} else {
println 'signing.properties not found'
android.buildTypes.release.signingConfig = null
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.puuuuh.ingressmap

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
4 changes: 4 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,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">AIzaSyBiNrgpSTqeXzVIm9DoWA8XlzhPiEzX6OM</string>
</resources>
66 changes: 57 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -7,7 +7,12 @@
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />

<queries>
<package android:name="com.android.vending" />
</queries>

<application
android:name=".MainApplication"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
@@ -17,21 +22,64 @@
android:usesCleartextTraffic="true"
tools:targetApi="m">

<activity android:name="com.puuuuh.ingressmap.view.MapActivity" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

<activity
android:name=".view.LoginActivity"
android:label="@string/title_activity_login" />
<activity android:name=".view.MainActivity" >
android:name=".MainActivity"
android:label="@string/title_activity_main">

<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />

<data
android:scheme="geo" />
</intent-filter>

<intent-filter>
<action android:name="android.intent.action.VIEW" />

<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />

<data
android:host="intel.ingress.com"
android:pathPrefix="/intel"
android:scheme="http" />
<data
android:host="intel.ingress.com"
android:pathPrefix="/intel"
android:scheme="https" />
<data
android:host="intel.ingress.com"
android:pathPrefix="/"
android:scheme="http" />
<data
android:host="intel.ingress.com"
android:pathPrefix="/"
android:scheme="https" />

</intent-filter>

<meta-data
android:name="android.app.default_searchable"
android:value=".MainActivity" />

</activity>

<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/google_maps_key" />

<activity
android:name=".view.LoginActivity"
android:label="@string/title_activity_login" />
</application>

</manifest>
</manifest>
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions app/src/main/java/com/puuuuh/ingressmap/Application.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.puuuuh.ingressmap

import android.app.Application
import android.content.Context
import androidx.appcompat.app.AppCompatDelegate
import com.google.gson.Gson
import com.google.gson.GsonBuilder
import com.puuuuh.ingressmap.model.*
import com.puuuuh.ingressmap.settings.Settings

// Not object class. AndroidManifest.xml error happen.
class MainApplication : Application() {

init {
instance = this
}

companion object {
private var instance: MainApplication? = null
val gson: Gson = GsonBuilder()
.registerTypeAdapter(GameEntity::class.java, GameEntityDeserializer())
.registerTypeAdapter(FieldData::class.java, FieldDeserializer())
.registerTypeAdapter(LinkData::class.java, LinkDeserializer())
.registerTypeAdapter(Mod::class.java, ModDeserializer())
.registerTypeAdapter(Point::class.java, PointDeserializer())
.registerTypeAdapter(PortalData::class.java, PortalDeserializer())
.registerTypeAdapter(Resonator::class.java, ResonatorDeserializer())
.registerTypeAdapter(PlayerInfo::class.java, PlayerInfoDeserializer())
.create()

fun applicationContext(): Context {
return instance!!.applicationContext
}
}

override fun onCreate() {
super.onCreate()
val context = applicationContext()
Settings.init(context)
AppCompatDelegate.setDefaultNightMode(Settings.theme)
}
}
Loading