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
/* | |
* Copyright (C) 2014 Lucas Rocha | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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
ItemSelectionSupport itemSelection = ItemSelectionSupport.addTo(recyclerView); | |
itemSelection.setChoiceMode(ChoiceMode.MULTIPLE); | |
itemSelection.setItemChecked(2, true); |
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 class GridAndListLayout extends TwoWayLayoutManager { | |
private final int NUM_LANES = 2; | |
public GridAndListLayout(Context context, Orientation orientation) { | |
super(context, orientation); | |
} | |
private boolean isGridItem(int position) { | |
return position < 4; | |
} |
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 class SimpleListLayout extends TwoWayLayoutManager { | |
public SimpleListLayout(Context context, Orientation orientation) { | |
super(context, orientation); | |
} | |
@Override | |
protected void measureChild(View child, Direction direction) { | |
measureChildWithMargins(child, 0, 0); | |
} |
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
ItemClickSupport itemClick = ItemClickSupport.addTo(recyclerView); | |
itemclick.setOnItemClickListener(new OnItemClickListener() { | |
@Override | |
public void onItemClick(RecyclerView p, View c, int pos, long id) { | |
... | |
} | |
}); | |
itemClick.setOnItemLongClickListener(new OnItemLongClickListener() { |
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 org.lucasr.layoutsamples.canvas; | |
import android.os.Build; | |
import android.text.Layout.Alignment; | |
import android.text.StaticLayout; | |
import android.text.TextDirectionHeuristic; | |
import android.text.TextDirectionHeuristics; | |
import android.text.TextPaint; | |
import android.text.TextUtils.TruncateAt; | |
import android.util.Log; |
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.android_transition_samples.app; | |
import android.animation.Animator; | |
import android.animation.AnimatorSet; | |
import android.animation.ObjectAnimator; | |
import android.animation.PropertyValuesHolder; | |
import android.content.Context; | |
import android.graphics.Rect; | |
import android.util.AttributeSet; | |
import android.view.View; |
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 org.lucasr.transition.samples; | |
import android.support.v7.app.ActionBarActivity; | |
import android.os.Bundle; | |
import android.transition.TransitionManager; | |
import android.view.LayoutInflater; | |
import android.view.Menu; | |
import android.view.MenuItem; | |
import android.widget.ListView; |
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
@namespace url(http://www.w3.org/1999/xhtml); | |
@-moz-document url-prefix("https://docs.google.com/document/") { | |
#docs-editor { | |
background-color: #000000 !important; | |
} | |
.kix-page { | |
background-color: #000000 !important; | |
border-top: 0px !important; |
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 org.lucasr; | |
import java.io.ByteArrayInputStream; | |
import java.security.cert.CertificateFactory; | |
import java.security.cert.X509Certificate; | |
import javax.security.auth.x500.X500Principal; | |
import android.content.Context; | |
import android.content.pm.PackageManager; |