-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added custom item listview to find course fragment.
- Loading branch information
Showing
10 changed files
with
297 additions
and
40 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...tyKit/app/src/main/java/dk/aau/sw805f18/ar/common/adapters/FindCourseListItemAdapter.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package dk.aau.sw805f18.ar.common.adapters; | ||
|
||
|
||
import android.content.Context; | ||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
import android.view.LayoutInflater; | ||
import android.view.View; | ||
import android.view.ViewGroup; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.TextView; | ||
|
||
import java.lang.reflect.Array; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import dk.aau.sw805f18.ar.R; | ||
import dk.aau.sw805f18.ar.models.FindCourseItem; | ||
|
||
public class FindCourseListItemAdapter extends ArrayAdapter<FindCourseItem> { | ||
private Context mContext; | ||
private ArrayList<FindCourseItem> mValues; | ||
|
||
public FindCourseListItemAdapter(Context context, ArrayList<FindCourseItem> values) { | ||
super(context, -1, values); | ||
mContext = context; | ||
mValues = values; | ||
} | ||
|
||
@NonNull | ||
@Override | ||
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) { | ||
LayoutInflater inflater = (LayoutInflater) mContext | ||
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); | ||
View rowView = inflater.inflate(R.layout.list_item_find_course, parent, false); | ||
|
||
TextView name = rowView.findViewById(R.id.find_course_list_item_name_textview); | ||
TextView players = rowView.findViewById(R.id.find_course_list_item_players_count_textview); | ||
TextView age = rowView.findViewById(R.id.find_course_list_item_age_textview); | ||
TextView distance = rowView.findViewById(R.id.find_course_list_item_distance_textview); | ||
|
||
name.setText(mValues.get(position).getName()); | ||
players.setText(String.valueOf(mValues.get(position).getPlayer())); | ||
age.setText(String.valueOf(mValues.get(position).getAge())); | ||
distance.setText(String.valueOf(mValues.get(position).getDistance())); | ||
|
||
return rowView; | ||
} | ||
} |
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
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
47 changes: 47 additions & 0 deletions
47
...playerAugmentedRealityKit/app/src/main/java/dk/aau/sw805f18/ar/models/FindCourseItem.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package dk.aau.sw805f18.ar.models; | ||
|
||
|
||
public class FindCourseItem { | ||
private String mName; | ||
private int mPlayer, mAge; | ||
private double mDistance; | ||
|
||
public FindCourseItem(String name, int player, int age, double distance) { | ||
this.mName = name; | ||
this.mPlayer = player; | ||
this.mAge = age; | ||
this.mDistance = distance; | ||
} | ||
|
||
public String getName() { | ||
return mName; | ||
} | ||
|
||
public void setName(String name) { | ||
this.mName = name; | ||
} | ||
|
||
public int getPlayer() { | ||
return mPlayer; | ||
} | ||
|
||
public void setPlayer(int player) { | ||
this.mPlayer = player; | ||
} | ||
|
||
public int getAge() { | ||
return mAge; | ||
} | ||
|
||
public void setAge(int age) { | ||
this.mAge = age; | ||
} | ||
|
||
public double getDistance() { | ||
return mDistance; | ||
} | ||
|
||
public void setDistance(double distance) { | ||
this.mDistance = distance; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
MultiplayerAugmentedRealityKit/app/src/main/res/drawable/ic_send_black_24dp.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:width="24dp" | ||
android:height="24dp" | ||
android:viewportWidth="24.0" | ||
android:viewportHeight="24.0"> | ||
<path | ||
android:fillColor="#FF000000" | ||
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/> | ||
</vector> |
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
10 changes: 0 additions & 10 deletions
10
MultiplayerAugmentedRealityKit/app/src/main/res/layout/list_item_course.xml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.