Operating System

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|

Remove padding in Preference Screen | Android

The Preference class uses com.android.internal.R.layout.preference as its layout. This contains an ImageView for an icon on the left hand side, then the title and summary textviews and finally a widget_frame Layout on the right hand side. By calling PreferenceScreen.setIcon() you can set the drawable to place in the icon image [...]

2019-10-27T23:10:56+05:30Categories: Android|

Taking screenshot on Emulator in Android Studio

Capturing android emulator screen shot is important for app developer, app screenshot can be used for portfolio websites, android development tutorials websites. Below are the steps Click on "..." in emulator setting dialogue. Take your screenshot   To find/set the location of the screenshot taken above, go to 'Setting' and [...]

2020-10-18T18:44:09+05:30Categories: Android|

AppBarLayout | Android

Introduction AppBarLayout is a vertical LinearLayout which implements many of the features of material designs app bar concept, namely scrolling gestures. This view depends heavily on being used as a direct child within a CoordinatorLayout. If you use AppBarLayout within a different ViewGroup, most of it's functionality will not work. [...]

2019-10-27T17:37:05+05:30Categories: Android|
Go to Top