Skip to content

Commit 53e841a

Browse files
committed
p031 p043 p047
1 parent 685ba1e commit 53e841a

File tree

19 files changed

+612
-280
lines changed

19 files changed

+612
-280
lines changed

.idea/caches/build_file_checksums.ser

0 Bytes
Binary file not shown.

imagepicker/src/main/java/com/lzy/imagepicker/ImageDataSource.java

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public Loader<Cursor> onCreateLoader(int id, Bundle args) {
7676

7777
@Override
7878
public void onLoadFinished(Loader<Cursor> loader, Cursor data) {
79+
7980
imageFolders.clear();
8081
if (data != null) {
8182
ArrayList<ImageItem> allImages = new ArrayList<>(); //所有图片的集合,不分文件夹

p022_hios2.0/src/main/java/com/example/shining/p022_hios20/base/WebViewActivity.java

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import android.view.View;
1010
import android.view.ViewGroup;
1111
import android.view.ViewParent;
12+
import android.view.WindowManager;
1213
import android.webkit.JavascriptInterface;
1314
import android.webkit.SslErrorHandler;
1415
import android.webkit.WebChromeClient;
@@ -45,6 +46,10 @@ public class WebViewActivity extends AppCompatActivity implements View.OnClickLi
4546
protected void onCreate(@Nullable Bundle savedInstanceState) {
4647
super.onCreate(savedInstanceState);
4748
setContentView(R.layout.web_webview_layout);
49+
50+
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
51+
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
52+
4853
findview();
4954
onclickListener();
5055
setupWebView();

p031_mokuaihua_viewpager_fragment/src/main/java/com/example/p031_mokuaihua_viewpager_fragment/demo2/Demo2Activity.java

+27-31
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,10 @@
1313
import android.view.View.OnClickListener;
1414

1515
import com.example.p031_mokuaihua_viewpager_fragment.R;
16-
import com.example.p031_mokuaihua_viewpager_fragment.applications.ConstantNetUtil;
17-
import com.example.p031_mokuaihua_viewpager_fragment.applications.NetConfig;
1816
import com.example.p031_mokuaihua_viewpager_fragment.base.BaseActivity;
1917
import com.example.p031_mokuaihua_viewpager_fragment.base.BaseFragment;
2018
import com.example.p031_mokuaihua_viewpager_fragment.base.BaseIndexFragment;
21-
import com.example.p031_mokuaihua_viewpager_fragment.demo2.configs.Demo2Config1;
22-
import com.example.p031_mokuaihua_viewpager_fragment.demo2.configs.Demo2Config2;
19+
import com.example.p031_mokuaihua_viewpager_fragment.demo2.configs.Demo2Config;
2320
import com.example.p031_mokuaihua_viewpager_fragment.utils.ComFragmentHelper;
2421
import com.example.p031_mokuaihua_viewpager_fragment.utils.MyLogUtil;
2522

@@ -62,20 +59,16 @@ public void config() {
6259
}
6360
}
6461

65-
@Override
66-
protected void onCreate(Bundle savedInstanceState) {
67-
if (ConstantNetUtil.VERSION_APK == NetConfig.version_name1) {
68-
Demo2Config1.config();
69-
} else if (ConstantNetUtil.VERSION_APK == NetConfig.version_name2) {
70-
Demo2Config2.config();
71-
}
72-
config();
73-
super.onCreate(savedInstanceState);
74-
setupFragments();
75-
findview();
76-
onclickListener();
77-
doNetWork();
78-
}
62+
// @Override
63+
// protected void onCreate(Bundle savedInstanceState) {
64+
//
65+
// super.onCreate(savedInstanceState);
66+
//
67+
// setupFragments();
68+
// findview();
69+
// onclickListener();
70+
// doNetWork();
71+
// }
7972

8073
@Override
8174
protected int getLayoutId() {
@@ -85,10 +78,13 @@ protected int getLayoutId() {
8578
@Override
8679
protected void setup(@Nullable Bundle savedInstanceState) {
8780
super.setup(savedInstanceState);
88-
// setupFragments();
89-
// findview();
90-
// onclickListener();
91-
// doNetWork();
81+
Demo2Config.config();
82+
config();
83+
setupFragments();
84+
findview();
85+
onclickListener();
86+
doNetWork();
87+
9288
}
9389

9490
/**
@@ -97,7 +93,7 @@ protected void setup(@Nullable Bundle savedInstanceState) {
9793
private void setupFragments() {
9894
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
9995
//TODO 多版本模式bufen
100-
SparseArrayCompat<Class<? extends BaseFragment>> array = which_version_fragment_config();//
96+
SparseArrayCompat<Class<? extends BaseFragment>> array = Demo2Config.getFragments();//
10197
int size = array.size();
10298
BaseFragment item;
10399
for (int i = 0; i < size; i++) {
@@ -107,14 +103,14 @@ private void setupFragments() {
107103
ft.commitAllowingStateLoss();
108104
}
109105

110-
private SparseArrayCompat<Class<? extends BaseFragment>> which_version_fragment_config() {
111-
if (ConstantNetUtil.VERSION_APK == NetConfig.version_name1) {
112-
return Demo2Config1.getFragments();
113-
} else if (ConstantNetUtil.VERSION_APK == NetConfig.version_name2) {
114-
return Demo2Config2.getFragments();
115-
}
116-
return Demo2Config1.getFragments();
117-
}
106+
// private SparseArrayCompat<Class<? extends BaseFragment>> which_version_fragment_config() {
107+
// if (ConstantNetUtil.VERSION_APK == NetConfig.version_name1) {
108+
// return Demo2Config1.getFragments();
109+
// } else if (ConstantNetUtil.VERSION_APK == NetConfig.version_name2) {
110+
// return Demo2Config2.getFragments();
111+
// }
112+
// return Demo2Config1.getFragments();
113+
// }
118114

119115
private void doNetWork() {
120116

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
package com.example.p031_mokuaihua_viewpager_fragment.demo2.configs;
2+
3+
import android.content.Context;
4+
import android.content.pm.ApplicationInfo;
5+
import android.content.pm.PackageManager;
6+
import android.support.v4.util.SparseArrayCompat;
7+
import android.text.TextUtils;
8+
9+
import com.example.p031_mokuaihua_viewpager_fragment.applications.DemoApplication;
10+
import com.example.p031_mokuaihua_viewpager_fragment.base.BaseFragment;
11+
import com.example.p031_mokuaihua_viewpager_fragment.utils.MyLogUtil;
12+
13+
public class Demo2Config {
14+
15+
private static final String INDEX_META_DATA = "DEMO2_CONFIG";
16+
17+
/** viewpager页大小*/
18+
// public static int PAGE_COUNT;
19+
/** viewpager每页的itemview id*/
20+
// public static String PAGE_ID;
21+
22+
/** 默认显示第几页*/
23+
// public static int DEFAULT_PAGE_INDEX;
24+
25+
/**
26+
* fragment配置
27+
*/
28+
private static SparseArrayCompat<Class<? extends BaseFragment>> sIndexFragments = new SparseArrayCompat<>();
29+
30+
public static void config() {
31+
Context ctx = DemoApplication.get();
32+
ApplicationInfo info = null;
33+
34+
try {
35+
info = ctx.getPackageManager().getApplicationInfo(ctx.getPackageName(), PackageManager.GET_META_DATA);
36+
} catch (PackageManager.NameNotFoundException e) {
37+
e.printStackTrace();
38+
}
39+
40+
if (info == null) {
41+
throw new UnsupportedOperationException();
42+
}
43+
44+
String klassName = info.metaData.getString(INDEX_META_DATA);
45+
if (TextUtils.isEmpty(klassName)) {
46+
throw new UnsupportedOperationException("please config " + INDEX_META_DATA + " value");
47+
}
48+
49+
if (klassName.startsWith(".")) {
50+
klassName = DemoApplication.get().getPackageName() + klassName;
51+
}
52+
53+
MyLogUtil.d("geek", klassName);
54+
55+
try {
56+
Class<?> klass = Class.forName(klassName);
57+
klass.getDeclaredMethod("setup").invoke(null);
58+
} catch (Exception e) {
59+
e.printStackTrace();
60+
}
61+
}
62+
63+
public static Class<? extends BaseFragment> getFragment(int id) {
64+
if (sIndexFragments.indexOfKey(id) < 0) {
65+
throw new UnsupportedOperationException("cannot find fragment by " + id);
66+
}
67+
return sIndexFragments.get(id);
68+
}
69+
70+
public static SparseArrayCompat<Class<? extends BaseFragment>> getFragments() {
71+
return sIndexFragments;
72+
}
73+
}
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,73 @@
1-
package com.example.p031_mokuaihua_viewpager_fragment.demo2.configs;
2-
3-
import android.content.Context;
4-
import android.content.pm.ApplicationInfo;
5-
import android.content.pm.PackageManager;
6-
import android.support.v4.util.SparseArrayCompat;
7-
import android.text.TextUtils;
8-
9-
import com.example.p031_mokuaihua_viewpager_fragment.applications.DemoApplication;
10-
import com.example.p031_mokuaihua_viewpager_fragment.base.BaseFragment;
11-
import com.example.p031_mokuaihua_viewpager_fragment.utils.MyLogUtil;
12-
13-
public class Demo2Config1 {
14-
15-
private static final String INDEX_META_DATA = "DEMO2_CONFIG";
16-
17-
/** viewpager页大小*/
18-
// public static int PAGE_COUNT;
19-
/** viewpager每页的itemview id*/
20-
// public static String PAGE_ID;
21-
22-
/** 默认显示第几页*/
23-
// public static int DEFAULT_PAGE_INDEX;
24-
25-
/**
26-
* fragment配置
27-
*/
28-
private static SparseArrayCompat<Class<? extends BaseFragment>> sIndexFragments = new SparseArrayCompat<>();
29-
30-
public static void config() {
31-
Context ctx = DemoApplication.get();
32-
ApplicationInfo info = null;
33-
34-
try {
35-
info = ctx.getPackageManager().getApplicationInfo(ctx.getPackageName(), PackageManager.GET_META_DATA);
36-
} catch (PackageManager.NameNotFoundException e) {
37-
e.printStackTrace();
38-
}
39-
40-
if (info == null) {
41-
throw new UnsupportedOperationException();
42-
}
43-
44-
String klassName = info.metaData.getString(INDEX_META_DATA);
45-
if (TextUtils.isEmpty(klassName)) {
46-
throw new UnsupportedOperationException("please config " + INDEX_META_DATA + " value");
47-
}
48-
49-
if (klassName.startsWith(".")) {
50-
klassName = DemoApplication.get().getPackageName() + klassName;
51-
}
52-
53-
MyLogUtil.d("geek", klassName);
54-
55-
try {
56-
Class<?> klass = Class.forName(klassName);
57-
klass.getDeclaredMethod("setup").invoke(null);
58-
} catch (Exception e) {
59-
e.printStackTrace();
60-
}
61-
}
62-
63-
public static Class<? extends BaseFragment> getFragment(int id) {
64-
if (sIndexFragments.indexOfKey(id) < 0) {
65-
throw new UnsupportedOperationException("cannot find fragment by " + id);
66-
}
67-
return sIndexFragments.get(id);
68-
}
69-
70-
public static SparseArrayCompat<Class<? extends BaseFragment>> getFragments() {
71-
return sIndexFragments;
72-
}
73-
}
1+
//package com.example.p031_mokuaihua_viewpager_fragment.demo2.configs;
2+
//
3+
//import android.content.Context;
4+
//import android.content.pm.ApplicationInfo;
5+
//import android.content.pm.PackageManager;
6+
//import android.support.v4.util.SparseArrayCompat;
7+
//import android.text.TextUtils;
8+
//
9+
//import com.example.p031_mokuaihua_viewpager_fragment.applications.DemoApplication;
10+
//import com.example.p031_mokuaihua_viewpager_fragment.base.BaseFragment;
11+
//import com.example.p031_mokuaihua_viewpager_fragment.utils.MyLogUtil;
12+
//
13+
//public class Demo2Config1 {
14+
//
15+
// private static final String INDEX_META_DATA = "DEMO2_CONFIG";
16+
//
17+
// /** viewpager页大小*/
18+
//// public static int PAGE_COUNT;
19+
// /** viewpager每页的itemview id*/
20+
//// public static String PAGE_ID;
21+
//
22+
// /** 默认显示第几页*/
23+
//// public static int DEFAULT_PAGE_INDEX;
24+
//
25+
// /**
26+
// * fragment配置
27+
// */
28+
// private static SparseArrayCompat<Class<? extends BaseFragment>> sIndexFragments = new SparseArrayCompat<>();
29+
//
30+
// public static void config() {
31+
// Context ctx = DemoApplication.get();
32+
// ApplicationInfo info = null;
33+
//
34+
// try {
35+
// info = ctx.getPackageManager().getApplicationInfo(ctx.getPackageName(), PackageManager.GET_META_DATA);
36+
// } catch (PackageManager.NameNotFoundException e) {
37+
// e.printStackTrace();
38+
// }
39+
//
40+
// if (info == null) {
41+
// throw new UnsupportedOperationException();
42+
// }
43+
//
44+
// String klassName = info.metaData.getString(INDEX_META_DATA);
45+
// if (TextUtils.isEmpty(klassName)) {
46+
// throw new UnsupportedOperationException("please config " + INDEX_META_DATA + " value");
47+
// }
48+
//
49+
// if (klassName.startsWith(".")) {
50+
// klassName = DemoApplication.get().getPackageName() + klassName;
51+
// }
52+
//
53+
// MyLogUtil.d("geek", klassName);
54+
//
55+
// try {
56+
// Class<?> klass = Class.forName(klassName);
57+
// klass.getDeclaredMethod("setup").invoke(null);
58+
// } catch (Exception e) {
59+
// e.printStackTrace();
60+
// }
61+
// }
62+
//
63+
// public static Class<? extends BaseFragment> getFragment(int id) {
64+
// if (sIndexFragments.indexOfKey(id) < 0) {
65+
// throw new UnsupportedOperationException("cannot find fragment by " + id);
66+
// }
67+
// return sIndexFragments.get(id);
68+
// }
69+
//
70+
// public static SparseArrayCompat<Class<? extends BaseFragment>> getFragments() {
71+
// return sIndexFragments;
72+
// }
73+
//}

0 commit comments

Comments
 (0)