Category : androidx

I’m trying to use Dagger Hilt in my project. so I add these lines of code as the official documentation says: first, in my build.gradle (app) plugins { id ‘com.android.application’ id ‘kotlin-android’ id ‘kotlin-kapt’ id ‘dagger.hilt.android.plugin’ } … dependencies { implementation ‘androidx.legacy:legacy-support-v4:1.0.0’ implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation ‘androidx.core:core-ktx:1.3.2’ implementation ‘androidx.appcompat:appcompat:1.2.0’ implementation ‘com.google.android.material:material:1.3.0’ implementation ‘androidx.constraintlayout:constraintlayout:2.0.4’ testImplementation ‘junit:junit:4.13.2’ androidTestImplementation ..

Read more

I have a problem I want to both change Buttons color and use com.google.android.material Objects I found out that when I change the line in themes: <style name="Theme.TeoriaLearning" parent="Theme.MaterialComponents.Light.DarkActionBar"> to this line: <style name="Theme.TeoriaLearning" parent="Theme.AppCompat.Light.DarkActionBar"> I can change the background color of Buttons.. etc. But also when I do that I can’t use com.google.android.material.textfield.TextInputLayout and ..

Read more

Im having a weird issue with androidx navigation library. I defined a fragment. The onCreateView is as shown: override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View { //load view with databinding //load the viewmodel //call the intent (activity as? MainActivity)?.showCamera() return binding.root } This works as expected but, if i use navigateUp() ..

Read more

This is the code from my Activity class: @Override protected void onCreate(Bundle savedInstanceState) { requestWindowFeature(Window.FEATURE_NO_TITLE); super.onCreate(savedInstanceState); _cpf = ProcessCameraProvider.getInstance(this); _cpf.addListener(new Runnable() { @Override public void run() { try { ProcessCameraProvider cameraProvider = _cpf.get(); bindImageAnalysis(cameraProvider); } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } } }, ContextCompat.getMainExecutor(this)); } private void bindImageAnalysis(@NonNull ProcessCameraProvider cameraProvider) { ImageAnalysis imageAnalysis ..

Read more

Im using custom view class in my xml : <com.myproj.test.Model.CustomProgressBar android:id="@+id/picka" app:progress="0" app:secondaryProgress="100" /> It worked before migrating to androidx. Now seems like Databinding is not able to reach this path : com.myproj.test.Model as the error is : can not find symbol class model. I already did, clear, rebuild, restart clear caches. Source: Android..

Read more

I removed implementation ‘com.android.support:design:28.0.0’ and migrated to androidx implementation ‘com.google.android.material:material:1.4.0-alpha01’ I like to know what is the equivalent code for BottomNavigationItemView. ` public void hideOrShowBottomNavigationItem(int id, BottomNavigationView view, int visibility) { BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0); for (int i = 0; i < menuView.getChildCount(); i++) { BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(i); if (itemView.getId() == id) ..

Read more