Application of three common bullets in android in the project

I. overview

Pop ups often appear in Android projects. There are three common implementation methods: dialog pop ups, window pop ups, and activity pseudo pop ups. This paper will talk about the implementation of three kinds of bullet frames and their application in the project.

II. Demonstration diagram

Figure 1 shows three common pop ups (link at the end of the text), and Figure 2 shows the activity pseudo pop ups used in the project

III. text

1. Dialog pop-up

Let's start with an article:

Summary of 8 dialog usage methods for Android

Dialog is the system's own pop-up box. However, it is often rejected because the UI is not good-looking, and it often needs to be customized

Here are: 1. Binding layout 2. Setting listening and listening interface

Mainly talk about the style in the layout (suspended on the activity, and the fuzzy display is controlled here)

Dialog pop ups are generally used to load and display network data, or pop ups with less interaction (basically replaced by the new drop-down refresh control swiperefreshlayout)

2. Window pop-up

This is great. Show, hide and click monitoring are all written by yourself. It turns out that clicking outside the window to close the window is realized in this way. Have you learned it again

Then about:

Android window manager

It is mainly used to customize controls, such as drop-down boxes:

Customize spinner drop-down box

3. Activity pop-up box

It can't be simpler. Jump to another activity

Note the activity theme (control the activity as a pop-up style):

Activity pseudo pop-up frames are most commonly used for interaction and complex operation, as shown in Figure 2

In addition, the width ratio of activity pop-up frame can be controlled here

Finally, paste mainactivity

Code download address: https://github.com/BabyWu/SmallWindows

The above is the analysis of the application of three common bullet frames in android in the project introduced by Xiaobian. I hope it will help you. If you have any questions, please leave me a message and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>