View GlobalErrorHandler.kt
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
// references : https://github.com/firebase/firebase-android-sdk/issues/1952#issuecomment-713094146 | |
// error handling page | |
class ErrorActivity : AppCompatActivity() { | |
companion object { | |
private const val ERROR_TEXT = "ERROR_TEXT" | |
fun start(context: Context, errorText: String) = with(context) { | |
val intent = Intent(this, ErrorActivity::class.java).apply { |
View releaseWrapperAndLocalPosition.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
private void releaseWrapperAndLocalPosition( | |
WrapperAndLocalPosition wrapperAndLocalPosition | |
) { | |
wrapperAndLocalPosition.mInUse = false; | |
wrapperAndLocalPosition.mWrapper = null; | |
wrapperAndLocalPosition.mLocalPosition = -1; | |
mReusableHolder = wrapperAndLocalPosition; | |
} |
View findWrapperAndLocalPosition.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
@NonNull | |
private WrapperAndLocalPosition findWrapperAndLocalPosition( | |
int globalPosition | |
) { | |
WrapperAndLocalPosition result; | |
if (mReusableHolder.mInUse) { | |
result = new WrapperAndLocalPosition(); | |
} else { | |
mReusableHolder.mInUse = true; |
View ConcatAdapterController4.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
class ConcatAdapterController implements NestedAdapterWrapper.Callback { | |
private WrapperAndLocalPosition mReusableHolder = new WrapperAndLocalPosition(); | |
static class WrapperAndLocalPosition { | |
NestedAdapterWrapper mWrapper; | |
int mLocalPosition; | |
boolean mInUse; | |
} | |
View getItemId.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
class ConcatAdapterController implements NestedAdapterWrapper.Callback { | |
.. | |
public long getItemId(int globalPosition) { | |
WrapperAndLocalPosition wrapperAndPos = findWrapperAndLocalPosition(globalPosition); | |
Long globalItemId = wrapperAndPos.mWrapper.getItemId(wrapperAndPos.mLocalPosition); | |
releaseWrapperAndLocalPosition(wrapperAndPos); | |
return globalItemId; | |
} | |
.. |
View getItemViewType.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
class ConcatAdapterController implements NestedAdapterWrapper.Callback { | |
.. | |
public int getItemViewType(int globalPosition) { | |
WrapperAndLocalPosition wrapperAndPos = findWrapperAndLocalPosition(globalPosition); | |
int itemViewType = wrapperAndPos.mWrapper.getItemViewType(wrapperAndPos.mLocalPosition); | |
releaseWrapperAndLocalPosition(wrapperAndPos); | |
return itemViewType; | |
} | |
.. |
View StableIdLookup.kt
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
class NestedAdapterWrapper { | |
@NonNull | |
private final StableIdStorage.StableIdLookup mStableIdLookup; | |
public long getItemId(int localPosition) { | |
long localItemId = adapter.getItemId(localPosition); | |
return mStableIdLookup.localToGlobal(localItemId); | |
} |
View ViewTypeLookup.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
class NestedAdapterWrapper { | |
@NonNull | |
private final ViewTypeStorage.ViewTypeLookup mViewTypeLookup; | |
NestedAdapterWrapper( | |
Adapter<ViewHolder> adapter, | |
final Callback callback, | |
ViewTypeStorage viewTypeStorage, | |
StableIdStorage.StableIdLookup stableIdLookup | |
) { |
View getItemViewType.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
class NestedAdapterWrapper { | |
int getItemViewType(int localPosition) { | |
return mViewTypeLookup.localToGlobal( | |
adapter.getItemViewType(localPosition) | |
); | |
} | |
} |
View ConcatAdapterController3.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
class ConcatAdapterController implements NestedAdapterWrapper.Callback { | |
... | |
@NonNull | |
private final ConcatAdapter.Config.StableIdMode mStableIdMode; | |
... | |
} |
NewerOlder