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
package com.example.marcin.splitlayout; | |
import android.annotation.TargetApi; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Region; |
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
import com.android.volley.AuthFailureError; | |
import com.android.volley.NetworkResponse; | |
import com.android.volley.Request; | |
import com.android.volley.Response; | |
import com.android.volley.VolleyLog; | |
import com.android.volley.toolbox.HttpHeaderParser; | |
import com.google.gson.Gson; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.reflect.TypeToken; |
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
// Dagger 1 example | |
@Module( | |
complete = false, | |
library = true | |
) | |
public final class ApiModule { | |
@Provides | |
@Singleton | |
Retrofit provideRetrofit(Gson gson, Application app) { | |
return new Retrofit.Builder() |
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 class LollipopBitmapMemoryCacheParamsSupplier implements Supplier<MemoryCacheParams> { | |
private ActivityManager activityManager; | |
public LollipopBitmapMemoryCacheParamsSupplier(ActivityManager activityManager) { | |
this.activityManager = activityManager; | |
} | |
@Override | |
public MemoryCacheParams get() { |
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
// | |
// Created by Vipul Asri on 02/04/17. | |
// | |
#include <jni.h> | |
extern "C" { | |
JNIEXPORT jstring JNICALL | |
Java_com_squareboat_secretkeys_MainActivity_getAPIKey(JNIEnv *env, jobject instance) { |
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
# Sets the minimum version of CMake required to build your native library. | |
# This ensures that a certain set of CMake features is available to | |
# your build. | |
cmake_minimum_required(VERSION 3.4.1) | |
# Specifies a library name, specifies whether the library is STATIC or | |
# SHARED, and provides relative paths to the source code. You can | |
# define multiple libraries by adding multiple add.library() commands, | |
# and CMake builds them for you. When you build your app, Gradle |
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
@BindView(R.id.image_progress) | |
AppCompatImageView mLoadingProgress; | |
private AnimatedVectorDrawableCompat mAVD = AnimatedVectorDrawableCompat.create(getContext(), R.drawable.avd_spectrum_logo); | |
if (mLoadingProgress != null && mAVD != null) { | |
mLoadingProgress.setImageDrawable(mAVD); | |
mAVD.start(); | |
mAVD.registerAnimationCallback(new Animatable2Compat.AnimationCallback() { |
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
import 'package:flutter/widgets.dart'; | |
class CustomTabIndicator extends Decoration { | |
@override | |
BoxPainter createBoxPainter([VoidCallback onChanged]) { | |
// TODO: implement createBoxPainter | |
} | |
} |
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
import 'package:flutter/widgets.dart'; | |
import 'package:flutter/material.dart'; | |
class CustomTabIndicator extends Decoration { | |
@override | |
_CustomPainter createBoxPainter([VoidCallback onChanged]) { | |
return new _CustomPainter(this, onChanged); | |
} |
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
//In this, we will create a variable to hold [indicatorHeight] i.e 15.0 | |
//Now, we will create a new offset to set the x-axis position of tab according to the TabIndicatorSize i.e label or tab start. | |
//And set the y-axis to tab height center position and subtracting the value of indicatorHeight center value. | |
final Rect rect = Offset(offset.dx, (configuration.size.height/2) - indicatorHeight/2) & Size(configuration.size.width, indicatorHeight); |
OlderNewer