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
{ | |
"id": "1234567890", | |
"name": "Test Account", | |
"given_name": "Test", | |
"family_name": "Account", | |
"picture": "https://lh3.googleusercontent.com/a/ACg8ocIpcv1MzLhbBpbYw4rGqW_-Eb3xkhE8oV1d1S7Dlv9OTki6sQ=s96-c" | |
} |
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
class MyApplication : Application(){ | |
override fun onCreate() { | |
super.onCreate() | |
applyTheme() | |
} | |
private fun applyTheme() { | |
PreferenceManager.getDefaultSharedPreferences(this) | |
.getString(getString(R.string.key_app_theme), ThemeHelper.DEFAULT_MODE)?.apply { |
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 void delete(Page page) { | |
try { | |
deletePageAndAllReferences(page); | |
} | |
catch (Exception e) { | |
logError(e); | |
} | |
} | |
private void deletePageAndAllReferences(Page page) throws Exception { |
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
╔=============|=====================╗==============================================================================| | |
║ AppState |Notification ║ Data | Both | | |
╠════════=════|════════=============╣===================|==========================================================| | |
║ Foreground | onMessageReceived ║ onMessageReceived | onMessageReceived | | |
║ Background | System tray ║ onMessageReceived | Notification: system tray. Data: in extras of the intent | | |
╚════════════=╩════════=============|===================|==========================================================| |
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
/* | |
create a new circular reaveal on the give view. This view is initially invisible. In this case the view covers full screen | |
*/ | |
@TargetApi(Build.VERSION_CODES.LOLLIPOP) | |
private void createCircularReveal(final View view) { | |
// to get the center of FAB | |
int centerX = (int) mFab.getX() + mFab.getWidth() / 2; | |
int centerY = (int) mFab.getY(); | |
float finalRadius = (float) Math.hypot(view.getWidth(), view.getHeight()); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<explode xmlns:android="http://schemas.android.com/apk/res/android"> | |
<targets> | |
<target android:excludeId="@android:id/statusBarBackground" /> | |
<target android:excludeId="@id/toolbar_container" /> | |
</targets> | |
</explode> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<style name="AppTheme" parent="BaseTheme"> | |
<!-- enable activity transitions --> | |
<item name="android:windowActivityTransitions">true</item> | |
<!-- enable window content transitions --> | |
<item name="android:windowContentTransitions">true</item> |
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
@Override | |
public void onClick(View v) { | |
if (v instanceof Button) { | |
ImageView circleImage = (ImageView) findViewById(R.id.iv_circle); | |
Intent intent = new Intent(AnimationActivity.this,ImageDetailActivity.class); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { | |
startActivity(intent, | |
ActivityOptions.makeSceneTransitionAnimation( | |
this, | |
new Pair<View, String>(circleImage, |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar"> | |
<!-- Customize your theme here. --> | |
<item name="colorPrimary">@color/colorPrimary</item> | |
<item name="colorPrimaryDark">@color/colorPrimaryDark</item> | |
<item name="colorAccent">@color/colorAccent</item> | |
</style> |
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.logintutorial; | |
import android.Manifest; | |
import android.annotation.TargetApi; | |
import android.content.pm.PackageManager; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.support.annotation.NonNull; | |
import android.support.v4.app.ActivityCompat; | |
import android.support.v4.content.ContextCompat; |