Skip to content

Instantly share code, notes, and snippets.

Avatar
😃
Hi!

Guilherme guuilp

😃
Hi!
View GitHub Profile
View activity_main.xml
<?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">
View Interface.java
public interface NoticiaOnClickListener{
public void onClickNoticia(View view, int idx);
}
View Variavel.java
private NoticiaOnClickListener noticiaOnClickListener;
View Metodo.java
@Override
public void onBindViewHolder(final NoticiaViewHolder holder, final int position) {
//Click
if (noticiaOnClickListener != null){
holder.itemView.setOnClickListener(new View.OnClickListener() {
View Implementacao.java
private NoticiaAdapter.NoticiaOnClickListener onClickNoticia() {
return new NoticiaAdapter.NoticiaOnClickListener() {
@Override
public void onClickNoticia(View view, int idx) {
Noticia c = noticias.get(idx);
View EditText.xml
<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>
View MainActivity.java
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")
View activity_movie_detail.xml
<?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"
View activity_movie_detail.xml
<?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 Jun 8, 2017
Change height animation on CardView
View MainActivity.java
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);