Widget.AppCompat.Button colorButtonNormal shows gray

To customize one Button only set android:theme=”@style/AppTheme.Button” to your Button. <Button android:theme=”@style/AppTheme.Button” /> Define your style as you did in your question <style name=”AppTheme.Button” parent=”Base.Widget.AppCompat.Button”> <item name=”colorButtonNormal”>@color/my_color</item> </style> [EDIT] See GitHub demo here

Android Selector Drawable with VectorDrawables srcCompat

Some things have changed since I asked this question, so I will answer it myself. With Support Library 23.4.0 the support for VectorDrawables from Ressources was reenabled: Android Support Library 23.4.0 available now You can find more information on that in this cast from the Google I/O 2016: What’s new in the support library – … Read more

Use Tab with new ToolBar (AppCompat v7-21)

With the API 21 the method setNavigationMode(ActionBar.NAVIGATION_MODE_TABS) is deprecated. UPDATE 01/08/2019 (Material Components Library) Add the dependency to your build.gradle: dependencies { implementation ‘com.google.android.material:material:1.1.0’ } Then you can use the new TabLayout. <androidx.constraintlayout.widget.ConstraintLayout> <com.google.android.material.appbar.AppBarLayout …> <androidx.appcompat.widget.Toolbar …/> <com.google.android.material.tabs.TabLayout … /> </com.google.android.material.appbar.AppBarLayout> <androidx.viewpager.widget.ViewPager android:id=”@+id/viewpager” app:layout_behavior=”@string/appbar_scrolling_view_behavior” /> </androidx.constraintlayout.widget.ConstraintLayout> The code is simple: TabLayout tabs = (TabLayout) findViewById(R.id.tabs); … Read more

Toolbar navigation icon never set

Currently you can use it, changing the order: (it seems to be a bug) Toolbar toolbar = (Toolbar) findViewById(R.id.my_awesome_toolbar); setSupportActionBar(toolbar); toolbar.setNavigationIcon(R.drawable.ic_good); toolbar.setTitle(“Title”); toolbar.setSubtitle(“Sub”); toolbar.setLogo(R.drawable.ic_launcher);

Android – onAttach(Context) not called for API 23

I solved the problem in this way: @TargetApi(23) @Override public void onAttach(Context context) { //This method avoid to call super.onAttach(context) if I’m not using api 23 or more //if (Build.VERSION.SDK_INT >= 23) { super.onAttach(context); onAttachToContext(context); //} } /* * Deprecated on API 23 * Use onAttachToContext instead */ @SuppressWarnings(“deprecation”) @Override public void onAttach(Activity activity) { … Read more

What is the SortedList working with RecyclerView.Adapter?

SortedList handles the communication to the Recycler adapter via Callback. One difference between SortedList and List is seen in the addAll helper method in the sample below. public void addAll(List<Page> items) { mPages.beginBatchedUpdates(); for (Page item : items) { mPages.add(item); } mPages.endBatchedUpdates(); } Keeps last added item Say I have 10 cached items to load … Read more

Make ImageView fit width of CardView

You need to do 2 things : 1) Call setPreventCornerOverlap(false) on your CardView. 2) Put rounded Imageview inside CardView About rounding your imageview, I had the same problem so I made a library that you can set different radii on each corners. There is one good library(vinc3m1’s RoundedImageView) that supports rounded corners on ImageView, but … Read more

Gradle Build Android Project “Could not resolve all dependencies” error

As Peter says, they won’t be in Maven Central from the Android SDK Manager download the ‘Android Support Repository’ and a Maven repo of the support libraries will be downloaded to your Android SDK directory (see ‘extras’ folder) to deploy the libraries to your local .m2 repository you can use maven-android-sdk-deployer 2017 edit: you can … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)