Skip to content

Instantly share code, notes, and snippets.

View AvatarQing's full-sized avatar
💭
I may be slow to respond.

Riki AvatarQing

💭
I may be slow to respond.
View GitHub Profile
@AvatarQing
AvatarQing / build.gradle
Created December 29, 2014 13:29
2048gradle友盟渠道打包+应用名称替换脚本
buildscript {
repositories { mavenCentral() }
dependencies { classpath 'com.android.tools.build:gradle:1.0.0' }
}
apply plugin: 'com.android.application'
dependencies {
compile 'com.android.support:support-v4:21.0.0'
compile 'com.google.android.gms:play-services:+'
compile project(':CommonAdLib:CommonAdLib')
@AvatarQing
AvatarQing / Renamer.groovy
Created December 7, 2014 04:27
2048图片重命名
import java.nio.file.Files
import java.nio.file.Paths
import java.nio.file.StandardCopyOption
def renameImages(def dirPath,def saveDirPath){
new File(saveDirPath).mkdirs()
def dirFile=new File(dirPath)
dirFile.listFiles().eachWithIndex {inFile,i->
String name=inFile.getName()
def number=Math.pow(2, i+1) as int
import org.codehaus.groovy.runtime.StringBufferWriter;
def downloadSingleImage(String imageUrl, String savePath) {
try {
URL url = new URL(imageUrl);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
DataInputStream is = new DataInputStream(connection.getInputStream());
FileOutputStream fos=new FileOutputStream(savePath)
DataOutputStream os = new DataOutputStream(fos);
byte[] buffer = new byte[4096];
@AvatarQing
AvatarQing / Generator.java
Created October 31, 2014 07:19
Copyright Generator
package org.diao.tools.copyright;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextLayout;
import java.awt.image.BufferedImage;
import java.io.BufferedReader;
import java.io.File;
@AvatarQing
AvatarQing / ImageResizer.bat
Last active August 29, 2015 14:07
Java图片大小重置
@echo off
echo ======
echo The Argument Specification of ImageResizer.jar
echo arg1: Original image file path
echo arg2: Output image file path
echo arg3: Output image format. Only support JPEG,PNG,BMP,WBMP,GIF.
echo arg4: Output image width
echo arg5: Output image height
echo ------
echo Start converting...
@AvatarQing
AvatarQing / MainActivity.java
Last active August 29, 2015 14:04
自定义的PinnedHeaderViewListView,PinnedHeaderView的触摸事件尚未处理
package com.example.pinnedheaderlistviewtest;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ArrayAdapter;
/**
The MIT License (MIT)
Copyright (c) 2014 singwhatiwanna
https://github.com/singwhatiwanna
http://blog.csdn.net/singwhatiwanna
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@AvatarQing
AvatarQing / PullToZoomListView.java
Last active November 8, 2015 15:53
PullToZoomListView改进+中文注释
package com.matrixxun.pulltozoomlistsimple;
import android.content.Context;
import android.os.SystemClock;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.MotionEvent;
import android.view.ViewGroup;
import android.view.WindowManager;
@AvatarQing
AvatarQing / readme.txt
Created May 20, 2014 14:33
使用ProGuard删除日志输出语句
(1)http://stackoverflow.com/questions/4435773/android-proguard-removing-all-log-statements-and-merging-packages
(2)http://stackoverflow.com/questions/7086920/removing-logging-with-proguard-doesnt-remove-the-strings-being-logged
在开发android的时候,经常要使用Log.d()语句,但是发布的时候,如果一行一行的注释还是有点麻烦的.
这个时候可以使用如下的指令让proguard帮助我们删除他:
-assumenosideeffects class android.util.Log{ public static *** d(...); public static *** i(...); }
@AvatarQing
AvatarQing / WaterWaveView.java
Last active April 10, 2017 09:59
水波浪效果
package com.example.glowbuttontest;
import java.lang.ref.WeakReference;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;