Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
es.oneoctopus.swiperefreshlayoutoverlay:library
Advanced tools
Custom SwipeRefreshLayout that works when overlaying the ActionBar
This library is now discontinued and you should only use it if you want to use the <21 support library in your application. In other case, the new support library SwipeRefreshLayout contains a new method, setProgressViewOffset, to set the view offset.
Esta biblioteca ha sido descontinuada y sólo deberías usarla si quieres utilizar la versión previa a la API 21 de la biblioteca de soporte. Para cualquier otro caso el SwipeRefreshLayout de la nueva biblioteca de soporte contiene el método setProgressViewOffset con el cual podrás ajustar el margen de la vista.
SwipeRefreshLayoutOverlay is modification of Android's SwipeRefreshLayout to use this pattern when you're overlaying the ActionBar (or the Status Bar in >= KitKat). If you use the original view in the support library you'll find out that the progress bar falls behind the ActionBar, making the refresh progress almost impossible to notice. Use this custom view instead of the original one to avoid the problem.
It works just like the original SwipeRefreshLayout. You just have to call to the setTopMargin
method with the desired margin (which should be the same as the ActionBar height, or the Status Bar + ActionBar heights if you're targeting KitKat or newer and the status bar is also translucent)
public class Whatever extends Activity {
private SwipeRefreshLayoutOverlay swipeToRefresh;
...
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
swipeToRefresh = (SwipeRefreshLayoutOverlay) findViewById(R.id.refresher);
swipeToRefresh.setOnRefreshListener(this);
swipeToRefresh.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
swipeToRefresh.setTopMargin(getActionBar().getHeight());
}
...
}
SwipeRefreshLayoutOverlay es una modificación del SwipeRefreshLayout de Android para usar este patrón de diseño cuando utilizas una ActionBar translúcida (o una Status Bar translúcida si estás utilizando KitKat o superior). Si utilizas la view original de la librería de soporte verás que la barra de progreso queda detrás de la ActionBar, de forma que es muy difícil verla. Utiliza esta custom view en lugar de la original para solucionar el problema.
###Uso
Funciona igual que la SwipeRefreshLayout original. Simplemente tienes que llamar al método setTopMargin
pasándole el margen deseado (que deberá ser igual que la altura de la ActionBar o de la Status Bar + la ActionBar si estás utilizando una Status Bar translúcida)
###Ejemplo
public class Whatever extends Activity {
private SwipeRefreshLayoutOverlay swipeToRefresh;
...
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
swipeToRefresh = (SwipeRefreshLayoutOverlay) findViewById(R.id.refresher);
swipeToRefresh.setOnRefreshListener(this);
swipeToRefresh.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, android.R.color.holo_orange_light, android.R.color.holo_red_light);
swipeToRefresh.setTopMargin(getActionBar().getHeight());
}
...
}
FAQs
Custom SwipeRefreshLayout that works when overlaying the ActionBar
We found that es.oneoctopus.swiperefreshlayoutoverlay:library demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.