-
Notifications
You must be signed in to change notification settings - Fork 0
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
75e43c0
commit 4a80232
Showing
9 changed files
with
138 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,5 +1,20 @@ | ||
/* | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
package org.luwrain.app.news2; | ||
This file is part of LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN 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 | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.app.news; | ||
|
||
import java.util.*; | ||
|
||
|
@@ -9,8 +24,6 @@ | |
import org.luwrain.pim.news.*; | ||
import org.luwrain.app.base.*; | ||
|
||
import org.luwrain.app.news.Strings; | ||
|
||
public final class App extends AppBase<Strings> implements MonoApp | ||
{ | ||
private NewsStoring storing = null; | ||
|
@@ -49,7 +62,7 @@ boolean openGroup(NewsGroup newGroup) | |
|
||
void loadGroups() | ||
{ | ||
final List<GroupWrapper> w = new LinkedList(); | ||
final List<GroupWrapper> w = new ArrayList<>(); | ||
final NewsGroup[] g = storing.getGroups().load(); | ||
Arrays.sort(g); | ||
int[] newCounts = storing.getArticles().countNewInGroups(g); | ||
|
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
/* | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
package org.luwrain.app.news2; | ||
This file is part of LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN 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 | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.app.news; | ||
|
||
import java.net.*; | ||
|
||
import org.luwrain.core.*; | ||
import org.luwrain.popups.*; | ||
|
||
import org.luwrain.app.news.Strings; | ||
|
||
final class Conversations | ||
{ | ||
private final Luwrain luwrain; | ||
|
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 |
---|---|---|
@@ -1,5 +1,20 @@ | ||
/* | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
package org.luwrain.app.news2; | ||
This file is part of LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN 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 | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.app.news; | ||
|
||
import java.util.*; | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Copyright 2012-2019 Michael Pozhidaev <[email protected]> | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
This file is part of LUWRAIN. | ||
|
@@ -24,15 +24,13 @@ public final class Extension extends EmptyExtension | |
{ | ||
return new Command[]{ | ||
new SimpleShortcutCommand("news"), | ||
new SimpleShortcutCommand("news2") | ||
}; | ||
} | ||
|
||
@Override public ExtensionObject[] getExtObjects(Luwrain luwrain) | ||
{ | ||
return new ExtensionObject[]{ | ||
new SimpleShortcut("news", App.class), | ||
new SimpleShortcut("news2", org.luwrain.app.news2.App.class) | ||
}; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,5 +1,20 @@ | ||
/* | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
package org.luwrain.app.news2; | ||
This file is part of LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN 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 | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.app.news; | ||
|
||
import org.luwrain.core.*; | ||
import org.luwrain.pim.news.*; | ||
|
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 |
---|---|---|
@@ -1,5 +1,20 @@ | ||
/* | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
package org.luwrain.app.news2; | ||
This file is part of LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN 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 | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.app.news; | ||
|
||
import java.util.*; | ||
|
||
|
@@ -15,8 +30,6 @@ | |
|
||
import static org.luwrain.core.DefaultEventResponse.*; | ||
|
||
import org.luwrain.app.news.Strings; | ||
|
||
final class MainLayout extends LayoutBase | ||
{ | ||
private final App app; | ||
|
@@ -281,6 +294,45 @@ private boolean markAsRead(NewsArticle article) | |
return true; | ||
} | ||
|
||
/* | ||
boolean setShowAllGroupsMode(ListArea groupsArea, boolean value) | ||
{ | ||
NullCheck.notNull(groupsArea, "groupsArea"); | ||
base.setShowAllGroups(value); | ||
groupsArea.refresh(); | ||
luwrain.playSound(Sounds.OK); | ||
return true; | ||
} | ||
boolean markAsReadWholeGroup(ListArea groupsArea, ListArea summaryArea, GroupWrapper group) | ||
{ | ||
NullCheck.notNull(groupsArea, "groupsArea"); | ||
NullCheck.notNull(summaryArea, "summaryArea"); | ||
NullCheck.notNull(group, "group"); | ||
if (base.markAsReadWholeGroup(group.group)) | ||
{ | ||
groupsArea.refresh(); | ||
groupsArea.announceSelected(); | ||
} | ||
base.closeGroup(); | ||
summaryArea.refresh(); | ||
return true; | ||
} | ||
boolean onOpenUrl(ReaderArea area) | ||
{ | ||
NullCheck.notNull(area, "area"); | ||
final Document doc = area.getDocument(); | ||
if (doc == null || doc.getUrl() == null) | ||
return false; | ||
luwrain.launchApp("reader", new String[]{doc.getUrl().toString()}); | ||
return true; | ||
} | ||
} | ||
*/ | ||
|
||
final class SummaryAppearance implements ListArea.Appearance<NewsArticle> | ||
{ | ||
@Override public void announceItem(NewsArticle article, Set<Flags> flags) | ||
|
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 |
---|---|---|
@@ -1,5 +1,20 @@ | ||
/* | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
package org.luwrain.app.news2; | ||
This file is part of LUWRAIN. | ||
LUWRAIN is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU General Public | ||
License as published by the Free Software Foundation; either | ||
version 3 of the License, or (at your option) any later version. | ||
LUWRAIN 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 | ||
General Public License for more details. | ||
*/ | ||
|
||
package org.luwrain.app.news; | ||
|
||
import java.util.*; | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
Copyright 2012-2019 Michael Pozhidaev <[email protected]> | ||
Copyright 2012-2021 Michael Pozhidaev <[email protected]> | ||
This file is part of LUWRAIN. | ||
|