Skip to content

Commit

Permalink
add loading layout
Browse files Browse the repository at this point in the history
Signed-off-by: alperozturk <[email protected]>
  • Loading branch information
alperozturk96 committed Feb 19, 2025
1 parent 2adf41f commit ca134d9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ private void initializeArguments() {
repository.getSharesForNotesAndSaveShareEntities();

runOnUiThread(() -> {
binding.searchContainer.setVisibility(View.VISIBLE);
binding.sharesList.setVisibility(View.VISIBLE);
binding.sharesList.setAdapter(new ShareeListAdapter(this, new ArrayList<>(), this, account));
binding.sharesList.setLayoutManager(new LinearLayoutManager(this));
binding.pickContactEmailBtn.setOnClickListener(v -> checkContactPermission());
Expand All @@ -123,6 +125,7 @@ private void initializeArguments() {
}

refreshSharesFromDB();
binding.loadingLayout.setVisibility(View.GONE);
});
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down
32 changes: 32 additions & 0 deletions app/src/main/res/layout/activity_note_share.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,36 @@
android:orientation="vertical"
android:paddingTop="@dimen/spacer_1hx">

<LinearLayout
android:id="@+id/loadingLayout"
tools:visibility="gone"
android:visibility="visible"
android:layout_width="match_parent"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical"
android:layout_height="match_parent">

<com.google.android.material.progressindicator.CircularProgressIndicator
android:layout_width="wrap_content"
android:layout_marginTop="@dimen/spacer_1x"
android:layout_height="wrap_content"
android:layout_gravity="center" />

<TextView
android:layout_width="match_parent"
android:layout_marginTop="@dimen/spacer_1x"
android:gravity="center"
android:layout_height="wrap_content"
android:text="@string/common_loading"
android:textSize="@dimen/note_font_size_large" />

</LinearLayout>

<LinearLayout
android:id="@+id/search_container"
tools:visibility="visible"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
Expand Down Expand Up @@ -81,6 +109,8 @@
android:id="@+id/shared_with_you_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:visibility="visible"
android:visibility="gone"
android:layout_marginBottom="@dimen/spacer_1x"
android:orientation="horizontal"
android:paddingLeft="@dimen/spacer_2x"
Expand Down Expand Up @@ -138,6 +168,8 @@

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/sharesList"
tools:visibility="visible"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@drawable/divider"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
<string name="menu_favorite">Favorite</string>
<string name="menu_preview">Preview</string>
<string name="menu_share">Share</string>
<string name="common_loading">Loading…</string>


<string name="search_in_category">Search in %1$s</string>
<string name="search_in_all">Search all notes</string>
Expand Down

0 comments on commit ca134d9

Please sign in to comment.