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
public class CheckableFrameLayout extends FrameLayout implements Checkable { | |
private static final int[] CHECKED_STATE_SET = { | |
android.R.attr.state_activated, | |
android.R.attr.state_checked, | |
}; | |
private boolean mChecked; | |
public CheckableFrameLayout(Context context) { | |
super(context); |
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
# Railscast | |
http://railscasts.com/episodes/308-oh-my-zsh | |
# Install Zsh | |
sudo apt-get update && sudo apt-get install zsh | |
# Install Oh-my-zsh | |
wget –no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O – | sh | |
# Make ZSH default shell |
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
/* | |
* Copyright 2013 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
Intent filter for URL capturing | |
Task: catch urls of type http://ХХХXviewster.com/movie/XXXXXX | |
Solution: activity with intent filter | |
<intent-filter> | |
<action android:name="android.intent.action.VIEW" /> | |
<category android:name="android.intent.category.DEFAULT" /> | |
<category android:name="android.intent.category.BROWSABLE" /> | |
<data android:scheme="http" /> | |
<data android:host="*.viewster.com" /> |
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
public class OverlayService extends Service { | |
LinearLayout oView; | |
@Override | |
public IBinder onBind(Intent i) { | |
return null; | |
} | |
@Override |
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
public static void uploadFile(String urlString, Map<String, String> params, String fileName, InputStream fileInputStream) { | |
String lineEnd = "\r\n"; | |
String twoHyphens = "--"; | |
String boundary = "*****"; | |
HttpURLConnection conn; | |
try { | |
// ------------------ CLIENT REQUEST | |
Log.e(Tag, "Inside second Method"); | |
// open a URL connection to the Servlet | |
URL url = new URL(urlString); |
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
import android.content.Context; | |
import android.support.v7.view.ActionMode; | |
import android.util.AttributeSet; | |
import android.view.View; | |
import android.widget.AbsListView; | |
import android.widget.ListView; | |
public class CamCompatListView extends ListView | |
{ | |
public CamCompatListView(Context context) |
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
public class MainActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.layoutfab); | |
//Outline | |
int size = getResources().getDimensionPixelSize(R.dimen.fab_size); | |
Outline outline = new Outline(); |
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
package com.dpmedeiros.androidtestsupportlibrary; | |
import android.os.Handler; | |
import android.os.Looper; | |
import org.mockito.invocation.InvocationOnMock; | |
import org.mockito.stubbing.Answer; | |
import org.powermock.api.mockito.PowerMockito; | |
import java.util.concurrent.Executors; |