Tencent ultra-practical open source library of UI wheel, I was porter wheels

Tencent ultra-practical open source library of UI wheel, I was porter wheels

QMUI_Android

Features

Global UI configuration

Only you need to modify a configuration table can be adjusted App global style, including component colors, navigation bars, dialog boxes, lists, etc. A modification takes effect globally.

Rich UI controls

Provide a rich common UI controls, such as BottomSheet, Tab, rounded ImageView, pull down to refresh, etc., easy to use and flexible, and supports custom style.

Efficient tool method

The method provides efficient tools, including device information, information screen, keyboard management, management, status bar, can solve a variety of common scenarios and greatly enhance the development efficiency.

function list

  • QMUIAnimationListView

  • The ListViewsupport of the Add / Remove Item animations, support for custom animations.

  • QMUIBottomSheet

  • On Dialogthe basis of re-customized show()and hide()animated when the Dialograised and lowered at the bottom of the screen. The following two panels style:
  1. List style: Use QMUIBottomSheet.BottomListSheetBuildergenerated.

  2. Grids type: Use QMUIBottomSheet.BottomGridSheetBuildergenerated.
  • QMUICommonListItemView

  • As a generic list QMUIGroupListViewin the Item, also it is used alone. It supports the following styles:
  1. Exhibition line character.

  2. Add a line to the right of or below the caption.

  3. In the item appears on the right arrow or a switch or a custom View
  • QMUIDialog

  • It offers a range of common dialog to solve using the system default dialog inconsistent performance on different Android version of the problem. Using different Builder to build different types of dialog boxes, which have set the title Builder and add buttons at the bottom of the function, different Builder specific role is as follows:
  1. MessageDialogBuilder: Message Type dialog Builder. It may be generated by a band title, message text, buttons, dialog.

  2. ConfirmMessageDialogBuilder: Checkbox confirmation message with the frame Builder.

  3. EditTextDialogBuilder: Builder dialog box with input box.

  4. MenuDialogBuilder: Menu Dialog Builder.

  5. CheckableDialogBuilder: Radio Type dialog Builder.

  6. MultiCheckableDialogBuilder: Multiple choice type of dialog Builder.

