Skip to content

Instantly share code, notes, and snippets.

import android.content.Context;
import android.graphics.Bitmap;
import android.support.v4.util.LruCache;
import com.android.volley.Cache;
import com.android.volley.Network;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.BasicNetwork;
import com.android.volley.toolbox.DiskBasedCache;
import com.android.volley.toolbox.HurlStack;
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".MainActivity">
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
import android.text.TextUtils;
import android.util.Base64;
import android.util.SparseArray;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
final class ProfilePictureRequest extends ImageRequest {
private User mUser;
public ProfilePictureRequest(User user, String url,
Response.Listener<Bitmap> listener, int maxWidth,
int maxHeight, ImageView.ScaleType scaleType,
Bitmap.Config decodeConfig, Response.ErrorListener errorListener) {
super(url, listener, maxWidth, maxHeight, scaleType, decodeConfig, errorListener);
final class ProfilePictureLoader extends ImageLoader {
private User mUser;
public ProfilePictureLoader(User user, RequestQueue queue, ImageCache imageCache) {
super(queue, imageCache);
this.mUser = user;
}
12-20 13:24:14.237 1396-1433/? W/audio_hw_generic: Not supplying enough data to HAL, expected position 7779145 , only wrote 7626960
12-20 13:24:16.844 2311-2311/com.google.android.googlequicksearchbox:search I/MicroDetectionWorker: Micro detection mode: [mDetectionMode: [1]].
12-20 13:24:16.844 2311-2311/com.google.android.googlequicksearchbox:search I/AudioController: Using mInputStreamFactoryBuilder
12-20 13:24:16.856 2311-11788/com.google.android.googlequicksearchbox:search I/MicroRecognitionRunner: Starting detection.
12-20 13:24:16.858 2311-11773/com.google.android.googlequicksearchbox:search I/MicrophoneInputStream: mic_starting com.google.android.apps.gsa.staticplugins.z.c@fd154db
12-20 13:24:16.862 1396-11791/? I/AudioFlinger: AudioFlinger's thread 0xa9b03340 ready to run
12-20 13:24:16.883 1396-1780/? E/AudioFlinger: not enough memory for AudioTrack size=131296
12-20 13:24:16.884 1396-1780/? D/MemoryDealer: AudioTrack (0xb029cec0, size=4194304)
0:
This file has been truncated, but you can view the full file.
2:38.238 2122-2292/? I/PGServer: report state:6 event type:2 pid:0 uid:10225 pkg:com.vokal.dscout to pid: 1064
12-20 13:22:38.239 2122-2292/? I/ash: Unfreeze com.vokal.dscout OK !
12-20 13:22:38.241 1064-13047/? I/PGManagerService: proxyBroadcast:[com.vokal.dscout] proxy:false
12-20 13:22:38.242 2122-2292/? I/ash: unproxy com.vokal.dscout broadcast OK !
12-20 13:22:38.244 1064-1767/? I/GnssLocationProvider: setRequest ProviderRequest[OFF]
12-20 13:22:38.244 1064-1767/? I/GnssLocationProvider: stopNavigating, mStarted=false
12-20 13:22:38.250 2122-2292/? I/ash: unproxy app:com.vokal.dscout,uid:10225,result:true
12-20 13:22:38.250 2122-2292/? I/ash: perform running actions!
12-20 13:22:38.250 2122-2292/? I/ash: running package: com.vokal.dscout, visible: false
12-20 13:22:38.250 2122-2292/? I/ash: com.vokal.dscout send broadcast:Heartbeat notify package: com.vokal.dscout, pid: -1
12-20 14:27:38.602 2122-2302/? I/PGServer: report state:10000 event type:1 pid:0 uid:0 pkg:com.google.android.googlequicksearchbox to pid: 1064
12-20 14:27:38.602 2122-2302/? I/PGServer: report state:10000 event type:1 pid:0 uid:0 pkg:com.google.android.googlequicksearchbox to pid: 2122
12-20 14:27:38.603 2122-2302/? I/SceneReceiver: state type: 10000 eventType:1 pid:0 uid:0 pkg:com.google.android.googlequicksearchbox
12-20 14:27:38.603 1064-13043/? W/AudioEffectLowPowerTaskImpl: onStateChanged, stateType = 10000, eventType = 1, pid = 0, pkg = com.google.android.googlequicksearchbox, uid = 0
12-20 14:27:38.614 498-3278/? E/BufferQueueProducer: [com.google.android.googlequicksearchbox/com.google.android.apps.gsa.staticplugins.opa.OpaActivity] connect: already connected (cur=1 req=1)
12-20 14:27:38.615 7752-7752/? I/GoogleInputMethod: onFinishInput() : Dummy InputConnection bound
12-20 14:27:38.615 7752-7752/? I/GoogleInputMethod: onStartInput() : Dummy InputConnection bound
12-20 14:27:38.732 2122-2302/? I/PGS
@communikein
communikein / data_binding_include_main_layout.xml
Last active December 28, 2017 10:28
Main layout with data binding. It includes a secondary layout and pass to it a variable.
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:bind="http://schemas.android.com/apk/res-auto">
<data>
<variable
name="mainUser"
type="it.communikein.myunimib.User" />
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
<variable
name="secondaryUser"
type="it.communikein.myunimib.User" />
</data>