aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/mygram/droid/MainActivity.java
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-22 11:53:30 +0200
committerDanilo M. <danix@danix.xyz>2026-10-22 11:53:30 +0200
commit01a5f2a67a43f268e2807e29e8664e6bbc5d655e (patch)
tree2a239a13dcb22d5e3af423b74529b6a61701aacf /app/src/main/java/mygram/droid/MainActivity.java
parent1fb99957c3c04b3ab5ca7e7d63c31ab0a62a9186 (diff)
downloadmygram-droid-01a5f2a67a43f268e2807e29e8664e6bbc5d655e.tar.gz
mygram-droid-01a5f2a67a43f268e2807e29e8664e6bbc5d655e.zip
Pink scaled focus, current-view mark, app logo as Home
From on-device testing: the grey focus box looked heavy, the current tab was not visible once focus moved into the content, and "Settings" was clipped. Focus now scales the icon and tints it with the logo pink; a pink bar marks the current view; the label is WRAP_CONTENT (the vertical default, MATCH_PARENT, did not widen its box). Home uses the app logo instead of loading Foldergram's from the instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'app/src/main/java/mygram/droid/MainActivity.java')
-rw-r--r--app/src/main/java/mygram/droid/MainActivity.java20
1 files changed, 11 insertions, 9 deletions
diff --git a/app/src/main/java/mygram/droid/MainActivity.java b/app/src/main/java/mygram/droid/MainActivity.java
index 7c29e0a..877f180 100644
--- a/app/src/main/java/mygram/droid/MainActivity.java
+++ b/app/src/main/java/mygram/droid/MainActivity.java
@@ -60,7 +60,7 @@ public final class MainActivity extends Activity {
private HomeRows homeRows;
private int tab = HOME;
private boolean ready, resumed, homeLoading;
- private ImageView logo;
+ private LinearLayout homeButton, likedButton, foldersButton;
@Override
protected void onCreate(Bundle state) {
@@ -93,19 +93,20 @@ public final class MainActivity extends Activity {
connect();
}
- /** [logo] [Reels] [Liked] [Folders] [Settings] */
+ /** [logo] [Reels] [Liked] [Folders] [Settings]; the current view is marked. */
private View topBar() {
LinearLayout bar = new LinearLayout(this);
bar.setGravity(Gravity.CENTER_VERTICAL);
int p = Ui.dp(this, 16);
bar.setPadding(p * 2, p, p * 2, 0);
- LinearLayout home = Ui.iconButton(this, R.drawable.ic_home, "Home", v -> show(HOME));
- logo = (ImageView) home.getChildAt(0);
- bar.addView(home);
+ homeButton = Ui.iconButton(this, R.drawable.ic_launcher, "Home", v -> show(HOME));
+ bar.addView(homeButton);
bar.addView(new Space(this), new LinearLayout.LayoutParams(0, 1, 1));
bar.addView(Ui.iconButton(this, R.drawable.ic_reels, "Reels", v -> Playlist.openReels(this)));
- bar.addView(Ui.iconButton(this, R.drawable.ic_favorite, "Liked", v -> show(LIKED)));
- bar.addView(Ui.iconButton(this, R.drawable.ic_folder, "Folders", v -> show(FOLDERS)));
+ likedButton = Ui.iconButton(this, R.drawable.ic_favorite, "Liked", v -> show(LIKED));
+ bar.addView(likedButton);
+ foldersButton = Ui.iconButton(this, R.drawable.ic_folder, "Folders", v -> show(FOLDERS));
+ bar.addView(foldersButton);
bar.addView(new Space(this), new LinearLayout.LayoutParams(0, 1, 1));
bar.addView(Ui.iconButton(this, R.drawable.ic_settings, "Settings",
v -> startActivity(new Intent(this, SettingsActivity.class))));
@@ -123,8 +124,6 @@ public final class MainActivity extends Activity {
if (isDestroyed())
return;
ready = true;
- // Foldergram's logo is AGPLv3: loaded from the instance after login, never bundled.
- Glide.with(logo).load(Api.resolve(Prefs.server(), "/icon-192.png")).error(R.drawable.ic_home).into(logo);
backgrounds = posts;
handler.removeCallbacks(rotate);
rotateBackground();
@@ -151,6 +150,9 @@ public final class MainActivity extends Activity {
if (!ready)
return;
tab = t;
+ Ui.markCurrent(homeButton, t == HOME);
+ Ui.markCurrent(likedButton, t == LIKED);
+ Ui.markCurrent(foldersButton, t == FOLDERS);
if (t == HOME) {
if (homeList != null) {
setContent(homeList);