Important:
- Use
R.layout.ben_toolbar_simple_title
if you have menu items in layout, or doesn't have any buttons at all - Use
R.layout.ben_toolbar_margin_title
if you have only one button in left corner (it could be back button for e.g)
Android Swipe Refresh |
/* | |
* Copyright 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
/* | |
* Copyright (C) 2014 Chris Banes | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
TextView txt = (TextView) findViewById(R.id.custom_fonts); | |
txt.setTextSize(30); | |
Typeface font = Typeface.createFromAsset(getAssets(), "Akshar.ttf"); | |
Typeface font2 = Typeface.createFromAsset(getAssets(), "bangla.ttf"); | |
SpannableStringBuilder SS = new SpannableStringBuilder("আমারநல்வரவு"); | |
SS.setSpan (new CustomTypefaceSpan("", font2), 0, 4,Spanned.SPAN_EXCLUSIVE_INCLUSIVE); | |
SS.setSpan (new CustomTypefaceSpan("", font), 4, 11,Spanned.SPAN_EXCLUSIVE_INCLUSIVE); | |
txt.setText(SS); |
/** | |
* Created by Yakiv M. on 24.07.14. | |
*/ | |
import android.content.Context; | |
import android.database.DataSetObservable; | |
import android.database.DataSetObserver; | |
import android.os.Build; | |
import android.util.AttributeSet; |
Android Adapters
If you haven't already set your NPM author info, now you should:
npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"
npm adduser
if (BuildConfig.DEBUG) { | |
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() | |
.detectCustomSlowCalls() | |
.detectDiskReads() | |
.detectDiskWrites() | |
.detectNetwork() | |
.penaltyLog() | |
.build()); | |
StrictMode.VmPolicy.Builder vmPolicy = new StrictMode.VmPolicy.Builder() |
private val keyguardManager: KeyguardManager | |
init { | |
keyguardManager = context.getSystemService(Context.KEYGUARD_SERVICE) as KeyguardManager | |
} | |
fun isDeviceSecure(): Boolean = if (hasMarshmallow()) keyguardManager.isDeviceSecure else keyguardManager.isKeyguardSecure | |
// Used to block application if no lock screen is setup. | |
fun showDeviceSecurityAlert(): AlertDialog { |