Skip to content

Commit

Permalink
Merge pull request zhihu#429 from marcinkunert/fix_travis_build
Browse files Browse the repository at this point in the history
Fix Travis build
  • Loading branch information
REBOOTERS committed Jul 8, 2018
2 parents 434e493 + c8616c5 commit ea81835
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ android:
components:
- tools
- platform-tools
- build-tools-26.0.3
- android-26
- build-tools-27.0.3
- android-27
- extra-android-m2repository

jdk:
Expand Down
4 changes: 2 additions & 2 deletions checkstyle.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">

<module name="Checker">
Expand Down Expand Up @@ -136,7 +136,7 @@
<module name="InnerAssignment"/>
<!--<module name="MagicNumber"/>-->
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<!--<module name="RedundantThrows"/>-->
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>

Expand Down
4 changes: 4 additions & 0 deletions matisse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ publish {
website = 'https://www.zhihu.com/'
}

checkstyle {
toolVersion = '7.6.1'
}

task checkstyle(type:Checkstyle) {
description 'Runs Checkstyle inspection against matisse sourcesets.'
group = 'Code Quality'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public class CheckRadioView extends AppCompatImageView {

private Drawable mDrawable;

private int selectedColor;
private int unSelectedColor;
private int mSelectedColor;
private int mUnSelectUdColor;

public CheckRadioView(Context context) {
super(context);
Expand All @@ -29,31 +29,31 @@ public CheckRadioView(Context context, AttributeSet attrs) {
}

private void init() {
selectedColor = ResourcesCompat.getColor(
mSelectedColor = ResourcesCompat.getColor(
getResources(), R.color.zhihu_item_checkCircle_backgroundColor,
getContext().getTheme());
unSelectedColor = ResourcesCompat.getColor(
mUnSelectUdColor = ResourcesCompat.getColor(
getResources(), R.color.zhihu_check_original_radio_disable,
getContext().getTheme());
setChecked(false);
}

public void setChecked(boolean enable){
if(enable){
public void setChecked(boolean enable) {
if (enable) {
setImageResource(R.drawable.ic_preview_radio_on);
mDrawable=getDrawable();
mDrawable.setColorFilter(selectedColor, PorterDuff.Mode.SRC_IN);
}else {
mDrawable = getDrawable();
mDrawable.setColorFilter(mSelectedColor, PorterDuff.Mode.SRC_IN);
} else {
setImageResource(R.drawable.ic_preview_radio_off);
mDrawable=getDrawable();
mDrawable.setColorFilter(unSelectedColor, PorterDuff.Mode.SRC_IN);
mDrawable = getDrawable();
mDrawable.setColorFilter(mUnSelectUdColor, PorterDuff.Mode.SRC_IN);
}
}


public void setColor(int color){
public void setColor(int color) {
if (mDrawable == null) {
mDrawable=getDrawable();
mDrawable = getDrawable();
}
mDrawable.setColorFilter(color, PorterDuff.Mode.SRC_IN);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public static float getSizeInMB(long sizeInBytes) {
df.applyPattern("0.0");
String result = df.format((float) sizeInBytes / 1024 / 1024);
Log.e(TAG, "getSizeInMB: " + result);
result = result.replaceAll(",","."); // in some case , 0.0 will be 0,0
result = result.replaceAll(",", "."); // in some case , 0.0 will be 0,0
return Float.valueOf(result);
}
}

0 comments on commit ea81835

Please sign in to comment.