Skip to content

Commit

Permalink
Other
Browse files Browse the repository at this point in the history
  • Loading branch information
HChenX committed Feb 29, 2024
1 parent 7ae3019 commit 541af55
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/*
* This file is part of HyperCeiler.
* This file is part of HyperCeiler.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* HyperCeiler is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
* Copyright (C) 2023-2024 HyperCeiler Contributions
*/
package com.sevtinge.hyperceiler.data.adapter;

import android.content.Context;
Expand Down Expand Up @@ -66,22 +66,15 @@ public AppDataAdapter(@NonNull Context context, int resource, List<AppData> appI
mMode = mode;
}

public void setData(List<AppData> appInfoList) {
AppDataAdapter.appInfoList = appInfoList;
notifyDataSetChanged();
}

@NonNull
@Override
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
AppData appInfo = getItem(position);
getShared();
// deleteAll();
View view = setNewView(convertView, parent, appInfo);
assert appInfo != null;
if (mMode == AppPicker.INPUT_MODE) {
String edit = getEdit(appInfo.packageName);
// Log.e(TAG, "eddd: " + edit, null);
if (!edit.equals("")) {
appName.setText(edit);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class AppPicker extends Fragment {
public Handler mHandler;
private Set<String> selectedApps;
private List<AppData> appDataList = new ArrayList<>();
private HashMap<String, Integer> hashMap = new HashMap<>();
private final HashMap<String, Integer> hashMap = new HashMap<>();
private IAppSelectCallback mAppSelectCallback;

public static IEditCallback iEditCallback;
Expand Down Expand Up @@ -203,6 +203,7 @@ public List<Parcelable> getPackageCodeList(PackageManager pm) {
intent.addCategory(Intent.CATEGORY_LAUNCHER);
List<ResolveInfo> resolveInfoList = new ArrayList<>();
List<ResolveInfo> resolveInfos = pm.queryIntentActivities(intent, PackageManager.GET_ACTIVITIES);
hashMap.clear();
for (ResolveInfo resolveInfo : resolveInfos) {
Integer added = hashMap.get(resolveInfo.activityInfo.applicationInfo.packageName);
if (added == null || added != 1) {
Expand Down

0 comments on commit 541af55

Please sign in to comment.