# Building Dynamic Custom Views

DevFeed: [Building Dynamic Custom Views](<https://devfeed.tech/articles/building-dynamic-custom-views-30572.md>)

Original publisher: [Read original article](<https://ryanharter.com/blog/2014/08/building-dynamic-custom-views/>)

Published: 2014-08-29T07:00:00Z

Content type: tutorial

Language: en

Sources: [Blogs on Ryan Harter](<https://devfeed.tech/sources/blogs-on-ryan-harter.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [screen](<https://devfeed.tech/topics/screen.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [padding](<https://devfeed.tech/tags/padding.md>), [screen](<https://devfeed.tech/tags/screen.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [view](<https://devfeed.tech/tags/view.md>)

## AI overview

A tutorial on building a custom Android view that lets users scroll content so any item can align with the center of the screen. It discusses using a HorizontalScrollView, adding scroll-position observation through subclassing, and handling side padding for different screen sizes.

## Source excerpt

Last week I released Fragment for Android. Fragment is made up of all sorts of custom Views, which I think sets it apart from many apps in the Play Store. Some of these views have a similar pattern to views I've had to create for other apps, in which a scroll view has padding such that every item within it can be scrolled to the center of the view. On it's surface this doesn't seem complex, but when you consider the massive difference in screen sizes available on Android, things get a little more complicated.