Example usage for android.transition Slide excludeTarget

List of usage examples for android.transition Slide excludeTarget

Introduction

In this page you can find the example usage for android.transition Slide excludeTarget.

Prototype

public Transition excludeTarget(int targetId, boolean exclude) 

Source Link

Document

Whether to add the given id to the list of target ids to exclude from this transition.

Usage

From source file:com.github.jorgecastilloprz.corleone.sample.ui.activity.GameDetailsActivity.java

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void excludeItemsFromTransitionIfLollipop() {
    Slide transition = new Slide();
    transition.excludeTarget(android.R.id.statusBarBackground, true);
    transition.excludeTarget(R.id.toolbar, true);
    getWindow().setEnterTransition(transition);
    getWindow().setReturnTransition(transition);
}

From source file:com.github.jorgecastilloprz.easymvp.mvp.views.DetailsActivity.java

private void excludeItemsFromTransitionIfLollipop() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Slide transition = new Slide();
        transition.excludeTarget(android.R.id.statusBarBackground, true);
        transition.excludeTarget(R.id.detailsToolbar, true);
        getWindow().setEnterTransition(transition);
        getWindow().setReturnTransition(transition);
    }//from w ww.  j  a va 2  s.  com
}

From source file:com.raulh82vlc.topratemovies.activities.CardFilmDetailsActivity.java

/**
 * Method startAllTransitions/*  www. j  a  va  2 s  .  co m*/
 * if API 21 then effects are settled
 */
private void startAllTransitions() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Slide transition = new Slide();
        transition.excludeTarget(android.R.id.statusBarBackground, true);
        getWindow().setEnterTransition(transition);
        getWindow().setReturnTransition(transition);
    }
}

From source file:com.zertinteractive.wallpaper.activities.DetailActivity.java

private void initActivityTransitions() {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        Slide transition = new Slide();
        transition.excludeTarget(android.R.id.statusBarBackground, true);
        getWindow().setEnterTransition(transition);
        getWindow().setReturnTransition(transition);
    }/* ww  w . ja  v  a 2  s  . c  om*/
}

From source file:mbullington.dialogue.activity.ConversationActivity.java

/**
 * On create//from w  w  w. ja va  2s  .c  om
 */
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    serverId = getIntent().getExtras().getInt("serverId");
    server = Dialogue.getInstance().getServerById(serverId);
    Settings settings = new Settings(this);

    // Finish activity if server does not exist anymore - See #55
    if (server == null) {
        this.finish();
    }

    setContentView(R.layout.conversations);
    ButterKnife.inject(this);

    Slide enterTransition = new Slide();
    enterTransition.excludeTarget(android.R.id.statusBarBackground, true);

    getWindow().setEnterTransition(enterTransition);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);

    toolbar.setNavigationIcon(R.drawable.back_arrow);
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            ConversationActivity.this.finish();
        }
    });

    setTitle(server.getTitle());

    boolean isLandscape = (getResources()
            .getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE);

    EditText input = (EditText) findViewById(R.id.input);
    input.setOnKeyListener(inputKeyListener);

    pager = (ViewPager) findViewById(R.id.pager);

    pagerAdapter = new ConversationPagerAdapter(this, server);
    pager.setAdapter(pagerAdapter);

    final float density = getResources().getDisplayMetrics().density;

    indicator = (ConversationIndicator) findViewById(R.id.titleIndicator);
    indicator.setServer(server);
    indicator.setTypeface(Typeface.MONOSPACE);
    indicator.setViewPager(pager);

    indicator.setFooterColor(0xFF31B6E7);
    indicator.setFooterLineHeight(1 * density);
    indicator.setFooterIndicatorHeight(3 * density);
    indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
    indicator.setSelectedColor(0xFFFFFFFF);
    indicator.setSelectedBold(true);
    indicator.setBackgroundColor(0xFF181818);

    historySize = settings.getHistorySize();

    if (server.getStatus() == Status.PRE_CONNECTING) {
        server.clearConversations();
        pagerAdapter.clearConversations();
        server.getConversation(ServerInfo.DEFAULT_NAME).setHistorySize(historySize);
    }

    float fontSize = settings.getFontSize();
    indicator.setTextSize(fontSize * density);

    input.setTextSize(settings.getFontSize());
    input.setTypeface(Typeface.MONOSPACE);

    // Optimization : cache field lookups
    Collection<Conversation> mConversations = server.getConversations();

    for (Conversation conversation : mConversations) {
        // Only scroll to new conversation if it was selected before
        if (conversation.getStatus() == Conversation.STATUS_SELECTED) {
            onNewConversation(conversation.getName());
        } else {
            createNewConversation(conversation.getName());
        }
    }

    int setInputTypeFlags = 0;

    setInputTypeFlags |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT;

    if (settings.autoCapSentences()) {
        setInputTypeFlags |= InputType.TYPE_TEXT_FLAG_CAP_SENTENCES;
    }

    if (isLandscape && settings.imeExtract()) {
        setInputTypeFlags |= InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE;
    }

    if (!settings.imeExtract()) {
        input.setImeOptions(input.getImeOptions() | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
    }

    input.setInputType(input.getInputType() | setInputTypeFlags);

    // Create a new scrollback history
    scrollback = new Scrollback();
}