This file contains 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
/* | |
* Copyright 2017 Google Inc. | |
* | |
* 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 |
This file contains 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
#build.gradle | |
# | |
# compile 'io.reactivex:rxandroid:1.0.1' | |
# compile 'io.reactivex:rxjava:1.0.14' | |
# compile 'io.reactivex:rxjava-math:1.0.0' | |
# compile 'com.jakewharton.rxbinding:rxbinding:0.2.0' | |
# rxjava | |
-keep class rx.schedulers.Schedulers { | |
public static <methods>; |
This file contains 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
/** | |
* 比较两个版本。 0 :两个版本相等; 1 : version1 > version2; -1 : version1 < version2 | |
* 仅适用于由数字和 "." 符号构成的版本号字符串。 对应正则规则 \d+(\.\d+)+ | |
* 如果 version1 和 version 2 均为 empty 返回0 , 否则 empty 恒小于任意字符串。 | |
*/ | |
private static int compareVersionString(String version1, String version2) { | |
if(StringUtils.isEmpty(version1)) { | |
if(StringUtils.isEmpty(version2)){ | |
return 0; | |
} else { |
This file contains 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
// status bar height | |
int statusBarHeight = 0; | |
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
statusBarHeight = getResources().getDimensionPixelSize(resourceId); | |
} | |
// action bar height | |
int actionBarHeight = 0; | |
final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes( |
This file contains 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 org.apache.tools.ant.taskdefs.condition.Os | |
def getPlatformNdkBuildCommand() { | |
def rootDir = project.rootDir | |
def localProperties = new File(rootDir, "local.properties") | |
if (localProperties.exists()) { | |
Properties properties = new Properties() | |
localProperties.withInputStream { | |
instr -> properties.load(instr) | |
} |
This file contains 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
/* | |
* 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 |
This file contains 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
<!-- You can change the parent around to whatever you normally use --> | |
<style name="DebugColors" parent="Theme.AppCompat"> | |
<!-- System colors --> | |
<item name="android:windowBackground">@color/__debugWindowBackground</item> | |
<item name="android:colorPressedHighlight">#FF4400</item> | |
<item name="android:colorLongPressedHighlight">#FF0044</item> | |
<item name="android:colorFocusedHighlight">#44FF00</item> | |
<item name="android:colorActivatedHighlight">#00FF44</item> |
This file contains 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
ImageView imageView = (ImageView) findViewById(R.id.card_thumbnail_image); | |
Bitmap mBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.rose); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP){ | |
//Default | |
imageView.setBackgroundResource(R.drawable.rose); | |
} else { | |
//RoundCorners | |
RoundCornersDrawable round = new RoundCornersDrawable(mBitmap, | |
getResources().getDimension(R.dimen.cardview_default_radius), 0); //or your custom radius |
This file contains 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.aracem.utils.animations.pagetransformation; | |
import org.jetbrains.annotations.NotNull; | |
import android.support.v4.view.ViewPager; | |
import android.view.View; | |
import java.util.ArrayList; | |
import java.util.List; |
This file contains 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
/* | |
* Copyright (C) 2014 The Android Open Source Project | |
* | |
* 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 |
NewerOlder