This file contains hidden or 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
| int x = targetView.getTop() + targetView.getWidth() / 2; | |
| int y = targetView.getTop() + targetView.getHeight() / 2; | |
| int fromX = sourceView.getTop() + sourceView.getWidth() / 2; | |
| int fromY = sourceView.getTop() + sourceView.getHeight() / 2; | |
| final int dx = x - fromX; | |
| final int dy = y - fromY; |
This file contains hidden or 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 android.content.Context; | |
| import android.util.Log; | |
| public class Logger { | |
| private static final boolean shouldLog = true; | |
| public static void i(String tag, String msg) { |
This file contains hidden or 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
| LocalActivityManager mgr = getLocalActivityManager(); | |
| Intent i = new Intent(this, SomeActivity.class); | |
| Window w = mgr.startActivity("unique_per_activity_string", i); | |
| View wd = w != null ? w.getDecorView() : null; | |
| if(wd != null) { | |
| mSomeContainer.addView(wd); | |
| } |
This file contains hidden or 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.firebase.utils; | |
| import java.util.Date; | |
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the | |
| * following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't |
This file contains hidden or 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 android.content.Context; | |
| import android.graphics.Typeface; | |
| import android.support.v4.view.PagerAdapter; | |
| import android.support.v4.view.ViewPager; | |
| import android.util.AttributeSet; | |
| import android.util.SparseArray; | |
| import android.util.TypedValue; | |
| import android.view.Gravity; | |
| import android.view.LayoutInflater; |
This file contains hidden or 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.vaibhav.testingapp; | |
| import android.graphics.drawable.ColorDrawable; | |
| import android.support.v7.widget.Toolbar; | |
| import android.view.Menu; | |
| import android.view.animation.AccelerateInterpolator; | |
| import android.view.animation.DecelerateInterpolator; | |
| import com.utils.Logger; | |
| import com.utils.PixelUtils; |
This file contains hidden or 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
| // File Name GreetingClient.java | |
| import java.io.DataInputStream; | |
| import java.io.DataOutputStream; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.OutputStream; | |
| import java.net.Socket; | |
| import java.util.Scanner; |
This file contains hidden or 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 ui.animation; | |
| import android.util.Log; | |
| import android.view.View; | |
| import android.view.animation.Animation; | |
| import android.view.animation.Transformation; | |
| public class CircularPropertyAnimation extends Animation { | |
| private float startAngle = 90; |
This file contains hidden or 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 android.content.Context; | |
| import android.content.SharedPreferences; | |
| import android.support.annotation.NonNull; | |
| import android.support.annotation.Nullable; | |
| import android.util.Log; | |
| import java.lang.reflect.Field; | |
| import java.util.Set; | |
| import java.util.prefs.AbstractPreferences; |
This file contains hidden or 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
| /** | |
| * Warning, this gives a false sense of security. If an attacker has enough access to | |
| * acquire your password store, then he almost certainly has enough access to acquire your | |
| * source binary and figure out your encryption key. However, it will prevent casual | |
| * investigators from acquiring passwords, and thereby may prevent undesired negative | |
| * publicity. | |
| */ | |
| public class ObscuredSharedPreferences implements SharedPreferences { | |
| protected static final String UTF8 = "utf-8"; | |
| private static final char[] SEKRIT = ... ; // INSERT A RANDOM PASSWORD HERE. |