28 |
--------------------------------------------------------------------------------
/res/raw/warring01.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Toolwiz/ToolWizAppLock/517ccfd1c21d1a70ec0dcdc9ae28b424becb4569/res/raw/warring01.ogg
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
24 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
24 | 64dp
25 |
26 |
27 |
--------------------------------------------------------------------------------
/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/res/values/color_material_design.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
20 |
21 | #de000000
22 | #8a000000
23 | #42000000
24 | #1f000000
25 |
26 | #ffffffff
27 | #b3ffffff
28 | #4dffffff
29 | #1fffffff
30 |
31 |
32 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 |
19 |
20 | 16dp
21 | 16dp
22 | 50.0dip
23 | 19.0dip
24 | 48.0dip
25 | 51.0dip
26 |
27 |
28 | 56dip
29 |
30 |
--------------------------------------------------------------------------------
/res/values/umeng_fb_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | #FF0FB0A8
20 | #FFD8D8D8
21 | #DCDCDC
22 | #8A000000
23 | #FFFFFF
24 | #F4F0745F
25 |
26 |
--------------------------------------------------------------------------------
/res/values/umeng_fb_dimens.xml:
--------------------------------------------------------------------------------
1 |
17 |
18 | 48dp
19 | 14sp
20 | 12sp
21 | 0.8dp
22 | 12dp
23 | 20sp
24 |
25 |
--------------------------------------------------------------------------------
/res/values/umeng_fb_style.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/res/values/values.xml:
--------------------------------------------------------------------------------
1 |
2 |
18 |
19 | 420
20 | 420
21 | 340
22 |
23 |
--------------------------------------------------------------------------------
/res/xml/device_admin.xml:
--------------------------------------------------------------------------------
1 |
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 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/MyConstants.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock;
18 |
19 | import java.io.File;
20 |
21 | import android.content.Context;
22 | import android.os.Environment;
23 |
24 | public class MyConstants {
25 |
26 | public static final String LOCK_PACKAGE_NAME = "lock_package_name";
27 |
28 | public static final String SDPATH = Environment
29 | .getExternalStorageDirectory().getPath();
30 |
31 | public static String getDatabasePath(Context context, String oldName) {
32 | boolean sdExist = Environment.isExternalStorageEmulated();
33 | if (sdExist) {
34 | return Environment.getExternalStorageDirectory().getAbsolutePath()
35 | + "/applock/" + oldName;
36 | } else {
37 | return oldName;
38 | }
39 | }
40 |
41 | public static String getHidePath(String pathString) {
42 | File pathFile = new File(pathString);
43 | if (pathFile != null) {
44 | return pathFile.getPath().substring(0, pathFile.getPath().lastIndexOf('/')) + "/.";
45 | }
46 | return "";
47 | }
48 |
49 | public static String getSuffix(){
50 | return ".lock";
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/BabyModel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table BabyModel.
22 | */
23 | public class BabyModel {
24 |
25 | private Long id;
26 | private String packageName;
27 |
28 | public BabyModel() {
29 | }
30 |
31 | public BabyModel(Long id) {
32 | this.id = id;
33 | }
34 |
35 | public BabyModel(Long id, String packageName) {
36 | this.id = id;
37 | this.packageName = packageName;
38 | }
39 |
40 | public Long getId() {
41 | return id;
42 | }
43 |
44 | public void setId(Long id) {
45 | this.id = id;
46 | }
47 |
48 | public String getPackageName() {
49 | return packageName;
50 | }
51 |
52 | public void setPackageName(String packageName) {
53 | this.packageName = packageName;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/FaviterApps.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table FAVITER_APPS.
22 | */
23 | public class FaviterApps {
24 |
25 | private Long id;
26 | private String packageName;
27 |
28 | public FaviterApps() {
29 | }
30 |
31 | public FaviterApps(Long id) {
32 | this.id = id;
33 | }
34 |
35 | public FaviterApps(Long id, String packageName) {
36 | this.id = id;
37 | this.packageName = packageName;
38 | }
39 |
40 | public Long getId() {
41 | return id;
42 | }
43 |
44 | public void setId(Long id) {
45 | this.id = id;
46 | }
47 |
48 | public String getPackageName() {
49 | return packageName;
50 | }
51 |
52 | public void setPackageName(String packageName) {
53 | this.packageName = packageName;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/GroupAudio.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table GroupAudio.
22 | */
23 | public class GroupAudio {
24 |
25 | private Long id;
26 | private Integer parentId;
27 | private String name;
28 | private Long createDate;
29 |
30 | public GroupAudio() {
31 | }
32 |
33 | public GroupAudio(Long id) {
34 | this.id = id;
35 | }
36 |
37 | public GroupAudio(Long id, Integer parentId, String name, Long createDate) {
38 | this.id = id;
39 | this.parentId = parentId;
40 | this.name = name;
41 | this.createDate = createDate;
42 | }
43 |
44 | public Long getId() {
45 | return id;
46 | }
47 |
48 | public void setId(Long id) {
49 | this.id = id;
50 | }
51 |
52 | public Integer getParentId() {
53 | return parentId;
54 | }
55 |
56 | public void setParentId(Integer parentId) {
57 | this.parentId = parentId;
58 | }
59 |
60 | public String getName() {
61 | return name;
62 | }
63 |
64 | public void setName(String name) {
65 | this.name = name;
66 | }
67 |
68 | public Long getCreateDate() {
69 | return createDate;
70 | }
71 |
72 | public void setCreateDate(Long createDate) {
73 | this.createDate = createDate;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/GroupFile.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table GroupFile.
22 | */
23 | public class GroupFile {
24 |
25 | private Long id;
26 | private Integer parentId;
27 | private String name;
28 | private Long createDate;
29 |
30 | public GroupFile() {
31 | }
32 |
33 | public GroupFile(Long id) {
34 | this.id = id;
35 | }
36 |
37 | public GroupFile(Long id, Integer parentId, String name, Long createDate) {
38 | this.id = id;
39 | this.parentId = parentId;
40 | this.name = name;
41 | this.createDate = createDate;
42 | }
43 |
44 | public Long getId() {
45 | return id;
46 | }
47 |
48 | public void setId(Long id) {
49 | this.id = id;
50 | }
51 |
52 | public Integer getParentId() {
53 | return parentId;
54 | }
55 |
56 | public void setParentId(Integer parentId) {
57 | this.parentId = parentId;
58 | }
59 |
60 | public String getName() {
61 | return name;
62 | }
63 |
64 | public void setName(String name) {
65 | this.name = name;
66 | }
67 |
68 | public Long getCreateDate() {
69 | return createDate;
70 | }
71 |
72 | public void setCreateDate(Long createDate) {
73 | this.createDate = createDate;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/GroupImage.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table GroupImage.
22 | */
23 | public class GroupImage {
24 |
25 | private Long id;
26 | private Integer parentId;
27 | private String name;
28 | private Long createDate;
29 |
30 | public GroupImage() {
31 | }
32 |
33 | public GroupImage(Long id) {
34 | this.id = id;
35 | }
36 |
37 | public GroupImage(Long id, Integer parentId, String name, Long createDate) {
38 | this.id = id;
39 | this.parentId = parentId;
40 | this.name = name;
41 | this.createDate = createDate;
42 | }
43 |
44 | public Long getId() {
45 | return id;
46 | }
47 |
48 | public void setId(Long id) {
49 | this.id = id;
50 | }
51 |
52 | public Integer getParentId() {
53 | return parentId;
54 | }
55 |
56 | public void setParentId(Integer parentId) {
57 | this.parentId = parentId;
58 | }
59 |
60 | public String getName() {
61 | return name;
62 | }
63 |
64 | public void setName(String name) {
65 | this.name = name;
66 | }
67 |
68 | public Long getCreateDate() {
69 | return createDate;
70 | }
71 |
72 | public void setCreateDate(Long createDate) {
73 | this.createDate = createDate;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/GroupVideo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table GroupVideo.
22 | */
23 | public class GroupVideo {
24 |
25 | private Long id;
26 | private Integer parentId;
27 | private String name;
28 | private Long createDate;
29 |
30 | public GroupVideo() {
31 | }
32 |
33 | public GroupVideo(Long id) {
34 | this.id = id;
35 | }
36 |
37 | public GroupVideo(Long id, Integer parentId, String name, Long createDate) {
38 | this.id = id;
39 | this.parentId = parentId;
40 | this.name = name;
41 | this.createDate = createDate;
42 | }
43 |
44 | public Long getId() {
45 | return id;
46 | }
47 |
48 | public void setId(Long id) {
49 | this.id = id;
50 | }
51 |
52 | public Integer getParentId() {
53 | return parentId;
54 | }
55 |
56 | public void setParentId(Integer parentId) {
57 | this.parentId = parentId;
58 | }
59 |
60 | public String getName() {
61 | return name;
62 | }
63 |
64 | public void setName(String name) {
65 | this.name = name;
66 | }
67 |
68 | public Long getCreateDate() {
69 | return createDate;
70 | }
71 |
72 | public void setCreateDate(Long createDate) {
73 | this.createDate = createDate;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/ParentModel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table ParentModel.
22 | */
23 | public class ParentModel {
24 |
25 | private Long id;
26 | private String packageName;
27 |
28 | public ParentModel() {
29 | }
30 |
31 | public ParentModel(Long id) {
32 | this.id = id;
33 | }
34 |
35 | public ParentModel(Long id, String packageName) {
36 | this.id = id;
37 | this.packageName = packageName;
38 | }
39 |
40 | public Long getId() {
41 | return id;
42 | }
43 |
44 | public void setId(Long id) {
45 | this.id = id;
46 | }
47 |
48 | public String getPackageName() {
49 | return packageName;
50 | }
51 |
52 | public void setPackageName(String packageName) {
53 | this.packageName = packageName;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/TimeLockInfo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table TimeLock.
22 | */
23 | public class TimeLockInfo {
24 |
25 | private Long id;
26 | private Integer beyondTimeManager;
27 | private String packageName;
28 |
29 | public TimeLockInfo() {
30 | }
31 |
32 | public TimeLockInfo(Long id) {
33 | this.id = id;
34 | }
35 |
36 | public TimeLockInfo(Long id, Integer beyondTimeManager, String packageName) {
37 | this.id = id;
38 | this.beyondTimeManager = beyondTimeManager;
39 | this.packageName = packageName;
40 | }
41 |
42 | public Long getId() {
43 | return id;
44 | }
45 |
46 | public void setId(Long id) {
47 | this.id = id;
48 | }
49 |
50 | public Integer getBeyondTimeManager() {
51 | return beyondTimeManager;
52 | }
53 |
54 | public void setBeyondTimeManager(Integer beyondTimeManager) {
55 | this.beyondTimeManager = beyondTimeManager;
56 | }
57 |
58 | public String getPackageName() {
59 | return packageName;
60 | }
61 |
62 | public void setPackageName(String packageName) {
63 | this.packageName = packageName;
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/VisitorModel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table visitorModel.
22 | */
23 | public class VisitorModel {
24 |
25 | private Long id;
26 | private String packageName;
27 |
28 | public VisitorModel() {
29 | }
30 |
31 | public VisitorModel(Long id) {
32 | this.id = id;
33 | }
34 |
35 | public VisitorModel(Long id, String packageName) {
36 | this.id = id;
37 | this.packageName = packageName;
38 | }
39 |
40 | public Long getId() {
41 | return id;
42 | }
43 |
44 | public void setId(Long id) {
45 | this.id = id;
46 | }
47 |
48 | public String getPackageName() {
49 | return packageName;
50 | }
51 |
52 | public void setPackageName(String packageName) {
53 | this.packageName = packageName;
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/WIFILockInfo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table WifiLock.
22 | */
23 | public class WIFILockInfo {
24 |
25 | private Long id;
26 | private String beyoundWifiManager;
27 | private String packageName;
28 |
29 | public WIFILockInfo() {
30 | }
31 |
32 | public WIFILockInfo(Long id) {
33 | this.id = id;
34 | }
35 |
36 | public WIFILockInfo(Long id, String beyoundWifiManager, String packageName) {
37 | this.id = id;
38 | this.beyoundWifiManager = beyoundWifiManager;
39 | this.packageName = packageName;
40 | }
41 |
42 | public Long getId() {
43 | return id;
44 | }
45 |
46 | public void setId(Long id) {
47 | this.id = id;
48 | }
49 |
50 | public String getBeyoundWifiManager() {
51 | return beyoundWifiManager;
52 | }
53 |
54 | public void setBeyoundWifiManager(String beyoundWifiManager) {
55 | this.beyoundWifiManager = beyoundWifiManager;
56 | }
57 |
58 | public String getPackageName() {
59 | return packageName;
60 | }
61 |
62 | public void setPackageName(String packageName) {
63 | this.packageName = packageName;
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/data/WIFILockManager.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.data;
18 |
19 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. Enable "keep" sections if you want to edit.
20 | /**
21 | * Entity mapped to table WIFILOCK_MANAGER.
22 | */
23 | public class WIFILockManager {
24 |
25 | private Long id;
26 | private String ssidName;
27 | private String lockName;
28 | private Boolean isOn;
29 |
30 | public WIFILockManager() {
31 | }
32 |
33 | public WIFILockManager(Long id) {
34 | this.id = id;
35 | }
36 |
37 | public WIFILockManager(Long id, String ssidName, String lockName, Boolean isOn) {
38 | this.id = id;
39 | this.ssidName = ssidName;
40 | this.lockName = lockName;
41 | this.isOn = isOn;
42 | }
43 |
44 | public Long getId() {
45 | return id;
46 | }
47 |
48 | public void setId(Long id) {
49 | this.id = id;
50 | }
51 |
52 | public String getSsidName() {
53 | return ssidName;
54 | }
55 |
56 | public void setSsidName(String ssidName) {
57 | this.ssidName = ssidName;
58 | }
59 |
60 | public String getLockName() {
61 | return lockName;
62 | }
63 |
64 | public void setLockName(String lockName) {
65 | this.lockName = lockName;
66 | }
67 |
68 | public Boolean getIsOn() {
69 | return isOn;
70 | }
71 |
72 | public void setIsOn(Boolean isOn) {
73 | this.isOn = isOn;
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/files/activity/filePackage/ImagePackageActivity.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.files.activity.filePackage;
18 |
19 | import android.app.Activity;
20 |
21 | /**
22 | * Created by dev on 2015/4/29.
23 | */
24 | public class ImagePackageActivity extends Activity {
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/files/widget/HackyViewPager.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.files.widget;
18 |
19 | import android.content.Context;
20 | import android.support.v4.view.ViewPager;
21 | import android.util.AttributeSet;
22 | import android.view.MotionEvent;
23 |
24 | /**
25 | * Created by dev on 2015/5/8.
26 | */
27 | public class HackyViewPager extends ViewPager {
28 |
29 | public HackyViewPager(Context context) {
30 | super(context);
31 | }
32 |
33 | public HackyViewPager(Context context, AttributeSet attrs) {
34 | super(context, attrs);
35 | }
36 |
37 | /**
38 | * 抓 IllegalArgumentException 异常,防止图片缩放时崩溃
39 | *
40 | * @param ev
41 | * @return
42 | */
43 | @Override
44 | public boolean onInterceptTouchEvent(MotionEvent ev) {
45 | try {
46 | return super.onInterceptTouchEvent(ev);
47 | } catch (IllegalArgumentException e) {
48 | e.printStackTrace();
49 | return false;
50 | }
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/model/AbstructProvider.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.model;
18 |
19 | import java.util.List;
20 |
21 | public interface AbstructProvider {
22 | public List> getList();
23 | }
24 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/model/FileModel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.model;
18 |
19 | public class FileModel {
20 | public static int FILE_DIR = 0;
21 | public static int FILE_FILE = 1;
22 | private String name;
23 | private String path;
24 | private int fileType;
25 |
26 | public FileModel() {
27 | super();
28 | }
29 |
30 | public FileModel(String name, String path, int fileType) {
31 | super();
32 | this.name = name;
33 | this.path = path;
34 | this.fileType = fileType;
35 | }
36 |
37 | public String getName() {
38 | return name;
39 | }
40 |
41 | public void setName(String name) {
42 | this.name = name;
43 | }
44 |
45 | public String getPath() {
46 | return path;
47 | }
48 |
49 | public void setPath(String path) {
50 | this.path = path;
51 | }
52 |
53 | public int getFileType() {
54 | return fileType;
55 | }
56 |
57 | public void setFileType(int fileType) {
58 | this.fileType = fileType;
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/model/ImageModel.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.model;
18 |
19 | public class ImageModel {
20 | private int id;
21 | private String title;
22 | private String displayName;
23 | private String mimeType;
24 | private String path;
25 | private long size;
26 |
27 | public ImageModel(int id, String title, String displayName,
28 | String mimeType, String path, long size) {
29 | super();
30 | this.id = id;
31 | this.title = title;
32 | this.displayName = displayName;
33 | this.mimeType = mimeType;
34 | this.path = path;
35 | this.size = size;
36 | }
37 |
38 | public int getId() {
39 | return id;
40 | }
41 | public void setId(int id) {
42 | this.id = id;
43 | }
44 | public String getTitle() {
45 | return title;
46 | }
47 | public void setTitle(String title) {
48 | this.title = title;
49 | }
50 | public String getDisplayName() {
51 | return displayName;
52 | }
53 | public void setDisplayName(String displayName) {
54 | this.displayName = displayName;
55 | }
56 | public String getMimeType() {
57 | return mimeType;
58 | }
59 | public void setMimeType(String mimeType) {
60 | this.mimeType = mimeType;
61 | }
62 | public String getPath() {
63 | return path;
64 | }
65 | public void setPath(String path) {
66 | this.path = path;
67 | }
68 | public long getSize() {
69 | return size;
70 | }
71 | public void setSize(long size) {
72 | this.size = size;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/model/LockAppInfo.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.model;
18 |
19 |
20 | public class LockAppInfo {
21 |
22 | public static int APP_LOCK_TYPE_COMM = 1; //普通锁
23 | public static int APP_LOCK_TYPE_TIME = 2; //时间锁
24 | public static int APP_LOCK_TYPE_WIFI = 3; //wifi锁
25 | public static int APP_LOCK_TYPE_MODEL = 4; //情景锁
26 |
27 | int lockType;
28 | }
29 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/model/SettingItem.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.model;
18 |
19 | public class SettingItem {
20 |
21 | public static final int SET_TYPE_ONOFF = 0;
22 | public static final int SET_TYPE_ENTER = 1;
23 | public static final int SET_TYPE_TEXT = 2;
24 | public static final int SET_TYPE_SECTION = 3;
25 | public static final int SET_TYPE_TITLE = 4;
26 |
27 | private int key;
28 | private int picId;
29 | private int titleId;
30 | private int text1;
31 | private int text2;
32 | private int type;
33 |
34 | public SettingItem(int key, int picId, int titleId, int text1, int text2,
35 | int type) {
36 | super();
37 | this.key = key;
38 | this.picId = picId;
39 | this.titleId = titleId;
40 | this.type = type;
41 | this.text1 = text1;
42 | this.text2 = text2;
43 | }
44 |
45 | public int getText1() {
46 | return text1;
47 | }
48 |
49 | public int getText2() {
50 | return text2;
51 | }
52 |
53 | public int getKey() {
54 | return key;
55 | }
56 |
57 | public int getPicId() {
58 | return picId;
59 | }
60 |
61 | public int getTitleId() {
62 | return titleId;
63 | }
64 |
65 | public int getType() {
66 | return type;
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/service/AppLockManager.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.service;
18 |
19 | public class AppLockManager {
20 |
21 | /**
22 | * 获取普通应用锁的列表
23 | */
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/service/DeviceAdminSample.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.service;
18 |
19 | import android.app.admin.DeviceAdminReceiver;
20 | import android.content.Context;
21 | import android.content.Intent;
22 | import android.content.SharedPreferences;
23 | import android.widget.Toast;
24 |
25 | public class DeviceAdminSample extends DeviceAdminReceiver {
26 |
27 | static SharedPreferences getSamplePreferences(Context context) {
28 | return context.getSharedPreferences(
29 | DeviceAdminReceiver.class.getName(), 0);
30 | }
31 |
32 | void showToast(Context context, CharSequence msg) {
33 | Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
34 | }
35 |
36 | @Override
37 | public void onEnabled(Context context, Intent intent) {
38 | showToast(context, "激活");
39 | }
40 |
41 | @Override
42 | public CharSequence onDisableRequested(Context context, Intent intent) {
43 | return "确定要取消激活";
44 | }
45 |
46 | @Override
47 | public void onDisabled(Context context, Intent intent) {
48 | showToast(context, "取消激活");
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/service/PlayWarringSoundService.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.service;
18 |
19 | import com.cleanwiz.applock.R;
20 |
21 | import android.content.Context;
22 | import android.media.AudioManager;
23 | import android.media.SoundPool;
24 |
25 | public class PlayWarringSoundService {
26 |
27 | private SoundPool soundPool;
28 | private Context context;
29 |
30 | public PlayWarringSoundService(Context context) {
31 | this.context = context;
32 | soundPool = new SoundPool(10, AudioManager.STREAM_SYSTEM, 5);
33 | soundPool.load(context, R.raw.warring01, 1);
34 | }
35 |
36 | public void playSound() {
37 | soundPool.play(1, 1, 1, 0, 0, 1);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/service/StartLookServiceReceiver.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.service;
18 |
19 | import com.cleanwiz.applock.utils.LogUtil;
20 |
21 | import android.content.BroadcastReceiver;
22 | import android.content.Context;
23 | import android.content.Intent;
24 |
25 | public class StartLookServiceReceiver extends BroadcastReceiver {
26 |
27 | @Override
28 | public void onReceive(Context context, Intent intent) {
29 | // TODO Auto-generated method stub
30 | if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
31 | LogUtil.e("colin", "receiver onReceive"+"to start lookservice");
32 | Intent serIntent = new Intent(context, StartLookServiceReceiver.class);
33 | context.startService(serIntent.setPackage("com.cleanwiz.applock"));
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/service/Tmp.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.service;
18 |
19 | public class Tmp {
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/anim/PopListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.anim;
18 |
19 | import android.view.View;
20 | import android.view.animation.Animation;
21 | import android.view.animation.Animation.AnimationListener;
22 |
23 | public class PopListener implements AnimationListener {
24 |
25 | public static final int TYPE_IN = 0;
26 | public static final int TYPE_OUT = 1;
27 |
28 | private View animView;
29 | private int type;
30 |
31 | public PopListener(View animView, int type) {
32 | super();
33 | this.animView = animView;
34 | this.type = type;
35 | }
36 |
37 | @Override
38 | public void onAnimationStart(Animation animation) {
39 | if (TYPE_IN == type) {
40 | animView.setVisibility(View.VISIBLE);
41 | }
42 |
43 | }
44 |
45 | @Override
46 | public void onAnimationEnd(Animation animation) {
47 | if (TYPE_OUT == type) {
48 | animView.setVisibility(View.INVISIBLE);
49 | }
50 | }
51 |
52 | @Override
53 | public void onAnimationRepeat(Animation animation) {
54 |
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/FrameAnimationController.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget;
18 |
19 | import android.os.Handler;
20 | import android.os.Message;
21 |
22 | public class FrameAnimationController {
23 | private static final int MSG_ANIMATE = 1000;
24 |
25 | public static final int ANIMATION_FRAME_DURATION = 1000 / 60;
26 |
27 | private static final Handler mHandler = new AnimationHandler();
28 |
29 | private FrameAnimationController() {
30 | throw new UnsupportedOperationException();
31 | }
32 |
33 | public static void requestAnimationFrame(Runnable runnable) {
34 | Message message = new Message();
35 | message.what = MSG_ANIMATE;
36 | message.obj = runnable;
37 | mHandler.sendMessageDelayed(message, ANIMATION_FRAME_DURATION);
38 | }
39 |
40 | public static void requestFrameDelay(Runnable runnable, long delay) {
41 | Message message = new Message();
42 | message.what = MSG_ANIMATE;
43 | message.obj = runnable;
44 | mHandler.sendMessageDelayed(message, delay);
45 | }
46 |
47 | private static class AnimationHandler extends Handler {
48 | public void handleMessage(Message m) {
49 | switch (m.what) {
50 | case MSG_ANIMATE:
51 | if (m.obj != null) {
52 | ((Runnable) m.obj).run();
53 | }
54 | break;
55 | }
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/NoScrollGridView.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget;
18 |
19 | import android.content.Context;
20 | import android.util.AttributeSet;
21 | import android.view.MotionEvent;
22 | import android.widget.GridView;
23 |
24 | public class NoScrollGridView extends GridView {
25 |
26 | public NoScrollGridView(Context context) {
27 | super(context);
28 | }
29 |
30 | public NoScrollGridView(Context context, AttributeSet attrs) {
31 | super(context, attrs);
32 | }
33 |
34 | public NoScrollGridView(Context context, AttributeSet attrs, int defStyle) {
35 | super(context, attrs, defStyle);
36 | }
37 |
38 | @Override
39 | public boolean dispatchTouchEvent(MotionEvent ev) {
40 | return false;
41 | }
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/actionview/BackAction.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget.actionview;
18 |
19 | public class BackAction extends Action {
20 |
21 | public BackAction() {
22 |
23 | final float endX = 0.82f;
24 | final float startX = 0.21875f;
25 | final float center = 0.5f;
26 |
27 | lineData = new float[]{
28 | // line 1
29 | startX, center, 0.52f, 0.2f,
30 | // line 2
31 | startX, center, endX, center,
32 | // line 2
33 | startX, center, 0.52f, 0.8f,};
34 |
35 | lineSegments.add(new LineSegment(0, 8));
36 | lineSegments.add(new LineSegment(4));
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/actionview/CloseAction.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget.actionview;
18 |
19 | public class CloseAction extends Action {
20 |
21 | public CloseAction() {
22 | final float start = 0.239375f;
23 | final float end = 1f - start;
24 |
25 | lineData = new float[]{
26 | // line 1
27 | start, start, end, end,
28 | // line 2
29 | start, end, end, start,
30 | // line 3
31 | start, start, end, end,};
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/actionview/DrawerAction.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget.actionview;
18 |
19 | public class DrawerAction extends Action {
20 |
21 | public DrawerAction() {
22 |
23 | final float startX = 0.1375f;
24 | final float endX = 1f - startX;
25 | final float endY = 0.707f;
26 | final float startY = 1f - endY;
27 | final float center = 0.5f;
28 |
29 | lineData = new float[]{
30 | // line 1
31 | startX, startY, endX, startY,
32 | // line 2
33 | startX, center, endX, center,
34 | // line 3
35 | startX, endY, endX, endY,};
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/actionview/LineSegment.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget.actionview;
18 |
19 | import android.os.Parcel;
20 | import android.os.Parcelable;
21 |
22 | /**
23 | * �߶�
24 | * A LineSegment describes which lines within an Action are linked together
25 | */
26 | public class LineSegment implements Parcelable {
27 |
28 | public int[] indexes;
29 |
30 | public LineSegment(int... indexes) {
31 | this.indexes = indexes;
32 | }
33 |
34 | public int getStartIdx() {
35 | return indexes[0];
36 | }
37 |
38 | @Override
39 | public int describeContents() {
40 | return 0;
41 | }
42 |
43 | @Override
44 | public void writeToParcel(Parcel dest, int flags) {
45 | dest.writeIntArray(this.indexes);
46 | }
47 |
48 | private LineSegment(Parcel in) {
49 | this.indexes = in.createIntArray();
50 | }
51 |
52 | public static final Creator CREATOR = new Creator() {
53 | public LineSegment createFromParcel(Parcel source) {
54 | return new LineSegment(source);
55 | }
56 |
57 | public LineSegment[] newArray(int size) {
58 | return new LineSegment[size];
59 | }
60 | };
61 | }
62 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/actionview/MoreAction.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget.actionview;
18 |
19 | public class MoreAction extends Action {
20 |
21 | public MoreAction() {
22 | final float start = 0.435f;
23 | final float end = 0.565f;
24 |
25 | final float bottom = 0.75f;
26 | final float top = 1f - bottom;
27 | final float center = 0.5f;
28 |
29 | lineData = new float[] {
30 | // line 1
31 | start, top, end, top,
32 | // line 2
33 | start, center, end, center,
34 | // line 3
35 | start, bottom, end, bottom, };
36 | }
37 |
38 | @Override
39 | public boolean isPlus() {
40 | return true;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/actionview/PlusAction.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget.actionview;
18 |
19 | public class PlusAction extends Action {
20 |
21 | public PlusAction() {
22 |
23 | final float bottom = 76f / 96f;
24 | final float top = 1f - bottom;
25 | final float left = 20f / 96f;
26 | final float right = 1f - left;
27 | final float center = 0.5f;
28 |
29 | lineData = new float[]{
30 | // line 1
31 | center, top, center, bottom,
32 | // line 2
33 | left, center, right, center,
34 | // line 3
35 | center, top, center, bottom,};
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/actionview/UiHelper.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.ui.widget.actionview;
18 |
19 | import android.graphics.drawable.Drawable;
20 | import android.os.Build;
21 | import android.view.View;
22 |
23 | public class UiHelper {
24 |
25 | @SuppressWarnings("deprecation")
26 | public static void setBackground(View view, Drawable d) {
27 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
28 | view.setBackground(d);
29 | } else {
30 | view.setBackgroundDrawable(d);
31 | }
32 | }
33 |
34 | public static void postInvalidateOnAnimation(View view) {
35 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
36 | view.postInvalidateOnAnimation();
37 | } else {
38 | view.invalidate();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/ui/widget/colorart/HashBag.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2013 Michael Evans
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.cleanwiz.applock.ui.widget.colorart;
18 |
19 | import java.util.HashMap;
20 | import java.util.Iterator;
21 |
22 | public class HashBag extends HashMap {
23 |
24 | public HashBag() {
25 | super();
26 | }
27 |
28 | public int getCount(K value) {
29 | if (get(value) == null) {
30 | return 0;
31 | } else {
32 | return get(value);
33 | }
34 | }
35 |
36 | public void add(K value) {
37 | if (get(value) == null) {
38 | put(value, 1);
39 | } else {
40 | put(value, get(value) + 1);
41 | }
42 | }
43 |
44 | public Iterator iterator() {
45 | return keySet().iterator();
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/utils/DensityUtil.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.utils;
18 |
19 | import com.cleanwiz.applock.AppLockApplication;
20 |
21 | import android.content.Context;
22 | import android.view.WindowManager;
23 |
24 | public class DensityUtil {
25 |
26 | /**
27 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
28 | */
29 | public static int dip2px(Context context, float dpValue) {
30 | float scale = context.getResources().getDisplayMetrics().density;
31 | return (int) (dpValue * scale + 0.5f);
32 | }
33 |
34 | /**
35 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
36 | */
37 | public static int px2dip(Context context, float pxValue) {
38 | float scale = context.getResources().getDisplayMetrics().density;
39 | return (int) (pxValue / scale + 0.5f);
40 | }
41 |
42 | public static int getScreenWidth() {
43 | // TODO Auto-generated method stub
44 | WindowManager wm = (WindowManager) AppLockApplication.getInstance()
45 | .getSystemService(Context.WINDOW_SERVICE);
46 | return wm.getDefaultDisplay().getWidth();
47 | }
48 |
49 | public static int getScreenHeight() {
50 | WindowManager wm = (WindowManager) AppLockApplication.getInstance()
51 | .getSystemService(Context.WINDOW_SERVICE);
52 | return wm.getDefaultDisplay().getHeight();
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/utils/LangUtils.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.utils;
18 |
19 | import java.util.Locale;
20 |
21 | public class LangUtils {
22 |
23 | public static String getSysLang() {
24 |
25 | return Locale.getDefault().getLanguage();
26 | }
27 |
28 | public static boolean isChinese(String lang) {
29 | boolean rst = lang.equalsIgnoreCase(Locale.SIMPLIFIED_CHINESE
30 | .getLanguage());
31 | return rst;
32 | }
33 |
34 | public static boolean isChinese() {
35 | return isChinese(getSysLang());
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/utils/LogUtil.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.utils;
18 |
19 | import android.util.Log;
20 |
21 | import com.cleanwiz.applock.AppLockApplication;
22 |
23 | /**
24 | * AppLock全局日志工具
25 | */
26 | public class LogUtil {
27 |
28 | public static void i(String tag, String msg) {
29 | if (AppLockApplication.LOG_FLAG) {
30 | Log.i(tag, msg);
31 | }
32 | }
33 |
34 | public static void d(String tag, String msg) {
35 | if (AppLockApplication.LOG_FLAG) {
36 | Log.d(tag, msg);
37 | }
38 | }
39 |
40 | public static void e(String tag, String msg) {
41 | if (AppLockApplication.LOG_FLAG) {
42 | Log.e(tag, msg);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/utils/NumUtil.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.utils;
18 |
19 | import java.math.RoundingMode;
20 | import java.text.DecimalFormat;
21 |
22 | /**
23 | * Created by dev on 2015/5/5.
24 | */
25 | public class NumUtil {
26 |
27 | /**
28 | * 转换内存
29 | *
30 | * @param finalMoney
31 | * @return
32 | */
33 | public static String transMoney(float finalMoney) {
34 | DecimalFormat formater = new DecimalFormat();
35 | formater.setMaximumFractionDigits(2);
36 | formater.setGroupingSize(0);
37 | formater.setRoundingMode(RoundingMode.FLOOR);
38 |
39 | return formater.format(finalMoney);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/utils/ScreenUtil.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.utils;
18 |
19 | import android.content.Context;
20 | import android.view.WindowManager;
21 |
22 | public class ScreenUtil {
23 |
24 | public static int[] getScreenDispaly(Context context) {
25 | WindowManager windowManager = (WindowManager) context
26 | .getSystemService(Context.WINDOW_SERVICE);
27 | int width = windowManager.getDefaultDisplay().getWidth();
28 | int height = windowManager.getDefaultDisplay().getHeight();
29 | int result[] = { width, height };
30 | return result;
31 | }
32 |
33 | /**
34 | * 根据手机的分辨率从 dp 的单位 转成为 px(像素)
35 | */
36 | public static int dip2px(Context context, float dpValue) {
37 | final float scale = context.getResources().getDisplayMetrics().density;
38 | return (int) (dpValue * scale + 0.5f);
39 | }
40 |
41 | /**
42 | * 根据手机的分辨率从 px(像素) 的单位 转成为 dp
43 | */
44 | public static int px2dip(Context context, float pxValue) {
45 | final float scale = context.getResources().getDisplayMetrics().density;
46 | return (int) (pxValue / scale + 0.5f);
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/com/cleanwiz/applock/utils/ToastUtils.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2015 btows.com.
3 | *
4 | * This program is free software: you can redistribute it and/or modify
5 | * it under the terms of the GNU General Public License as published by
6 | * the Free Software Foundation, either version 3 of the License, or
7 | * (at your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 | * GNU General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | ******************************************************************************/
17 | package com.cleanwiz.applock.utils;
18 |
19 | import com.cleanwiz.applock.AppLockApplication;
20 |
21 | import android.view.Gravity;
22 | import android.widget.Toast;
23 |
24 | public class ToastUtils {
25 |
26 | public static void showToast(CharSequence message) {
27 |
28 | Toast mToast = Toast.makeText(AppLockApplication.getInstance(),
29 | message, Toast.LENGTH_SHORT);
30 | mToast.setGravity(Gravity.CENTER, 0, 0);
31 | mToast.show();
32 | }
33 |
34 | public static void showToast(int rId) {
35 | Toast mToast = Toast.makeText(AppLockApplication.getInstance(), rId,
36 | Toast.LENGTH_SHORT);
37 | mToast.setGravity(Gravity.CENTER, 0, 0);
38 | mToast.show();
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------