Skip to content

Instantly share code, notes, and snippets.

View guuilp's full-sized avatar
😃
Hi!

Guilherme guuilp

😃
Hi!
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:openDrawer="start">
public interface NoticiaOnClickListener{
public void onClickNoticia(View view, int idx);
}
private NoticiaOnClickListener noticiaOnClickListener;
@Override
public void onBindViewHolder(final NoticiaViewHolder holder, final int position) {
//Click
if (noticiaOnClickListener != null){
holder.itemView.setOnClickListener(new View.OnClickListener() {
private NoticiaAdapter.NoticiaOnClickListener onClickNoticia() {
return new NoticiaAdapter.NoticiaOnClickListener() {
@Override
public void onClickNoticia(View view, int idx) {
Noticia c = noticias.get(idx);
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp">
<EditText android:id="@+id/input_email"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Número de Cliente" />
</android.support.design.widget.TextInputLayout>
public static final String QUERY_PARAMETER = "q";
public void onClickOpenAddressButton(View v) {
// COMPLETED (5) Store an address in a String
String addressString = "1600 Amphitheatre Parkway, CA";
// COMPLETED (6) Use Uri.Builder with the appropriate scheme and query to form the Uri for the address
Uri.Builder builder = new Uri.Builder();
builder.scheme("geo")
.path("0,0")
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="false">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
@guuilp
guuilp / MainActivity.java
Created June 8, 2017 00:29
Change height animation on CardView
public class MainActivity extends AppCompatActivity {
private CardView cardView;
private Boolean isCollapsed = true;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);