Skip to content

Commit e14a9c1

Browse files
madhurgupta10neslihanturan
authored andcommitted
Added Title to the Pic of the Day App Widget (commons-app#2758)
1 parent f7f88d5 commit e14a9c1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

app/src/main/java/fr/free/nrw/commons/widget/PicOfDayAppWidget.java

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ private void loadPictureOfTheDay(Context context,
6161
.subscribe(
6262
response -> {
6363
if (response != null) {
64+
views.setTextViewText(R.id.appwidget_title, response.getDisplayTitle());
6465
loadImageFromUrl(response.getImageUrl(), context, views, appWidgetManager, appWidgetId);
6566
}
6667
},

app/src/main/res/layout/pic_of_day_app_widget.xml

+13-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,23 @@
1515
android:layout_marginTop="10dp"
1616
android:text="@string/app_widget_heading"/>
1717

18+
<TextView
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:id="@+id/appwidget_title"
22+
android:textAlignment="center"
23+
android:layout_gravity="bottom"
24+
android:textColor="@color/white"
25+
android:layout_marginTop="15dp"
26+
android:layout_marginStart="5dp"
27+
android:layout_marginEnd="5dp"
28+
android:textSize="12sp"/>
29+
1830
<ImageView
1931
android:padding="15dp"
2032
android:id="@+id/appwidget_image"
2133
android:layout_width="match_parent"
22-
android:layout_height="match_parent"
34+
android:layout_height="wrap_content"
2335
android:contentDescription="@string/appwidget_img" />
2436

2537
</LinearLayout>

0 commit comments

Comments
 (0)