Compare commits

..

5 Commits

Author SHA1 Message Date
rybakoff888ilia@gmail.com 03afdcbe20 Merge branch 'refs/heads/develop/mir-stash' into feature/MIR-6740-nexus 2024-07-09 18:11:39 +03:00
rybakoff888ilia@gmail.com 78b0715f51 change repos to nspk 2024-05-13 18:23:22 +03:00
Bogdan Terehov 8218d32f88 Merge pull request 'fix add namespace to yandex-map and base-map' (#13) from feature/update_gradle into feature/MIR-6740
Reviewed-on: #13
Reviewed-by: Vladimir Skorobogatov <vladimir.skorobogatov@noreply.localhost>
2024-05-02 13:02:27 +03:00
Bogdan Terehov 14f2d637aa fix add namespace to yandex-map and base-map 2024-05-01 18:38:51 +03:00
Bogdan Terehov 985a5658f0 feature MIR-6740: [Android] Добавление поддержки Android 14
migrate to gradle 8.0
2023-12-27 23:28:36 +03:00
17 changed files with 88 additions and 79 deletions

View File

@ -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 {

View File

@ -1 +1,5 @@
apply from: "../android-configs/lib-config.gradle"
android {
namespace = "ru.touchin.basemap"
}

View File

@ -1 +1 @@
<manifest package="ru.touchin.basemap"/>
<manifest />

View File

@ -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()
}

View File

@ -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"

View File

@ -1,5 +1,9 @@
apply from: "../android-configs/lib-config.gradle"
android {
namespace = "ru.touchin.roboswag.core.log"
}
dependencies {
implementation "androidx.annotation:annotation"

View File

@ -12,7 +12,7 @@ dependencies {
constraints {
implementation("androidx.appcompat:appcompat") {
version {
require '1.7.0-alpha03'
require '1.0.2'
}
}
}

View File

@ -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
}
}

View File

@ -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.
*

View File

@ -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.

View File

@ -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/")
}
}

View File

@ -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'

View File

@ -35,5 +35,7 @@ dependencies {
}
repositories {
mavenCentral()
maven {
url = uri("https://nexus.mir/repository/maven-proxy-group/")
}
}

View File

@ -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)
}
}
}
}

View File

@ -46,5 +46,7 @@ dependencies {
}
repositories {
mavenCentral()
maven {
url = uri("https://nexus.mir/repository/maven-proxy-group/")
}
}

View File

@ -13,3 +13,7 @@ dependencies {
}
}
}
android {
namespace = "ru.touchin.yandexmap"
}

View File

@ -1 +1 @@
<manifest package="ru.touchin.yandexmap"/>
<manifest />