7 CustomDialogBuilder: Customize dialog content area Builder.

  1. AutoResizeDialogBuilder: Lift automatically adjust the height of the Dialog Builder with keyboard
  • QMUIEmptyView

  • Common air interface controls, support for display loading, the main headings and subheadings, and pictures.

  • QMUIFloatLayout

  • Similarly the CSS float: leftfloating layout, from left to right child View and wrap. It supports the following features:
  1. Control sub Viewvertically between / horizontal spacing.

  2. The control sub- Viewhorizontally aligned direction (left / center / right justified).

  3. Restricted sub- Viewnumber or the number of rows.
  • QMUIFontFitTextView

  • So that TextViewin the case of a fixed width, the text character size can be reduced from the adaptation to a multi-line fit.

  • QMUIGroupListView

  • General list, commonly used in App's settings interface, note its parent class is not ListViewbut LinearLayout, it is generally with ScrollViewuse. Providing the concept of the Section for the block list. With QMUIGroupListView.Section, QMUICommonListItemViewand QMUIGroupListSectionHeaderFooterViewuse.

  • QMUIGroupListSectionHeaderFooterView

  • As a general list QMUIGroupListViewin the head or the tail of each Section it can also be used alone.

  • QMUIItemViewsAdapter

  • "Data -View list" with a cache function of the adapter for custom Viewneeds repeating unit display ListViewscene, mainly to ensure cache function in case of need to refresh the data or multiple layout ( ListViewor RecycleViewthe ItemView) have been multiplexed It exists View. QMUI for QMUITabSegmentthe Tabadaptation of the data.

  • QMUIKeyboardHelper

  • Provide a more convenient way for a given EditText show / hide the soft keyboard, and provides utility methods to determine whether the current keyboard visible.

  • QMUILinkTextView

  • So that TextViewcan automatically identify URL, phone, email address, compared with TextViewthe following characteristics:
  1. You can set the style of the link.

  2. You can set click on the event link.
  • QMUILoadingView

  • For displaying Loadingthe Viewsupports color and size settings.

  • QMUIObservableScrollView

  • Can listen scrolling events ScrollView, and to obtain an offset before and after each rolling in a rolling callback.

  • QMUIPopup

  • A floating layer, support for custom content floating layer, show support for the floating layer next to either direction of the specified View, support for custom floating layer Appear / Disappear animations.

  • QMUIListPopup

  • Inherited from QMUIPopup, the QMUIPopupbase supports the display of a list.

  • QMUIProgressBar

  • A control progress bar displayed by the progress of the color change, and a rectangular annular support two forms, the main features are as follows:
  1. Support show progress, support modifying the text color and size in the progress bar in text form.

  2. Can xmlattribute modification progress of the background color, the color of the current progress, the size of the progress bar.

  3. Support maximum limit progress.
  • QMUIPullRefreshLayout

  • Pull-down refresh control. Support for custom RefreshView (represented being refreshed View), trigger characteristics refresh location.

  • QMUIQQFaceView
  1. It supports the display of expression pseudo TextView(continued Custom View, rather than true TextView), to achieve TextViewthe maxLine, ellipsize, textSize, textColorand other basic functions.

  2. Support and QMUITouchableSpancooperation to achieve the use of clickable content.
  • QMUIQQFaceCompiler

  • QMUIQQFaceViewThe content parser to parse the text QMUIQQFaceViewyou want to format the data.

  • IQMUIQQFaceManager

  • QMUIQQFaceViewResource management interface, use QMUIQQFaceViewmust implement this interface to provide expression resources.

  • QMUIRadiusImageView

  • Provide added rounded, borders to picture, clipped to a circular shape or other features.

  • QMUIRoundButton

  • To Buttonprovide rounded corners, support for the following features:
  1. Fillet size specified.

  2. Specify the size of the fillet in different directions.

  3. Specify the size of half the height of the fillet, and the fillet size following the change in height adaptation.

  4. Support specify a background color and border color, support the use of color or when a specified color ColorStateList.
  • QMUIRoundButtonDrawable

  • Using this Drawablecan easily generate rounded rectangle / circular Drawable, to provide a background color, stroke color and size, height and other characteristics rounded adaptive View.

  • QMUISpanTouchFixTextView

  • Compared TextView, amended two common problems:
  1. Fixed TextViewand ClickableSpanwhen used together, click ClickableSpanwill trigger TextViewthe problem events.

  2. Fixed TextViewdefault if you add ClickableSpanlater will not be able to pass a click event to the TextViewproblems of the Parent.
  • QMUITabSegment

  • A plurality of transverse Tablayout comprising a plurality of features:
  1. You can use xmlor QMUITabSegmentset the configuration method provides a unified text color, icon position, whether you want to underline.

  2. Each Tabcan be very flexible configuration to support the text and icon displayed on the content, select the icon state support, support for publishing content alignment direction of settings, support for displaying red spots, insert custom support View, support for monitor double-click events.

  3. By setupWithViewPager(ViewPager)methods and ViewPagerbinding.
  • QMUITipDialog

  • A floating layer in the middle of the screen display, the following two styles:
  1. Use QMUITipDialog.Buildergenerated, providing a style icon and a line of text, which has an icon Loading, success, failure, and other types optional.

  2. Use QMUITipDialog.CustomBuildergenerate, support incoming custom layoutResId.
  • QMUITopBar

  • GM's top Bar. It provides the following features:

More may refer to wiki documents

  1. In the left / right button add picture / text buttons / Custom View.

  2. Set the title / subtitle and supports set the title / subtitle of the horizontal alignment.
  • QMUITopBarLayout

  • On QMUITopBarthe parcel, and agents of the QMUITopBarway. With QMUIWindowInsetLayoutuse, can QMUITopBarsupport the status bar immersive interface extends to the top of the status bar.

  • QMUIVerticalTextView

  • In TextViewsupport vertical text basis.

  • QMUITouchableSpan

Inherited from - ClickableSpanhave a different background color and font color, the press and state support normal state. Recommendations with QMUISpanTouchFixTextViewor subclasses, facilitate the coordination of event delivery.

  • QMUIWindowInsetLayout

  • With immersive status bar used to coordinate the child View's fitSystemWindows.

  • QMUIWrapContentListView

  • It supports highly value wrap_contentthe ListViewresolve native ListViewset the height of wrap_contentthe height of the calculation error of the bug.

  • QMUIBlockSpaceSpan

  • By providing the span between paragraphs, to achieve the effect of spacing segments.

  • QMUICustomTypefaceSpan

  • By providing the span between paragraphs, to achieve the effect of spacing segments.

  • QMUICustomTypefaceSpan

  • Support for Typefacea way to set spanthe font, font achieve custom effects.

  • QMUIAlignMiddleImageSpan

  • Inherited from ImageSpan, so that on this basis to achieve spanvertical centering effect.

  • QMUIMarginImageSpan

  • Inherited from QMUIMarginImageSpanleft and right on this basis supports the picture settings pitch.

  • QMUITextSizeSpan

  • Support adjust the font size span. AbsoluteSizeSpanThe font size can be adjusted, but in English because of the different shuffling decent can not be aligned with the bottom or top aligned according to particular needs. And QMUITextSizeSpanyou can pass more than one parameter, so that you can determine the offset value depending on the circumstances.

  • QMUISticSectionLayout

  • List of supported secondary structure is folded and deployed; this suspension support section header when scrolling; Support add custom list item in front sectionTop list or sectionTop View. More may refer to wiki documents.

