Skip to content

Instantly share code, notes, and snippets.

View AKiniyalocts's full-sized avatar
🔭

Anthony Kiniyalocts AKiniyalocts

🔭
  • Big Nerd Ranch
  • Southgate, KY
View GitHub Profile
@AKiniyalocts
AKiniyalocts / MeteoIconParser.java
Created June 19, 2014 06:18
Converter for forecast io icons to meteoicons
/**
* Created by anthony on 6/19/14.
*
* Instansiate this class with a string (The icon name you want to convert) then call getIconTextCode()
* on that instantiation to return the appropriate character for that forecast IO icon, utilized in the ttf font file.
*
* Icons: http://www.alessioatzeni.com/meteocons/
* Forecast IO lib: https://github.com/dvdme/forecastio-lib-java
*
* This was made assumming you are using the meteo .ttf and not the actual icons.
@AKiniyalocts
AKiniyalocts / DeclareTextureRegions.sh
Last active August 29, 2015 14:03
Declares all png files as a Texture Region
#!/bin/bash
#
# 1. Place this in the /android/assets/images directory
# 2. chmod 755 DeclareTextureRegions.sh to make it executable
# 3. ./DeclareTextureRegions
# 4. Enter the directory you wish to generate statements for e.g. (pg03)
# 5. A file will be created in that images folder that contains statements for those png files.
echo "enter the path containg the images: "
read path
@AKiniyalocts
AKiniyalocts / nav_drawer_toolbar.xml
Last active August 29, 2015 14:08
Incorporating the new appcompat-v7 ToolBar with the Navigation Drawer
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/background_material_dark"
android:layout_marginTop="@dimen/status_bar_padding"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<RelativeLayout
@AKiniyalocts
AKiniyalocts / gist:59c432023eee5ef8e4e0
Created December 23, 2014 21:26
Android-Libs pushbullet channel subscriber
<a class="pushbullet-subscribe-widget" data-channel="android-libs" data-widget="button" data-size="small"></a>
<script type="text/javascript">(function(){var a=document.createElement('script');a.type='text/javascript';a.async=true;a.src='https://widget.pushbullet.com/embed.js';var b=document.getElementsByTagName('script')[0];b.parentNode.insertBefore(a,b);})();</script>
@AKiniyalocts
AKiniyalocts / HackyDrawerLayout
Created April 2, 2015 22:36
Subclass of DrawerLayout to catch the crash on zoom when using PhotoView as a child
package com.your.package;
import android.content.Context;
import android.support.v4.widget.DrawerLayout;
import android.util.AttributeSet;
import android.view.MotionEvent;
public class HackyDrawerLayout extends DrawerLayout {
@AKiniyalocts
AKiniyalocts / build.gradle
Created June 26, 2015 01:32
Common dependencies in my build.gradle file (work in progress)
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
@AKiniyalocts
AKiniyalocts / toolbar.xml
Created June 26, 2015 01:48
Simple toolbar layout file
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:id="@+id/main_toolbar"
/>
@AKiniyalocts
AKiniyalocts / generate_icons.sh
Last active October 16, 2018 18:03
Generate resized icons for your android applications using imagemagick!
#!/bin/bash
# This requires imagemagick (a super awesome image tool)
# Install via: sudo apt-get install imagemagick
echo "Enter the path to the 512x512 icon"
read icon
mkdir "drawable-mdpi" "drawable-hdpi" "drawable-xhdpi" "drawable-xxhdpi" "drawable-xxxhdpi"
@AKiniyalocts
AKiniyalocts / CustomTextInputLayout.java
Last active August 29, 2015 14:25
This fixes the InputTextLayout in the Android Design Library not showing hint text correctly on 5.0+
**
* Depends on android design library.
*
*/
import android.content.Context;
import android.graphics.Canvas;
import android.support.design.widget.TextInputLayout;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.View;
@AKiniyalocts
AKiniyalocts / ButterKnifeActivity.java
Created July 18, 2015 03:25
Quick abstract super class for Activities that use ButterKnife. Eliminate calling ButterKnife.bind(this) every activity.
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import butterknife.ButterKnife;
/**
* Created by anthony on 7/17/15.
*/
public abstract class ButterKnifeActivity extends AppCompatActivity {