Tag:encapsulation

  • Implementation of universal encapsulation of Android MVP basefragment

    Time:2020-11-5

    This is the sixth article in our series on the basic MVP framework. Basemvp has been encapsulated by us almost. From the last article (Android MVP architecture (V) MVP multiple presenter dependency injection), we have solved the problem of multiple presenters. This is to dynamically instantiate different presenters by means of dependency injection and reflection […]

  • An example of encapsulation code for Java to return paging result set

    Time:2020-10-29

    This article mainly introduces the Java returns pagination result set encapsulation code example, the article through the example code introduction is very detailed, has certain reference study value to everybody’s study or the work, needs the friend may refer to The code is as follows package com.leyou.common; import java.util.List; public class PageResult<T> { Private long […]

  • IOS encapsulates the navigation bar and return to get the instance of the controller where the control is located

    Time:2020-9-29

    When a project finds that each return button is the same, and the font of the title is not the font of the system. If each page sets the return button and resets the font of the title, the code will look complicated and will waste a lot of time. At this time, it is […]

  • Instance code of IOS request permission encapsulation class

    Time:2020-8-3

    Upper direct code #import <Foundation/Foundation.h> #import <AVFoundation/AVFoundation.h> #import <AssetsLibrary/AssetsLibrary.h> #import <Photos/Photos.h> #import <CoreLocation/CoreLocation.h> @interface PermissionUtil : NSObject +(Boolean)JudgeCameraPermission; +(Boolean)JudgeLocationPermission; @end #import “PermissionUtil.h” @implementation PermissionUtil +(BOOL)isCanUsePhotos { if ([[[UIDevice currentDevice] systemVersion] floatValue] < 8.0) { ALAuthorizationStatus author =[ALAssetsLibrary authorizationStatus]; if (author == kCLAuthorizationStatusRestricted || author == kCLAuthorizationStatusDenied) { //No permission return NO; } } else { […]

  • IOS local storage nsuserdefaults encapsulation code

    Time:2020-8-1

    Direct code #import <Foundation/Foundation.h> @interface NSUserDefaultUtil : NSObject +(void)PutDefaults:(NSString *)key Value:(id)value; +(id)GetDefaults:(NSString *)key; @end #import “NSUserDefaultUtil.h” @implementation NSUserDefaultUtil +(void)PutDefaults:(NSString *)key Value:(id)value{ if (key!=NULL&&value!=NULL) { NSUserDefaults *userDefaults=[NSUserDefaults standardUserDefaults]; [userDefaults setObject:value forKey:key]; } } +(id)GetDefaults:(NSString *)key{ NSUserDefaults *userDefaults=[NSUserDefaults standardUserDefaults]; id obj; if (key!=NULL) { obj=[userDefaults objectForKey:key]; } return obj; } @end usage method [NSUserDefaultUtil PutDefaults:@”key” Value:str]; self.str […]

  • Java data encapsulation tree structure code example

    Time:2020-7-7

    This article mainly introduces the Java data encapsulation tree structure code example, the article through the example code introduction is very detailed, has the certain reference study value to everybody’s study or the work, needs the friend may refer to 1. Entity class @data public class PublishServiceType implements Comparable<PublishServiceType>{ /** * */ private static final […]

  • The realization of the second encapsulation of flutter Dio

    Time:2020-4-17

    Catalog: Diomanager: DIO auxiliary class nwmethod: request method, get, post, etc Nwapi: as you all know Entityfactory: JSON conversion auxiliary factory, convert JSON to t Baseentity < T >: data base class. The returned parameters are {“code”: 0, “message”: “”, “data”: {}}} Baselistentity < T >: data base class 2, the returned parameter is {“code”: […]

  • A detailed explanation of the implementation method of Python underlying encapsulation

    Time:2020-3-25

    This article mainly introduces the implementation method of Python underlying encapsulation. The example code is introduced in detail in this article, which has a certain reference value for your study or work. You can refer to the following for your friends In fact, the implementation of Python encapsulation features is purely “opportunistic”. The reason why […]

  • IOS Alipay, WeChat and UnionPay pay integrated package calls (next)

    Time:2020-3-12

    1、 More and more apps are adding third-party functions. The app may have different pages but call the same payment method. For example, the interface is as follows: These two pages will use third party payment: (WeChat, Alipay, UnionPay) if you call directly all the interface of the third party’s interface on every page, obviously […]

  • IOS Alipay, WeChat and UnionPay pay for integrated package calls (Part one)

    Time:2020-3-11

    I. integration of Alipay payment Alipay integrated official tutorial https://docs.open.alipay.com/204/105295/ Alipay integrates official demo https://docs.open.alipay.com/54/104509/ 1. Import SDK and add dependency Library Start the IDE (such as Xcode), copy the following files from the compressed files in the IOS package to the project folder, and import them into the project project. AlipaySDK.bundle AlipaySDK.framework In the […]

  • Deep analysis of SQL encapsulation, polymorphism and overloading

    Time:2020-2-5

    Object-oriented 1. Class: abstracted from many objects 2. Object: class instantiated 3. Definition of class Keyword class 4. The class contains Member variables Member attribute Member method 5. Object orientedThree characteristics (1) Encapsulation Objective: to protect classes and make them more secure. Method: make the member variables in the class private, and do the corresponding […]

  • Graphic presentation of c-packing method

    Time:2020-2-1

    C. use packaging method 1. Calculate the sum of all prime numbers (prime numbers) between 1-100. Code: 2. Program execution results: 3. Implement with method: there is an array, find out the maximum value. Cannot call array’s max method Code: 4. Program execution results: 5. Implementation by method: there is a string array, please output […]