diff options
-rw-r--r-- | gen/net/cbaines/suma/R.java | 93 | ||||
-rw-r--r-- | res/layout/bus_specific_stop_view.xml | 32 | ||||
-rw-r--r-- | src/net/cbaines/suma/BusSpecificStopView.java | 48 |
3 files changed, 94 insertions, 79 deletions
diff --git a/gen/net/cbaines/suma/R.java b/gen/net/cbaines/suma/R.java index 7e3d3f9..01cabe8 100644 --- a/gen/net/cbaines/suma/R.java +++ b/gen/net/cbaines/suma/R.java @@ -71,58 +71,59 @@ public final class R { public static final int busRouteActivityID=0x7f0a0013; public static final int busRouteActivityLabel=0x7f0a0012; public static final int busRouteBusStops=0x7f0a0014; - public static final int busSpecificStopViewID=0x7f0a0016; public static final int busSpecificStopViewName=0x7f0a0015; public static final int busSpecificStopViewProgressBar=0x7f0a0017; - public static final int busStopID=0x7f0a0020; - public static final int busStopListItems=0x7f0a0027; - public static final int busStopLoadBar=0x7f0a0025; - public static final int busStopMessage=0x7f0a0024; - public static final int busStopName=0x7f0a0018; - public static final int busStopTimes=0x7f0a0022; - public static final int busTimeContentLayout=0x7f0a0021; - public static final int centerLoadBar=0x7f0a0023; - public static final int check1=0x7f0a0039; - public static final int childname=0x7f0a0038; - public static final int donateBitcoinAddress=0x7f0a002d; + public static final int busSpecificStopViewRightContainer=0x7f0a0016; + public static final int busSpecificStopViewTime=0x7f0a0018; + public static final int busStopID=0x7f0a0021; + public static final int busStopListItems=0x7f0a0028; + public static final int busStopLoadBar=0x7f0a0026; + public static final int busStopMessage=0x7f0a0025; + public static final int busStopName=0x7f0a0019; + public static final int busStopTimes=0x7f0a0023; + public static final int busTimeContentLayout=0x7f0a0022; + public static final int centerLoadBar=0x7f0a0024; + public static final int check1=0x7f0a003a; + public static final int childname=0x7f0a0039; + public static final int donateBitcoinAddress=0x7f0a002e; public static final int donateButton=0x7f0a0003; - public static final int donateDialogErrorMessage=0x7f0a002c; - public static final int donateDialogMessage=0x7f0a0029; - public static final int donateDialogMessageLayout=0x7f0a002b; - public static final int donateDialogProgress=0x7f0a002a; - public static final int favouriteCheckBox=0x7f0a001f; - public static final int favouriteDialogMessage=0x7f0a0033; - public static final int favouriteListItems=0x7f0a0034; - public static final int findContentLayout=0x7f0a002f; - public static final int findListItems=0x7f0a0031; - public static final int findLoadBar=0x7f0a0030; + public static final int donateDialogErrorMessage=0x7f0a002d; + public static final int donateDialogMessage=0x7f0a002a; + public static final int donateDialogMessageLayout=0x7f0a002c; + public static final int donateDialogProgress=0x7f0a002b; + public static final int favouriteCheckBox=0x7f0a0020; + public static final int favouriteDialogMessage=0x7f0a0034; + public static final int favouriteListItems=0x7f0a0035; + public static final int findContentLayout=0x7f0a0030; + public static final int findListItems=0x7f0a0032; + public static final int findLoadBar=0x7f0a0031; public static final int helpExpandableListView=0x7f0a0002; - public static final int layout_root=0x7f0a0026; - public static final int linearLayout1=0x7f0a0019; - public static final int linearLayout2=0x7f0a0028; - public static final int mapview=0x7f0a0032; - public static final int menu_about=0x7f0a0043; - public static final int menu_favourites=0x7f0a0044; - public static final int menu_find=0x7f0a003f; - public static final int menu_find_my_location=0x7f0a0041; - public static final int menu_next_stop=0x7f0a003e; - public static final int menu_preferences=0x7f0a0040; - public static final int menu_previous_stop=0x7f0a003c; - public static final int menu_refresh_bus=0x7f0a003b; - public static final int menu_refresh_stop=0x7f0a003d; - public static final int menu_view=0x7f0a0042; - public static final int radio_u1=0x7f0a001a; - public static final int radio_u1n=0x7f0a001b; - public static final int radio_u2=0x7f0a001c; - public static final int radio_u6=0x7f0a001d; - public static final int radio_u9=0x7f0a001e; - public static final int searchBar=0x7f0a002e; + public static final int layout_root=0x7f0a0027; + public static final int linearLayout1=0x7f0a001a; + public static final int linearLayout2=0x7f0a0029; + public static final int mapview=0x7f0a0033; + public static final int menu_about=0x7f0a0044; + public static final int menu_favourites=0x7f0a0045; + public static final int menu_find=0x7f0a0040; + public static final int menu_find_my_location=0x7f0a0042; + public static final int menu_next_stop=0x7f0a003f; + public static final int menu_preferences=0x7f0a0041; + public static final int menu_previous_stop=0x7f0a003d; + public static final int menu_refresh_bus=0x7f0a003c; + public static final int menu_refresh_stop=0x7f0a003e; + public static final int menu_view=0x7f0a0043; + public static final int radio_u1=0x7f0a001b; + public static final int radio_u1n=0x7f0a001c; + public static final int radio_u2=0x7f0a001d; + public static final int radio_u6=0x7f0a001e; + public static final int radio_u9=0x7f0a001f; + public static final int searchBar=0x7f0a002f; public static final int textView1=0x7f0a0000; public static final int textView2=0x7f0a0001; - public static final int toastViewLinearLayout=0x7f0a0035; - public static final int toastViewSubMessage=0x7f0a0037; - public static final int toastViewText=0x7f0a0036; - public static final int view_list=0x7f0a003a; + public static final int toastViewLinearLayout=0x7f0a0036; + public static final int toastViewSubMessage=0x7f0a0038; + public static final int toastViewText=0x7f0a0037; + public static final int view_list=0x7f0a003b; } public static final class layout { public static final int about_dialog=0x7f030000; diff --git a/res/layout/bus_specific_stop_view.xml b/res/layout/bus_specific_stop_view.xml index e48e2f1..8652d2d 100644 --- a/res/layout/bus_specific_stop_view.xml +++ b/res/layout/bus_specific_stop_view.xml @@ -1,28 +1,36 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" - android:layout_height="match_parent" > + android:layout_height="wrap_content" > <TextView android:id="@+id/busSpecificStopViewName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" - android:layout_alignParentTop="true" /> + android:layout_alignParentTop="true" + android:layout_toLeftOf="@+id/busSpecificStopViewRightContainer" + android:singleLine="true" + android:text="Name" /> - <TextView - android:id="@+id/busSpecificStopViewID" + <LinearLayout + android:id="@+id/busSpecificStopViewRightContainer" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" - android:layout_alignParentTop="true" /> + android:layout_alignParentTop="true" > - <ProgressBar - android:id="@+id/busSpecificStopViewProgressBar" - style="?android:attr/progressBarStyleSmall" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_alignParentTop="true" - android:layout_toLeftOf="@+id/textView2" /> + <ProgressBar + android:id="@+id/busSpecificStopViewProgressBar" + style="?android:attr/progressBarStyleSmall" + android:layout_width="wrap_content" + android:layout_height="wrap_content" /> + + <TextView + android:id="@+id/busSpecificStopViewTime" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Time" /> + </LinearLayout> </RelativeLayout>
\ No newline at end of file diff --git a/src/net/cbaines/suma/BusSpecificStopView.java b/src/net/cbaines/suma/BusSpecificStopView.java index 723d7c0..79b1305 100644 --- a/src/net/cbaines/suma/BusSpecificStopView.java +++ b/src/net/cbaines/suma/BusSpecificStopView.java @@ -23,6 +23,7 @@ import java.sql.SQLException; import java.text.DateFormat; import android.app.Activity; +import android.content.Context; import android.content.Intent; import android.content.res.Resources; import android.net.Uri; @@ -31,15 +32,15 @@ import android.view.Gravity; import android.view.View; import android.view.View.OnClickListener; import android.view.View.OnLongClickListener; +import android.widget.LinearLayout; import android.widget.ProgressBar; -import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.j256.ormlite.android.apptools.OpenHelperManager; import com.j256.ormlite.dao.Dao; -public class BusSpecificStopView extends RelativeLayout implements OnClickListener, OnLongClickListener { +public class BusSpecificStopView extends LinearLayout implements OnClickListener, OnLongClickListener { private static final String TAG = "BusSpecificStopView"; @@ -62,14 +63,19 @@ public class BusSpecificStopView extends RelativeLayout implements OnClickListen this.context = context; - location = new TextView(context); + View.inflate(context, R.layout.bus_specific_stop_view, this); + + // location = new TextView(context); + location = (TextView) findViewById(R.id.busSpecificStopViewName); location.setTextSize(22f); location.setGravity(Gravity.LEFT); - time = new TextView(context); + // time = new TextView(context); + time = (TextView) findViewById(R.id.busSpecificStopViewTime); time.setTextSize(22f); - timeProgress = new ProgressBar(context, null, android.R.attr.progressBarStyleSmall); + // timeProgress = new ProgressBar(context, null, android.R.attr.progressBarStyleSmall); + timeProgress = (ProgressBar) findViewById(R.id.busSpecificStopViewProgressBar); Resources resources = context.getResources(); onClickHelpMessage = resources.getString(R.string.bus_stop_view_on_click_toast_help_message); @@ -77,22 +83,22 @@ public class BusSpecificStopView extends RelativeLayout implements OnClickListen setStop(stop); - RelativeLayout.LayoutParams relativeParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, - LayoutParams.WRAP_CONTENT); - relativeParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT); - - RelativeLayout.LayoutParams relativeParams2 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, - LayoutParams.FILL_PARENT); - relativeParams2.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); - - addView(location, relativeParams); - addView(time, relativeParams2); - - // LinearLayout progressLayout = new LinearLayout(context); - // progressLayout.setOrientation(LinearLayout.VERTICAL); - // progressLayout.addView(timeProgress, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); - - addView(timeProgress, relativeParams2); + // RelativeLayout.LayoutParams relativeParams = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, + // LayoutParams.WRAP_CONTENT); + // relativeParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT); + // + // RelativeLayout.LayoutParams relativeParams2 = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, + // LayoutParams.FILL_PARENT); + // relativeParams2.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); + // + // addView(location, relativeParams); + // addView(time, relativeParams2); + // + // // LinearLayout progressLayout = new LinearLayout(context); + // // progressLayout.setOrientation(LinearLayout.VERTICAL); + // // progressLayout.addView(timeProgress, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); + // + // addView(timeProgress, relativeParams2); } public void setStop(Stop stop) { |