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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<?xml version="1.0" encoding="utf-8"?> | |
<ripple xmlns:android="http://schemas.android.com/apk/res/android" | |
android:color="#ColorCode"> | |
<!--Without mask, it will create a cborderless ripple--> | |
<item android:id="@android:id/mask" | |
android:drawable="@android:color/white"/> | |
</ripple> |
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
/*Create an object of activity options to enable scene transition animation*/ | |
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this); | |
/*Pass it to startActivity() method as the second parameter*/ | |
startActivity(intent, options.toBundle()); |
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
ImageView imageView = (ImageView) findViewById(R.id.image_star); | |
TextView textViewName = (TextView) findViewById(R.id.text_view_name); | |
Pair[] pairs = new Pair[2]; | |
pairs[0] = new Pair<View, String>(imageView, "transition_star"); | |
pairs[1] = new Pair<View, String>(textViewName, "transition_name"); | |
ActivityOptions options = ActivityOptions.makeSceneTransitionAnimation(this, pairs); | |
Intent i = new Intent(this, TransitionActivity.class); | |
i.putExtra("KEY_TYPE", "SharedTransition"); |
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
private void setupWindowAnimations() { | |
// Re-enter transition is executed when returning back to this activity | |
Slide slideTransition = new Slide(); | |
slideTransition.setSlideEdge(Gravity.LEFT); | |
slideTransition.setDuration(1000); | |
getWindow().setReenterTransition(slideTransition); // When MainActivity Re-enter the Screen | |
getWindow().setExitTransition(slideTransition); // When MainActivity Exits the Screen | |
// For overlap of Re Entering Activity - MainActivity.java and Exiting TransitionActivity.java |
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 karthik.saveexternaltorage; | |
import android.os.Environment; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.TextView; | |
import android.widget.Toast; |