Category : androidx

I’m relatively new to Android and I’m trying to write a plugin for unity3d that uses MediaBrowerService and MediaBrowserCompact. When I run the plug-in on Unity I get a NoClassDefFoundError but I can figure out how to include the dependency. This is my gradle: plugins { id ‘com.android.library’ } android { compileSdkVersion 30 buildToolsVersion "30.0.3" ..

Read more

I want to be able to add more states to my current BottomSheet with multiple custom heights. Right now, the AndroidX bottom sheet only has the following states: STATE_HIDDEN, STATE_HALF_EXPANDED, STATE_EXPANDED, STATE_COLLAPSED, STATE_DRAGGING, STATE_SETTLING. Is there any way to add states/heights to the "BottomSheetBehavior" class? Solutions I’ve considered: There is a lot of material on ..

Read more

In androidx you can easily toggle between day/night mode. E.g.: <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar"> <!– attributes –> </style> And when toggling theme: AppCompatDelegate.setDefaultNightMode(nightMode); getDelegate().applyDayNight(); Now, let’s say I want to add a minor customization to either the day or the night theme: <style name="LimeTheme" parent="AppTheme"> <item name="colorPrimary">@color/lime1</item> <item name="colorPrimaryDark">@color/lime2</item> <item name="colorControlHighlight">@color/lime3</item> </style> How do I accomplish ..

Read more

I’m trying to build android project with navigation component. My android project is written by both java and kotlin with some third party libraries(some library is very old). When I add the following code into my app’s build.gradle file in order to install navigation component as gogole site described([navigation component][1]) dependencies { def nav_version = ..

Read more

I have a App with a popup dialog spinner that used to work on SDK 28 without problems. Now i have migrated to SDK 29 AndroidX and the popup does not work anymore. Spinner_LockSetting = (Spinner) findViewById(R.id.Spinner_LockSetting); SettingValueAdapter adapter = new SettingValueAdapter(this, android.R.layout.simple_spinner_dropdown_item, SettingValue.values()); Spinner_LockSetting.setAdapter(adapter); Spinner_LockSetting.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, ..

Read more