Skip to content

Instantly share code, notes, and snippets.

😄
Working

JohnWatsonDev johnwatsondev

😄
Working
Block or report user

Report or block johnwatsondev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@johnwatsondev
johnwatsondev / README.md
Created Mar 15, 2019 — forked from lopspower/README.md
Hexadecimal color code for transparency
View README.md

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@johnwatsondev
johnwatsondev / Root phone and install Gapp.md
Last active Feb 11, 2019
Root phone and install Gapp
View Root phone and install Gapp.md

Software

  1. TWRP --- Recovery

Install TWRP

adb reboot bootloader

fastboot flash recovery twrp-3.2.3-0-hammerhead.img
@johnwatsondev
johnwatsondev / DividerItemDecoration.java
Last active Sep 6, 2019
Customizing the DividerItemDecoration class so we can remove divider / decorator after the last item
View DividerItemDecoration.java
/*
* Copyright (C) 2016 The Android Open Source Project
*
* 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
@johnwatsondev
johnwatsondev / build.gradle
Created Apr 11, 2018 — forked from jpardogo/build.gradle
Gradle DependecyResolution
View build.gradle
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
boolean isMultidex = details.requested.name.contains('multidex')
if (details.requested.group == 'com.android.support' && !isMultidex){
details.useVersion lib_versions.support
}else if(isMultidex){
details.useVersion lib_versions.multidex
}
}
@johnwatsondev
johnwatsondev / jetbrain.sh
Created Mar 13, 2018
set jet brain server locally
View jetbrain.sh
#!/bin/sh
echo 'start jetbrain local server...'
cd '/DevelopPrograms/IntelliJIDEALicenseServer' && screen -dmS IntelliJIDEALicenseServer -d -m ./IntelliJIDEALicenseServer_darwin_amd64 -p 1024 -u johnwatsondev
@johnwatsondev
johnwatsondev / EqualSpacingItemDecoration.java
Created Dec 26, 2017 — forked from alexfu/EqualSpacingItemDecoration.java
Add equal spacing to RecyclerView items automatically. Can handle horizontal, vertical, and grid display modes
View EqualSpacingItemDecoration.java
import android.graphics.Rect;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
public class EqualSpacingItemDecoration extends RecyclerView.ItemDecoration {
private final int spacing;
private int displayMode;
public static final int HORIZONTAL = 0;
@johnwatsondev
johnwatsondev / SpanningGridLayoutManager.java
Created Dec 26, 2017 — forked from heinrichreimer/SpanningGridLayoutManager.java
GridLayoutManager implementation that stretches to fit all grid items on screen and disables scrolling. Useful for dashboards etc.
View SpanningGridLayoutManager.java
package com.example;
import android.content.Context;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.ViewGroup;
public class SpanningGridLayoutManager extends GridLayoutManager {
@johnwatsondev
johnwatsondev / SpanningLinearLayoutManager.java
Created Dec 26, 2017 — forked from heinrichreimer/SpanningLinearLayoutManager.java
LinearLayoutManager implementation that stretches to fit all list items on screen and disables scrolling. Useful for dashboards etc.
View SpanningLinearLayoutManager.java
package de.wilhelmgym.quiz.recyclerview;
import android.content.Context;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.ViewGroup;
public class SpanningLinearLayoutManager extends LinearLayoutManager {
View java.util.zip.ZipException: duplicate entry.md
$ ./gradlew clean installDebug --stacktrace --info | grep CredentialProvider.class

addJar(.../android/app/libs/aliyun-oss-sdk-android-2.3.0.jar): entry com/alibaba/sdk/android/common/auth/CredentialProvider.class
addJar(.../node_modules/react-native-api-sdk-rn/android/build/intermediates/bundles/default/libs/aliyun-oss-sdk-android-2.3.0.jar): entry com/alibaba/sdk/android/common/auth/CredentialProvider.class

Caused by: com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/alibaba/sdk/android/common/auth/CredentialProvider.class
You can’t perform that action at this time.