当前位置: 首页>>代码示例>>Java>>正文


Java AppDiff类代码示例

本文整理汇总了Java中org.fdroid.fdroid.privileged.views.AppDiff的典型用法代码示例。如果您正苦于以下问题:Java AppDiff类的具体用法?Java AppDiff怎么用?Java AppDiff使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AppDiff类属于org.fdroid.fdroid.privileged.views包,在下文中一共展示了AppDiff类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: bindModel

import org.fdroid.fdroid.privileged.views.AppDiff; //导入依赖的package包/类
@Override
public void bindModel() {
    itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            boolean shouldBeVisible = contentView.getVisibility() != View.VISIBLE;
            contentView.setVisibility(shouldBeVisible ? View.VISIBLE : View.GONE);
            updateExpandableItem(shouldBeVisible);
            if (shouldBeVisible && recyclerView != null) {
                ((LinearLayoutManager) recyclerView.getLayoutManager()).scrollToPositionWithOffset(items.indexOf(VIEWTYPE_PERMISSIONS), 0);
            }
        }
    });
    headerView.setText(R.string.permissions);
    updateExpandableItem(false);
    contentView.removeAllViews();
    AppDiff appDiff = new AppDiff(context.getPackageManager(), versions.get(0));
    AppSecurityPermissions perms = new AppSecurityPermissions(context, appDiff.pkgInfo);
    contentView.addView(perms.getPermissionsView(AppSecurityPermissions.WHICH_ALL));
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:21,代码来源:AppDetailsRecyclerViewAdapter.java

示例2: newPermissionCount

import org.fdroid.fdroid.privileged.views.AppDiff; //导入依赖的package包/类
private int newPermissionCount() {
    boolean supportsRuntimePermissions = apk.targetSdkVersion >= 23;
    if (supportsRuntimePermissions) {
        return 0;
    }

    AppDiff appDiff = new AppDiff(context.getPackageManager(), apk);
    if (appDiff.pkgInfo == null) {
        // could not get diff because we couldn't parse the package
        throw new RuntimeException("cannot parse!");
    }
    AppSecurityPermissions perms = new AppSecurityPermissions(context, appDiff.pkgInfo);
    if (appDiff.installedAppInfo != null) {
        // update to an existing app
        return perms.getPermissionCount(AppSecurityPermissions.WHICH_NEW);
    }
    // new app install
    return perms.getPermissionCount(AppSecurityPermissions.WHICH_ALL);
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:20,代码来源:Installer.java

示例3: newPermissionCount

import org.fdroid.fdroid.privileged.views.AppDiff; //导入依赖的package包/类
private int newPermissionCount(Uri packageUri) {
    AppDiff appDiff = new AppDiff(mContext.getPackageManager(), packageUri);
    if (appDiff.mPkgInfo == null) {
        // could not get diff because we couldn't parse the package
        return -1;
    }
    AppSecurityPermissions perms = new AppSecurityPermissions(mContext, appDiff.mPkgInfo);
    if (appDiff.mInstalledAppInfo != null) {
        // update to an existing app
        return perms.getPermissionCount(AppSecurityPermissions.WHICH_NEW);
    }
    // default: even if there aren't any permissions, we want to make the
    // user always confirm installing new apps
    return 1;
}
 
开发者ID:CmDnoEdition,项目名称:fdroid,代码行数:16,代码来源:PrivilegedInstaller.java


注:本文中的org.fdroid.fdroid.privileged.views.AppDiff类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。