GamingMode: Make AppTile view smaller and remove the app label
We already know what app is it by looking at the icon, so lets simplify
the view of it for better visual appearance.
Signed-off-by: Nauval Rizky <enuma.alrizky@gmail.com>
diff --git a/app/src/main/java/org/exthmui/game/qs/AppTile.java b/app/src/main/java/org/exthmui/game/qs/AppTile.java
index 41a5491..d288717 100644
--- a/app/src/main/java/org/exthmui/game/qs/AppTile.java
+++ b/app/src/main/java/org/exthmui/game/qs/AppTile.java
@@ -19,6 +19,10 @@
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
+import android.view.View;
+import android.widget.LinearLayout;
+
+import org.exthmui.game.R;
public class AppTile extends TileBase {
@@ -27,7 +31,11 @@
PackageManager pm = context.getPackageManager();
try {
ApplicationInfo applicationInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA);
- qsText.setText(applicationInfo.loadLabel(pm));
+ int size = (int) context.getResources().getDimension(R.dimen.app_qs_icon_size);
+ int padding = (int) context.getResources().getDimension(R.dimen.app_qs_icon_padding);
+ qsText.setVisibility(View.GONE);
+ qsIcon.setPadding(padding,padding,padding,padding);
+ qsIcon.setLayoutParams(new LinearLayout.LayoutParams(size, size));
qsIcon.setImageDrawable(applicationInfo.loadIcon(pm));
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml
index 2e5fbd6..03f84ca 100644
--- a/app/src/main/res/values/dimens.xml
+++ b/app/src/main/res/values/dimens.xml
@@ -5,6 +5,8 @@
<dimen name="gaming_qs_icon_size">56dp</dimen>
<dimen name="gaming_qs_icon_padding">16dp</dimen>
<dimen name="gaming_qs_text_size">12sp</dimen>
+ <dimen name="app_qs_icon_size">32dp</dimen>
+ <dimen name="app_qs_icon_padding">2dp</dimen>
<dimen name="music_info_margin_horizontal">6dp</dimen>
<dimen name="time_battery_margin_horizontal">6dp</dimen>
<dimen name="gaming_menu_padding">12dp</dimen>