Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
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
220b3111
Commit
220b3111
authored
Sep 03, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add timber, picasso, crashlytics
parent
ad2d80ea
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
1 deletion
+51
-1
build.gradle
app/build.gradle
+11
-0
RoomParkApplication.kt
...a/com/biganto/visual/roompark/base/RoomParkApplication.kt
+37
-1
dependencies.gradle
dependencies.gradle
+3
-0
No files found.
app/build.gradle
View file @
220b3111
...
...
@@ -79,6 +79,17 @@ dependencies {
//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.2.0'
...
...
app/src/main/java/com/biganto/visual/roompark/base/RoomParkApplication.kt
View file @
220b3111
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.
...
...
@@ -11,6 +16,37 @@ 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
dependencies.gradle
View file @
220b3111
...
...
@@ -16,4 +16,7 @@ ext {
materialVersion
=
'1.1.0-alpha09'
gradleVersion
=
'3.5.0'
koinVersion
=
'2.0.1'
timberVersion
=
'4.7.1'
picassoVersion
=
'2.5.2'
}
\ 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