1.添加库Calligraphy
dependencies {
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
}
2.添加字体文件到assets/fonts/
路径
fonts/RobotoSlab-Thin.ttf
WP
dependencies {
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
}
assets/fonts/
路径fonts/RobotoSlab-Thin.ttf
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Window window = MyActivity.this.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(ContextCompat.getColor(MyActivity.this, R.color.colorPrimaryDark));
}
public Bitmap fastblur(Context context, Bitmap sentBitmap, int radius) {
Bitmap bitmap = sentBitmap.copy(sentBitmap.getConfig(), true);
if (radius < 1) {
return (null);
}
int w = bitmap.getWidth();
int h = bitmap.getHeight();
int[] pix = new int[w * h];
bitmap.getPixels(pix, 0, w, 0, 0, w, h);
int wm = w - 1;
int hm = h - 1;
int wh = w * h;
int div = radius + radius + 1;
int r[] = new int[wh];
int g[] = new int[wh];
int b[] = new int[wh];
int rsum, gsum, bsum, x, y, i, p, yp, yi, yw;
int vmin[] = new int[Math.max(w, h)];
int divsum = (div + 1) >> 1;
divsum *= divsum;
int temp = 256 * divsum;
int dv[] = new int[temp];
for (i = 0; i < temp; i++) {
dv[i] = (i / divsum);
}
在http://windows.github.com/下载的GitHub客户端安装程序可能出现安装错误,日志显示 http://github-windows.s3.amazonaws.com/GitHub.application 无法下载。用Internet Explorer无法访问此地址,用其它浏览器下载打开后无法部署(提示错误,详细信息显示
DeploymentDownloadException
或InvalidDeploymentException
异常)。
WebView webView = (WebView)findViewById(R.id.webview);
// setting WebViewClient
webView.setWebViewClient(new DemoWebViewClient());
webView.getSettings().setDomStorageEnabled(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.loadUrl("https://github.com");
Android Studio菜单Build->Generate Signed APK,安装到设备之后程序崩溃
java.util.MissingResourceException
Can't find resource for bundle 'org.ocpsoft.prettytime.i18n.Resources_zh_CN', key ''
java.util.ResourceBundle.missingResourceException(ResourceBundle.java:238)
java.util.ResourceBundle.getBundle(ResourceBundle.java:230)
java.util.ResourceBundle.getBundle(ResourceBundle.java:159)
b.a.a.b.b.b(Unknown Source)
b.a.a.b.b.a(Unknown Source)
b.a.a.c.a(Unknown Source)
b.a.a.c.a(Unknown Source)
b.a.a.c.b(Unknown Source)
b.a.a.c.<init>(Unknown Source)
com.way.heard.e.j.a(Unknown Source)
com.way.heard.a.u.a(Unknown Source)
com.way.heard.a.u.a(Unknown Source)
android.support.v7.widget.eb.a(Unknown Source)
android.support.v7.widget.eb.b(Unknown Source)
android.support.v7.widget.es.a(Unknown Source)
android.support.v7.widget.es.c(Unknown Source)
android.support.v7.widget.cy.a(Unknown Source)
android.support.v7.widget.LinearLayoutManager.a(Unknown Source)
android.support.v7.widget.LinearLayoutManager.a(Unknown Source)
android.support.v7.widget.LinearLayoutManager.c(Unknown Source)
android.support.v7.widget.RecyclerView.G(Unknown Source)
android.support.v7.widget.RecyclerView.k(Unknown Source)
android.support.v7.widget.RecyclerView.onLayout(Unknown Source)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.support.v4.widget.SwipeRefreshLayout.onLayout(Unknown Source)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
android.widget.FrameLayout.onLayout(FrameLayout.java:273)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
android.widget.FrameLayout.onLayout(FrameLayout.java:273)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.support.design.widget.CoordinatorLayout.c(Unknown Source)
android.support.design.widget.CoordinatorLayout.a(Unknown Source)
android.support.design.widget.dh.a(Unknown Source)
android.support.design.widget.AppBarLayout$ScrollingViewBehavior.a(Unknown Source)
android.support.design.widget.CoordinatorLayout.onLayout(Unknown Source)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.support.v4.widget.DrawerLayout.onLayout(Unknown Source)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
android.widget.FrameLayout.onLayout(FrameLayout.java:273)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
android.widget.FrameLayout.onLayout(FrameLayout.java:273)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
android.widget.FrameLayout.onLayout(FrameLayout.java:273)
com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2728)
android.view.View.layout(View.java:16727)
android.view.ViewGroup.layout(ViewGroup.java:5452)
android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2288)
android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2025)
android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1174)
android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6241)
android.view.Choreographer$CallbackRecord.run(Choreographer.java:873)
android.view.Choreographer.doCallbacks(Choreographer.java:676)
android.view.Choreographer.doFrame(Choreographer.java:606)
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:859)
android.os.Handler.handleCallback(Handler.java:739)
android.os.Handler.dispatchMessage(Handler.java:95)
android.os.Looper.loop(Looper.java:168)
android.app.ActivityThread.main(ActivityThread.java:5845)
java.lang.reflect.Method.invoke(Native Method)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
解决办法为在proguard-rules文件中添加
-keep class org.ocpsoft.prettytime.i18n.**
EditText控件添加属性
android:singleLine="true"
弹出的软盘输入法中回车键为next,直到最后一个获取焦点后显示为Done,点击Done后,软盘输入键盘便隐藏。
etTitle.setOnKeyListener(newView.OnKeyListener() {
@Override
public booleanonKey(View v, intkeyCode,KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_ENTER) {
LogUtil.d(TAG,"initView debug, OnKeyListener, KEYCODE_ENTER");
InputMethodManager imm = (InputMethodManager) v.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
if(imm.isActive()) {
imm.hideSoftInputFromWindow(v.getApplicationWindowToken(),0);
}
return true;
}
return false;
}
});
I’m not a developer or designer. And I don’t add footer to show who did this theme. If you like this theme or using it, please give a star for motivation, It makes me happy.
_config.yml
file._posts
folder and add yours.index.md
file in about
folder.YourUserName.github.io
That’s all.
Video embeds are responsive and scale with the width of the main content block with the help of FitVids.