lab pause

This commit is contained in:
Philipp Wo 2019-03-08 19:03:00 +01:00
parent e2fea3a851
commit ffad4f9e50
4 changed files with 120 additions and 0 deletions

View File

@ -0,0 +1,39 @@
package at.fhj.airkoality.model;
public class Location {
private String location;
private String city;
private String county:
public Location(String location, String city, String county) {
this.location = location;
this.city = city;
this.county = county;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCounty() {
return county;
}
public void setCounty(String county) {
this.county = county;
}
}

View File

@ -0,0 +1,39 @@
package at.fhj.airkoality.ui.adapter;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import java.util.List;
import at.fhj.airkoality.model.Location;
public class LocationListAdapter extends RecyclerView.Adapter<LocationListAdapter.LocationItemViewHolder> {
private List<Location> location;
@NonNull
@Override
public LocationItemViewHolder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
return null;
}
@Override
public void onBindViewHolder(@NonNull LocationItemViewHolder locationItemViewHolder, int i) {
}
@Override
public int getItemCount() {
return 0;
}
class LocationItemViewHolder extends RecyclerView.ViewHolder{
public LocationItemViewHolder(@NonNull View itemView){
super(itemView);
}
}
}

View File

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:id="@+id/cvLocationItem"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tvlocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tvCity"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tcCountry"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>

View File

@ -30,3 +30,13 @@
- Editieren der Farben, Strings und Styles in den jeweiligen Files unter /res/values/
- Hinzufügen der Activities in der AndroidManifest.xml Datei
- strings.xml kennengelernt um Texte einer App zentral verwalten zu können
## 08.03.2019
Context -> weiß was in der App gerade "abgeht" (Java Objekt)
- Activity oder Application
- Immer Context der aktuellen Activity verwenden
Best Practise kennengelernt um große Listen darzustellen
Fragments ->