Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
bc81c185
Commit
bc81c185
authored
Sep 03, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/base_application' into develop
parents
18cdd5a1
7370656c
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
223 additions
and
19 deletions
+223
-19
misc.xml
.idea/misc.xml
+1
-1
vcs.xml
.idea/vcs.xml
+6
-0
build.gradle
app/build.gradle
+78
-12
ExampleInstrumentedTest.kt
...va/com/biganto/visual/roompark/ExampleInstrumentedTest.kt
+2
-4
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+2
-1
RoomParkApplication.kt
...a/com/biganto/visual/roompark/base/RoomParkApplication.kt
+52
-0
RoomParkMainActivity.kt
.../com/biganto/visual/roompark/base/RoomParkMainActivity.kt
+21
-0
AppModule.kt
...ain/java/com/biganto/visual/roompark/di/koin/AppModule.kt
+34
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-0
build.gradle
build.gradle
+4
-1
dependencies.gradle
dependencies.gradle
+22
-0
No files found.
.idea/misc.xml
View file @
bc81c185
...
...
@@ -148,7 +148,7 @@
</profile-state>
</entry>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
7
"
project-jdk-name=
"JDK"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1_
8
"
project-jdk-name=
"JDK"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
.idea/vcs.xml
0 → 100644
View file @
bc81c185
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
app/build.gradle
View file @
bc81c185
...
...
@@ -2,33 +2,99 @@ apply plugin: 'com.android.application'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-kapt'
apply
plugin:
'kotlin-android-extensions'
apply
from:
'../dependencies.gradle'
//apply plugin: 'io.fabric'
android
{
compileSdkVersion
28
compileSdkVersion
compileSdkVersion_RoomPark
defaultConfig
{
applicationId
"com.biganto.visual.roompark"
minSdkVersion
21
targetSdkVersion
28
versionCode
1
versionName
"1.0"
applicationId
$APPLICATION_ID
ndk
{
abiFilters
'armeabi-v7a'
,
'x86'
}
minSdkVersion
minSdkVersion_RoomPark
targetSdkVersion
targetSdkVersion_RoomPark
versionCode
VERSION_CODE
versionName
VERSION_NAME
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
}
buildTypes
{
debug
{
aaptOptions
.
cruncherEnabled
=
false
ext
.
alwaysUpdateBuildId
=
false
}
release
{
minifyEnabled
false
proguardFiles
getDefaultProguardFile
(
'proguard-android-optimize.txt'
),
'proguard-rules.pro'
proguardFiles
getDefaultProguardFile
(
'proguard-android.txt'
),
'proguard-rules.pro'
debuggable
false
}
}
androidExtensions
{
experimental
=
true
}
configurations
.
all
{
resolutionStrategy
.
force
"com.bluelinelabs:conductor:$conductorVersion"
}
aaptOptions
{
noCompress
'.unity3d'
,
'.ress'
,
'.resource'
,
'.obb'
}
compileOptions
{
targetCompatibility
1.8
sourceCompatibility
1.8
}
}
kapt
{
mapDiagnosticLocations
=
true
}
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
]
)
implementation
fileTree
(
include:
[
'*.jar'
,
'*.aar'
],
dir:
'libs'
)
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation
'androidx.appcompat:appcompat:1.0.2'
implementation
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation
'androidx.core:core-ktx:1.0.2'
implementation
'androidx.constraintlayout:constraintlayout:1.1.3'
//Koin
implementation
"org.koin:koin-core:$koinVersion"
implementation
"org.koin:koin-core-ext:$koinVersion"
implementation
"org.koin:koin-android:$koinVersion"
implementation
"org.koin:koin-android-scope:$koinVersion"
//Material
implementation
"com.google.android.material:material:$materialVersion"
//Constraint Layout
implementation
"androidx.constraintlayout:constraintlayout:$constrainLayoutVersion"
//image loading store and cashe by url: Picasso
implementation
"com.squareup.picasso:picasso:$picassoVersion"
//Logger: Timber
implementation
"com.jakewharton.timber:timber:$timberVersion"
//Crashlytics
implementation
(
'com.crashlytics.sdk.android:crashlytics:2.10.0@aar'
)
{
transitive
=
true
;
}
//Tests
testImplementation
'junit:junit:4.12'
androidTestImplementation
'androidx.test:runner:1.1.1'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation
'androidx.test:runner:1.2.0'
androidTestImplementation
'androidx.test.ext:junit:1.1.1'
androidTestImplementation
'androidx.test.ext:truth:1.2.0'
androidTestImplementation
'com.google.truth:truth:0.42'
androidTestImplementation
'androidx.test.espresso:espresso-core:3.2.0'
}
app/src/androidTest/java/com/biganto/visual/roompark/ExampleInstrumentedTest.kt
View file @
bc81c185
package
com.biganto.visual.roompark
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.
*
...
...
app/src/main/AndroidManifest.xml
View file @
bc81c185
...
...
@@ -3,13 +3,14 @@
package=
"com.biganto.visual.roompark"
>
<application
android:name=
".base.RoomParkApplication"
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"
>
<activity
android:name=
".
RoomParkMainAcit
vity"
>
<activity
android:name=
".
base.RoomParkMainActi
vity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
app/src/main/java/com/biganto/visual/roompark/base/RoomParkApplication.kt
0 → 100644
View file @
bc81c185
package
com.biganto.visual.roompark.base
import
android.app.Application
import
android.util.Log
import
com.biganto.visual.roompark.BuildConfig
import
com.biganto.visual.roompark.di.koin.initDI
import
com.crashlytics.android.Crashlytics
import
com.squareup.picasso.Picasso
import
timber.log.Timber
/**
* Created by Vladislav Bogdashkin on 03.09.2019.
*/
class
RoomParkApplication
:
Application
()
{
override
fun
onCreate
()
{
super
.
onCreate
()
initDI
()
if
(
BuildConfig
.
DEBUG
)
Timber
.
plant
(
Timber
.
DebugTree
())
else
Timber
.
plant
(
CrashlyticsTree
())
val
picassoBuilder
=
Picasso
.
Builder
(
this
)
picassoBuilder
.
listener
{
_
,
uri
,
exception
->
Timber
.
e
(
exception
)
Timber
.
e
(
exception
,
"PICASSO url = %s"
,
uri
.
toString
())
}
// Picasso.Builder creates the Picasso object to do the actual requests
val
picasso
=
picassoBuilder
.
build
()
try
{
Picasso
.
setSingletonInstance
(
picasso
)
}
catch
(
ignored
:
IllegalStateException
)
{
Timber
.
e
(
ignored
,
"PICASSO"
)
// Picasso instance was already set
// cannot set it after Picasso.with(Context) was already in use
}
}
}
private
class
CrashlyticsTree
:
Timber
.
Tree
()
{
override
fun
log
(
priority
:
Int
,
tag
:
String
?,
message
:
String
,
throwable
:
Throwable
?)
{
if
(
priority
==
Log
.
VERBOSE
||
priority
==
Log
.
DEBUG
)
return
Crashlytics
.
log
(
priority
,
tag
,
message
)
throwable
?.
let
{
Crashlytics
.
logException
(
it
)
}
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/MainActivity.kt
→
app/src/main/java/com/biganto/visual/roompark/
base/RoomPark
MainActivity.kt
View file @
bc81c185
package
com.biganto.visual.roompark
package
com.biganto.visual.roompark
.base
import
android.os.Bundle
import
android.widget.TextView
import
androidx.appcompat.app.AppCompatActivity
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.di.koin.StartUpData
import
org.koin.android.scope.currentScope
class
RoomParkMainAcitvity
:
AppCompatActivity
()
{
class
RoomParkMainActivity
:
AppCompatActivity
()
{
lateinit
var
entryText
:
TextView
private
val
entryDate
:
StartUpData
by
currentScope
.
inject
()
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
setContentView
(
R
.
layout
.
activity_main
)
entryText
=
findViewById
(
R
.
id
.
entryTextView
)
entryText
.
text
=
entryDate
.
helloText
}
}
app/src/main/java/com/biganto/visual/roompark/di/koin/AppModule.kt
0 → 100644
View file @
bc81c185
package
com.biganto.visual.roompark.di.koin
import
com.biganto.visual.roompark.base.RoomParkApplication
import
com.biganto.visual.roompark.base.RoomParkMainActivity
import
org.koin.android.ext.koin.androidContext
import
org.koin.android.ext.koin.androidLogger
import
org.koin.core.context.startKoin
import
org.koin.core.qualifier.named
import
org.koin.dsl.module
/**
* Created by Vladislav Bogdashkin on 03.09.2019.
*/
fun
RoomParkApplication
.
initDI
(){
startKoin
{
androidLogger
()
androidContext
(
this
@initDI
)
modules
(
listOf
(
appModule
,
scopesModule
))
}
}
val
appModule
=
module
{
}
val
scopesModule
=
module
{
scope
(
named
<
RoomParkMainActivity
>()){
scoped
{
StartUpData
(
"ja pesik!"
)
}
}
}
data class
StartUpData
(
val
helloText
:
String
)
app/src/main/res/layout/activity_main.xml
View file @
bc81c185
...
...
@@ -7,6 +7,7 @@
tools:context=
".MainActivity"
>
<TextView
android:id=
"@+id/entryTextView"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"Hello World!"
...
...
build.gradle
View file @
bc81c185
...
...
@@ -3,12 +3,15 @@
buildscript
{
ext
.
kotlin_version
=
'1.3.41'
repositories
{
flatDir
{
dirs
'libs'
}
google
()
jcenter
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:3.5.0'
classpath
"com.android.tools.build:gradle:3.5.0"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
...
...
dependencies.gradle
0 → 100644
View file @
bc81c185
ext
{
$APPLICATION_ID
=
"com.biganto.visual.roompark"
targetSdkVersion_RoomPark
=
28
minSdkVersion_RoomPark
=
21
compileSdkVersion_RoomPark
=
28
VERSION_CODE
=
1
VERSION_NAME
=
"0.0.1"
// supportLibraryVersion = '1.1.0-alpha05'
constrainLayoutVersion
=
'1.1.3'
// requeryVersion = '1.5.1'
// rxBindingVersion = '2.1.1'
conductorVersion
=
'3.0.0-rc1'
materialVersion
=
'1.1.0-alpha09'
gradleVersion
=
'3.5.0'
koinVersion
=
'2.0.1'
timberVersion
=
'4.7.1'
picassoVersion
=
'2.71828'
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment