CN106325658A - Android-based dynamic layout method and system - Google Patents

Android-based dynamic layout method and system Download PDF

Info

Publication number
CN106325658A
CN106325658A CN201510347176.9A CN201510347176A CN106325658A CN 106325658 A CN106325658 A CN 106325658A CN 201510347176 A CN201510347176 A CN 201510347176A CN 106325658 A CN106325658 A CN 106325658A
Authority
CN
China
Prior art keywords
layout
function
android
interface
property parameters
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.)
Withdrawn
Application number
CN201510347176.9A
Other languages
Chinese (zh)
Inventor
周彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201510347176.9A priority Critical patent/CN106325658A/en
Priority to PCT/CN2015/090183 priority patent/WO2016201813A1/en
Publication of CN106325658A publication Critical patent/CN106325658A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides an Android-based dynamic layout method and system. The method comprises the steps of obtaining a permission parameter of a current user for each function of a to-be-laid application; determining an executable function capable of being executed according to the permission parameter of the current user, and obtaining an attribute parameter corresponding to the executable function, wherein the attribute parameter includes a display position, a name and an icon of each function; generating a view unit according to the attribute parameter of the executable function, and determining a display sequence of all view units; and determining reserved positions of the view units in a main interface of the to-be-laid application, and adding the view units in the main interface according to the display sequence. According to the method and the system, the interface is flexibly and dynamically laid by configuring the attribute parameter of each function, and a function layout module is separated from the main interface, so that the requirement of lightweight design is met; and during attribute parameter configuration, the display position of each function is set, so that the situation that a logic code is needed to judge the layout is avoided and the complexity of interface layout is lowered.

Description

A kind of Dynamic Distribution based on Android method and system
Technical field
The present invention relates to Android application and development and area of maintenance, particularly to a kind of based on Android Dynamic Distribution's method and system.
Background technology
Along with the high speed development of mobile interchange and popularizing of smart mobile phone, the most traditional and non-traditional Industry has gradually stepped into the work new model of Intelligent mobile, should be used for daily life by Android Work of living is more universal, therefore Android application demand explosive growth.
In Android application and development and safeguarding, interface Dynamic Distribution can effective compatible various applied field Scape, simplifies maintenance work, the control authority of efficient, flexible;Often in same application, different user angles Color has different function interfaces, uses Dynamic Distribution to be just well positioned to meet this scene, it is simple to unified upgrading Safeguard.
Can Android layout be to be directly connected to Android application interface be attracted to the eyeball of user, institute Substantial amounts of energy will be spent to go polishing with developer in layout.The view layout of Android is by can Expand what markup language (xml) resource file controlled, in xml resource file, interface has been carried out static state Layout, application directly presents view layout according to xml resource file;But running into an Android When application needs to show different user interface issues under different scenes, traditional approach is exactly to answer for various Carry out separated layout by scene, then pass through in android code by defining multiple xml resource files The Rule of judgment of each scene is to meet many scenes application demand;Or define an xml resource file, bag Containing all function distributions, in android code, control display by Rule of judgment or hide a certain merit Can, thus realize the effect of Dynamic Distribution.
But both the above method all has problems: in first method, define multiple topology file and pass through again Android code judges, resource file reuses rate height, has run counter to light-weighted design;Resource file is Static, the amendment of little details also must revise source resource file;Scene is many, and rear judgement code will be various, Add logical complexity.
In second method, define an xml resource file, comprise all function distributions, at android Code controls display by Rule of judgment or hides a certain function, the layout order of the most each function It is relatively fixed, there is the limitation that cannot flexibly each functional device be sorted;It is unfavorable for expanding simultaneously, because of For often increasing New function, in addition it is also necessary to amendment integral layout resource file.
Summary of the invention
The invention provides a kind of Dynamic Distribution based on Android method and system, its purpose is to solve Certainly the most traditional Android static topology mode resource file is reused that rate is high, logical complexity is high and cannot be flexible To problems such as each functional device sequences.
In order to achieve the above object, The embodiment provides a kind of Dynamic Distribution based on Android Method, including:
Obtain active user for a rights parameters treating each function that layout applies;
According to the rights parameters of active user, determine the performed function that can perform, and then obtain and can perform The property parameters that function is corresponding, property parameters includes display position, title and the icon of each function;
According to the property parameters of function can be performed, generate view unit, and determine the display of each view unit Sequentially;
Determine the reserved location of the view unit treated in the main interface that layout is applied, according to DISPLAY ORDER, leading Each view unit is added at interface.
Further, active user's step for a rights parameters treating each function that layout applies is being obtained Before Zhou, the method also includes:
Obtaining and treat all functions that layout is applied, each function is carried out property parameters configuration, property parameters is extremely Include display position, title and the icon of this function less, and according to the display position of each function to all Function is ranked up.
Further, it is determined that the reserved location of the view unit treated in the main interface that layout is applied, according to display Sequentially, after the step of each view unit is added at main interface, the method also includes:
Generate layout resource file, and according to layout resource file display layout interface.
Further, the property parameters of each function also includes the labelling of this function, control of authority and redirects Action.
Further, include according to the step at layout resource file display layout interface:
Layout resource file is resolved, generates layout interface;
Layout interface is shown.
To achieve these goals, present invention also offers a kind of dynamic layout system based on Android, Including:
For one, first acquisition module, treats that the authority of each function that layout apply is joined for obtaining active user Number;
Second acquisition module, for the rights parameters according to active user, determines the performed merit that can perform Can, so obtain can perform the property parameters that function is corresponding, property parameters include each function display position, Title and icon;
View unit generation module, can perform the property parameters of function for basis, generates view unit, and Determine the DISPLAY ORDER of each view unit;
View unit adds module, for determining the reserved place of the view unit treated in the main interface that layout is applied Put, according to DISPLAY ORDER, add each view unit at main interface.
Further, this system also includes:
Property parameters configuration module, treats, for obtaining, all functions that layout is applied, belongs to each function Property parameter configuration, property parameters at least includes display position, title and the icon of this function, and according to every All functions are ranked up by the display position of individual function.
Further, this system also includes:
Resource file generation module, is used for generating layout resource file, and shows cloth according to layout resource file Office interface.
Further, the property parameters of each function also includes the labelling of this function, control of authority and redirects Action.
Further, resource file generation module includes:
Analyzing sub-module, for resolving layout resource file, generates layout interface;
Display sub-module, for showing layout interface.
The such scheme of the present invention at least includes following beneficial effect:
Dynamic Distribution based on the Android method and system that the present invention provides, by configuring each function Property parameters comes Dynamic Distribution interface flexibly, function distribution module and main interfacial separation, meets lightweight and sets The requirement of meter, facilitates later maintenance;Layout resource file is dynamic, has good expansion, needs During change interface layout, only need to revise the property parameters of corresponding function, solve the function distribution of static state In mode, each functional sequence is relatively fixed, it is impossible to the limitation of sequence flexibly;When property parameters configures, The display position of each function is set, avoids and need logical code to judge layout, reduce interface The complexity of layout.
Accompanying drawing explanation
Fig. 1 is the flow chart of steps of Dynamic Distribution based on the Android method described in embodiments of the invention;
Fig. 2 is the structural representation of the dynamic layout system based on Android described in embodiments of the invention.
Detailed description of the invention
For making the technical problem to be solved in the present invention, technical scheme and advantage clearer, below in conjunction with attached Figure and specific embodiment are described in detail.
See Fig. 1, the present invention is directed to existing problem, it is provided that a kind of Dynamic Distribution based on Android Method, the method can apply to a terminal unit being provided with Android operation system, and this terminal unit is concrete Can be smart mobile phone or panel computer, the method includes:
Step 101, obtains active user for a rights parameters treating each function that layout applies.
Step 102, according to the rights parameters of active user, determines the performed function that can perform, and then Acquisition can perform the property parameters that function is corresponding, property parameters include the display position of each function, title with And icon.
It is to say, only select active user executable function to participate in interface layout, it is to avoid at android Code control display by Rule of judgment or hides the complicated procedures of a certain function, also making resource simultaneously File lightweight.
Here, acquisition can perform property parameters corresponding to function and can read from terminal unit this locality, or Initiate request to a predetermined remote server, wait that remote server feeds back to terminal unit.
Step 103, according to performing the property parameters of function, generates view unit, and determines each view The DISPLAY ORDER of unit.
Here, find the picture of correspondence according to the icon in the property parameters that can perform function, look for according to title To corresponding character value, completing the structure of view unit, view unit is ranked up by display position.
Step 104, determines the reserved location of the view unit treated in the main interface that layout is applied, according to display Sequentially, each view unit is added at main interface.
Here, often in same application, different user roles has different demands to each function, The present invention, according to the different user demand to each function, shows user's desired view unit, makes interface cloth Office more meets user's request.Further, treat, for one, each merit that layout is applied acquisition active user Before the step of the rights parameters of energy, also include:
Obtaining and treat all functions that layout is applied, each function is carried out property parameters configuration, property parameters is extremely Include display position, title and the icon of this function less, and according to the display position of each function to all Function is ranked up;Further, the property parameters of each function also includes the labelling of this function, authority control Make and redirect action.
Owing to, in this method, layout resource file is dynamic, therefore, when certain function display position, Title, icon, labelling, control of authority and redirect the parameters such as action when changing, only need to revise this merit The property parameters of energy, it is not necessary to amendment resource file.
Further, it is determined that the reserved location of the view unit treated in the main interface that layout is applied, according to display Sequentially, after the step of each view unit is added at main interface, also include:
Generate layout resource file, and according to layout resource file display layout interface.
Further, include according to the step at layout resource file display layout interface:
Layout resource file is resolved, generates layout interface;
Layout interface is shown.
Here, dynamically generating xml resource file, xml resource file is directly resolved, presents cloth by application Office interface, and then realize dynamically controlling the effect of the layout interface of Android.
Dynamic Distribution based on the Android method and system that the present invention provides, by configuring each function Property parameters comes Dynamic Distribution interface flexibly, function distribution module and main interfacial separation, meets lightweight and sets The requirement of meter, facilitates later maintenance;When property parameters configures, the display position of each function is set Fixed, avoid and need logical code to judge layout, reduce the complexity of interface layout.
See Fig. 2, to achieve these goals, present invention also offers a kind of based on Android dynamic Layout system, including:
First acquisition module 201, for obtaining active user for the power treating each function that layout applies Limit parameter;
Second acquisition module 202, for the rights parameters according to active user, determines that can perform holds Row function, so obtain can perform the property parameters that function is corresponding, property parameters includes the display of each function Position, title and icon;
View unit generation module 203, can perform the property parameters of function for basis, generates view unit, And determine the DISPLAY ORDER of each view unit;
View unit adds module 204, for determining the pre-of the view unit treated in the main interface that layout is applied Stay position, according to DISPLAY ORDER, add each view unit at main interface.
Further, this system also includes:
Property parameters configuration module 205, treats, for obtaining, all functions that layout is applied, enters each function Row property parameters configures, and property parameters at least includes display position, title and the icon of this function, and depends on According to the display position of each function, all functions are ranked up.
Further, this system also includes:
Resource file generation module 206, is used for generating layout resource file, and shows according to layout resource file Show layout interface.
Further, the property parameters of each function also includes the labelling of this function, control of authority and redirects Action.
Further, resource file generation module 206 includes:
Analyzing sub-module 2061, for resolving layout resource file, generates layout interface;
Display sub-module 2062, for showing layout interface.
It should be noted that the dynamic layout system based on Android that the present invention provides is to apply above-mentioned side All embodiments of the device of method, i.e. said method are all applicable to this device, and all can reach same or similar Beneficial effect.
The above is the preferred embodiment of the present invention, it is noted that for the common skill of the art For art personnel, on the premise of without departing from principle of the present invention, it is also possible to make some improvements and modifications, These improvements and modifications also should be regarded as protection scope of the present invention.

Claims (10)

1. Dynamic Distribution based on an Android method, it is characterised in that including:
Obtain active user for a rights parameters treating each function that layout applies;
According to the rights parameters of described active user, determine the performed function that can perform, and then obtain institute Stating and can perform the property parameters that function is corresponding, described property parameters includes the display position of each function, title And icon;
According to the described property parameters performing function, generate view unit, and determine each view unit DISPLAY ORDER;
The reserved location of view unit in the main interface that layout is applied is treated described in determining, suitable according to described display Sequence, adds each view unit at main interface.
2. Dynamic Distribution based on Android as claimed in claim 1 method, it is characterised in that Before obtaining active user's step for a rights parameters treating each function that layout applies, also include:
Obtaining and treat all functions that layout is applied, each function carries out property parameters configuration, described attribute is joined Number at least includes display position, title and the icon of this function, and according to the display position pair of each function All functions are ranked up.
3. Dynamic Distribution based on Android as claimed in claim 1 method, it is characterised in that described The reserved location of view unit in the main interface that layout is applied is treated described in determining, according to described DISPLAY ORDER, After the step of each view unit is added at main interface, also include:
Generate layout resource file, and according to described layout resource file display layout interface.
4. Dynamic Distribution based on Android as claimed in claim 2 method, it is characterised in that institute The property parameters stating each function also includes the labelling of this function, control of authority and redirects action.
5. Dynamic Distribution based on Android as claimed in claim 3 method, it is characterised in that institute State and include according to the step at described layout resource file display layout interface:
Described layout resource file is resolved, generates layout interface;
Described layout interface is shown.
6. a dynamic layout system based on Android, it is characterised in that including:
For one, first acquisition module, treats that the authority of each function that layout apply is joined for obtaining active user Number;
Second acquisition module, for the rights parameters according to described active user, determines that can perform holds Row function, and then can perform, described in acquisition, the property parameters that function is corresponding, described property parameters includes each merit Display position, title and the icon of energy;
View unit generation module, for according to the described property parameters performing function, generates view unit, And determine the DISPLAY ORDER of each view unit;
View unit adds module, treats the pre-of view unit in the main interface that layout is applied described in determine Stay position, according to described DISPLAY ORDER, add each view unit at main interface.
7. dynamic layout system based on Android as claimed in claim 6, it is characterised in that institute System of stating also includes:
Property parameters configuration module, treats, for obtaining, all functions that layout is applied, belongs to each function Property parameter configuration, described property parameters at least includes display position, title and the icon of this function, and depends on According to the display position of each function, all functions are ranked up.
8. dynamic layout system based on Android as claimed in claim 6, it is characterised in that described System also includes:
Resource file generation module, is used for generating layout resource file, and shows according to described layout resource file Show layout interface.
9. dynamic layout system based on Android as claimed in claim 7, it is characterised in that institute The property parameters stating each function also includes the labelling of this function, control of authority and redirects action.
10. dynamic layout system based on Android as claimed in claim 8, it is characterised in that institute State resource file generation module to include:
Analyzing sub-module, for resolving described layout resource file, generates layout interface;
Display sub-module, for showing described layout interface.
CN201510347176.9A 2015-06-19 2015-06-19 Android-based dynamic layout method and system Withdrawn CN106325658A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510347176.9A CN106325658A (en) 2015-06-19 2015-06-19 Android-based dynamic layout method and system
PCT/CN2015/090183 WO2016201813A1 (en) 2015-06-19 2015-09-21 Dynamic layout method and system based on android

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510347176.9A CN106325658A (en) 2015-06-19 2015-06-19 Android-based dynamic layout method and system

Publications (1)

Publication Number Publication Date
CN106325658A true CN106325658A (en) 2017-01-11

Family

ID=57544829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510347176.9A Withdrawn CN106325658A (en) 2015-06-19 2015-06-19 Android-based dynamic layout method and system

Country Status (2)

Country Link
CN (1) CN106325658A (en)
WO (1) WO2016201813A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107741970A (en) * 2017-10-09 2018-02-27 北京京东尚科信息技术有限公司 Method and apparatus for being laid out to homepage
CN108334386A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 A kind of layout method and system of view component
CN114327656A (en) * 2021-12-27 2022-04-12 杭州圆规网络科技有限公司 Method and device for dynamically laying out application program interface, storage medium and electronic device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020085020A1 (en) * 2000-09-14 2002-07-04 Carroll Thomas J. XML-based graphical user interface application development toolkit
CN101882074A (en) * 2010-03-15 2010-11-10 浪潮集团山东通用软件有限公司 Method and system for graphic user interface combination and layout
CN103336691A (en) * 2013-06-29 2013-10-02 安科智慧城市技术(中国)有限公司 Dynamic layout method and system based on Android
CN104239044A (en) * 2014-09-05 2014-12-24 北京航天自动控制研究所 Dynamic generation method for graphical user interface
CN104484169A (en) * 2014-12-09 2015-04-01 成都视达科信息技术有限公司 Android software user interface generating method and system and Android application system
CN104636643A (en) * 2013-11-07 2015-05-20 华为技术有限公司 System interface content presentation control method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103440131B (en) * 2013-08-30 2016-06-29 四川九洲电器集团有限责任公司 A kind of mobile terminal touch screen view layout method of adjustment based on Android system
CN104462979B (en) * 2014-12-26 2017-11-07 深圳数字电视国家工程实验室股份有限公司 The automation dynamic testing method and device of a kind of application program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020085020A1 (en) * 2000-09-14 2002-07-04 Carroll Thomas J. XML-based graphical user interface application development toolkit
CN101882074A (en) * 2010-03-15 2010-11-10 浪潮集团山东通用软件有限公司 Method and system for graphic user interface combination and layout
CN103336691A (en) * 2013-06-29 2013-10-02 安科智慧城市技术(中国)有限公司 Dynamic layout method and system based on Android
CN104636643A (en) * 2013-11-07 2015-05-20 华为技术有限公司 System interface content presentation control method and device
CN104239044A (en) * 2014-09-05 2014-12-24 北京航天自动控制研究所 Dynamic generation method for graphical user interface
CN104484169A (en) * 2014-12-09 2015-04-01 成都视达科信息技术有限公司 Android software user interface generating method and system and Android application system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334386A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 A kind of layout method and system of view component
CN107741970A (en) * 2017-10-09 2018-02-27 北京京东尚科信息技术有限公司 Method and apparatus for being laid out to homepage
CN114327656A (en) * 2021-12-27 2022-04-12 杭州圆规网络科技有限公司 Method and device for dynamically laying out application program interface, storage medium and electronic device

Also Published As

Publication number Publication date
WO2016201813A1 (en) 2016-12-22

Similar Documents

Publication Publication Date Title
CN106445484B (en) The method and system of data tracking are realized by Software Development Kit
CN101408899B (en) Method and apparatus for switching website multiple data sources
CN103984818B (en) AUV (autonomous underwater vehicle) design flow visualization modeling method based on Flex technology
CN105677371B (en) Method and system for quickly generating software interface
CN104252378A (en) Virtual computer experience classroom system
CN106325975A (en) Method for automatically deploying and managing big data clusters by using Docker container
CN104202416A (en) Service orchestration system and method under cloud operating system
CN104461743A (en) Device and method for automatically generating resources and configuration
CN107766145A (en) EMS memory management process and device under dual system
CN106325658A (en) Android-based dynamic layout method and system
CN106648674A (en) Big data computing management method and system
CN105404169A (en) Central control system of smart home and control method
CN105425607A (en) Intelligent household central control system based on multiple Agents and control method thereof
CN105718601A (en) Business dynamic integration model and application method thereof
CN107515756A (en) A kind of display and control software implementation method based on display mechanism
CN112486491A (en) Page generation method and device, computer equipment and storage medium
CN109471546A (en) A kind of method, system and the storage medium of KVM command scheduling
CN104750525A (en) Control method for turning on and turning off server in timed mode
CN107562520A (en) The method and apparatus of the internal memory of dilatation virtual machine
CN104978170A (en) Multi-agent system generating method based on graphical expression
CN111767149B (en) Scheduling method, device, equipment and storage equipment
CN102945264A (en) Method for intelligently starting distributed transaction
CN107122285A (en) A kind of multithread process control Dynamic Announce and intelligence change System and method for
CN104486117B (en) A kind of the configuration order exchange method and system of more board core switch
CN106406978A (en) Automatic making device and method for private cloud virtual machine template

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20170111