Blog column>Mobile development column>Android custom control
  • Android custom control
  • From simple to complex custom controls, detailed insights, to provide source code to download.
  • subscribe

Updated articles

[mobile development] Android custom control - ExpandTextView

This paper introduces a shener TextView figure: Click when textview stretching, the feeling of a clip, the principle is very simple, is to two textview overlap, a real fixed number of lines of text, another reality all text, initialization, container height is equal to the height of fixed text, when fully extended is equal to the height of a text display full height, process with an animation on the control. The following code: ExpandTextView.java Import...

ExpandTextView

[mobile development] Android custom control - PullZoomView

This paper describes the simple implementation of PullZoomView, as shown in fig.: Is through the drop-down ListView or ScrollView or more View, such as GridView, RecycleView, and so on, when the Header has a zoom effect Implementation of the idea is based on the need to encapsulate the different control to do a different implementation, such as: ListView: the control itself has the function of adding Header, we only need to do a simple process can be used to meet certain conditions...

Pullzoom Pullzoomview

[mobile development] Android custom control - Indicator

Indicator is really an old stem... There are rewriting HorizontalScrollView, there are rewriting LinearLayout. This is rewriting the LinearLayout Oh, to LinearLayout add textview used as tab, in the bottom of the LinearLayout draw a rectangle as indicator. Viewpager rolling with simple elementary mixed math to choose the position of the rectangle, and then roll it.

Indicator ViewPager Indicator

Android custom control - hand to teach you to achieve SlidingMenu (two)

Recalling the preceding: Part1 created the basic components of the project, and the success of the gave us a SlidingMenuAbove custom relativelayout activity contentView set Series two       This film describes how to achieve the basic sliding action Fingers in the SlidingMenuAbove on the left and right slide when the SlidingMenuAbove in a certain circumstances follow the finger to slide the release of the finger after the completion of the rest of the Sliding...

Android custom View

[mobile development] Android custom control - FloatLayout

This article describes a lot of App have the layout of the container, as shown in...

FloatLayout Imitation beautiful floating container Floating Layout

[mobile development] Android custom control - hand to teach you to write Google style ProgressBar

This paper gives a detailed introduction about how to implement a Google style ProgressBar Here is a relatively simple warm up first Android custom control - Simple_Loading At first: Balalala Well, we have to achieve this effect is Analysis: according to the previous link in the rewrite, we need to rewrite a View, and then in the View through the calculation to draw the arc, so as to achieve a LoadingBar, we come back to think about, since the department...

ProgressBar Custom ProgressBar Google style ProgressBar

[mobile development] Android custom control - Simple_Loading

Moto Bunsuke's implementation of a simple custom load cycle First look at the effect: Inheritance of View, and a series of custom attributes to achieve the effect of Loading on canvas Effect of a total of three: 1 arc Loading 2 round Loading 3 can set the number of 1-100, expressed as a percentage, and the corresponding percentage effect on the Loading The significance of attribute files and attributes: ...

Android custom View Custom Loading

[mobile development] Android custom main menu recommend

This article describes an ultra simple custom main menu, the results are as follows: Principle: in fact, is a simple package of native Dialog. Plus display and hidden animation effects. To add a callback event to the control. TestDialog.java Class TestDialog implements OnClickListener public { Context mContext private; Dialog mD private...

Custom main menu Custom Dialog

[mobile development] Android custom Activity base class

We sometimes have a common point in the development of App when there is a common point of time, for example, have the same TitleBar, and TitleBar can be set to display the text. The click event on the titlebar, if for each activity are written over the titlebar is a very troublesome thing, this time we can rewrite a activity base class, let other similar activity to inherit this class, thus eliminating the need for a lot of repeated unnecessary work. Improve the efficiency. As graph:...

BaseActivity Android custom Activity base class Custom Activity

[mobile development] ViewGroup rewrite - scroll the page container

Scroll page container Sub control level array of sub control can scroll between the fingers can be switched automatically before and after switching For example, like ViewPager, follow the gesture scroll, loosen the finger can automatically determine the scroll to the next one or the next. As graph. OnLayout specifies the location of the child control, override the onTouchEvent handle touch events, implement the onGestureListener interface, handle the scroll event. OnLayout rules are very simple, high constant, wide in accordance with the number of...

ViewGroup rewriting Rolling container

[mobile development] ViewGroup rewriting - grid container

This article describes the ViewGroup rewrite, we are familiar with LinearLayout, RelativeLayout, FrameLayout and so on, all of the container class is a subclass of ViewGroup, ViewGroup and inheritance View. We are skilled in the use of these off the shelf system layout may sometimes be unable to meet our own needs, and this is what we need to rewrite a container to achieve results. ViewGroup rewriting can achieve a variety of effects, the following write a simple rewrite of a ViewGr...

ViewGroup rewriting Custom ViewGroup

[mobile development] App index in Launcher -- Apps letter index component

This paper introduces the Apps Launcher index function, what is the alphabetical index? Google's native Launcher is to use a drawer to hold all App, but is it really convenient for the drawer? Recently, a lot of lightweight desktop popular on the market have abandoned the drawer, with the Apps index to replace. As graph: Let's analyze and then make one. 1 the whole can be rewritten RelativeLayout 2 on the right side of the slider can be rewritten LinearLayout 3 middle mounted A...

Android Android custom alphabetical index Launcher alphabetical index

[mobile development] FolderGroup Launcher indicator effect

FolderGroup this name is what I think, meaning at a glance, then to what is FolderGroup? Look at this effect: Since the interaction of a desktop first try this folder, immediately copied in a complete mess. Launcher and understanding of the people know, Worksapce's left and right slip effect is achieved by rewriting the ViewGroup, only this class on nearly 4K line, the system of LinearLayout but also more than 3k. ViewPager...

Launcher FolderGroup FolderGroup indicator

Android custom control - Custom Preference

Figure defines a color selection Preference Train of thought: inherit Preference, rewrite onCreateView Premise: the need for a layout file, TextView display text, ImageView display color Xmlns:android= http://schemas.android.com/apk/res/android "<RelativeLayout" @+id/pref "android:id=...

Custom Preference

[mobile development] Android custom control - Custom Attributes

This article describes the use of custom attributes in the Android which custom controls The following diagram as an example to explain the figure: A circle, we customize a view, by painting a circle as an example to round radius, color, transparent value as custom properties to explain To define a custom View, inherited from View, three heavy construction method Circle.java In general, our custom attributes are also initialized in the overloaded construction method, and we need to define a good property file before initialization...

Android custom control Android custom attributes Android custom control using custom attributes Declare-styleable custom

[mobile development] Android custom control - picture clipping

This article describes a custom picture clipping control The control by another blog: Android pictures, zoom expansion and custom control As graph: Train of thought: draw a picture on a custom View (another Bo Wen mentioned in the previous reference), draw a custom FloatDrawable on the custom View, that is, the floating layer in the picture. Draw pictures and the intersection of FloatDrawable complement part of shades of gray (this is actually very simple, just one sentence). In custom tou View...

Android picture clipping Picture clipping Android custom picture clipping control

[programming language] Android custom control - PagerSlidingTabStrip

PagerSlidingTabStrip is an open source project on Gihub: https://github.com/astuetz/PagerSlidingTabStrip The main is a class PagerSlidingTabStrip.java As graph: ...

PagerSlidingTabStrip

  • Columnist:U013045971
  • Creation time: 2016-01-29
  • Article number: 19
  • Browse volume: 7295 times

Latest comments