Skip to content

Instantly share code, notes, and snippets.

View sergio11's full-sized avatar
🏠
Working from home

Sergio Sánchez Sánchez sergio11

🏠
Working from home
View GitHub Profile
@iainporter
iainporter / InboundFileIntegration.java
Created August 28, 2020 17:57
DSL spring integration flow for polling for files
@Bean
public IntegrationFlow inboundFileIntegration(@Value("${inbound.file.poller.fixed.delay}") long period,
@Value("${inbound.file.poller.max.messages.per.poll}") int maxMessagesPerPoll,
TaskExecutor taskExecutor,
MessageSource<File> fileReadingMessageSource) {
return IntegrationFlows.from(fileReadingMessageSource,
c -> c.poller(Pollers.fixedDelay(period)
.taskExecutor(taskExecutor)
.maxMessagesPerPoll(maxMessagesPerPoll)
.transactionSynchronizationFactory(transactionSynchronizationFactory())
@jamsoft
jamsoft / BaseViewModel.cs
Last active October 21, 2017 17:01
View Model Value Change Tracking in MvvmCross
public class MyBaseVm : MvxViewModel
{
#region IsDirty
private string _cleanHash;
protected string CleanHash
{
get { return _cleanHash; }
}
@ssinss
ssinss / EndlessRecyclerOnScrollListener.java
Last active January 19, 2024 08:52
Endless RecyclerView OnScrollListener
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class EndlessRecyclerOnScrollListener extends RecyclerView.OnScrollListener {
public static String TAG = EndlessRecyclerOnScrollListener.class.getSimpleName();
private int previousTotal = 0; // The total number of items in the dataset after the last load
private boolean loading = true; // True if we are still waiting for the last set of data to load.
private int visibleThreshold = 5; // The minimum amount of items to have below your current scroll position before loading more.
int firstVisibleItem, visibleItemCount, totalItemCount;