-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a533db9
Showing
93 changed files
with
4,365 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-kapt' | ||
apply plugin: 'kotlin-android-extensions' | ||
|
||
android { | ||
compileSdkVersion 28 | ||
defaultConfig { | ||
applicationId "lv.garage.aastream" | ||
minSdkVersion 21 | ||
targetSdkVersion 28 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation fileTree(dir: 'libs', include: ['*.aar']) | ||
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" | ||
implementation 'androidx.appcompat:appcompat:1.0.2' | ||
implementation 'androidx.core:core-ktx:1.0.2' | ||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3' | ||
testImplementation 'junit:junit:4.12' | ||
androidTestImplementation 'androidx.test:runner:1.1.1' | ||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' | ||
implementation 'com.google.code.gson:gson:2.8.5' | ||
implementation 'eu.chainfire:libsuperuser:1.1.0.201903290044' | ||
implementation 'com.google.dagger:dagger:2.21' | ||
annotationProcessor 'com.google.dagger:dagger-compiler:2.21' | ||
kapt 'com.google.dagger:dagger-compiler:2.21' | ||
implementation 'androidx.recyclerview:recyclerview:1.0.0' | ||
kapt 'com.github.bumptech.glide:glide:4.9.0' | ||
kapt "com.github.bumptech.glide:compiler:4.9.0" | ||
implementation 'com.github.bumptech.glide:glide:4.9.0' | ||
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0' | ||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:dist="http://schemas.android.com/apk/distribution" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
package="com.garage.aastream"> | ||
|
||
<dist:module dist:instant="true"/> | ||
|
||
<uses-permission android:name="android.permission.INTERNET"/> | ||
<uses-permission android:name="android.permission.WAKE_LOCK"/> | ||
<uses-permission android:name="android.permission.ACCESS_SUPERUSER"/> | ||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | ||
|
||
<!-- System permissions - granted for root --> | ||
<uses-permission android:name="android.permission.CAPTURE_VIDEO_OUTPUT" tools:ignore="ProtectedPermissions"/> | ||
<uses-permission android:name="android.permission.CAPTURE_SECURE_VIDEO_OUTPUT" tools:ignore="ProtectedPermissions"/> | ||
<uses-permission android:name="android.permission.WRITE_SETTINGS" tools:ignore="ProtectedPermissions"/> | ||
|
||
<application | ||
android:name="com.garage.aastream.App" | ||
android:allowBackup="true" | ||
android:fullBackupContent="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme" | ||
tools:ignore="GoogleAppIndexingWarning"> | ||
|
||
<activity | ||
android:name="com.garage.aastream.activities.CarDebugActivity" | ||
android:theme="@style/AppTheme.NoActionBar"/> | ||
|
||
<activity | ||
android:name="com.garage.aastream.activities.ResultRequestActivity" | ||
android:exported="false"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
</intent-filter> | ||
</activity> | ||
|
||
<activity android:name="com.garage.aastream.activities.SettingsActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
|
||
<service | ||
android:name="com.garage.aastream.services.CarService" | ||
android:enabled="true" | ||
android:exported="true" | ||
android:label="@string/app_name" | ||
tools:ignore="ExportedService"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION" /> | ||
<category android:name="com.google.android.gms.car.category.CATEGORY_PROJECTION_OEM" /> | ||
</intent-filter> | ||
</service> | ||
|
||
<meta-data | ||
android:name="com.google.android.gms.car.application" | ||
android:resource="@xml/automotive_app_desc" /> | ||
</application> | ||
|
||
</manifest> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.garage.aastream | ||
|
||
import android.app.Application | ||
import com.garage.aastream.injection.DaggerInjectionComponent | ||
import com.garage.aastream.injection.InjectionComponent | ||
import com.garage.aastream.injection.InjectionModule | ||
import com.garage.aastream.utils.DevLog | ||
|
||
/** | ||
* Created by Endy Rubbin on 22.05.2019 10:54. | ||
* For project: AAStream | ||
*/ | ||
@Suppress("unused") | ||
class App : Application() { | ||
|
||
lateinit var component: InjectionComponent | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
DevLog.init(getString(R.string.app_name), BuildConfig.DEBUG) | ||
component = DaggerInjectionComponent.builder().injectionModule(InjectionModule(this)).build() | ||
component.inject(this) | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
app/src/main/java/com/garage/aastream/activities/CarDebugActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.garage.aastream.activities | ||
|
||
import android.content.res.Configuration | ||
import android.os.Bundle | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.garage.aastream.App | ||
import com.garage.aastream.R | ||
import com.garage.aastream.activities.controllers.CarActivityController | ||
import com.garage.aastream.utils.DevLog | ||
import javax.inject.Inject | ||
|
||
/** | ||
* Created by Endy Rubbin on 22.05.2019 10:44. | ||
* For project: AAStream | ||
*/ | ||
class CarDebugActivity : AppCompatActivity() { | ||
|
||
@Inject lateinit var activityController: CarActivityController | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
setTheme(R.style.AppTheme_NoActionBar) | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_car) | ||
(application as App).component.inject(this) | ||
|
||
DevLog.d("Car debug activity created") | ||
activityController.onCreate(window.decorView, windowManager, savedInstanceState == null) | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
activityController.onResume() | ||
} | ||
|
||
override fun onStart() { | ||
super.onStart() | ||
activityController.onStart() | ||
} | ||
|
||
override fun onStop() { | ||
super.onStop() | ||
activityController.onStop() | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
activityController.onDestroy() | ||
} | ||
|
||
override fun onConfigurationChanged(newConfig: Configuration?) { | ||
super.onConfigurationChanged(newConfig) | ||
activityController.onConfigurationChanged() | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
app/src/main/java/com/garage/aastream/activities/CarMainActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package com.garage.aastream.activities | ||
|
||
import android.content.res.Configuration | ||
import android.os.Bundle | ||
import com.google.android.apps.auto.sdk.CarActivity | ||
import com.garage.aastream.App | ||
import com.garage.aastream.R | ||
import com.garage.aastream.activities.controllers.CarActivityController | ||
import com.garage.aastream.utils.DevLog | ||
import javax.inject.Inject | ||
|
||
/** | ||
* Created by Endy Rubbin on 22.05.2019 10:44. | ||
* For project: AAStream | ||
*/ | ||
class CarMainActivity : CarActivity() { | ||
|
||
@Inject lateinit var activityController: CarActivityController | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
setTheme(R.style.AppTheme_NoActionBar) | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_car) | ||
(applicationContext as App).component.inject(this) | ||
|
||
DevLog.d("Car debug activity created") | ||
activityController.onCreate(c().decorView, c().windowManager, | ||
savedInstanceState == null, carUiController) | ||
@Suppress("DEPRECATION") | ||
setIgnoreConfigChanges(0xFFFF) | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
activityController.onResume() | ||
} | ||
|
||
override fun onStart() { | ||
super.onStart() | ||
activityController.onStart() | ||
} | ||
|
||
override fun onStop() { | ||
super.onStop() | ||
activityController.onStop() | ||
} | ||
|
||
override fun onDestroy() { | ||
super.onDestroy() | ||
activityController.onDestroy() | ||
} | ||
|
||
override fun onConfigurationChanged(newConfig: Configuration?) { | ||
super.onConfigurationChanged(newConfig) | ||
activityController.onConfigurationChanged() | ||
} | ||
|
||
override fun onWindowFocusChanged(focus: Boolean, b1: Boolean) { | ||
super.onWindowFocusChanged(focus, b1) | ||
DevLog.d("Window focus changed $focus") | ||
if (focus) { | ||
activityController.onWindowFocusChanged() | ||
} | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
app/src/main/java/com/garage/aastream/activities/ResultRequestActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.garage.aastream.activities | ||
|
||
import android.content.Context | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.os.Handler | ||
import android.os.Message | ||
import androidx.appcompat.app.AppCompatActivity | ||
import com.garage.aastream.R | ||
import com.garage.aastream.utils.DevLog | ||
|
||
/** | ||
* Created by Endy Rubbin on 27.05.2019 16:11. | ||
* For project: AAStream | ||
*/ | ||
class ResultRequestActivity: AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
DevLog.d("Request onCreate") | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_request_result) | ||
startActivityForResult() | ||
} | ||
|
||
override fun onDestroy() { | ||
DevLog.d("Request onDestroy") | ||
super.onDestroy() | ||
} | ||
|
||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { | ||
DevLog.d("Request onActivityResult") | ||
super.onActivityResult(requestCode, resultCode, data) | ||
if (resultHandler != null) { | ||
val msg = Message.obtain(resultHandler, requestWhat, requestCode, resultCode, data) | ||
msg.sendToTarget() | ||
} | ||
finish() | ||
} | ||
|
||
private fun startActivityForResult() { | ||
DevLog.d("Request startActivityForResult") | ||
if (resultHandler != null && requestIntent != null) { | ||
startActivityForResult(requestIntent, requestCode) | ||
} else { | ||
finish() | ||
} | ||
} | ||
|
||
companion object { | ||
private var resultHandler: Handler? = null | ||
private var requestWhat: Int = 0 | ||
private var requestIntent: Intent? = null | ||
private var requestCode: Int = 0 | ||
|
||
fun startActivityForResult(context: Context, handler: Handler, what: Int, intent: Intent, requestCod: Int) { | ||
DevLog.d("startActivityForResult") | ||
resultHandler = handler | ||
requestWhat = what | ||
requestIntent = intent | ||
requestCode = requestCod | ||
|
||
val request = Intent(context, ResultRequestActivity::class.java) | ||
request.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) | ||
context.startActivity(request) | ||
} | ||
} | ||
} |
Oops, something went wrong.