This file contains hidden or 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
| package com.sjl.util; | |
| import android.app.Activity; | |
| import android.app.Application; | |
| import android.content.Context; | |
| import android.os.Bundle; | |
| import android.os.Handler; | |
| import android.util.Log; | |
| import java.util.List; |
This file contains hidden or 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 class NullIfEmptyStrAdapter extends TypeAdapter<String> { | |
| @Override | |
| public void write(JsonWriter out, String value) throws IOException { | |
| out.value(value); | |
| } | |
| @Override | |
| public String read(JsonReader in) throws IOException { | |
| if (in.peek() == JsonToken.NULL) { |
This file contains hidden or 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
| /** | |
| * Transform pictures to desired size and format according to Qiniu Api | |
| */ | |
| public class QiniuReqTransformer implements Picasso.RequestTransformer { | |
| @Override | |
| public Request transformRequest(Request request) { | |
| if (request.resourceId != 0) { | |
| return request; // Don't transform resource requests. | |
| } |
This file contains hidden or 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
| <?xml version="1.0"?> | |
| <!DOCTYPE module PUBLIC | |
| "-//Puppy Crawl//DTD Check Configuration 1.3//EN" | |
| "http://www.puppycrawl.com/dtds/configuration_1_3.dtd"> | |
| <module name="Checker"> | |
| <module name="FileLength"> | |
| <property name="max" value="500"/> | |
| <property name="fileExtensions" value="java"/> | |
| </module> |
This file contains hidden or 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
| <?xml version="1.0"?> | |
| <!DOCTYPE suppressions PUBLIC | |
| "-//Puppy Crawl//DTD Suppressions 1.1//EN" | |
| "http://www.puppycrawl.com/dtds/suppressions_1_1.dtd"> | |
| <suppressions> | |
| <suppress checks="[a-zA-Z0-9]*" files="R.java" /> | |
| <suppress checks="[a-zA-Z0-9]*" files="BuildConfig.java" /> | |
| <suppress checks="[a-zA-Z0-9]*" files="Test" /> |
This file contains hidden or 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
| <code_scheme name="code_style"> | |
| <option name="AUTODETECT_INDENTS" value="false" /> | |
| <option name="PREFER_LONGER_NAMES" value="false" /> | |
| <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> | |
| <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" /> | |
| <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND"> | |
| <value /> | |
| </option> | |
| <option name="IMPORT_LAYOUT_TABLE"> | |
| <value> |
This file contains hidden or 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
| #!/bin/sh | |
| # | |
| # To use this you need: | |
| # 1. checkstyle's jar file somewhere | |
| # 2. a checkstyle XML check file somewhere | |
| # 3. java environment | |
| # 4. To configure git: | |
| # * git config --add checkstyle.jar <location of jar> | |
| # * git config --add checkstyle.checkfile <location of checkfile> | |
| # 5. Put this in your .git/hooks directory as pre-commit |