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
// En MainActivity.cs | |
[Activity(Label = "NotiXamarin_ensayo", Icon = "@drawable/icon", ParentActivity = typeof(NewsListActivity))] | |
public class MainActivity : Activity | |
{ | |
internal static string KEY_ID = "KEY_ID"; | |
protected override void OnCreate(Bundle bundle) | |
{ | |
base.OnCreate(bundle); |
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
// MainActivity | |
public override bool OnCreateOptionsMenu(IMenu menu) | |
{ | |
MenuInflater.Inflate(Resource.Menu.newsActionMenu, menu); | |
return base.OnCreateOptionsMenu(menu); | |
} | |
public override bool OnOptionsItemSelected(IMenuItem item) | |
{ |
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
// MainActivity.cs | |
internal static string KEY_ID = "KEY_ID"; | |
private News _news; | |
private readonly string KEY_BODY = "KEY_BODY"; | |
private readonly string KEY_IMAGE_NAME = "KEY_IMAGE_NAME"; | |
private readonly string KEY_TITLE = "KEY_TITLE"; | |
protected override void OnCreate(Bundle bundle) | |
{ |
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
// Este es el ejemplo utilizado al inicio del video. | |
private void TestDb() | |
{ | |
string folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); | |
string rutaDb = System.IO.Path.Combine(folder, "notiXamarinDb.db"); | |
// Crea la base de datos si no existe, y crea una conexión | |
var db = new SQLiteConnection(rutaDb); | |
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
gist fragmentos | |
// NewsListActivity | |
public class NewsListActivity : Activity | |
{ | |
protected override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); | |
// Create your application here |
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
gist tabs | |
// newsListActivity.cs | |
[Activity(Label = "NotiXamarin", MainLauncher = true, LaunchMode = Android.Content.PM.LaunchMode.SingleTop)] | |
public class NewsListActivity : Activity | |
{ | |
protected override void OnCreate(Bundle savedInstanceState) | |
{ | |
base.OnCreate(savedInstanceState); |
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
// values/Strings.xml | |
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="NewsListActivity.Tabs.AllNews.Header">All news</string> | |
<string name="NewsListActivity.Tabs.SavedNews.Header">Saved news</string> | |
</resources> | |
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
// NewsListRow.axml | |
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:id="@+id/newsListRow_RelativeLayout" | |
android:background="@color/listitemunselected"> | |
<TextView | |
android:text="Small Text" |
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
// BaseNewsListFragment.cs | |
protected NewsListAdapter _newsListAdapter; | |
// INotify.cs | |
internal interface INotify | |
{ | |
void NotifyObserver(); | |
} |
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
gist web api | |
// News | |
public class News | |
{ | |
public int Id { get; set; } | |
public string Title { get; set; } | |
public string Body { get; set; } | |
public string ImageName { get; set; } |