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
1.create google app (google console) | |
Example: | |
Client ID xxx.apps.googleusercontent.com | |
Email address xxx@developer.gserviceaccount.com | |
Client secret xxx | |
Redirect URIs | |
https://localhost/oauth2callback | |
Javascript Origins | |
https://localhost |
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
private String decodeBody(Response response) throws IOException { | |
final ResponseBody body = response.body(); | |
if (body == null) return null; | |
if (isZipped(response)) { | |
return unzip(response.body()); | |
} else { | |
return body.string(); | |
} | |
} |
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
Google devices info: | |
https://design.google.com/devices/ | |
===================== PHONES ====================== | |
Nexus S: | |
{1.0 0mcc0mnc en_US sw320dp w320dp h460dp nrml port finger qwerty/v/v dpad/v s.4} | |
Nexus 4: xhdpi | |
{1.0 310mcc?mnc en_US ldltr sw384dp w384dp h567dp 320dpi nrml port finger -keyb/v/h -nav/h s.5} |
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; | |
import java.lang.annotation.Retention; | |
import javax.inject.Inject; | |
import javax.inject.Scope; | |
import javax.inject.Singleton; | |
import dagger.Binds; | |
import dagger.BindsInstance; |
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
gradlew :app:dependencyInsight --configuration testCompile --dependency kotlin-reflect | |
gradlew :tapp:dependencyInsight --configuration appDebugCompileClasspath --dependency okhttp | |
Resolve all dependencies. Force gradle to precache dependencies for all configurations: | |
``` | |
allprojects { | |
task resolveAllDependencies { | |
doLast { | |
configurations.all { it.resolve() } | |
} |
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 io.wondrous.sns.utils; | |
import android.os.Handler; | |
import android.os.Looper; | |
import java.util.concurrent.atomic.AtomicBoolean; | |
import java.util.concurrent.atomic.AtomicLong; | |
public class MainThreadWatchDog { | |
public static final long MAIN_THREAD_PING_INTERVAL = 200; |
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
To make emulator looks crystal clear, easiest way - change window size to be exact size. | |
On linux there is command: | |
wmctrl -r "win" -e G,X,Y,W,H | |
G - gravity | |
X,Y - window coords | |
W - width | |
H - height | |
For 1280x800 window, command will be: |
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
Show traces: | |
$ repo --trace <command> | |
Upload for review with topic set to current branch name: | |
$ repo upload -t | |
or | |
review.URL.uploadtopic = true | |
Issues |
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
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); | |
int memoryClass = manager.getMemoryClass(); | |
48 - Samsung Nexus S | |
64 - Samsung Galaxy Nexus | |
Samsung S2 | |
Samsung S3 | |
128 - Samsung S4 |
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
/** | |
* Calculates correct item position based on RecyclerAdapter and ViewHolder adapter position. | |
* Takes in consideration RecyclerMergeAdapter and adjust position accordingly | |
* | |
* @param adapter RecyclerAdapter with access to RecyclerView instance | |
* @param viewHolder ViewHolder that was created by @adapter | |
* @return adjusted local position for viewHolder | |
*/ | |
public static int getLocalPosition(RecyclerAdapter adapter, RecyclerView.ViewHolder viewHolder) { | |
int position = viewHolder.getAdapterPosition(); |
NewerOlder