Assigned
Status Update
Comments
lb...@toogoodtogo.com <lb...@toogoodtogo.com> #2
We don't support cross-process invalidations yet.
lb...@toogoodtogo.com <lb...@toogoodtogo.com> #3
At least , add a "refresh all observables" function to alpha4 ? i am trying to implement it by myself with your InvalidationTracker class
lb...@toogoodtogo.com <lb...@toogoodtogo.com> #4
Okey, I made it and created a method to invalidate all observables below;
private void refreshAllLiveData() {
AppDataBase YOUR_DATABASE_WHICH_YOU_BUILD = .....
SupportSQLiteDatabase writableDatabase = YOUR_DATABASE_WHICH_YOU_BUILD.getOpenHelper().getWritableDatabase();
//get the database count;
Cursor cursor = writableDatabase.query("SELECT count(*) FROM sqlite_master WHERE type = 'table' AND name != 'android_metadata' AND name != 'room_master_table';");
int tableCount = 0;
while(cursor.moveToNext()) {
tableCount = cursor.getInt(0);
}
for (int i = 0; i < tableCount; i++) {
//update version table with the incremented count because room modification log stores tables with ids instead of names
writableDatabase.execSQL("INSERT OR REPLACE INTO room_table_modification_log VALUES(null, "+(i)+")");
}
YOUR_DATABASE_WHICH_YOU_BUILD.getInvalidationTracker().refreshVersionsAsync();
}
-----
This is a workaroud for refreshing all live datas, I still prefer to use a proper API you implemented.
Thanx
private void refreshAllLiveData() {
AppDataBase YOUR_DATABASE_WHICH_YOU_BUILD = .....
SupportSQLiteDatabase writableDatabase = YOUR_DATABASE_WHICH_YOU_BUILD.getOpenHelper().getWritableDatabase();
//get the database count;
Cursor cursor = writableDatabase.query("SELECT count(*) FROM sqlite_master WHERE type = 'table' AND name != 'android_metadata' AND name != 'room_master_table';");
int tableCount = 0;
while(cursor.moveToNext()) {
tableCount = cursor.getInt(0);
}
for (int i = 0; i < tableCount; i++) {
//update version table with the incremented count because room modification log stores tables with ids instead of names
writableDatabase.execSQL("INSERT OR REPLACE INTO room_table_modification_log VALUES(null, "+(i)+")");
}
YOUR_DATABASE_WHICH_YOU_BUILD.getInvalidationTracker().refreshVersionsAsync();
}
-----
This is a workaroud for refreshing all live datas, I still prefer to use a proper API you implemented.
Thanx
Description
Setup:
RecyclerView with a horizontal LinearLayoutManager and set reverseLayout to true. The RecyclerView is in a LinearLayout with horizontal orientation next to a fixed size element. The RecyclerView's width is set to 0dp and it's weight is set to 1 so it takes up all the remaining space next to the fixed size View.
Actual result:
The list is displayed but the last item is slightly offset from the right edge of the screen.
Expected result:
The list should start exactly from the right side of the screen.
Additional info:
The same issue happens if the RecyclerView is in a ConstraintLayout and has constraints on its siblings that affects it's width.
The same issue happens if we set stackFromEnd to true instead of reverseLayout.
The scroll position is changing every time we call requestLayout on the RecyclerView, so it seems to be a bug related to the layout phase.
If the RecyclerView has a fixed size, instead of filling up the remaining space by setting weight on it, the list is displayed correctly.
Sample code:https://github.com/szugyi/recyclerview-scroll-position-bug