Skip to content

Commit

Permalink
Revert "Solution for #162" (#176)
Browse files Browse the repository at this point in the history
* Revert "As for the modification of issue162, all previous modifications are invalid"

This reverts commit 6e530cc.

* Revert "A bug"

This reverts commit b6c985f.

* Revert "some comment"

This reverts commit 881d644.

* Revert "issue second priority"

This reverts commit 186e7d7.
  • Loading branch information
SubhamTyagi authored Apr 24, 2022
1 parent 6e530cc commit c29435b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 66 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1291,12 +1291,6 @@ protected void onPostExecute(Void aVoid) {

}

/**So this is where you sort your apps.
* We modified this method so that when the first sorting condition fails, it can sort by the frequency of use, which makes it easier for users to find the app they want to use.
*
* @param integers
* @return
*/
@Override
protected Void doInBackground(final Integer... integers) {
final int type = integers[0];
Expand All @@ -1310,24 +1304,10 @@ protected Void doInBackground(final Integer... integers) {

switch (type) {
case SORT_BY_SIZE://descending
Collections.sort(mAppsList, (apps, t1) -> {
//CS304 Issue link: https://github.com/SubhamTyagi/Last-Launcher/issues/162
if (apps.getSize() != t1.getSize()) {
return t1.getSize() - apps.getSize();
} else {
return -t1.getRecentUsedWeight() + apps.getRecentUsedWeight();
}
});
Collections.sort(mAppsList, (apps, t1) -> (t1.getSize() - apps.getSize()));
break;
case SORT_BY_OPENING_COUNTS://descending
Collections.sort(mAppsList, (apps, t1) -> {
//CS304 Issue link: https://github.com/SubhamTyagi/Last-Launcher/issues/162
if (t1.getOpeningCounts() != apps.getOpeningCounts()) {
return t1.getOpeningCounts() - apps.getOpeningCounts();
}else {
return -t1.getRecentUsedWeight() + apps.getRecentUsedWeight();
}
});
Collections.sort(mAppsList, (apps, t1) -> t1.getOpeningCounts() - apps.getOpeningCounts());
break;
case SORT_BY_COLOR:
Collections.sort(mAppsList, (apps, t1) -> {
Expand All @@ -1340,19 +1320,11 @@ protected Void doInBackground(final Integer... integers) {
return (hsv[i] < another[i]) ? -1 : 1;
}
}
//CS304 Issue link: https://github.com/SubhamTyagi/Last-Launcher/issues/162
return -t1.getRecentUsedWeight() + apps.getRecentUsedWeight();
return 0;
});
break;
case SORT_BY_UPDATE_TIME://descending
Collections.sort(mAppsList, (apps, t1) -> {
//CS304 Issue link: https://github.com/SubhamTyagi/Last-Launcher/issues/162
if (t1.getUpdateTime()!=apps.getUpdateTime()){
return t1.getUpdateTime() - apps.getUpdateTime();
}else {
return -t1.getRecentUsedWeight() + apps.getRecentUsedWeight();
}
});
Collections.sort(mAppsList, (apps, t1) -> t1.getUpdateTime() - apps.getUpdateTime());
break;
case SORT_BY_RECENT_OPEN://descending
Collections.sort(mAppsList, (apps, t1) -> (t1.getRecentUsedWeight() - apps.getRecentUsedWeight()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,6 @@ public void onClick(View view) {
}
}

/**This method is used to control the order of apps.
* The code block we added is to give the newly added buttons the ability to sort them by name.
*
* @param view
*/
private void sortApps(View view) {
Context context;
// set theme
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class Constants {
public static int dynamicHeight = 20;
public static final int DEFAULT_TEXT_SIZE_NORMAL_APPS = dynamicHeight;
public static final int DEFAULT_TEXT_SIZE_OFTEN_APPS = dynamicHeight * 9 / 5;
public static final int MAX_TEXT_SIZE_FOR_APPS = 90;
public static final int MIN_TEXT_SIZE_FOR_APPS = 14;
public static final int MAX_TEXT_SIZE_FOR_APPS=90;
public static final int MIN_TEXT_SIZE_FOR_APPS=14;


}

This file was deleted.

0 comments on commit c29435b

Please sign in to comment.