Skip to content

Instantly share code, notes, and snippets.

package dk.q8.mobileapp.ui;
import android.content.Context;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.CoordinatorLayout;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
public class FlingBehavior extends AppBarLayout.Behavior {
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
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"
android:id="@+id/fragment_qvikoffer_list_layout_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_base"
android:orientation="vertical">
package com.company.components;
import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.Paint;
import android.graphics.PixelFormat;
import android.graphics.Rect;
@flasher297
flasher297 / NotificationHelper.java
Created February 18, 2017 21:06 — forked from h4h13/NotificationHelper.java
Android Big Picture notification with picasso
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.NotificationCompat;
import com.squareup.picasso.Picasso;
import java.io.IOException;
@flasher297
flasher297 / googleMapMyLocation
Created December 19, 2016 16:27 — forked from Manabu-GT/googleMapMyLocation
Android - adjust google map's my location button
//HACK: Get the button view and place it on the bottom right (as Google Maps app)
View locationButton = ((View) mMapFragment.getView().findViewById(1).getParent()).findViewById(2);
RelativeLayout.LayoutParams rlp = (RelativeLayout.LayoutParams) locationButton.getLayoutParams();
rlp.addRule(RelativeLayout.ALIGN_PARENT_TOP, 0);
rlp.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
rlp.setMargins(0, 0, 30, 30);
private static final class Link
{
String data;
Link next = null;
Link(String o, Link n) {
data = o;
next = n;
}
@flasher297
flasher297 / RetrofitCachingExample.java
Created February 4, 2016 11:58 — forked from swankjesse/RetrofitCachingExample.java
Demonstrate HTTP caching with OkHttp and Retrofit.
/*
* Copyright (C) 2013 Square, 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
@flasher297
flasher297 / gitignore-android-studio-list
Created December 1, 2015 10:57 — forked from vtanathip/gitignore-android-studio-list
Git Ignore files list that should use in Android Studio Projects
# built application files
*.apk
*.ap_
# files for the dex VM
*.dex
# Java class files
*.class
@ECHO OFF
IF "%1"=="" GOTO MissingFileNameError
IF EXIST "%1" (GOTO ContinueProcessing) ELSE (GOTO FileDoesntExist)
:ContinueProcessing
set FileNameToProcess=%1
set FileNameForDx=%~n1.dex
IF "%~x1"==".dex" GOTO ProcessWithPowerShell
REM preprocess Jar with dx
import android.content.Context;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
public class OnSwipeTouchListener implements View.OnTouchListener
{
// -- Construction
public OnSwipeTouchListener(Context context) {