Simple use of ViewPager in Android Development

What is ViewPager? ViewPager (android.support.v4.view.ViewPager) is a class in the Android extension package v4. This class allows users to switch the current view left and right to achieve the effect of sliding switch. Before using this class, you must understand: The ViewPager class directly inherits the ViewGroup class, that is ...

Posted by amir1985 on Fri, 06 Dec 2019 18:54:28 -0800

How to judge whether the page is pc or mobile and enter different pages

vue judges whether pc or mobile end enters different pages respectively The mobile terminal code is determined as follows: function IsPC(){ var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = true; for (var v = 0; v < Agents. ...

Posted by neuro4848 on Fri, 06 Dec 2019 16:02:03 -0800

Demonstration of using JsBridge

In the development of Android projects, if we need to call the functions in web in Android programs, we can use Jsbridge as a bridge for communication invocation. github code Express Sample demonstration: Jsbridge mutual call demonstration Jsbridge library introduction: implementation 'com.github.lzyzsd:jsbridge:1.0.4' One s ...

Posted by ldomingues on Fri, 06 Dec 2019 13:44:43 -0800

Using encapsulation for ionic3 toastController

1. description toastController is an official message prompt box component provided by ionic, which is used to give feedback and prompt to users after operation.Official website address: https://ionicframework.com/do...The following is the default style. To use it in a project, you need to change many styles, and you need to explain some parame ...

Posted by dstockto on Fri, 06 Dec 2019 11:12:54 -0800

MVC architecture design and three-tier model & the essence and decoupling of MVP

Blog Homepage 1. MVC architecture design and classic three-tier model MVC: model view controller, classic mode, easy to manage. Model: business layer and model layer, entity model and business related code View: view layer, which corresponds to layout layout file in android Controller: control layer, UI operation in android, corresponding to A ...

Posted by rdimaggio on Fri, 06 Dec 2019 08:26:53 -0800

Preview of camera+TextureSurface at the beginning of live video

Today, I'll talk about using camera interface and TextureSurface to preview First look at xml: <?xml version="1.0" encoding="utf-8"?> <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com ...

Posted by driverdave on Fri, 06 Dec 2019 03:19:57 -0800

You know the six most common layouts for Android development?

There is a good analogy on the Web: Layout is like a frame in a building. Components are arranged in order according to the layout requirements, which makes up a beautiful interface for viewing. Layout type 1. LinearLayout (Linear Layout) A linear layout arranges the child elements (which can be controls or layouts) in a horizontal or vertical ...

Posted by JoCitizen on Thu, 05 Dec 2019 20:27:22 -0800

Mobile custom scroll bar

In the development of mobile terminal, in order to prevent the click through behavior, we sometimes block the default behavior of the browser. At this time, we need to customize the required browser behavior. This article introduces the scroll bar of the customized browser. Default behavior of mobile browser The default behavior of browser m is ...

Posted by jdwmk on Thu, 05 Dec 2019 13:24:15 -0800

Optimize package size - PNG section

background Compared with JPEG image, PNG image is a lossless image storage format, and there is an additional transparency channel, so in general, PNG image is larger than JPEG image, and PNG image is often the big head of APK image resources, so optimizing the size of PNG image is more rewarding for reducing the volume of packet. wiki about P ...

Posted by mwmobley on Thu, 05 Dec 2019 12:08:02 -0800

Android embedded solution

I. event realization principle: ① View set AccessibilityDelegate ② when the View generates click, long click and other events, it will respond to the original Listener method ③ after the response of the original Listener method is completed, forward the message to the AccessibilityDelegate in the sendAccessibilityEvent method ④ handle the ev ...

Posted by niall_buckley on Thu, 05 Dec 2019 12:02:07 -0800