Skip to content

Commit 97e1eee

Browse files
Merge pull request #12 from D4rK7355608/codex/exclude-java-package-from-promotion-and-standardize-card-hei
Fix promo list
2 parents 7739f93 + 7fe5b0b commit 97e1eee

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/src/main/java/com/d4rk/androidtutorials/java/ui/screens/home/repository/HomeRepository.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,13 @@ public void fetchPromotedApps(PromotedAppsCallback callback) {
8787
JSONArray apps = response.getJSONObject("data").getJSONArray("apps");
8888
for (int i = 0; i < apps.length(); i++) {
8989
JSONObject obj = apps.getJSONObject(i);
90+
String pkg = obj.getString("packageName");
91+
if (BuildConfig.APPLICATION_ID.equals(pkg)) {
92+
continue;
93+
}
9094
result.add(new PromotedApp(
9195
obj.getString("name"),
92-
obj.getString("packageName"),
96+
pkg,
9397
obj.getString("iconLogo")
9498
));
9599
}

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
xmlns:app="http://schemas.android.com/apk/res-auto"
44
style="@style/Widget.Material3.CardView.Elevated"
55
android:layout_width="160dp"
6-
android:layout_height="wrap_content"
6+
android:layout_height="180dp"
77
android:layout_marginEnd="8dp">
88

99
<androidx.appcompat.widget.LinearLayoutCompat
@@ -25,6 +25,8 @@
2525
android:layout_width="match_parent"
2626
android:layout_height="wrap_content"
2727
android:layout_marginTop="8dp"
28+
android:maxLines="2"
29+
android:ellipsize="end"
2830
android:text="App"
2931
android:textAppearance="@style/TextAppearance.Material3.BodyMedium" />
3032

0 commit comments

Comments
 (0)