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.wandoujia.jupiter.util; | |
import android.content.Context; | |
import android.content.SharedPreferences; | |
import android.content.pm.ApplicationInfo; | |
import android.content.pm.PackageManager; | |
import android.os.Build; | |
import java.io.File; | |
import java.io.IOException; |
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.netease.cc.dhsdkcore.utils; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.net.ConnectivityManager; | |
import android.net.NetworkInfo; | |
import android.support.v4.content.LocalBroadcastManager; | |
import android.widget.Toast; |
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
/** | |
* H 色相 就是指颜色 | |
* S 饱和度 0 - 1取值 | |
* V 亮度 0 - 1 | |
* / | |
private static int darkenColor(int color) { | |
float[] hsv = new float[3]; | |
Color.colorToHSV(color, hsv); | |
hsv[2] *= 0.9f; |
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.netease.cc.dhsdkcore.widget; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; |
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.netease.cc.dhsdkcore.widget; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapShader; | |
import android.graphics.Canvas; | |
import android.graphics.Matrix; | |
import android.graphics.Paint; | |
import android.graphics.RectF; |
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" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
<solid android:color="@color/mgsdk__color_e9303d" /> | |
<corners android:radius="15dp" /> | |
</shape> |
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
task buildJar(type: Copy){ | |
//先删除以前的jar包 | |
delete 'build/libs/***.jar' | |
from('build/intermediates/bundles/release/') | |
into('build/libs/') | |
include('classes.jar') | |
rename ('classes.jar', '***.jar') | |
} | |
// | |
buildJar.dependsOn(build) |
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
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Rect; | |
import android.graphics.drawable.Drawable; | |
import android.text.style.ImageSpan; | |
/** | |
* 垂直居中的ImageSpan | |
* | |
*/ |
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
1.git config http.postBuffer 524288000 | |
2.可能是授权导致的问题,直接用 ssh 的路径clone |
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
Paint.FontMetrics fontMetrics = mTextPaint.getFontMetrics(); | |
float textWidth = mTextPaint.measureText(mText); | |
float textCenterVerticalBaselineY = mButton.getHeight() / 2 - fontMetrics.descent + (fontMetrics.bottom - fontMetrics.top) / 2; | |
canvas.drawText(mText,mButton.getWidth() / 2 - textWidth / 2,textCenterVerticalBaselineY,mTextPaint); |