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 class UsPhoneNumberFormatter implements TextWatcher { | |
//This TextWatcher sub-class formats entered numbers as 1 (123) 456-7890 | |
private boolean mFormatting; // this is a flag which prevents the | |
// stack(onTextChanged) | |
private boolean clearFlag; | |
private int mLastStartLocation; | |
private String mLastBeforeText; | |
private WeakReference<EditText> mWeakEditText; |
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
// status bar height | |
int statusBarHeight = 0; | |
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
statusBarHeight = getResources().getDimensionPixelSize(resourceId); | |
} | |
// action bar height | |
int actionBarHeight = 0; | |
final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes( |
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.app.Activity; | |
import android.os.Bundle; | |
/** | |
* Created by William on 5/29/2016. | |
* | |
* new AlertDialog.Builder(this). | |
* | |
* use:(OnClickListener){setNegativeButton, setNeutralButton, setPositiveButton} |
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
language: android | |
android: | |
components: | |
# Uncomment the lines below if you want to | |
# use the latest revision of Android SDK Tools | |
- platform-tools | |
- tools | |
# The BuildTools version used by your project | |
- build-tools-22.0.0 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<style> | |
.spinBtn{ | |
position: relative; | |
color: rgba(255,255,255,1); | |
text-decoration: none; |
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
# | |
# Build configuration for Circle CI | |
# | |
general: | |
artifacts: | |
- /home/ubuntu/your-app-name/app/build/outputs/apk/ | |
machine: | |
environment: |
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
# | |
# Build configuration for Circle CI | |
# | |
general: | |
artifacts: | |
- /home/ubuntu/AndroidApp/app/build/outputs/apk/ | |
machine: | |
environment: |
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
/** | |
* Sets the text size for a Paint object so a given string of text will be a | |
* given width. | |
* | |
* @param paint the Paint to set the text size for | |
* @param desiredView the desired view | |
* @param text the text that should be that width | |
*/ | |
private static float setTextSizeByWidth(Paint paint, View desiredView, | |
String text) { |
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 Drawable applyRandomColorToDrawable(Drawable image) { | |
if (image != null) { | |
// PorterDuffColorFilter porterDuffColorFilter = new PorterDuffColorFilter(randomColorInt(), | |
PorterDuffColorFilter porterDuffColorFilter = new PorterDuffColorFilter(getRandomAlphaColorInt(), | |
PorterDuff.Mode.SRC_ATOP); | |
image.setColorFilter(porterDuffColorFilter); | |
} | |
return image; | |
} |
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
using UnityEngine; | |
using UnityEngine.Networking; | |
public class YourClass : Player | |
{ | |
[Client] | |
public void Addthing() | |
{ |