androidx

AndroidX migrate dependency / libraries

感情迁移 提交于 2020-06-25 09:00:07
问题 I have successfully migrated my project to AndroidX. App is running perfectly , but I am getting compile time errors, because my dependencies use support package. Reason of this error Because PhotoView is a dependency class, which uses android.support.v7.widget.AppCompatImageView which is no more available in my project. Because it is now androidx.appcompat.widget.AppCompatImageView Project still run? Yes, android.enableJetifier convert this dependency to AndroidX at runtime, but I want to

Unresolved reference ActivityTestRule for AndroidX

扶醉桌前 提交于 2020-06-24 19:49:49
问题 I'm trying to test my UI via instrumentation test, with androidX espresso library. In my grade I have: apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: "kotlin-kapt" android { compileSdkVersion 28 defaultConfig { applicationId "it.zehus.mybike" minSdkVersion 21 targetSdkVersion 28 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" android.defaultConfig

TextInputLayout FilledBox boxBackgroundColor not apply alpha channel

僤鯓⒐⒋嵵緔 提交于 2020-06-16 21:24:38
问题 TextInputLayout boxBackgroundColor not apply alpha channel. This happened when I merge app to AndroidX. Before merging everything was working good. When boxBackgroundColor is "#77ff0000" color appears as light red when I set boxBackgroundColor as transparent, color appears as white. It draws background like first fill with white color and then applies given boxBackgroundColor. Gradle: implementation 'androidx.appcompat:appcompat:1.1.0-alpha01' implementation 'com.google.android.material

TextInputLayout FilledBox boxBackgroundColor not apply alpha channel

对着背影说爱祢 提交于 2020-06-16 21:18:32
问题 TextInputLayout boxBackgroundColor not apply alpha channel. This happened when I merge app to AndroidX. Before merging everything was working good. When boxBackgroundColor is "#77ff0000" color appears as light red when I set boxBackgroundColor as transparent, color appears as white. It draws background like first fill with white color and then applies given boxBackgroundColor. Gradle: implementation 'androidx.appcompat:appcompat:1.1.0-alpha01' implementation 'com.google.android.material

TextInputLayout FilledBox boxBackgroundColor not apply alpha channel

风格不统一 提交于 2020-06-16 21:18:19
问题 TextInputLayout boxBackgroundColor not apply alpha channel. This happened when I merge app to AndroidX. Before merging everything was working good. When boxBackgroundColor is "#77ff0000" color appears as light red when I set boxBackgroundColor as transparent, color appears as white. It draws background like first fill with white color and then applies given boxBackgroundColor. Gradle: implementation 'androidx.appcompat:appcompat:1.1.0-alpha01' implementation 'com.google.android.material

Koin sharedViewModel with SavedStateHandle

余生颓废 提交于 2020-06-16 01:30:32
问题 I have single activity application and number of fragments. Some of these fragments are using my viewmodel, typically like this: private val myViewModel: MyViewModel by sharedViewModel() What if I want to have the model both shared and keep its state with SavedStateHandle? I cannot figure out if this is supported and if so, how it needs to be used (declaring viewmodel as stateViewModel in hosting activity is not working). 回答1: Update: as koin 2.1.6 is around, they introduced org.koin.androidx

After changing the version to Androidx, it does not become mqtt connect

拜拜、爱过 提交于 2020-05-31 04:16:40
问题 After changing version to Androidx and can not connect to mqtt server. It worked well in other versions than Androidx. Is this a version problem? My source code and build information is on the link-> I added it when I made the project. AndroidX Artifact has not been mqt communication since then. What is the problem? My error Logs↓ E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.adfdffffaaaaaaa, PID: 28371 java.lang.NoClassDefFoundError: Failed resolution of: Landroidx

The given artifact contains a string literal with a package reference 'android.support.v4.widget' that cannot be safely rewritten

你。 提交于 2020-05-30 07:52:07
问题 Got this error when I tried to sync my project with gradle files ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory). Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:23:5-342

After migrating to AndroidX application crashes with Attempt to invoke androidx.fragment.app.FragmentManagerImpl.isDestroyed() on a null ref

强颜欢笑 提交于 2020-05-28 14:17:05
问题 The full stack includes only android core code: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.fragment.app.FragmentManagerImpl.isDestroyed()' on a null object reference at androidx.fragment.app.Fragment.performDetach(Fragment.java:2844) at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1033) at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1237) at androidx.fragment.app

How to get an Instance of ViewModel in activity in 2020?

帅比萌擦擦* 提交于 2020-05-27 09:27:12
问题 I am new to the mvvm pattern. I created a ViewModel for the main activity. Now I want to get an instance of the ViewModel in the main activity. Most Tutorials and answers here on Stackoverflow suggest using ViewModelProviders.of(... , but this is depreceated. So according to this question on stackoverflow: ViewModelProviders is deprecated in 1.1.0 main activity in onCreate, I do the following (and I could swear I already had it running): mainActivityViewModel = new ViewModelProvider(this).get