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
<LinearLayout | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:orientation="horizontal" | |
> | |
<ImageView | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:id="@+id/iv_icon" |
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
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="uk.co.placona.realmnotes"> | |
<uses-permission android:name="android.permission.INTERNET" /> |
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
dependencies { | |
compile fileTree(dir: 'libs', include: ['*.jar']) | |
testCompile 'junit:junit:4.12' | |
compile 'com.android.support:appcompat-v7:24.1.1' | |
compile 'com.android.support:design:24.1.1' | |
compile 'com.android.support:recyclerview-v7:24.1.1' | |
compile 'com.github.thorbenprimke:realm-recyclerview:0.9.23' | |
compile 'com.squareup.picasso:picasso:2.5.2' | |
compile 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.0.2' |
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
git clone [email protected]:mplacona/RealmNotes.git |
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
Picasso.with(mContext).invalidate(file); | |
Picasso.with(mContext) | |
.load(ICON_URL) | |
.memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_STORE) | |
.networkPolicy(NetworkPolicy.NO_CACHE, NetworkPolicy.NO_STORE) | |
.placeholder(R.mipmap.ic_launcher) | |
.error(R.mipmap.error) | |
.into(viewHolder.mIcon); |
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
Picasso.with(getApplicationContext()) | |
.load(ICON_URL + "&" + position) | |
.placeholder(R.mipmap.ic_launcher) | |
.error(R.mipmap.error) | |
.into(viewHolder.mIcon); |
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
private static final String ICON_URL = "https://unsplash.it/50/50?random"; | |
... | |
@Override | |
public void onBindRealmViewHolder(ViewHolder viewHolder, int position) { | |
final Note note = realmResults.get(position); | |
viewHolder.mText.setText(note.getText()); | |
viewHolder.mDate.setText(note.getDate().toString()); |
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
Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView); |
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
using System.Web.Mvc; | |
using Twilio.TwiML; | |
using Twilio.TwiML.Mvc; | |
namespace ReceiveSms.Controllers | |
{ | |
public class SmsController : TwilioController | |
{ | |
// POST: Sms | |
[HttpPost] |
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
mSend.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
try { | |
post(mContext.getString("YOUR_NGROK_URL/sms"), new Callback(){ | |
@Override | |
public void onFailure(Call call, IOException e) { | |
e.printStackTrace(); | |
} |