Retrieve parking lot filled status from server and display it.

This commit is contained in:
bspeice 2013-11-18 15:03:53 -05:00
parent ae548625a3
commit 84bc2e3894
2 changed files with 28 additions and 9 deletions

View File

@ -4,6 +4,10 @@
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:id="@+id/lotViewFilledStatus"
android:layout_width="wrap_content"
@ -11,6 +15,14 @@
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"
android:layout_width="wrap_content"

View File

@ -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);
getDialog().setTitle(pc.getValue());
initializeData(pc);
if (view == null)
Log.e("LotViewFragment", "Unable to instantiate view!");