Skip to content

Instantly share code, notes, and snippets.

JNIEXPORT jobject JNICALL Java_com_example_yourapp_CvUtil_processMat(
JNIEnv * env, jclass cls, jlong mat_addr, jfloat threshold) {
android {
...
sourceSets {
main {
jni.srcDirs = []
}
}
}
<VirtualHost *:80>
ServerName kyouko.net
Redirect / https://kyouko.net
...
</VirtualHost>
HeartBeatAnimationUtil.with(mImageLogo).start();
HeartBeatAnimationUtil.with(mImageLogo)
.scaleFrom(1.0f)
.scaleTo(0.8f)
.in(100)
.after(1200)
.start();
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.PropertyValuesHolder;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;
/**
* An utility class for playing "heart beat" animation on a certain view object.
*/
PropertyValuesHolder pvhIncreaseScaleX =
PropertyValuesHolder.ofFloat("scaleX", 1.0f, 0.8f);
PropertyValuesHolder pvhIncreaseScaleY =
PropertyValuesHolder.ofFloat("scaleY", 1.0f, 0.8f);
PropertyValuesHolder pvhDecreaseScaleX =
PropertyValuesHolder.ofFloat("scaleX", 0.8f, 1.0f);
PropertyValuesHolder pvhDecreaseScaleY =
PropertyValuesHolder.ofFloat("scaleY", 0.8f, 1.0f);
ObjectAnimator heartBeatIncreaseAnimator = ObjectAnimator.ofPropertyValuesHolder(
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:ordering="sequentially"
android:interpolator="@android:interpolator/accelerate_decelerate">
<set>
<objectAnimator
android:propertyName="scaleX"
android:valueFrom="1.0"
android:valueTo="0.8"
android:duration="100" />
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:interpolator/accelerate_decelerate"
android:ordering="sequentially"
android:repeatCount="infinite">
<scale
android:startOffset="1200"
android:duration="100"
android:pivotX="50%"
<set
xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:interpolator/accelerate_decelerate">
<scale
android:duration="100"
android:pivotX="50%"
android:pivotY="50%"
android:fromXScale="1.0"
android:fromYScale="1.0"
@beta
beta / BottomSheetDialog.java
Last active August 18, 2016 08:01
android/support/design/widget/BottomSheetDialog.java of Android Design Support Library 23.4.0
private View wrapInBottomSheet(int layoutResId, View view, ViewGroup.LayoutParams params) {
final CoordinatorLayout coordinator = (CoordinatorLayout) View.inflate(getContext(),
R.layout.design_bottom_sheet_dialog, null);
if (layoutResId != 0 && view == null) {
view = getLayoutInflater().inflate(layoutResId, coordinator, false);
}
FrameLayout bottomSheet = (FrameLayout) coordinator.findViewById(R.id.design_bottom_sheet);
BottomSheetBehavior.from(bottomSheet).setBottomSheetCallback(mBottomSheetCallback);
if (params == null) {
bottomSheet.addView(view);