mirror of
https://github.com/bspeice/UNCCGameDay
synced 2024-11-05 07:38:13 -05:00
Retrieve parking lot filled status from server and display it.
This commit is contained in:
parent
ae548625a3
commit
84bc2e3894
@ -4,12 +4,24 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lotViewFilledStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Filled Status:"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lotViewFilledStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Filled Status:"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/lotViewCurrentFilled"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lotViewRateLot"
|
||||
|
@ -6,6 +6,7 @@ import com.uncc.gameday.R;
|
||||
import com.uncc.gameday.parking.ParkingChoice;
|
||||
import com.uncc.gameday.parking.ParkingClient;
|
||||
import com.uncc.gameday.parking.ParkingCoordinate;
|
||||
import com.uncc.gameday.parking.ParkingLot;
|
||||
import com.uncc.gameday.parking.ParkingRating;
|
||||
import com.uncc.gameday.parking.RatingChoices;
|
||||
|
||||
@ -15,6 +16,7 @@ import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.SeekBar;
|
||||
import android.widget.Toast;
|
||||
|
||||
@ -27,6 +29,11 @@ public class LotViewFragment extends DialogFragment {
|
||||
|
||||
private void initializeData(ParkingChoice pc){
|
||||
ParkingClient client = new ParkingClient(this.getActivity());
|
||||
|
||||
ParkingLot pl = client.listLot(pc);
|
||||
ProgressBar bar = (ProgressBar)this.getView().findViewById(R.id.lotViewCurrentFilled);
|
||||
bar.setProgress(pl.getFilledPct());
|
||||
|
||||
ParkingCoordinate coord = client.listLotLocation(pc).getCoordinate();
|
||||
// Set up the MapView here.
|
||||
}
|
||||
@ -44,10 +51,10 @@ public class LotViewFragment extends DialogFragment {
|
||||
pc = ParkingChoice.BLACK;
|
||||
|
||||
this.pc = pc;
|
||||
initializeData(pc);
|
||||
|
||||
View view = inflater.inflate(R.layout.lot_view, container);
|
||||
View view = inflater.inflate(R.layout.lot_view, container);
|
||||
getDialog().setTitle(pc.getValue());
|
||||
initializeData(pc);
|
||||
|
||||
if (view == null)
|
||||
Log.e("LotViewFragment", "Unable to instantiate view!");
|
||||
|
Loading…
Reference in New Issue
Block a user