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 UserDetailActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
DataBindingIncludeMainLayout mBinding = DataBindingUtil | |
.setContentView(this, R.layout.data_binding_include_main_layout); | |
User user = new User("username", "password"); |
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="user" type="it.communikein.myunimib.User"/> | |
</data> | |
<merge> | |
<include layout="@layout/name" | |
bind:user="@{user}"/> | |
<include layout="@layout/contact" |
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
@Entity(tableName = "pois") | |
public class Poi { | |
@PrimaryKey | |
private String id; | |
private String title; | |
private String description; | |
private long timestamp; | |
private double locationLat; | |
private double locationLng; |
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 PoisViewModel extends ViewModel { | |
private LiveData<List<Poi>> mData; | |
@Inject | |
public PoisViewModel(PoisRepository repository) { | |
mData = repository.getObservableAllPois(); | |
} | |
public LiveData<List<Poi>> getObservableAllPois() { |
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 MainActivity extends AppCompatActivity { | |
public static final ArrayList<String> TABS_TITLE = new ArrayList<>(); | |
private static final String FRAGMENT_MAP_TITLE = "Map"; | |
private static final String FRAGMENT_LIST_TITLE = "List"; | |
/* */ | |
private FragmentPoisBinding mBinding; | |
/* */ |
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:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools"> | |
<android.support.constraint.ConstraintLayout | |
android:id="@+id/container" | |
android:layout_width="match_parent" | |
android:layout_height="match_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
<?xml version="1.0" encoding="utf-8"?> | |
<layout | |
xmlns:android="http://schemas.android.com/apk/res/android"> | |
<com.google.android.gms.maps.MapView | |
android:id="@+id/map" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" /> | |
</layout> |
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:app="http://schemas.android.com/apk/res-auto"> | |
<android.support.design.widget.CoordinatorLayout | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<android.support.v7.widget.RecyclerView |
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 PoisListFragment extends Fragment implements { | |
private AcFragmentPoisListBinding mBinding; | |
private PoisListAdapter mAdapter; | |
@Override | |
public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, | |
Bundle savedInstanceState) { | |
/* Inflate the layout for this fragment */ |
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 PoisMapFragment extends Fragment implements OnMapReadyCallback { | |
private AcFragmentPoisMapBinding mBinding; | |
/* Might be null if Google Play services APK is not available. */ | |
private GoogleMap mMap = null; | |
private static final String MAPVIEW_BUNDLE_KEY = "MapViewBundleKey"; | |
private static final LatLng bergamo = new LatLng(45.6983, 9.6773); | |
private static final LatLng rome = new LatLng(41.9028, 12.4964); |