use of forpdateam.ru.forpda.api.search.models.SearchSettings in project ForPDA by RadiationX.
the class ThemeDialogsHelper method showUserMenu.
public static void showUserMenu(Context context, IPostFunctions theme, IBaseForumPost post) {
if (userMenu == null) {
userMenu = new DynamicDialogMenu<>();
userMenu.addItem(App.get().getString(R.string.profile), (context1, data) -> IntentHandler.handle("https://4pda.ru/forum/index.php?showuser=" + data.getUserId()));
userMenu.addItem(App.get().getString(R.string.reputation), IPostFunctions::showReputationMenu);
userMenu.addItem(App.get().getString(R.string.pm_qms), (context1, data) -> IntentHandler.handle("https://4pda.ru/forum/index.php?act=qms&mid=" + data.getUserId()));
userMenu.addItem(App.get().getString(R.string.user_themes), (context1, data) -> {
SearchSettings settings = new SearchSettings();
settings.setSource(SearchSettings.SOURCE_ALL.first);
settings.setNick(data.getNick());
settings.setResult(SearchSettings.RESULT_TOPICS.first);
IntentHandler.handle(settings.toUrl());
});
userMenu.addItem(App.get().getString(R.string.messages_in_this_theme), (context1, data) -> {
SearchSettings settings = new SearchSettings();
settings.addForum(Integer.toString(data.getForumId()));
settings.addTopic(Integer.toString(data.getTopicId()));
settings.setSource(SearchSettings.SOURCE_CONTENT.first);
settings.setNick(data.getNick());
settings.setResult(SearchSettings.RESULT_POSTS.first);
settings.setSubforums(SearchSettings.SUB_FORUMS_FALSE);
IntentHandler.handle(settings.toUrl());
});
userMenu.addItem(App.get().getString(R.string.user_messages), (context1, data) -> {
SearchSettings settings = new SearchSettings();
settings.setSource(SearchSettings.SOURCE_CONTENT.first);
settings.setNick(data.getNick());
settings.setResult(SearchSettings.RESULT_POSTS.first);
settings.setSubforums(SearchSettings.SUB_FORUMS_FALSE);
IntentHandler.handle(settings.toUrl());
});
}
userMenu.disallowAll();
userMenu.allow(0);
userMenu.allow(1);
if (ClientHelper.getAuthState() == ClientHelper.AUTH_STATE_LOGIN && post.getUserId() != ClientHelper.getUserId()) {
userMenu.allow(2);
}
userMenu.allow(3);
userMenu.allow(4);
userMenu.allow(5);
userMenu.show(context, theme, post);
}
use of forpdateam.ru.forpda.api.search.models.SearchSettings in project ForPDA by RadiationX.
the class SearchFragment method saveSettings.
private void saveSettings() {
SearchSettings saveSettings = new SearchSettings();
saveSettings.setResult(settings.getResult());
saveSettings.setSort(settings.getSort());
saveSettings.setSource(settings.getSource());
String saveUrl = saveSettings.toUrl();
Log.d(LOG_TAG, "SAVE SETTINGS " + saveUrl);
App.get().getPreferences().edit().putString("search_settings", saveUrl).apply();
}
Aggregations