Compare commits
5 Commits
master
...
feature/MI
| Author | SHA1 | Date |
|---|---|---|
|
|
03afdcbe20 | |
|
|
78b0715f51 | |
|
|
8218d32f88 | |
|
|
14f2d637aa | |
|
|
985a5658f0 |
|
|
@ -1,10 +1,10 @@
|
|||
apply plugin: 'kotlin-android'
|
||||
|
||||
rootProject.ext {
|
||||
compileSdk = 30
|
||||
compileSdk = 34
|
||||
|
||||
minSdk = 21
|
||||
targetSdk = 30
|
||||
targetSdk = 34
|
||||
}
|
||||
|
||||
android {
|
||||
|
|
@ -16,12 +16,12 @@ android {
|
|||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
|
|
|
|||
|
|
@ -1 +1,5 @@
|
|||
apply from: "../android-configs/lib-config.gradle"
|
||||
|
||||
android {
|
||||
namespace = "ru.touchin.basemap"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<manifest package="ru.touchin.basemap"/>
|
||||
<manifest />
|
||||
|
|
|
|||
10
build.gradle
10
build.gradle
|
|
@ -1,8 +1,8 @@
|
|||
buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
maven {
|
||||
url = uri("https://nexus.mir/repository/maven-proxy-group/")
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.0.0'
|
||||
|
|
@ -14,10 +14,8 @@ buildscript {
|
|||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
maven {
|
||||
url "https://maven.dev.touchin.ru/"
|
||||
url = uri("https://nexus.mir/repository/maven-proxy-group/")
|
||||
metadataSources {
|
||||
artifact()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
apply from: "../android-configs/lib-config.gradle"
|
||||
|
||||
android {
|
||||
namespace = "ru.touchin.extensions"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "androidx.recyclerview:recyclerview"
|
||||
implementation "androidx.fragment:fragment-ktx"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
apply from: "../android-configs/lib-config.gradle"
|
||||
|
||||
android {
|
||||
namespace = "ru.touchin.roboswag.core.log"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "androidx.annotation:annotation"
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ dependencies {
|
|||
constraints {
|
||||
implementation("androidx.appcompat:appcompat") {
|
||||
version {
|
||||
require '1.7.0-alpha03'
|
||||
require '1.0.2'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,21 +25,9 @@ abstract class KeyboardResizeableViewController<TActivity : BaseActivity, TState
|
|||
lifecycle.addObserver(activity.keyboardBehaviorDetector as LifecycleObserver)
|
||||
}
|
||||
|
||||
private val onKeyboardHideListener = {
|
||||
if (isKeyboardVisible) {
|
||||
onKeyboardHide()
|
||||
}
|
||||
isKeyboardVisible = false
|
||||
}
|
||||
|
||||
private val onKeyboardShowListener = { diff: Int ->
|
||||
onKeyboardShow(diff)
|
||||
isKeyboardVisible = true
|
||||
}
|
||||
|
||||
private var isKeyboardVisible: Boolean = false
|
||||
|
||||
private val keyboardHidingOnBackPressedListener = OnBackPressedListener {
|
||||
private val keyboardHideListener = OnBackPressedListener {
|
||||
if (isKeyboardVisible) {
|
||||
UiUtils.OfViews.hideSoftInput(activity)
|
||||
true
|
||||
|
|
@ -58,31 +46,39 @@ abstract class KeyboardResizeableViewController<TActivity : BaseActivity, TState
|
|||
isHideKeyboardOnBackEnabled = true
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
activity.keyboardBehaviorDetector?.apply {
|
||||
addOnHideListener(onKeyboardHideListener)
|
||||
addOnShowListener(onKeyboardShowListener)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (isHideKeyboardOnBackEnabled) activity.addOnBackPressedListener(keyboardHidingOnBackPressedListener)
|
||||
if (isHideKeyboardOnBackEnabled) activity.addOnBackPressedListener(keyboardHideListener)
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
notifyKeyboardHidden()
|
||||
if (isHideKeyboardOnBackEnabled) activity.removeOnBackPressedListener(keyboardHidingOnBackPressedListener)
|
||||
if (isHideKeyboardOnBackEnabled) activity.removeOnBackPressedListener(keyboardHideListener)
|
||||
}
|
||||
|
||||
@CallSuper
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
activity.keyboardBehaviorDetector?.apply {
|
||||
keyboardHideListener = {
|
||||
if (isKeyboardVisible) {
|
||||
onKeyboardHide()
|
||||
}
|
||||
isKeyboardVisible = false
|
||||
}
|
||||
keyboardShowListener = { diff ->
|
||||
onKeyboardShow(diff)
|
||||
isKeyboardVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
activity.keyboardBehaviorDetector?.apply {
|
||||
removeOnHideListener(onKeyboardHideListener)
|
||||
removeOnShowListener(onKeyboardShowListener)
|
||||
keyboardHideListener = null
|
||||
keyboardShowListener = null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -90,4 +86,5 @@ abstract class KeyboardResizeableViewController<TActivity : BaseActivity, TState
|
|||
if (isKeyboardVisible) onKeyboardHide()
|
||||
isKeyboardVisible = false
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,13 +69,12 @@ open class ViewController<TActivity : FragmentActivity, TState : Parcelable>(
|
|||
|
||||
val view: View = creationContext.inflater.inflate(layoutRes, creationContext.container, false)
|
||||
|
||||
override val lifecycle: Lifecycle
|
||||
get() = fragment.viewLifecycleOwner.lifecycle
|
||||
|
||||
init {
|
||||
lifecycle.addObserver(LifecycleLoggingObserver(this))
|
||||
}
|
||||
|
||||
override fun getLifecycle(): Lifecycle = fragment.viewLifecycleOwner.lifecycle
|
||||
|
||||
/**
|
||||
* Look for a child view with the given id. If this view has the given id, return this view.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -71,19 +71,6 @@ open class DelegationListAdapter<TItem>(config: AsyncDifferConfig<TItem>) : Recy
|
|||
*/
|
||||
fun submitList(list: List<TItem>) = differ.submitList(list)
|
||||
|
||||
/**
|
||||
* Submits a new list to be diffed, and displayed.
|
||||
*
|
||||
* The commit callback can be used to know when the List is committed, but note that it
|
||||
* may not be executed. If List B is submitted immediately after List A, and is
|
||||
* committed directly, the callback associated with List A will not be run.
|
||||
*
|
||||
* @param newList The new List.
|
||||
* @param commitCallback Optional runnable that is executed when the List is committed, if
|
||||
* it is committed.
|
||||
*/
|
||||
fun submitList(list: List<TItem>?, commitCallback: (() -> Unit)?) = differ.submitList(list, commitCallback)
|
||||
|
||||
/**
|
||||
* Get the current List - any diffing to present this list has already been computed and
|
||||
* dispatched via the ListUpdateCallback.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
apply from: "../android-configs/lib-config.gradle"
|
||||
apply plugin: 'kotlin-android'
|
||||
|
||||
android {
|
||||
namespace = "ru.touchin.roboswag.recyclerview_decorators"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(":utils")
|
||||
implementation project(":kotlin-extensions")
|
||||
|
|
@ -28,5 +32,7 @@ dependencies {
|
|||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://nexus.mir/repository/maven-proxy-group/")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
apply from: "../android-configs/lib-config.gradle"
|
||||
|
||||
android {
|
||||
namespace = "ru.touchin.roboswag.core.utils"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def coreVersion = '1.0.0'
|
||||
def annotationVersion = '1.1.0'
|
||||
|
|
|
|||
|
|
@ -35,5 +35,7 @@ dependencies {
|
|||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://nexus.mir/repository/maven-proxy-group/")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,26 +36,24 @@ class LoadingContentView @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
private fun updateView(state: State) {
|
||||
when (state) {
|
||||
State.ShowContent -> {
|
||||
getChildAt(childCount - 1)?.let { showChild(it.id) }
|
||||
}
|
||||
|
||||
is State.Stub -> {
|
||||
setStubText(state.stubText)
|
||||
showChild(R.id.text_stub)
|
||||
}
|
||||
|
||||
State.Loading -> {
|
||||
showChild(R.id.progress_bar)
|
||||
}
|
||||
|
||||
is State.Error -> {
|
||||
binding.apply {
|
||||
errorText.text = state.errorText
|
||||
errorRepeatButton.setOnRippleClickListener { state.action.invoke() }
|
||||
errorRepeatButton.text = state.repeatButtonText
|
||||
showChild(R.id.error_with_repeat)
|
||||
if (state == State.ShowContent) {
|
||||
getChildAt(childCount - 1)?.let { showChild(it.id) }
|
||||
} else {
|
||||
when (state) {
|
||||
is State.Stub -> {
|
||||
setStubText(state.stubText)
|
||||
showChild(R.id.text_stub)
|
||||
}
|
||||
is State.Loading -> {
|
||||
showChild(R.id.progress_bar)
|
||||
}
|
||||
is State.Error -> {
|
||||
binding.apply {
|
||||
errorText.text = state.errorText
|
||||
errorRepeatButton.setOnRippleClickListener { state.action.invoke() }
|
||||
errorRepeatButton.text = state.repeatButtonText
|
||||
showChild(R.id.error_with_repeat)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,5 +46,7 @@ dependencies {
|
|||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven {
|
||||
url = uri("https://nexus.mir/repository/maven-proxy-group/")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,3 +13,7 @@ dependencies {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "ru.touchin.yandexmap"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
<manifest package="ru.touchin.yandexmap"/>
|
||||
<manifest />
|
||||
|
|
|
|||
Loading…
Reference in New Issue