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
// o terceiro parâmetro é uma string json | |
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(Request.Method.POST, url, paramsPost, | |
new Response.Listener<JSONObject>() { | |
@Override | |
public void onResponse(JSONObject response) { | |
//onPostExecute(response); | |
} | |
}, |
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 addItem(int position, Object object) { | |
MessageUser message = (MessageUser) object; | |
messages.add(position, message); | |
notifyItemInserted(position); | |
} |
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
// Sempre atualizar os dados de uma activity, sempre que ela é acessada, coloque suas rotinas no método onResume | |
@Override | |
public void onResume() { | |
super.onResume(); | |
// Suas rotinas | |
} |
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
<!-- | |
Ver http://stackoverflow.com/questions/17989733/move-to-another-edittext-when-soft-keyboard-next-is-clicked-on-android | |
--> | |
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:orientation="vertical" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<EditText | |
android:layout_width="fill_parent" |
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
// Se um recyclerView não estiver sendo chamado | |
// (métodos do Adapter onCreateViewHolder e onBindViewHolder), | |
// mesmo passando uma lista de itens maior que zero, deve ser definida uma altura | |
// minima para a tag RecyclerView : | |
<android.support.v7.widget.RecyclerView | |
android:id="@+id/rvCardsList" | |
android:layout_width="match_parent" | |
android:layout_height="40dp" |
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
// Quando um método é chamado via Reflection em Java, as IDE's marcam o método como não utilizado. | |
// Para alterar essa verificação, adicione a seguinte annotation ao método: | |
@SuppressWarnings("unused") | |
public void timerMethod() { | |
} | |
// Funcionou no Android Studio. |
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
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle"> | |
<gradient | |
android:angle="90" | |
android:startColor="#f00" | |
android:centerColor="@android:color/transparent" | |
android:centerX="0.01" /> | |
</shape> |
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
Hex Opacity Values | |
100% — FF | |
95% — F2 | |
90% — E6 | |
85% — D9 | |
80% — CC | |
75% — BF | |
70% — B3 | |
65% — A6 |
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
Se a lista de itens for exibida, mas os dados em cada item não vierem preenchidos, | |
verificar o contexto passada para o Adapter. |
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
<RelativeLayout | |
android:id="@+id/rlBlock" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="@drawable/bg_item" | |
android:layout_gravity="center_vertical" | |
android:paddingTop="10dp" | |
android:gravity="center_horizontal"> |