Skip to content

Instantly share code, notes, and snippets.

View ptsiogas's full-sized avatar
🚀
Think outside the box.

Paris Tsiogas ptsiogas

🚀
Think outside the box.
  • Desquared S.A
  • Athens, Greece
View GitHub Profile
@ptsiogas
ptsiogas / shadow_effect.java
Created October 1, 2015 13:56
Create shadow effect background color programmatically.
/**
* Creates background color with shadow effect - programmatically
*
* @param color the background color
*/
private LayerDrawable setLayerShadow(String color) {
GradientDrawable shadow;
int strokeValue = 6;
int radiousValue = 2;
try{
@ptsiogas
ptsiogas / Run_Async_Task.snippets
Created September 14, 2015 13:50
Run Async Task (Xamarin)
//Async method
public void requestInputAsync() {
//The worker does all the work for you.
BackgroundWorker requestInputWorkerNew = new BackgroundWorker ();
requestInputWorkerNew.DoWork += new DoWorkEventHandler (delegate(object o, DoWorkEventArgs args) {
//Do all the async work here but for God's sake don't mess with the UI Thread
}
});
requestInputWorkerNew.RunWorkerCompleted += new RunWorkerCompletedEventHandler(
@ptsiogas
ptsiogas / run_async_task.java
Last active September 20, 2015 17:54
Run an Async Task (Android)
//Declare variable and execute async
DownloadFilesTask mDonwloadFilesTask;
mDonwloadFilesTask = new DownloadFilesTask();
mDonwloadFilesTask.execute("");
//----------------------------------
public class DownloadFilesTask extends AsyncTask<String, Void, String> {
protected String doInBackground(String... params) {
//do all the heavy staff here but dont you dare messing with the UI!
return "Executed!";
}