Helper Classes

  • QMUIColorHelper

  • Color processing tools, divided according to the function type, containing a total of the following features:
  1. Set Transparency is a color.

  2. The specified ratio between two color values ​​in a color value is calculated.

  3. Converting the color value to a string.
  • QMUIDeviceHelper

  • Get Device information tools, in accordance with the type of function to divide a total includes the following features:
  1. Judgment means for the phone / tablet.

  2. Determine whether the device is Meizu phone.

  3. Determine whether the current system is Flyme system.

  4. Determine whether the current system MIUI system.

  5. Determine whether the current floating window has the authority.
  • QMUIDisplayHelper

  • Tools screen-related, according to the type of function to divide a total includes the following features:
  1. Easy access to an DisplayMetricsinstance.

  2. Acquiring screen information includes screen density, screen width and height, the height of the status bar, the ActionBar height.

  3. Acquisition device hardware information, including whether there is a camera available, whether there are hardware menu, whether there is a network, SD Card is available, the country currently selected language.

  4. Judgment is currently in full screen mode, controlled entry / exit full screen mode.

  5. dp value of px and interconversion.
  • QMUIDrawableHelper
  1. Fast draw a specified size, color, border image support rounded rectangular and circular shapes.

  2. Bring quickly draw a dividing line or below the line of the picture.

  3. Fading pictures can quickly draw a rounded.

  4. The color of the current picture into another color.

  5. The two images to generate a new image after the superposition.

  6. For a Viewgeneration picture shots.
  • QMUIPackageHelper

  • Provides an easy way to get the version information App, you can get the major version number, minor version number, and revision number alone.

  • QMUIResHelper

  • Encapsulating a more convenient method for obtaining the current Themeat the Attrvalue of the support Float, Color, ColorStateList, Drawableand Dimentypes Attr.

-QMUISpanHelper

  • Providing such a method QMUIMarginImageSpancan be more convenient to use.

  • QMUIStatusBarHelper

  • The status bar related tools, according to the type of function to divide a total includes the following features:
  1. Fast implementation immersive status bar (support 4.4 or higher MIUIand Flyme, as well as other 5.0+ Android).

  2. Quick set the status bar is black or white font icon (support 4.4 or later MIUIand Flyme, version 6.0 and above other Android).

3. The method of providing a plurality of common tools, such as access to the status bar height, determines whether the current full-screen and the like.

  • QMUIViewHelper

  • View tools, according to the type of function to divide a total includes the following features:
  1. To ImageViewbe processed, you can be scaled pictures.

  2. To Viewdo animation background color changes, support for multiple animation parameters.

  3. To Viewdo retreat cinematics, supports transparency and change up and down displacement in two ways.
    View providing a plurality of tools commonly used method, e.g., acquired from a ViewStub View View of the single direction provided padding, determining whether ListView has scrolled in the end portion and the like.

  4. Providing a plurality of common Viewtools method, such as Viewproviding a single direction padding, from ViewStubobtaining one View, it is determined ListViewwhether the scroll in the end portion and the like.

start using

qmui

1. import library

The latest JCenter library is uploaded to the warehouse, make sure you configure the JCenter warehouse source, and then direct reference:

implementation 'com.qmuiteam:qmui:1.2.0'

So far, QMUI has been introduced into the project.

Configuration Topics

The project themeis parentdirected QMUI.Compat, so far, QMUI can work properly.

3. override the default performance components

You can in the project themeused <item name="(name)">(value)</item>to override the default performance QMUI component form. You can specify the name of the specific property, please refer to @style/QMUI.Compatthe property.

1. import library

arch library will depend qmui library, the library also need to introduce qmui

implementation com.qmuiteam:arch:0.3.1

2. Initialize the Application # onCreate in

QMUISwipeBackActivityManager.init(this);

At last

If you see here, I feel well written articles give a praise chant? If you think there need to be improved, please give me a message. Will be serious inquiry, insufficiently corrected. Thank you.

Guess you like

Origin blog.51cto.com/14332859/2433335