1、处理viewpager fragment

2、将MainActivity管理的逻辑移到MainFragment,MessageFragment,NewsFragment同理,
3、处理首页ViewPager等手动计算size的问题
4、添加一堆ScaleXXXView,可以用来设定View本身的比例大小

TODO
1、将DownloadManagerActivity也处理成Fragment
2、其他界面也慢慢处理成Fragment
This commit is contained in:
CsHeng
2017-06-17 15:52:42 +08:00
parent 5e668d9e13
commit fc5b6ae4e4
90 changed files with 2803 additions and 1145 deletions

View File

@ -91,12 +91,10 @@ public class PackageUtils {
private static String[] parseSignature(byte[] signature) {
String[] ret = null;
try {
CertificateFactory certFactory = CertificateFactory
.getInstance("X.509");
X509Certificate cert = (X509Certificate) certFactory
.generateCertificate(new ByteArrayInputStream(signature));
ret = new String[]{cert.getPublicKey().toString(),
cert.getSerialNumber().toString()};
CertificateFactory certFactory = CertificateFactory.getInstance("X.509");
X509Certificate cert = (X509Certificate) certFactory.generateCertificate(
new ByteArrayInputStream(signature));
ret = new String[]{cert.getPublicKey().toString(), cert.getSerialNumber().toString()};
} catch (CertificateException e) {
e.printStackTrace();
}
@ -159,8 +157,8 @@ public class PackageUtils {
*/
public static Intent getUninstallIntent(Context context, String path) {
Intent uninstallIntent = new Intent();
uninstallIntent.setAction("android.intent.action.DELETE");
uninstallIntent.addCategory("android.intent.category.DEFAULT");
uninstallIntent.setAction(Intent.ACTION_DELETE);
uninstallIntent.addCategory(Intent.CATEGORY_DEFAULT);
String packageName = getPackageNameByPath(context, path);
uninstallIntent.setData(Uri.parse("package:" + packageName));
InstallUtils.getInstance(context).addUninstall(packageName);
@ -172,8 +170,7 @@ public class PackageUtils {
*/
public static String getPackageNameByPath(Context context, String path) {
PackageManager packageManager = context.getApplicationContext().getPackageManager();
PackageInfo info = packageManager.getPackageArchiveInfo(path,
PackageManager.GET_ACTIVITIES);
PackageInfo info = packageManager.getPackageArchiveInfo(path, PackageManager.GET_ACTIVITIES);
if (info != null) {
ApplicationInfo appInfo = info.applicationInfo;
return appInfo.packageName;