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
private void setNavigationItemSelectedListener(final BottomNavigationView.OnNavigationItemSelectedListener listener) { | |
BottomNavigationMenuView menuView = (BottomNavigationMenuView) mBinding.bottomNavi.getChildAt(0); | |
for (int i = 0; i < menuView.getChildCount(); i++) { | |
final BottomNavigationItemView itemView = (BottomNavigationItemView) menuView.getChildAt(i); | |
// Labels are re-used from a pool, if you have global freeze text enabled, this causes state problems | |
((TextView) itemView.findViewById(android.support.design.R.id.smallLabel)).setFreezesText(false); | |
((TextView) itemView.findViewById(android.support.design.R.id.largeLabel)).setFreezesText(false); | |
// Workaround for BottomNavigationMenu bug where it selects the item even if the listener returns false |
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
// http://matsuhilog.blogspot.jp/2013/05/performance-analytics-in-android.html | |
// https://code.google.com/p/codenameone/issues/detail?id=294 | |
public static String getDefaultUserAgent(Context context) { | |
String ua; | |
if (Build.VERSION.SDK_INT >= 17) { | |
ua = Util.getDefaultUserAgent(context); | |
} else if (Build.VERSION.SDK_INT >= 16) { | |
ua = Util.getUserAgent(context); | |
} else { | |
try { |
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 vn.mclab.babyoto.utils; | |
import android.content.Context; | |
import android.content.res.Configuration; | |
import android.content.res.Resources; | |
import android.os.Build; | |
import java.util.Locale; | |
import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper; |
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 jp.co.permission.movielike.custom.view; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.text.Layout; | |
import android.text.Layout.Alignment; | |
import android.text.StaticLayout; | |
import android.text.TextUtils.TruncateAt; | |
import android.util.AttributeSet; | |
import android.widget.TextView; |
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 static boolean rajDhaniSuperFastUnzip(String inputZipFile, String destinationDirectory) | |
{ | |
try { | |
int BUFFER = 2048; | |
List<String> zipFiles = new ArrayList<String>(); | |
File sourceZipFile = new File(inputZipFile); | |
File unzipDestinationDirectory = new File(destinationDirectory); | |
unzipDestinationDirectory.mkdir(); | |
ZipFile zipFile; | |
zipFile = new ZipFile(sourceZipFile, ZipFile.OPEN_READ); |
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 static String readKernelVersion() { | |
try { | |
Process p = Runtime.getRuntime().exec("uname -s -m", null, null); | |
InputStream is = null; | |
if (p.waitFor() == 0) { | |
is = p.getInputStream(); | |
} else { | |
is = p.getErrorStream(); | |
} |