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 static final class TodosEntry implements BaseColumns { | |
// Table name | |
public static final String TABLE_NAME = "todos"; | |
//column (field) names | |
public static final String _ID = BaseColumns._ID; | |
public static final String COLUMN_TEXT = "text"; | |
public static final String COLUMN_CREATED = "created"; | |
public static final String COLUMN_EXPIRED = "expired"; | |
public static final String COLUMN_DONE = "done"; | |
public static final String COLUMN_CATEGORY = "category"; |
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
import { Component } from '@angular/core'; | |
import { FiltroPaperiPipe } from "./paperi/paperi-filtro.pipe" | |
//@component is a decorator that contains metadata and template. In this case an URL | |
//all'interno un oggetto con le sue proprietà {} | |
@Component({ | |
selector: 'app-root', | |
templateUrl: './app.component.html', | |
styleUrls: ['./app.component.css'] | |
}) |
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
<div class="panel panel-primary"> | |
<div class="panel-heading"> | |
<!--Interpolazione--> | |
{{title}} | |
</div> | |
<div class="panel-body"> | |
<div class="row"> | |
<div class="col-md-2">Filtro</div> | |
<div class="col-md-4"> |
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
import {PipeTransform, Pipe} from "@angular/core" | |
@Pipe ({ | |
name: 'filtroPaperi' | |
}) | |
export class FiltroPaperiPipe implements PipeTransform{ | |
transform(value :any[], filter:string) : any[] { | |
let filtro: string = filter ? filter.toLocaleLowerCase() : null; | |
return filtro ? value.filter((papero) => |
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
import { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { FormsModule } from '@angular/forms'; | |
import { HttpModule } from '@angular/http'; | |
import { FiltroPaperiPipe } from "./paperi/paperi-filtro.pipe" | |
import { AppComponent } from './app.component'; | |
@NgModule({ | |
declarations: [ |
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 class DatabaseHelper extends SQLiteOpenHelper{ | |
//Constants for db name and version | |
private static final String DATABASE_NAME = "todos.db"; | |
private static final int DATABASE_VERSION = 1; | |
//SQL to create tables | |
private static final String TABLE_CATEGORIES_CREATE= | |
"CREATE TABLE " + CategoriesEntry.TABLE_NAME + " (" + |
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
private long createToDo() { | |
helper = new DatabaseHelper(this); | |
db = helper.getWritableDatabase(); | |
//rawQuery | |
/*String query = "INSERT INTO todos (" | |
+ TodosEntry.COLUMN_TEXT + "," | |
+ TodosEntry.COLUMN_CATEGORY + "," | |
+ TodosEntry.COLUMN_CREATED + "," | |
+ TodosEntry.COLUMN_EXPIRED + "," |
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
package com.example.todos; | |
import android.content.Context; | |
import android.databinding.DataBindingUtil; | |
import android.databinding.InverseBindingMethod; | |
import android.databinding.InverseBindingMethods; | |
import android.databinding.ObservableArrayList; | |
import android.databinding.ObservableInt; | |
import android.view.LayoutInflater; | |
import android.view.View; |
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
package com.example.todos; | |
import android.app.LoaderManager; | |
import android.content.ContentValues; | |
import android.content.CursorLoader; | |
import android.content.DialogInterface; | |
import android.content.Loader; | |
import android.database.Cursor; | |
import android.databinding.DataBindingUtil; | |
import android.databinding.ObservableArrayList; |
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"?> | |
<layout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:bind="http://schemas.android.com/apk/res-auto"> | |
<data> | |
<variable name="categories" type="com.example.todos.model.CategoryList"/> | |
<variable name="category" type="com.example.todos.model.Category"/> | |
</data> | |
<LinearLayout | |
android:orientation="vertical" android:layout_width="match_parent" |
OlderNewer