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
7370656c
Commit
7370656c
authored
Sep 03, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added activity inject sample code
parent
220b3111
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
3 deletions
+13
-3
RoomParkMainActivity.kt
.../com/biganto/visual/roompark/base/RoomParkMainActivity.kt
+8
-1
AppModule.kt
...ain/java/com/biganto/visual/roompark/di/koin/AppModule.kt
+3
-1
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-0
dependencies.gradle
dependencies.gradle
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/base/RoomParkMainActivity.kt
View file @
7370656c
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
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
View file @
7370656c
...
...
@@ -27,6 +27,8 @@ 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 @
7370656c
...
...
@@ -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!"
...
...
dependencies.gradle
View file @
7370656c
...
...
@@ -17,6 +17,6 @@ ext {
gradleVersion
=
'3.5.0'
koinVersion
=
'2.0.1'
timberVersion
=
'4.7.1'
picassoVersion
=
'2.
5.2
'
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