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 new directive with cli : | |
ng g d directive-name | |
// directives are used as attribute to existant html element ex : | |
<div direcrive-name> ... </div> | |
// example of a directive : | |
@Directive({ | |
selector: '[myDirectives]' |
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
// dependency for TabLayout | |
compile 'com.android.support:design:24.1.1' | |
// xml | |
<android.support.design.widget.AppBarLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> | |
<include |
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
// child component : | |
export class ChildComponent implements OnInit { | |
@Output() close: EventEmitter<boolean> = new EventEmitter<boolean>(); | |
callEvent() { | |
this.close.emit(true); | |
} | |
... | |
} |
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 me.wangyuwei.signuptransition; | |
import android.os.Bundle; | |
import android.support.v7.app.AppCompatActivity; | |
import android.transition.ChangeBounds; | |
import android.transition.Scene; | |
import android.transition.TransitionManager; | |
import android.view.animation.DecelerateInterpolator; | |
import android.widget.LinearLayout; | |
import android.widget.RelativeLayout; |
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
// java | |
private Scene mSceneMain; | |
LinearLayout container = (LinearLayout) findViewById(R.id.container); | |
mSceneMain = Scene.getSceneForLayout(container, R.layout.scene_main, this); | |
container.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
TransitionManager.go(mSceneMain, new ChangeBounds().setDuration(500).setInterpolator(new DecelerateInterpolator())); | |
} | |
}, 1000); |
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
public void animate(View view,Boolean up) { | |
if(up) { | |
view.setVisibility(View.VISIBLE); | |
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationY", view.getBottom(), 0); | |
objectAnimator.setDuration(400).setInterpolator(new DecelerateInterpolator()); | |
objectAnimator.start(); | |
} else { | |
ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(view, "translationY", 0, view.getBottom()); | |
objectAnimator.setDuration(400).setInterpolator(new AccelerateInterpolator()); | |
objectAnimator.start(); |