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 / 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;
[ 24154] ERROR - ctionSystem.DefaultActionGroup - cannot create class "importre.intellij.android.selector.action.AndroidSelector" [Plugin: importre.intellij.android.selector]
com.intellij.diagnostic.PluginException: cannot create class "importre.intellij.android.selector.action.AndroidSelector" [Plugin: importre.intellij.android.selector]
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(ActionManagerImpl.java:176)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convert(ActionManagerImpl.java:516)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getActionImpl(ActionManagerImpl.java:496)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:489)
at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(DefaultActionGroup.java:354)
at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:312)
at com.intellij.ide.actions.WeighingActionGroup.getChildren(WeighingActionGroup.java:61)
@AKiniyalocts
AKiniyalocts / drawer_toggle_style.xml
Created September 30, 2015 00:33
How to style an ActionBarDrawerToggle
<style name="MyTheme" parent="Theme.AppCompat">
<item name="drawerArrowStyle">@style/MyDrawerArrowToggle</item>
</style>
<style name="MyDrawerArrowToggle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="color">?android:attr/textColorSecondary</item>
<item name="middleBarArrowSize">16dp</item>
<item name="spinBars">true</item>
<item name="thickness">2dp</item>
<item name="topBottomBarArrowSize">11.31dp</item>