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
0459e678
Commit
0459e678
authored
Apr 06, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix errors
parent
0845fa5b
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
60 additions
and
21 deletions
+60
-21
BigantoBasePresenter.kt
...biganto/visual/roompark/conductor/BigantoBasePresenter.kt
+2
-3
PhotoDialogController.kt
...isual/roompark/conductor/dialogs/PhotoDialogController.kt
+3
-0
TourChooserDialogController.kt
...uctor/dialogs/tour_chooser/TourChooserDialogController.kt
+1
-0
EstateRepository.kt
...to/visual/roompark/data/data_provider/EstateRepository.kt
+1
-1
ScreenController.kt
...l/roompark/presentation/screen/albums/ScreenController.kt
+1
-0
ScreenPresenter.kt
...al/roompark/presentation/screen/albums/ScreenPresenter.kt
+2
-1
ScreenPresenter.kt
...ual/roompark/presentation/screen/deals/ScreenPresenter.kt
+4
-2
ScreenPresenter.kt
.../roompark/presentation/screen/settings/ScreenPresenter.kt
+0
-2
SnackBarModule.kt
...isual/roompark/util/view_utils/snackbar/SnackBarModule.kt
+23
-3
activity_main.xml
app/src/main/res/layout/activity_main.xml
+3
-2
date_album_viewholder.xml
app/src/main/res/layout/date_album_viewholder.xml
+1
-0
tour_chooser_viewholder.xml
app/src/main/res/layout/tour_chooser_viewholder.xml
+6
-6
styles.xml
app/src/main/res/values-v23/styles.xml
+1
-0
styles.xml
app/src/main/res/values/styles.xml
+12
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/BigantoBasePresenter.kt
View file @
0459e678
...
@@ -30,12 +30,11 @@ abstract class BigantoBasePresenter<V : MvpView, VS>
...
@@ -30,12 +30,11 @@ abstract class BigantoBasePresenter<V : MvpView, VS>
open
fun
parseError
(
t
:
Throwable
)
:
VS
=
open
fun
parseError
(
t
:
Throwable
)
:
VS
=
when
(
t
)
{
when
(
t
)
{
is
CustomApiException
->{
is
CustomApiException
->
{
Timber
.
e
(
"CustomApiException ${t.messageStringId} / ${t.customMessage}"
)
Timber
.
e
(
"CustomApiException ${t.messageStringId} / ${t.customMessage}"
)
parse
(
t
)
parse
(
t
)
}
}
is
NoNetworkException
->
{
parse
(
t
)}
is
NoNetworkException
->
parse
(
t
)
else
->
{
Timber
.
e
(
t
);
parse
(
t
)}
else
->
{
Timber
.
e
(
t
);
parse
(
t
)}
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/PhotoDialogController.kt
View file @
0459e678
package
com.biganto.visual.roompark.conductor.dialogs
package
com.biganto.visual.roompark.conductor.dialogs
import
android.annotation.SuppressLint
import
android.content.pm.ActivityInfo
import
android.content.pm.ActivityInfo
import
android.graphics.Bitmap
import
android.graphics.Bitmap
import
android.os.Bundle
import
android.os.Bundle
...
@@ -37,6 +38,7 @@ class PhotoDialogController : Controller {
...
@@ -37,6 +38,7 @@ class PhotoDialogController : Controller {
lateinit
var
recyclerView
:
RecyclerView
lateinit
var
recyclerView
:
RecyclerView
@SuppressLint
(
"SourceLockedOrientationActivity"
)
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
):
View
{
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
val
view
=
inflater
.
inflate
(
getLayoutId
(),
container
,
false
)
...
@@ -85,6 +87,7 @@ class PhotoDialogController : Controller {
...
@@ -85,6 +87,7 @@ class PhotoDialogController : Controller {
@LayoutRes
@LayoutRes
fun
getLayoutId
()
=
R
.
layout
.
photo_viewer
fun
getLayoutId
()
=
R
.
layout
.
photo_viewer
@SuppressLint
(
"SourceLockedOrientationActivity"
)
override
fun
handleBack
():
Boolean
{
override
fun
handleBack
():
Boolean
{
activity
?.
requestedOrientation
=
ActivityInfo
.
SCREEN_ORIENTATION_USER_PORTRAIT
activity
?.
requestedOrientation
=
ActivityInfo
.
SCREEN_ORIENTATION_USER_PORTRAIT
return
router
.
popCurrentController
()
return
router
.
popCurrentController
()
...
...
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/tour_chooser/TourChooserDialogController.kt
View file @
0459e678
...
@@ -77,6 +77,7 @@ class ChooseTourDialogController : Controller {
...
@@ -77,6 +77,7 @@ class ChooseTourDialogController : Controller {
})
})
view
.
findViewById
<
View
>(
R
.
id
.
close_current_button
).
setOnClickListener
{
handleBack
()
}
view
.
findViewById
<
View
>(
R
.
id
.
close_current_button
).
setOnClickListener
{
handleBack
()
}
view
.
setOnClickListener
{
handleBack
()
}
return
view
return
view
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/data/data_provider/EstateRepository.kt
View file @
0459e678
...
@@ -232,7 +232,7 @@ class EstateRepository @Inject constructor(
...
@@ -232,7 +232,7 @@ class EstateRepository @Inject constructor(
override
fun
getDeals
():
Observable
<
List
<
DealModel
>>
{
override
fun
getDeals
():
Observable
<
List
<
DealModel
>>
{
return
Observable
.
mergeDelayError
(
return
Observable
.
mergeDelayError
(
arrayListOf
(
arrayListOf
(
getDealsDb
,
//
getDealsDb,
getDealsApi
getDealsApi
)
)
)
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenController.kt
View file @
0459e678
...
@@ -300,6 +300,7 @@ class AlbumsScreenController :
...
@@ -300,6 +300,7 @@ class AlbumsScreenController :
.
debounce
(
300L
,
TimeUnit
.
MILLISECONDS
)
.
debounce
(
300L
,
TimeUnit
.
MILLISECONDS
)
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doOnNext
{
(
albumsRecyclerView
.
adapter
as
AlbumListAdapter
).
setItems
(
arrayListOf
())}
.
doOnNext
{
(
albumsRecyclerView
.
adapter
as
AlbumListAdapter
).
setItems
(
arrayListOf
())}
.
share
()
override
fun
onPhotoSelected
():
Observable
<
PhotoModel
>
override
fun
onPhotoSelected
():
Observable
<
PhotoModel
>
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenPresenter.kt
View file @
0459e678
...
@@ -69,8 +69,9 @@ class AlbumsScreenPresenter @Inject constructor(
...
@@ -69,8 +69,9 @@ class AlbumsScreenPresenter @Inject constructor(
val
headerItemSelected
=
intent
(
AlbumsScreen
::
onAlbumSelected
)
val
headerItemSelected
=
intent
(
AlbumsScreen
::
onAlbumSelected
)
.
doOnNext
{
selectedIndex
=
it
.
albumId
}
.
doOnNext
{
selectedIndex
=
it
.
albumId
}
.
doOnNext
{
restoreModel
.
currentIndex
=
it
.
albumId
}
.
doOnNext
{
restoreModel
.
currentIndex
=
it
.
albumId
}
.
flat
Map
<
AlbumsScreenViewState
>
{
model
->
.
switch
Map
<
AlbumsScreenViewState
>
{
model
->
requestAlbum
(
model
.
albumId
)
requestAlbum
(
model
.
albumId
)
.
onErrorReturn
(
::
parseError
)
.
startWith
(
Observable
.
just
<
AlbumsScreenViewState
>(
AlbumsScreenViewState
.
HeaderAlbumChoosed
(
item
=
model
))
.
startWith
(
Observable
.
just
<
AlbumsScreenViewState
>(
AlbumsScreenViewState
.
HeaderAlbumChoosed
(
item
=
model
))
)
)
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/deals/ScreenPresenter.kt
View file @
0459e678
...
@@ -30,15 +30,17 @@ class DealsScreenPresenter @Inject constructor(
...
@@ -30,15 +30,17 @@ class DealsScreenPresenter @Inject constructor(
val
fetchDeals
=
interactor
.
fetchDeals
()
val
fetchDeals
=
interactor
.
fetchDeals
()
.
flatMap
{
deals
->
.
flatMap
{
deals
->
getStatusList
getStatusList
.
map
{
.
map
{
List
(
deals
.
size
)
{
index
->
List
(
deals
.
size
)
{
index
->
DealPreviewModel
(
DealPreviewModel
(
Pair
(
deals
[
index
],
it
)
Pair
(
deals
[
index
],
it
)
)
)
}
}
}
}
.
doOnError
{
Timber
.
e
(
" ERORORO "
)
}
}
}
.
map
(
DealsScreenViewState
::
DealsLoaded
)
.
map
<
DealsScreenViewState
>(
DealsScreenViewState
::
DealsLoaded
)
.
onErrorReturn
(
::
parseError
)
val
state
=
Observable
.
mergeDelayError
(
val
state
=
Observable
.
mergeDelayError
(
arrayListOf
(
arrayListOf
(
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/settings/ScreenPresenter.kt
View file @
0459e678
...
@@ -101,8 +101,6 @@ class SettingsScreenPresenter @Inject constructor(
...
@@ -101,8 +101,6 @@ class SettingsScreenPresenter @Inject constructor(
}
}
.
startWith
(
SettingsScreenViewState
.
OnCacheDeleting
(
0f
))
.
startWith
(
SettingsScreenViewState
.
OnCacheDeleting
(
0f
))
.
doOnError
{
Timber
.
e
(
it
)
}
.
doOnError
{
Timber
.
e
(
it
)
}
.
onErrorReturn
(
::
parseError
)
}
}
val
state
=
Observable
.
mergeDelayError
(
val
state
=
Observable
.
mergeDelayError
(
...
...
app/src/main/java/com/biganto/visual/roompark/util/view_utils/snackbar/SnackBarModule.kt
View file @
0459e678
...
@@ -5,8 +5,10 @@ import android.view.View
...
@@ -5,8 +5,10 @@ import android.view.View
import
androidx.annotation.StringRes
import
androidx.annotation.StringRes
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.R
import
com.biganto.visual.roompark.base.IBottomNavigation
import
com.biganto.visual.roompark.util.view_utils.snackbar.SnackBarMessageType.*
import
com.biganto.visual.roompark.util.view_utils.snackbar.SnackBarMessageType.*
import
com.google.android.material.snackbar.Snackbar
import
com.google.android.material.snackbar.Snackbar
import
timber.log.Timber
import
javax.inject.Inject
import
javax.inject.Inject
/**
/**
...
@@ -68,9 +70,27 @@ class SnackBarProvider @Inject constructor(val activity: Activity) : ISnackBarPr
...
@@ -68,9 +70,27 @@ class SnackBarProvider @Inject constructor(val activity: Activity) : ISnackBarPr
override
fun
showSnackBar
(
message
:
String
,
type
:
SnackBarMessageType
,
length
:
Int
)
{
override
fun
showSnackBar
(
message
:
String
,
type
:
SnackBarMessageType
,
length
:
Int
)
{
snack
?.
dismiss
()
snack
?.
dismiss
()
snack
=
Snackbar
snack
=
Snackbar
.
make
(
parentView
,
message
,
length
)
.
make
(
parentView
,
message
,
length
)
.
setAction
(
actionText
(
type
))
{}
// .setAction(actionText(type)) {}
.
setActionTextColor
(
color
(
type
))
// .setActionTextColor(color(type))
Timber
.
w
(
" act - ${activity} "
)
Timber
.
w
(
" act - ${(activity as? IBottomNavigation)} "
)
// (activity as? IBottomNavigation)?.let {bNAv ->
// Timber.w(" act $bNAv" )
// snack?.apply {
// Timber.w(" sna")
// view.layoutParams = (view.layoutParams as CoordinatorLayout.LayoutParams).apply {
// Timber.w(" fusc $this")
// setMargins(
// leftMargin,
// topMargin,
// rightMargin,
// 300
// )
// }
// }?.show()
// }
snack
?.
show
()
snack
?.
show
()
}
}
...
...
app/src/main/res/layout/activity_main.xml
View file @
0459e678
...
@@ -120,13 +120,14 @@
...
@@ -120,13 +120,14 @@
<com.google.android.material.bottomnavigation.BottomNavigationView
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id=
"@+id/bottom_navigation_view"
android:id=
"@+id/bottom_navigation_view"
android:background=
"@color/colorOpacityCardBackground"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"
wrap_conten
t"
android:layout_height=
"
@dimen/bottom_navigation_heigh
t"
android:layout_gravity=
"bottom"
android:layout_gravity=
"bottom"
android:fitsSystemWindows=
"true"
android:fitsSystemWindows=
"true"
android:visibility=
"gone"
android:visibility=
"gone"
app:elevation=
"0dp"
app:elevation=
"0dp"
app:itemBackground=
"@color/color
CommonBackground
"
app:itemBackground=
"@color/color
OpacityBackgroundInv
"
app:itemHorizontalTranslationEnabled=
"false"
app:itemHorizontalTranslationEnabled=
"false"
app:itemIconTint=
"@drawable/bottom_navigation_icon_selector"
app:itemIconTint=
"@drawable/bottom_navigation_icon_selector"
app:labelVisibilityMode=
"unlabeled"
app:labelVisibilityMode=
"unlabeled"
...
...
app/src/main/res/layout/date_album_viewholder.xml
View file @
0459e678
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
android:minHeight=
"80dp"
android:orientation=
"vertical"
android:orientation=
"vertical"
tools:itemCount=
"1"
tools:itemCount=
"1"
tools:listitem=
"@layout/photo_preview_viewholder"
/>
tools:listitem=
"@layout/photo_preview_viewholder"
/>
...
...
app/src/main/res/layout/tour_chooser_viewholder.xml
View file @
0459e678
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
android:id=
"@+id/tour_preview_imageView"
android:id=
"@+id/tour_preview_imageView"
android:layout_width=
"32dp"
android:layout_width=
"32dp"
android:layout_height=
"32dp"
android:layout_height=
"32dp"
android:layout_marginStart=
"
19
dp"
android:layout_marginStart=
"
0
dp"
android:layout_marginTop=
"16dp"
android:layout_marginTop=
"16dp"
android:layout_marginBottom=
"16dp"
android:layout_marginBottom=
"16dp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
app:srcCompat=
"@drawable/ic_bell_on"
/>
app:srcCompat=
"@drawable/ic_bell_on"
/>
<com.google.android.material.textview.MaterialTextView
<com.google.android.material.textview.MaterialTextView
style=
"@style/
Default_TextView
"
style=
"@style/
Common_Text.Notice
"
android:id=
"@+id/tour_name"
android:id=
"@+id/tour_name"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -34,12 +34,12 @@
...
@@ -34,12 +34,12 @@
<ImageView
<ImageView
android:id=
"@+id/tour_status_imageView"
android:id=
"@+id/tour_status_imageView"
android:layout_width=
"
32dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"
32dp
"
android:layout_height=
"
wrap_content
"
android:layout_marginTop=
"8dp"
android:layout_marginTop=
"8dp"
android:layout_marginEnd=
"16dp"
android:layout_marginEnd=
"16dp"
app:layout_constraintBottom_toBottomOf=
"
parent
"
app:layout_constraintBottom_toBottomOf=
"
@+id/tour_name
"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toTopOf=
"
parent
"
app:layout_constraintTop_toTopOf=
"
@+id/tour_name
"
app:srcCompat=
"@drawable/ic_back"
/>
app:srcCompat=
"@drawable/ic_back"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
app/src/main/res/values-v23/styles.xml
View file @
0459e678
...
@@ -18,5 +18,6 @@
...
@@ -18,5 +18,6 @@
<item
name=
"colorControlNormal"
>
@color/colorAccent
</item>
<item
name=
"colorControlNormal"
>
@color/colorAccent
</item>
<item
name=
"android:statusBarColor"
>
@color/colorPrimary
</item>
<item
name=
"android:statusBarColor"
>
@color/colorPrimary
</item>
<item
name=
"android:windowLightStatusBar"
>
true
</item>
<item
name=
"android:windowLightStatusBar"
>
true
</item>
<item
name=
"snackbarStyle"
>
@style/Widget.RoomPark.Snackbar
</item>
</style>
</style>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/styles.xml
View file @
0459e678
<resources>
<resources
xmlns:tools=
"http://schemas.android.com/tools"
>
<!-- Base application theme. -->
<!-- Base application theme. -->
<style
name=
"AppTheme"
parent=
"Theme.MaterialComponents.Light.NoActionBar"
>
<style
name=
"AppTheme"
parent=
"Theme.MaterialComponents.Light.NoActionBar"
>
...
@@ -15,6 +15,17 @@
...
@@ -15,6 +15,17 @@
<item
name=
"colorControlHighlight"
>
@color/colorAccent
</item>
<item
name=
"colorControlHighlight"
>
@color/colorAccent
</item>
<item
name=
"colorControlNormal"
>
@color/colorAccent
</item>
<item
name=
"colorControlNormal"
>
@color/colorAccent
</item>
<item
name=
"android:statusBarColor"
>
@color/colorPrimary
</item>
<item
name=
"android:statusBarColor"
>
@color/colorPrimary
</item>
<item
name=
"snackbarStyle"
>
@style/Widget.RoomPark.Snackbar
</item>
</style>
<style
name=
"Widget.RoomPark.Snackbar"
parent=
"Widget.MaterialComponents.Snackbar"
tools:override=
"true"
>
<item
name=
"android:layout_margin"
>
@null
</item>
<!-- Use default Snackbar margins for top/left/right -->
<item
name=
"android:layout_marginTop"
tools:ignore=
"PrivateResource"
>
@dimen/mtrl_snackbar_margin
</item>
<item
name=
"android:layout_marginLeft"
tools:ignore=
"PrivateResource"
>
@dimen/mtrl_snackbar_margin
</item>
<item
name=
"android:layout_marginRight"
tools:ignore=
"PrivateResource"
>
@dimen/mtrl_snackbar_margin
</item>
<!-- Custom bottom margin, this could work for top/left/right too -->
<item
name=
"android:layout_marginBottom"
>
@dimen/bottom_navigation_height
</item>
</style>
</style>
<style
name=
"Widget.MainTextInputStyle"
parent=
"Widget.MaterialComponents.TextInputLayout.OutlinedBox"
>
<style
name=
"Widget.MainTextInputStyle"
parent=
"Widget.MaterialComponents.TextInputLayout.OutlinedBox"
>
...
...
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