-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1650485
commit f42d15f
Showing
25 changed files
with
7,518 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/hippo/ehviewer/ui/dialog/FavoriteListSortDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.hippo.ehviewer.ui.dialog; | ||
|
||
import static com.hippo.ehviewer.client.EhConfig.ORDER_BY_FAV_TIME; | ||
import static com.hippo.ehviewer.client.EhConfig.ORDER_BY_PUB_TIME; | ||
|
||
import android.app.AlertDialog; | ||
|
||
import com.hippo.ehviewer.R; | ||
import com.hippo.ehviewer.client.parser.FavoritesParser; | ||
import com.hippo.ehviewer.ui.scene.FavoritesScene; | ||
|
||
public class FavoriteListSortDialog { | ||
private final FavoritesScene scene; | ||
|
||
public FavoriteListSortDialog(FavoritesScene scene) { | ||
this.scene = scene; | ||
} | ||
|
||
public void showCloudSort(FavoritesParser.Result mResult) { | ||
int checked; | ||
if (null == mResult.favOrder) { | ||
return; | ||
} | ||
if (mResult.favOrder.equals(ORDER_BY_FAV_TIME)) { | ||
checked = 0; | ||
} else if (mResult.favOrder.equals(ORDER_BY_PUB_TIME)) { | ||
checked = 1; | ||
} else { | ||
return; | ||
} | ||
AlertDialog dialog = new AlertDialog.Builder(scene.getContext()) | ||
.setIcon(R.mipmap.ic_launcher) | ||
.setTitle(R.string.order) | ||
.setSingleChoiceItems(R.array.fav_sort, checked, (dialogInterface, i) -> { | ||
if (i == 0) { | ||
scene.updateSort("inline_set=fs_f"); | ||
} else { | ||
scene.updateSort("inline_set=fs_p"); | ||
} | ||
dialogInterface.dismiss(); | ||
}) | ||
.create(); | ||
dialog.show(); | ||
} | ||
|
||
public void showLocalSort(FavoritesParser.Result mResult) { | ||
|
||
} | ||
} |
Oops, something went wrong.