Skip to content

Commit

Permalink
xml setup
Browse files Browse the repository at this point in the history
  • Loading branch information
vavali08 committed Nov 5, 2023
1 parent 8bb25b5 commit 40e1229
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@ class DiningWidget : AppWidgetProvider() {
}

internal fun updateAppWidget(context: Context, appWidgetManager: AppWidgetManager, appWidgetId: Int) {
val widgetText = context.getString(R.string.appwidget_text)
// Construct the RemoteViews object
val views = RemoteViews(context.packageName, R.layout.dining_widget)
views.setTextViewText(R.id.appwidget_text, widgetText)

// Instruct the widget manager to update the widget
appWidgetManager.updateAppWidget(appWidgetId, views)
Expand Down
42 changes: 34 additions & 8 deletions PennMobile/src/main/res/layout/dining_widget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,49 @@
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_margin="5dp"
android:text="@string/swipes" />
android:text="@string/swipes"
android:layout_margin="5dp"/>

<TextView
android:id="@+id/dollarsText"
android:id = "@+id/dollarsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:text="Dollars"
android:layout_below="@id/swipesText"
android:layout_margin="5dp"
/>

<ProgressBar
android:id="@+id/swipesBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="7dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:layout_toEndOf="@id/swipesText"
android:text="@string/dollars" />
android:layout_alignBottom="@id/swipesText"
android:layout_alignTop="@id/swipesText"
android:layout_alignParentEnd="true"
android:indeterminate="false"
android:progress="20"/>

<ProgressBar
android:id="@+id/swipesProgressBar"
style="?android:attr/progressBarStyle"
android:id="@+id/dollarsBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android/>
android:layout_marginStart="5dp"
android:layout_marginTop="7dp"
android:layout_marginEnd="5dp"
android:layout_marginBottom="5dp"
android:layout_toEndOf="@id/dollarsText"
android:layout_alignBottom="@id/dollarsText"
android:layout_alignTop="@id/dollarsText"
android:layout_alignParentEnd="true"
android:indeterminate="false"
android:progress="62"/>


</RelativeLayout>

0 comments on commit 40e1229

Please sign in to comment.