CN105549957A - Method for customizing a scroll bar indicator - Google Patents
Method for customizing a scroll bar indicator Download PDFInfo
- Publication number
- CN105549957A CN105549957A CN201510619804.4A CN201510619804A CN105549957A CN 105549957 A CN105549957 A CN 105549957A CN 201510619804 A CN201510619804 A CN 201510619804A CN 105549957 A CN105549957 A CN 105549957A
- Authority
- CN
- China
- Prior art keywords
- self
- list
- scroll bar
- interface
- thread
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
The invention provides a method for customizing a scroll bar indicator. The method comprises the following steps: opening a show hidden thread at an Android mobile phone terminal; setting a monitoring interface of a flag variable for the thread, and monitoring a list slide or stop action; monitoring that a ListView list slides and shows to a certain item by the monitoring interface; when the list slides to the certain item, displaying own custom View to make the custom View to be displayed at one side of a scroll bar; acquiring data in the list through a custom interface, and displaying corresponding data in the custom View; and controlling the display of the indicator by the thread. The technical scheme of the invention has the following beneficial effects: for any ListView list, as long as the custom interface is realized, custom characters and picture backgrounds can be displayed, which is more powerful than interface functions provided by a system.
Description
Technical field
The present invention is applied to Android system application, particularly a kind of method of self-defined scroll bar indicator.
Background technology
Contacts list conventional in mobile phone, when sliding-rolling bar, can show corresponding alphabetical indicators.But for general list, we only will not show letter, but wish the content that display defines arbitrarily oneself.
Summary of the invention
The function of the Interface realization provided in view of system is limited, solves the problem of self-defined display, is achieved by the following technical solution.
The method of self-defined scroll bar indicator, is characterized in that, comprising:
S1, Android phone end open one display hide thread;
S2, described thread arrange the monitoring interface of an indexed variable, monitor list and slide or stop action;
S3, described monitoring interface are monitored slip in ListView list and are shown to a certain;
S4, when list slides into a certain, the self-defined View showing oneself makes it to be presented at scroll bar side;
S5, the data obtained by self defined interface in list, show corresponding data in self-defined View;
The display of S6, described Thread control indicator.
Described self-defined View is the coordinate sliding into a certain item by calculating list, uses Paint to draw self-defined picture, uses Canvas to draw the text coordinating picture.
The thread that described unlatching one display is hidden, is in onScroll method, detects and slide into a certain item, calculate corresponding coordinate with this, and opens the hiding thread of icon realization.
The described data obtained by self defined interface in list, be in scrollTo method, BaseAdapter achieves self-defining SectionIndexer interface, can get the data in ListView list.
The show or hide of described Control director, be by arranging an indexed variable mThumbVisible, monitoring corresponding sliding condition, being set to ture is false.
The beneficial effect implementing technical scheme of the present invention is, for arbitrary ListView list, as long as achieve this self defined interface, just can show self-defining word and picture background, the interface function provided than system is more powerful.
Accompanying drawing explanation
Fig. 1 is the method flow block diagram of self-defined scroll bar indicator of the present invention.
Embodiment
Below in conjunction with accompanying drawing, embodiments of the invention are described in detail, but the multitude of different ways that the present invention can be defined by the claims and cover is implemented.
As shown in Figure 1, Fig. 1 is the FB(flow block) of the method for self-defined scroll bar indicator, comprises the following steps:
S1, Android phone end open one display hide thread;
S2, described thread arrange the monitoring interface of an indexed variable, monitor list and slide or stop action;
S3, described monitoring interface are monitored slip in ListView list and are shown to a certain;
S4, when list slides into a certain, the self-defined View showing oneself makes it to be presented at scroll bar side;
S5, the data obtained by self defined interface in list, show corresponding data in self-defined View;
The display of S6, described Thread control indicator.
The environment that technical scheme in the present invention is implemented is in Android system, and self-defining scroll bar indicator is the drafting comprising picture, by calculating the coordinate sliding into a certain item, uses Paint and Canvas to draw this picture and text.
In a particular embodiment of the present invention, comprise the monitoring of slip: in onScroll method, detect and slide into a certain item, calculate corresponding coordinate with this, and open the hiding thread of icon realization.
In a particular embodiment of the present invention, comprise the acquisition of data: in scrollTo method, BaseAdapter has achieved self-defining SectionIndexer interface, therefore can get the data in ListView list.
In a particular embodiment of the present invention, the display of picture is comprised with hiding: arrange an indexed variable mThumbVisible, monitor corresponding sliding condition, being set to ture is false, adds this condition judgment in method for drafting.
These are only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.
Claims (5)
1. the method for self-defined scroll bar indicator, is characterized in that, comprising:
S1, Android phone end open one display hide thread;
S2, described thread arrange the monitoring interface of an indexed variable, monitor list and slide or stop action;
S3, described monitoring interface are monitored slip in ListView list and are shown to a certain;
S4, when list slides into a certain, the self-defined View showing oneself makes it to be presented at scroll bar side;
S5, the data obtained by self defined interface in list, show corresponding data in self-defined View;
The display of S6, described Thread control indicator.
2. the method for self-defined scroll bar indicator according to claim 1, it is characterized in that, described self-defined View is the coordinate sliding into a certain item by calculating list, uses Paint to draw self-defined picture, uses Canvas to draw the text coordinating picture.
3. the method for self-defined scroll bar indicator according to claim 1, is characterized in that, the thread that described unlatching one display is hidden, in onScroll method, detection slides into a certain item, calculates corresponding coordinate with this, and opens the hiding thread of icon realization.
4. the method for self-defined scroll bar indicator according to claim 1, it is characterized in that, the described data obtained by self defined interface in list, in scrollTo method, BaseAdapter achieves self-defining SectionIndexer interface, can get the data in ListView list.
5. the method for self-defined scroll bar indicator according to claim 1, is characterized in that, the show or hide of described Control director, and be by arranging an indexed variable mThumbVisible, monitoring corresponding sliding condition, being set to ture is false.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510619804.4A CN105549957A (en) | 2015-09-25 | 2015-09-25 | Method for customizing a scroll bar indicator |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510619804.4A CN105549957A (en) | 2015-09-25 | 2015-09-25 | Method for customizing a scroll bar indicator |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105549957A true CN105549957A (en) | 2016-05-04 |
Family
ID=55829156
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510619804.4A Pending CN105549957A (en) | 2015-09-25 | 2015-09-25 | Method for customizing a scroll bar indicator |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105549957A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102281206A (en) * | 2010-06-10 | 2011-12-14 | 腾讯科技(深圳)有限公司 | Instant messaging client and implementing method thereof |
US20120044251A1 (en) * | 2010-08-20 | 2012-02-23 | John Liam Mark | Graphics rendering methods for satisfying minimum frame rate requirements |
CN104252351A (en) * | 2013-06-29 | 2014-12-31 | 北京新媒传信科技有限公司 | Method and device for realizing list control |
-
2015
- 2015-09-25 CN CN201510619804.4A patent/CN105549957A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102281206A (en) * | 2010-06-10 | 2011-12-14 | 腾讯科技(深圳)有限公司 | Instant messaging client and implementing method thereof |
US20120044251A1 (en) * | 2010-08-20 | 2012-02-23 | John Liam Mark | Graphics rendering methods for satisfying minimum frame rate requirements |
CN104252351A (en) * | 2013-06-29 | 2014-12-31 | 北京新媒传信科技有限公司 | Method and device for realizing list control |
Non-Patent Citations (1)
Title |
---|
幻奕: "Android 自定义列表指示器", 《HTTP://WWW.CNBLOGS.COM/HUANYI0723/P/4813508.HTML》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104090714B (en) | A kind of mobile terminal checks the method and system of chat record | |
USD721379S1 (en) | Display screen or portion thereof with graphical user interface | |
USD721378S1 (en) | Display screen or portion thereof with graphical user interface | |
CN106325674B (en) | Message prompting method and device | |
CN107092453B (en) | Screen display control method and device and terminal | |
EP2674846A3 (en) | Information terminal device and display control method | |
CN103558990A (en) | Method and system for rapidly opening or operating applications on mobile terminal | |
JP2014176055A5 (en) | Wrist terminal device, communication terminal device, and program | |
WO2018076673A1 (en) | Application icon display control method and apparatus, and terminal | |
USD889505S1 (en) | Display screen with graphical user interface for monitoring remote video camera | |
CN105468253A (en) | Mobile terminal interface content display method and apparatus and terminal | |
CN108509248B (en) | Data processing method and device, storage medium, processor and terminal | |
CN103327164A (en) | Mobile terminal and anti-peaking method thereof | |
US20180295225A1 (en) | Method and device for controlling notification content preview on mobile terminal, and storage medium | |
US20120185780A1 (en) | System and method for integrating menu options of message applications of electronic device | |
CN109992188B (en) | Method and device for realizing scrolling display of iOS mobile terminal text | |
CN104504557A (en) | Terminal event reminding method and terminal event reminding system | |
CN104580591A (en) | Mobile phone and display system thereof | |
CN104077539A (en) | Screen capture prevention method based on program windows | |
CN105607800A (en) | Method and device for input display of terminal screen | |
CN107357510B (en) | Visual feedback method and device for touch selection | |
CN103731534A (en) | Display method and device of shortcut toggles in notification bar | |
US20170139584A1 (en) | User account switching interface | |
CN204316567U (en) | Mobile phone and display system thereof | |
CN105117287A (en) | Graphical user interface and implementation method and user interaction method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20160504 |
|
WD01 | Invention patent application deemed withdrawn after publication |