-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfig.java
43 lines (31 loc) · 2.03 KB
/
Config.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package mohapps.iaudemo.config;
import java.util.ArrayList;
import java.util.List;
import mohapps.inappupdate.helper.ForceUpdateStrategyConfig;
public class Config {
public static List<Integer> FORCE_UPDATE_STRATEGY_LIST() {
List<Integer> FORCE_UPDATE_STRATEGY_LIST = new ArrayList<>();
//TODO: Add or remove force update strategies here (uncomment to add)
//FORCE_UPDATE_STRATEGY_LIST.add(ForceUpdateStrategy.LAST_DIGIT);
//FORCE_UPDATE_STRATEGY_LIST.add(ForceUpdateStrategy.MAJOR_CHANGE);
return FORCE_UPDATE_STRATEGY_LIST;
}
//TODO: Don't forget to modify corresponding value for each strategy below
//To use ForceUpdateStrategy.LAST_DIGIT you have to specify a positive number (no limit on digits)
//example: If you set it as 4, updates with version code of *4 such as 4, 14, 24, 34, ..., 104, 114, ... will be forced to users
//example: If you set it as 23, updates with version code of *23 such as 23, 123, 223, 323, ..., 1023, 1123, ... will be forced to users
public static Long FORCE_UPDATE_LAST_DIGIT = (long) -1;
//To use ForceUpdateStrategy.MAJOR_CHANGE you have to specify a positive number (no limit on digits)
//example: If you set it as 1, updates where 1 digit from left chenged such as 1 to 2, 12 to 22, 100658 to 200033 will be forced to users
//example: If you set it as 2, updates where 2 digits from left chenged such as 11 to 22, 120 to 230, 100658 to 210033 will be forced to users
//If your versions number of digits increased update will be forced
//example: updates where number of digits increased such as 9 to 10, 99 to 100 will be forced to users
public static Integer FORCE_UPDATE_MAJOR_LENGTH = -1;
public static ForceUpdateStrategyConfig getForceUpdateStrategyConfig(){
return ForceUpdateStrategyConfig.builder()
.setForceUpdateStrategyList(FORCE_UPDATE_STRATEGY_LIST())
.setEndsWith(FORCE_UPDATE_LAST_DIGIT)
.setMajorLength(FORCE_UPDATE_MAJOR_LENGTH)
.build();
}
}