Android

ItemAnimator | Android

ItemAnimator class provides mechanism for animating child views. It can be used to animate adding, removing, modifying and moving a child view. If you want custom animations you can subclass ItemAnimator. DefaultItemAnimator class provide animations for basic operations like adding, removing and changing items Fade in and fade out (for [...]

2019-11-17T21:33:37+05:30Categories: Android|

LayoutManager | Android

Introducion A layout manager positions item views inside a RecyclerView and determines when to reuse item views that are no longer visible to the user. RecyclerView provides these built-in layout managers: LinearLayoutManager : Shows items in a vertical or horizontal scrolling list. GridLayoutManager : Shows items in a grid. StaggeredGridLayoutManager : [...]

2019-11-17T21:10:57+05:30Categories: Android|

CardView | Android

CardView can represent the information in a card manner with a drop shadow called elevation and corner radius which looks consistent across the platform. It’s a kind of FrameLayout with a rounded corner background and shadow. We can easily design good looking UI when we combined CardView with RecyclerView. A CardView [...]

2019-11-17T20:15:38+05:30Categories: Android|

RecyclerView | Android

Introduction RecyclerView is a ViewGroup that renders any adapter-based view in a similar way. RecyclerView is a more flexible pattern of view recycling than ListView and GridView. RecyclerView focuses only on recycling views. All the other actions needed to create a view, like how to present data set or inflate [...]

2019-11-17T18:04:27+05:30Categories: Android|

Creating custom views | Android

To change the default behaviour of View in Custom View, one need to override onMeasure(). Depending on how you use your custom view, extend View and modify onMeasure() as per the requirement. Layout process consists of two passes, measuring the view and layout the views. Measure pass sets how big [...]

2019-11-17T16:29:30+05:30Categories: Android|

Show Menu in ActionBar | Android

To show menu icon in action bar as shown in the below image, follow these steps Create a menu resource inside res/menu, name it whatever you want. Override onCreateOptionsMenu and inflate it. @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.yourentry, menu); return true; } Set android:showAsAction="always in [...]

2019-11-09T23:40:54+05:30Categories: Android|

ViewGroup.LayoutParams | Android

Introduction LayoutParams are used by views to tell their parents how they want to be laid out. The base LayoutParams class just describes how big the view wants to be for both width and height. To specify how big a view must be we use android:layout_width and android:layout_height attributes. The [...]

2019-11-03T16:42:17+05:30Categories: Android|

Color of tabs in TabLayout | Android

Modifying the background color and selected color of tab in TabLayout can be done using design support library that Android provides. One can change the background of the whole TabLayout using the app:tabBackground property and you can change the tab indicator color using the app:tabIndicatorColor property. Better way to change [...]

2019-10-29T18:30:34+05:30Categories: Android|

Home Navigation in ActionBar | Android

The Android ActionBar home navigation related methods setHomeButtonEnabled(boolean) setDisplayHomeAsUpEnabled(boolean) setDisplayShowHomeEnabled(boolean)   setHomeButtonEnabled(boolean ) It will just make the icon clickable, with the color at the background of the icon as a feedback of the click. This method is similar to the next one actually, except that the left-facing caret doesn’t [...]

2019-10-28T20:33:03+05:30Categories: Android|

ActionBar Back button | Android

Back arrow button also known as UP button are on of the most useful part of every android application because this icon will provide direct back button navigation to application user and by clicking on it the user will redirect to back activity. To set the action bar, // Initialize [...]

2019-10-28T19:22:15+05:30Categories: Android|
Go to Top