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
/** JSAPI支付 */ | |
public JSONObject jsPay() { | |
JSONObject obj = new JSONObject(); | |
WeixinMpAccount weixinAccount = JSON.parseObject( | |
ConfigUtil.getValue("account"), WeixinMpAccount.class); | |
// V3 支付 | |
PayPackage payPackage = new PayPackageV3(weixinAccount, "用户openid", | |
"商品描述", "系统内部订单号", 1d, "IP地址", TradeType.JSAPI); | |
// V2 支付 |
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
提示:默认情况下,当您将 EditText 元素设置为使用 "textPassword" 输入类型时,字体系列将设置为固定宽度。因此,您应该将其字体系列更改为 "sans-serif",以便两个文本字段都使用匹配的字体样式。 | |
``` | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content"> | |
<ImageView | |
android:src="@drawable/header_logo" | |
android:layout_width="match_parent" |
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
/** | |
* On Lollipop+ perform a circular reveal animation (an expanding circular mask) when showing | |
* the search panel. | |
*/ | |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | |
private void doEnterAnim() { | |
// Fade in a background scrim as this is a floating window. We could have used a | |
// translucent window background but this approach allows us to turn off window animation & | |
// overlap the fade with the reveal animation – making it feel snappier. | |
View scrim = findViewById(R.id.scrim); |
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
class FileSplit { | |
public static void splitFile(File f) throws IOException { | |
int partCounter = 1;//I like to name parts from 001, 002, 003, ... | |
//you can change it to 0 if you want 000, 001, ... | |
int sizeOfFiles = 1024 * 1024;// 1MB | |
byte[] buffer = new byte[sizeOfFiles]; | |
try (BufferedInputStream bis = new BufferedInputStream( | |
new FileInputStream(f))) {//try-with-resources to ensure closing stream |
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
public static void start(Activity context, BooksBean positionData, ImageView imageView) { | |
Intent intent = new Intent(context, BookDetailActivity.class); | |
intent.putExtra(EXTRA_PARAM, positionData); | |
ActivityOptionsCompat options = | |
ActivityOptionsCompat.makeSceneTransitionAnimation(context, | |
imageView, CommonUtils.getString(R.string.transition_book_img));//与xml文件对应 | |
ActivityCompat.startActivity(context, intent, options.toBundle()); | |
} |
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
public static void start(Activity context, BooksBean positionData, ImageView imageView) { | |
Intent intent = new Intent(context, BookDetailActivity.class); | |
intent.putExtra(EXTRA_PARAM, positionData); | |
ActivityOptionsCompat options = | |
ActivityOptionsCompat.makeSceneTransitionAnimation(context, | |
imageView, CommonUtils.getString(R.string.transition_book_img));//与xml文件对应 | |
ActivityCompat.startActivity(context, intent, options.toBundle()); | |
} | |
RxBus.getDefault().toObservable(RxCodeConstants.JUMP_TYPE_TO_ONE, RxBusBaseMessage.class) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<me.relex.photodraweeview.PhotoDraweeView xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/iv_gallery_photo" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
app:fadeDuration="1000" | |
app:failureImage="@drawable/works_list_default_img" | |
app:failureImageScaleType="centerInside" | |
app:placeholderImage="@drawable/loading_everyday" |
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
getWindow().setBackgroundDrawable(new ColorDrawable(0)); | |
try { | |
getWindow().getDecorView().setBackgroundDrawable(null); | |
} catch (Throwable e){ | |
} |
OlderNewer