How to implement the Material-design Elevation for Pre-lollipop

You can mimic the elevation on pre-Lollipop with a official method. I achieve same effect using, android:background=”@android:drawable/dialog_holo_light_frame” My tested output: reference – https://stackoverflow.com/a/25683148/3879847 Thanks to user @Repo.. Update : If you want change color of this drawable try @Irfan answer below ↓ https://stackoverflow.com/a/40815944/3879847

Appcompat v21 Toolbar elevation pre-lollipop

This worked for me very well: <android.support.v7.widget.CardView xmlns:card_view=”http://schemas.android.com/apk/res-auto” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@color/primary” card_view:cardElevation=”4dp” card_view:cardCornerRadius=”0dp”> <android.support.v7.widget.Toolbar android:id=”@+id/toolbar” android:layout_width=”match_parent” android:layout_height=”wrap_content” android:background=”@color/primary” android:minHeight=”?attr/actionBarSize” /> </android.support.v7.widget.CardView>

How to style the cursor color of SearchView under AppCompat

After alot of experimentation, I was finally able to change the cursor color by using the autoCompleteTextViewStyle attribute, along with a custom cursor Drawable. Modifying the code you provided in the example, you would do something like the following. First, you add the aforementioned attribute to your main theme as follows: <style name=”AppBaseTheme” parent=”Theme.AppCompat.Light.NoActionBar”> <!– … Read more

Android vectorDrawables.useSupportLibrary = true is stopping app

You cannot use Vector Drawables in any other views except ImageView in pre-lollipop. Please see this SO Answer by google developer advocate. For AppCompat users, we’ve decided to remove the functionality which let you use vector drawables from resources on pre-Lollipop devices due to issues found in the implementation in version 23.2.0/23.2.1 [ https://code.google.com/p/android/issues/detail?id=205236, https://code.google.com/p/android/issues/detail?id=204708 … Read more

Dynamically change height of BottomSheetBehavior

I had the same problem with RelativeLayout as my bottom sheet. The height won’t be recalculated. I had to resort to setting the height by the new recalculated value and call BottomSheetBehavior.onLayoutChild. This is my temporary solution: coordinatorLayout = (CoordinatorLayout)findViewById(R.id.coordinator_layout); bottomSheet = findViewById(R.id.bottom_sheet); int accountHeight = accountTextView.getHeight(); accountTextView.setVisibility(View.GONE); bottomSheet.getLayoutParams().height = bottomSheet.getHeight() – accountHeight; bottomSheet.requestLayout(); behavior.onLayoutChild(coordinatorLayout, … Read more

Seeing message in logs: “app:theme is deprecated”?

Replace app:theme to android:theme but you can have a situation when you are not using app:theme. Check your layout, especially toolbar layout. In my case, I didn’t have app:theme in my layout files. Then take a look at my situation: <android.support.v7.widget.Toolbar xmlns:android=”http://schemas.android.com/apk/res/android” xmlns:styled=”http://schemas.android.com/apk/res-auto” android:id=”@+id/toolbar_actionbar” android:layout_width=”match_parent” android:layout_height=”?attr/actionBarSize” android:background=”?attr/colorPrimary” android:minHeight=”?attr/actionBarSize” styled:popupTheme=”@style/ToolbarDarkPopup” styled:theme=”@style/ActionBarThemeOverlay” /> And I’ve changed this … Read more

Embedding ads within Recyclerview

In your adapter, you first need to override getItemViewType, for example: @Override public int getItemViewType(int position) { if (position % 5 == 0) return AD_TYPE; return CONTENT_TYPE; } Then in onCreateViewHolder, inflate a different view according to the type. Something like this: @Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { View v = null; if … Read more

Android: CoordinatorLayout and SwipeRefreshLayout

Set the scroll behavior to the SwipeRefreshLayout not the RecyclerView. <androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:id=”@+id/swipe_container” android:layout_width=”match_parent” android:layout_height=”match_parent” app:layout_behavior=”@string/appbar_scrolling_view_behavior”> <androidx.recyclerview.widget.RecyclerView android:id=”@+id/cardList” android:layout_width=”match_parent” android:layout_height=”match_parent” android:scrollbars=”vertical” /> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

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