forked from mirrors/Fedilab
Some fixes
This commit is contained in:
parent
77b6c478d1
commit
d66c257370
5 changed files with 60 additions and 25 deletions
|
@ -13,8 +13,8 @@ android {
|
|||
defaultConfig {
|
||||
minSdk 21
|
||||
targetSdk 32
|
||||
versionCode 436
|
||||
versionName "3.9.1"
|
||||
versionCode 437
|
||||
versionName "3.9.2"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
flavorDimensions "default"
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
[
|
||||
{
|
||||
"version": "3.9.2",
|
||||
"code": "437",
|
||||
"note": "Added:\n- New design with 5 themes\n\nChanged:\n- Remove built-in browser support\n- Fit preview image displays images vertically\n- Add counters next to images\n\nFixed:\n- Jumps in timelines\n- Replies to wrong messages with followed instances\n- Bug with delete&redraft with a media\n- Some crashes"
|
||||
},
|
||||
{
|
||||
"version": "3.9.1",
|
||||
"code": "436",
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.google.gson.annotations.SerializedName;
|
|||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -154,7 +155,17 @@ public class Pinned implements Serializable {
|
|||
}
|
||||
try {
|
||||
Cursor c = db.query(Sqlite.TABLE_PINNED_TIMELINES, null, Sqlite.COL_INSTANCE + " = '" + account.instance + "' AND " + Sqlite.COL_USER_ID + " = '" + account.user_id + "'", null, null, null, Sqlite.COL_UPDATED_AT + " DESC", "1");
|
||||
return cursorToPined(c);
|
||||
Pinned pinned = cursorToPined(c);
|
||||
List<PinnedTimeline> pinnedTimelines = new ArrayList<>();
|
||||
if (pinned != null) {
|
||||
for (PinnedTimeline pinnedTimeline : pinned.pinnedTimelines) {
|
||||
if (pinnedTimeline.displayed) {
|
||||
pinnedTimelines.add(pinnedTimeline);
|
||||
}
|
||||
}
|
||||
pinned.pinnedTimelines = pinnedTimelines;
|
||||
}
|
||||
return pinned;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -274,7 +274,9 @@ public class PinnedTimelineHelper {
|
|||
|
||||
for (MastodonList mastodonList : mastodonLists) {
|
||||
boolean present = false;
|
||||
for (PinnedTimeline pinnedTimeline : pinned.pinnedTimelines) {
|
||||
try {
|
||||
Pinned pinnedAll = new Pinned(activity).getAllPinned(currentAccount);
|
||||
for (PinnedTimeline pinnedTimeline : pinnedAll.pinnedTimelines) {
|
||||
if (pinnedTimeline.mastodonList != null && mastodonList.id.compareTo(pinnedTimeline.mastodonList.id) == 0) {
|
||||
present = true;
|
||||
break;
|
||||
|
@ -285,20 +287,24 @@ public class PinnedTimelineHelper {
|
|||
needRedraw = true; //Something changed, redraw must be done
|
||||
PinnedTimeline pinnedTimeline = new PinnedTimeline();
|
||||
pinnedTimeline.type = Timeline.TimeLineEnum.LIST;
|
||||
pinnedTimeline.position = pinned.pinnedTimelines.size();
|
||||
pinnedTimeline.position = pinnedAll.pinnedTimelines.size();
|
||||
pinnedTimeline.mastodonList = mastodonList;
|
||||
pinned.pinnedTimelines.add(pinnedTimeline);
|
||||
pinnedAll.pinnedTimelines.add(pinnedTimeline);
|
||||
try {
|
||||
boolean exist = new Pinned(activity).pinnedExist(pinned);
|
||||
boolean exist = new Pinned(activity).pinnedExist(pinnedAll);
|
||||
if (exist) {
|
||||
new Pinned(activity).updatePinned(pinned);
|
||||
new Pinned(activity).updatePinned(pinnedAll);
|
||||
} else {
|
||||
new Pinned(activity).insertPinned(pinned);
|
||||
new Pinned(activity).insertPinned(pinnedAll);
|
||||
}
|
||||
} catch (DBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} catch (DBException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (!needRedraw) { //if there were no changes with list, no need to update tabs
|
||||
|
|
13
src/fdroid/fastlane/metadata/android/en/changelogs/437.txt
Normal file
13
src/fdroid/fastlane/metadata/android/en/changelogs/437.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
Added:
|
||||
- New design with 5 themes
|
||||
|
||||
Changed:
|
||||
- Remove built-in browser support
|
||||
- Fit preview image displays images vertically
|
||||
- Add counters next to images
|
||||
|
||||
Fixed:
|
||||
- Jumps in timelines
|
||||
- Replies to wrong messages with followed instances
|
||||
- Bug with delete&redraft with a media
|
||||
- Some crashes
|
Loading…
Reference in a new issue