MiniumApps/launcher3/src/main/java/co/siempo/phone/activities/JunkfoodFlaggingActivity.java
/**
     * bind the list view of flag app and all apps.
     */
bind the list view of flag app and all apps.
bind the list view of flag app and all apps .
private void bindData() {
        try {
            flagAppList = new ArrayList<>();
            unflageAppList = new ArrayList<>();
            bindingList = new ArrayList<>();
            junkfoodFlaggingAdapter = new JunkfoodFlaggingAdapter(this, bindingList);
            listAllApps.setAdapter(junkfoodFlaggingAdapter);
            for (String resolveInfo : installedPackageList) {
                if (!resolveInfo.equalsIgnoreCase(getPackageName())) {
                    String applicationname = CoreApplication.getInstance()
                            .getListApplicationName().get(resolveInfo);
                    if (!TextUtils.isEmpty(applicationname)) {
                        if (adapterlist.contains(resolveInfo)) {
                            flagAppList.add(new AppListInfo(resolveInfo, applicationname, false, false, true));
                        } else {
                            unflageAppList.add(new AppListInfo(resolveInfo, applicationname, false, false, false));
                        }
                    }
                }
            }
            removeJunkAppsFromFavorites();
            if (flagAppList.size() == 0) {
                flagAppList.add(new AppListInfo("", "", true, true, true));
            } else {
                flagAppList.add(0, new AppListInfo("", "", true, false, true));
            }
            flagAppList = Sorting.sortApplication(flagAppList);
            bindingList.addAll(flagAppList);
            if (unflageAppList.size() == 0) {
                unflageAppList.add(new AppListInfo("", "", true, true, false));
            } else {
                unflageAppList.add(0, new AppListInfo("", "", true, false, false));
            }
            unflageAppList = Sorting.sortApplication(unflageAppList);
            bindingList.addAll(unflageAppList);
            if (junkfoodFlaggingAdapter != null) {
                junkfoodFlaggingAdapter.setData(bindingList);
                junkfoodFlaggingAdapter.getFilter().filter(edtSearch.getText().toString());
                listAllApps.setSelection(firstPosition);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
private void bindData ( ) { try { flagAppList = new ArrayList < > ( ) ; unflageAppList = new ArrayList < > ( ) ; bindingList = new ArrayList < > ( ) ; junkfoodFlaggingAdapter = new JunkfoodFlaggingAdapter ( this , bindingList ) ; listAllApps . setAdapter ( junkfoodFlaggingAdapter ) ; for ( String resolveInfo : installedPackageList ) { if ( ! resolveInfo . equalsIgnoreCase ( getPackageName ( ) ) ) { String applicationname = CoreApplication . getInstance ( ) . getListApplicationName ( ) . get ( resolveInfo ) ; if ( ! TextUtils . isEmpty ( applicationname ) ) { if ( adapterlist . contains ( resolveInfo ) ) { flagAppList . add ( new AppListInfo ( resolveInfo , applicationname , false , false , true ) ) ; } else { unflageAppList . add ( new AppListInfo ( resolveInfo , applicationname , false , false , false ) ) ; } } } } removeJunkAppsFromFavorites ( ) ; if ( flagAppList . size ( ) == 0 ) { flagAppList . add ( new AppListInfo ( "" , "" , true , true , true ) ) ; } else { flagAppList . add ( 0 , new AppListInfo ( "" , "" , true , false , true ) ) ; } flagAppList = Sorting . sortApplication ( flagAppList ) ; bindingList . addAll ( flagAppList ) ; if ( unflageAppList . size ( ) == 0 ) { unflageAppList . add ( new AppListInfo ( "" , "" , true , true , false ) ) ; } else { unflageAppList . add ( 0 , new AppListInfo ( "" , "" , true , false , false ) ) ; } unflageAppList = Sorting . sortApplication ( unflageAppList ) ; bindingList . addAll ( unflageAppList ) ; if ( junkfoodFlaggingAdapter != null ) { junkfoodFlaggingAdapter . setData ( bindingList ) ; junkfoodFlaggingAdapter . getFilter ( ) . filter ( edtSearch . getText ( ) . toString ( ) ) ; listAllApps . setSelection ( firstPosition ) ; } } catch ( Exception e ) { e . printStackTrace ( ) ; } }
bind the list view of flag app and all apps.
bind the list view of flag app and all apps .
//Code for removing the junk app from Favorite Sorted Menu and //Favorite List