aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java4
-rw-r--r--src/main/res/layout/activity_media_browser.xml15
-rw-r--r--src/main/res/menu/fragment_conversation.xml2
3 files changed, 20 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java b/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java
index ce5291466..9aa308f57 100644
--- a/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/MediaBrowserActivity.java
@@ -51,6 +51,8 @@ public class MediaBrowserActivity extends XmppActivity implements OnMediaLoaded
mMediaAdapter = new MediaAdapter(this, R.dimen.media_size);
this.binding.media.setAdapter(mMediaAdapter);
GridManager.setupLayoutManager(this, this.binding.media, R.dimen.browser_media_size);
+ this.binding.noMedia.setVisibility(View.GONE);
+ this.binding.progressbar.setVisibility(View.VISIBLE);
}
@Override
@@ -74,8 +76,10 @@ public class MediaBrowserActivity extends XmppActivity implements OnMediaLoaded
if (attachments.size() > 0) {
mMediaAdapter.setAttachments(attachments);
this.binding.noMedia.setVisibility(View.GONE);
+ this.binding.progressbar.setVisibility(View.GONE);
} else {
this.binding.noMedia.setVisibility(View.VISIBLE);
+ this.binding.progressbar.setVisibility(View.GONE);
}
});
}
diff --git a/src/main/res/layout/activity_media_browser.xml b/src/main/res/layout/activity_media_browser.xml
index e94fc97e6..809fc2911 100644
--- a/src/main/res/layout/activity_media_browser.xml
+++ b/src/main/res/layout/activity_media_browser.xml
@@ -20,6 +20,21 @@
android:padding="2dp"
android:scrollbars="vertical" />
+ <RelativeLayout
+ android:id="@+id/progressbar"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ProgressBar
+ style="?android:attr/progressBarStyleLarge"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerInParent="true"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:gravity="center" />
+ </RelativeLayout>
+
<TextView
android:id="@+id/no_media"
android:layout_width="match_parent"
diff --git a/src/main/res/menu/fragment_conversation.xml b/src/main/res/menu/fragment_conversation.xml
index 14a3ecbc6..8858d941d 100644
--- a/src/main/res/menu/fragment_conversation.xml
+++ b/src/main/res/menu/fragment_conversation.xml
@@ -98,7 +98,7 @@
<item
android:id="@+id/action_mediabrowser"
android:icon="@drawable/ic_image_white_24dp"
- android:orderInCategory="100"
+ android:orderInCategory="1"
android:title="@string/media_browser"
app:showAsAction="always" />
</menu> \ No newline at end of file