Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Esi Rewrite #11

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 60 additions & 2 deletions .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### Android ###
# Built application files
*.apk
*.ap_

# Files for the Dalvik VM
# Files for the ART/Dalvik VM
*.dex

# Java class files
Expand Down Expand Up @@ -34,5 +35,62 @@ captures/

# Intellij
*.iml
.idea/
.idea/workspace.xml
.idea/libraries

.idea/
# Keystore files
*.jks

### Android Patch ###
gen-external-apklibs


### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk


### Java ###
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# Allow anything in the gradle wrapper folder
!gradle/wrapper/*
!gradle/wrapper/gradle-wrapper.jar
!gradle/wrapper/gradle-wrapper.properties
/app/google-services.json
Empty file modified .travis.yml
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified app/.gitignore
100644 → 100755
Empty file.
112 changes: 59 additions & 53 deletions app/build.gradle
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,44 +1,49 @@
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'


android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude '.readme'
}

lintOptions {
abortOnError false
}

compileSdkVersion 28
buildToolsVersion "28.0.0"
defaultConfig {
applicationId "com.w9jds.marketbot"
targetSdkVersion 27
minSdkVersion 21
versionCode 13
versionName "v2.0.4"
versionName "v3.0.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
postprocessing {
removeUnusedCode false
removeUnusedResources false
obfuscate false
optimizeCode false
proguardFile 'proguard-rules.pro'
}
}
}

dataBinding {
enabled = true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

buildscript {
repositories {
mavenCentral()
jcenter()
}

dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
kapt {
generateStubs = true
}
}

Expand All @@ -49,45 +54,46 @@ repositories {
maven { url "https://jitpack.io" }
}

def dbflow_version = "3.0.0-beta5"
def google_version = "23.4.0"

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:1.2.41"

debugCompile 'com.facebook.stetho:stetho:1.3.1'
debugCompile 'com.facebook.stetho:stetho-okhttp:1.3.1'
debugCompile 'com.facebook.stetho:stetho-urlconnection:1.3.1'
debugImplementation "com.facebook.stetho:stetho:1.5.0"
debugImplementation "com.facebook.stetho:stetho-okhttp3:1.5.0"
debugImplementation "com.facebook.stetho:stetho-urlconnection:1.5.0"

compile "com.android.support:support-v4:${google_version}"
compile "com.android.support:palette-v7:${google_version}"
compile "com.android.support:appcompat-v7:${google_version}"
compile "com.android.support:recyclerview-v7:${google_version}"
compile "com.android.support:design:${google_version}"
implementation "android.arch.navigation:navigation-fragment:1.0.0-alpha02"
implementation "android.arch.navigation:navigation-ui:1.0.0-alpha02"

apt 'com.google.dagger:dagger-compiler:2.2'
apt 'com.android.databinding:compiler:2.0.0-rc3'
apt "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
implementation "androidx.room:room-runtime:2.0.0-alpha1"
implementation "androidx.room:room-rxjava2:2.0.0-alpha1"
kapt "androidx.room:room-compiler:2.0.0-alpha1"

provided 'org.glassfish:javax.annotation:10.0-b28'
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0-alpha1"
implementation "androidx.constraintlayout:constraintlayout:1.1.2"
implementation "com.google.android.material:material:1.0.0-alpha3"

implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.google.firebase:firebase-database:16.0.1"

compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
compileOnly 'org.glassfish:javax.annotation:10.0-b28'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'

implementation "com.squareup.retrofit2:retrofit:2.4.0"
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation "com.squareup.retrofit2:adapter-rxjava2:2.4.0"

implementation "com.google.dagger:dagger:2.14.1"
implementation 'com.github.bumptech.glide:glide:4.7.1'

kapt 'com.github.bumptech.glide:compiler:4.7.1'
kapt "com.google.dagger:dagger-compiler:2.14.1"
kapt "com.android.databinding:compiler:3.1.3"


compile 'com.google.dagger:dagger:2.2'
compile 'io.reactivex:rxandroid:1.1.0'
compile 'io.reactivex:rxjava:1.1.2'
compile 'com.github.PhilJay:MPAndroidChart:v2.2.4'
compile 'com.squareup.retrofit2:retrofit:2.0.1'
compile 'com.squareup.retrofit2:converter-jackson:2.0.1'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.1'
compile 'org.devfleet.crest:api:0.+'
compile 'org.devfleet.crest:retrofit:0.+'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.android.support:support-v4:23.4.0'
}

apply plugin: 'com.google.gms.google-services'
Empty file modified app/proguard-rules.pro
100644 → 100755
Empty file.
13 changes: 0 additions & 13 deletions app/src/androidTest/java/com/w9jds/marketbot/ApplicationTest.java

This file was deleted.

Empty file modified app/src/debug/AndroidManifest.xml
100644 → 100755
Empty file.
22 changes: 0 additions & 22 deletions app/src/debug/java/com/w9jds/marketbot/DebugMarketBot.java

This file was deleted.

18 changes: 18 additions & 0 deletions app/src/debug/java/com/w9jds/marketbot/DebugMarketBot.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.w9jds.marketbot

import com.facebook.stetho.Stetho
import com.w9jds.marketbot.classes.MarketBot

class DebugMarketBot : MarketBot() {

override fun onCreate() {
super.onCreate()

Stetho.initialize(
Stetho.newInitializerBuilder(this)
.enableDumpapp(Stetho.defaultDumperPluginsProvider(this))
.enableWebKitInspector(Stetho.defaultInspectorModulesProvider(this))
.build())
}

}
45 changes: 8 additions & 37 deletions app/src/main/AndroidManifest.xml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.w9jds.marketbot">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.INTERNET" />

<application
Expand All @@ -11,56 +13,25 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/MarketBot">
android:theme="@style/Theme.MarketBot"
android:fullBackupContent="false"
tools:ignore="GoogleAppIndexingWarning">

<activity
android:name=".ui.MainActivity"
android:theme="@style/MarketBot.Activities.MainActivity"
android:theme="@style/Theme.MarketBot.Activities"
android:configChanges="orientation|screenSize|keyboardHidden">

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

</intent-filter>

<meta-data
android:name="android.app.default_searchable"
android:value=".activities.SearchActivity" />
</activity>

<activity
android:name=".ui.ItemActivity"
android:theme="@style/MarketBot.Activities.ItemActivity"
android:configChanges="orientation|screenSize|keyboardHidden">

<intent-filter>
<action android:name="com.w9jds.marketbot.intent.action.OPEN_TYPE" />
<category android:name="android.intent.category.DEFAULT"/>

</intent-filter>

</activity>

<activity
android:name=".ui.SearchActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:configChanges="orientation|screenSize|keyboardHidden">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>

<intent-filter>
<action android:name="com.google.android.gms.actions.SEARCH_ACTION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<nav-graph android:value="@navigation/nav_graph"/>

<meta-data
android:name="android.app.searchable"
android:resource="@xml/searchable" />
</activity>

<activity android:name=".ui.InfoActivity">

</activity>

Expand Down
28 changes: 28 additions & 0 deletions app/src/main/java/com/w9jds/marketbot/classes/ApiService.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.w9jds.marketbot.classes

import com.w9jds.marketbot.classes.models.universe.Reference
import com.w9jds.marketbot.classes.models.market.MarketOrder
import com.w9jds.marketbot.classes.models.universe.Station
import io.reactivex.Observable
import retrofit2.Call
import retrofit2.http.*

interface ApiService {

@GET("/v1/markets/{region_id}/orders/")
fun getOrders(
@Path("region_id") regionId: Int,
@Query("type_id") typeId: Int
): Observable<List<MarketOrder>>

@POST("/v2/universe/names/")
fun getNames(
@Body ids: List<Long>
): Call<List<Reference>>

@GET("/v2/universe/stations/{station_id}/")
fun getStation(
@Path("station_id") locationId: Long
): Call<Station>

}
Loading