Skip to content

Instantly share code, notes, and snippets.

@b3er
b3er / Main.kt
Created September 5, 2018 17:18
/*
[GameCard
{
GameSet{ set: 4 0 3, size: 7 }
GameSet{ set: 3 1 2, size: 6 }
GameSet{ set: 1 4 0, size: 5 }
},
GameCard
{
GameSet{ set: 0 4 2, size: 6 }
@b3er
b3er / ApiExtensions.kt
Created April 22, 2016 10:51
Spek friday lunch madness
package org.jetbrains.spek.api
import java.util.*
import kotlin.reflect.*
import kotlin.test.assertEquals
import kotlin.test.assertTrue
/**
* Created by b3er on 22/04/16.
* (c) b3er 2016
package tiny.lib.views.widgets;
import android.content.Context;
import android.content.res.TypedArray;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import tiny.lib.views.recycler.ExRecyclerView;
public class AutoFitRecyclerView extends ExRecyclerView {
ActivityManagerNativeRef
.bindService(new IApplicationThread() {
@Override
public IBinder asBinder() {
return caller;
}
}, new Intent("android.bluetooth.IBluetoothHeadset"),
new IServiceConnection.Stub() {
@Override
public void connected(ComponentName name, IBinder service)
package fahrbot.apps.ditalix.free.ui.widget;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Parcel;
import android.os.Parcelable;
import android.preference.Preference;
import android.view.View;
import android.view.ViewGroup;
private void handleDrag(MotionEvent event) {
try {
if (mDraggingViewImage != null) {
if (mLayoutParams == null) {
mLayoutParams = new WindowManager.LayoutParams(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT,
WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE |
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
}
mLayoutParams.height = WindowManager.LayoutParams.WRAP_CONTENT;
public static void writeToStream(OutputStream stream) {
try {
String data = toJSON(ExFactory.getString(R.string.prefPasswordHash)).toString();
stream.write(data.getBytes("UTF-8"));
} catch (Exception e) {
L.e("Config.writeToStream()", e);
}
}
private static JSONObject toJSON(String... excludes) {
public class AppWidgetInfoRenderer extends Renderers.GenericCachedRenderer<AppWidgetProviderInfo> {
private static final String TAG = "AppWidgetInfoRenderer";
/* From IRenderer */
@Override
public View inflateView(@NotNull IExAdapter<AppWidgetProviderInfo> adapter,
AppWidgetProviderInfo item, @Nullable ViewGroup root, int type) {
return new ViewHolder(adapter.getLayoutInflater(root).inflate(R.layout.app_widget_info_item, root, false)).root;
}
package org.b3er.mywiki.ui.widgets;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.FrameLayout;
import tiny.lib.misc.compat.v11.view.ViewHelper;
import tiny.lib.misc.compat.v11.view.ViewPropertyAnimator;
public class Tile extends FrameLayout {
package fahrbot.apps.calculator.ui.widget;
import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import tiny.lib.log.L;
import tiny.lib.misc.ExFactory;
import tiny.lib.misc.app.IRenderer;