Skip to content

Instantly share code, notes, and snippets.

View SyllaJay's full-sized avatar

Xinyue SyllaJay

  • ByteDance Ltd.
  • Shenzhen
View GitHub Profile
/*
* Copyright (C) 2014 Chris Banes
*
* 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
/*
* Copyright 2014 Chris Banes
*
* 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
#!/bin/bash
# Author: Tobias Preuss
# Version: 2015-01-19
echo "Creating symbolic links in Android SDK folder"
echo "============================================="
echo
if [ -z "$ANDROID_HOME" ] ; then
package com.tryear.jay.toolbarmaterialdesign;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
@SyllaJay
SyllaJay / PasswordEditText.java
Last active August 29, 2015 14:19
An EditText for input type "textPassword", with a switch button which can control the visibility of password.
package com.you.packagename.widget;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.text.InputType;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.EditText;
@SyllaJay
SyllaJay / LetterSpacingTextView.java
Last active October 24, 2022 19:18
Android TextView, that allows changing the letter spacing of the text. @author: Pedro Barros
/**
* Text view that allows changing the letter spacing of the text.
*
* @author Pedro Barros (pedrobarros.dev at gmail.com)
* @since May 7, 2013
*/
public static class LetterSpacingTextView extends TextView {
private float spacing = Spacing.NORMAL;
private CharSequence originalText = "";
@SyllaJay
SyllaJay / AutoScaleTextView.java
Last active August 29, 2015 14:22
A custom Text View that lowers the text size when the text is to big for the TextView.
package de.ankri.views;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
import de.ankri.R;
@SyllaJay
SyllaJay / DisplayUtils.java
Last active August 29, 2015 14:24
A android display utility
/**
* Copyright (C) 2014 Jay.
*
* All Rights Reserved.
*/
package com.tryear.jandroid.lib.util;
import android.app.Activity;
import android.content.Context;
@SyllaJay
SyllaJay / ClearableEditText
Created July 14, 2015 02:22
Android Clearable EditText
package com.tryear.jandroidlib.widget;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
@SyllaJay
SyllaJay / CountDownTimerPrecise.java
Last active November 12, 2015 08:17
A CountDownTimer! More accurate than android.os.CountDownTimer!
/*
* Copyright (C) 2008 The Android Open Source Project
*
* 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