Skip to content

Commit

Permalink
solve bug of hiding of fab on opening snackbar
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitbansal05 committed Feb 3, 2018
1 parent b65f022 commit c6e527f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 48 deletions.
84 changes: 41 additions & 43 deletions res/layout/list_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
ownCloud Android client application
Copyright (C) 2012 Bartek Przybylski
Expand All @@ -17,21 +16,19 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:id="@+id/coordinator_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:filterTouchesWhenObscured="true"
>
android:filterTouchesWhenObscured="true">

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:fab="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentTop="true"
>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="top">

<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_containing_list"
Expand Down Expand Up @@ -76,18 +73,20 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone" >
<ScrollView

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/empty_list_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="@string/empty"
android:visibility="visible" />
</ScrollView>
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical|center_horizontal"
android:text="@string/empty"
android:visibility="visible" />
</ScrollView>
</android.support.v4.widget.SwipeRefreshLayout>

</FrameLayout>
Expand All @@ -96,51 +95,50 @@
android:id="@+id/fab_main"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_gravity="bottom|end"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_marginEnd="@dimen/standard_margin"
android:layout_marginRight="@dimen/standard_margin"
android:visibility="gone"
fab:layout_dodgeInsetEdges="bottom"
fab:fab_addButtonColorNormal="@color/primary_button_background_color"
fab:fab_addButtonColorPressed="@color/owncloud_blue"
fab:fab_addButtonPlusIconColor="@color/white"
fab:fab_labelStyle="@style/menu_labels_style"
android:layout_marginBottom="@dimen/standard_margin"
android:layout_marginRight="@dimen/standard_margin"
android:layout_marginEnd="@dimen/standard_margin"
android:visibility="gone">
fab:fab_labelStyle="@style/menu_labels_style">

<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_upload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_size="mini"
fab:fab_icon="@drawable/ic_action_upload"
fab:fab_colorNormal="@color/primary_button_background_color"
fab:fab_colorPressed="@color/owncloud_blue"
fab:fab_title=""/>
fab:fab_icon="@drawable/ic_action_upload"
fab:fab_size="mini"
fab:fab_title="" />

<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_upload_from_app"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_size="mini"
fab:fab_icon="@drawable/ic_import"
fab:fab_colorNormal="@color/primary_button_background_color"
fab:fab_colorPressed="@color/owncloud_blue"
fab:fab_title=""/>
fab:fab_icon="@drawable/ic_import"
fab:fab_size="mini"
fab:fab_title="" />

<com.getbase.floatingactionbutton.FloatingActionButton
android:id="@+id/fab_mkdir"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
fab:fab_size="mini"
fab:fab_icon="@drawable/ic_action_create_dir"
fab:fab_colorNormal="@color/primary_button_background_color"
fab:fab_colorPressed="@color/owncloud_blue"
fab:fab_title=""/>
fab:fab_icon="@drawable/ic_action_create_dir"
fab:fab_size="mini"
fab:fab_title="" />

</com.getbase.floatingactionbutton.FloatingActionsMenu>

<!-- last to draw, will be top in Z axis -->
<include layout="@layout/top_progress_bar"/>
<include layout="@layout/top_progress_bar" />

</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>
4 changes: 2 additions & 2 deletions res/layout/top_progress_bar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
android:layout_height="4dp"
android:padding="0dp"
android:layout_margin="0dp"
android:layout_alignParentTop="true"
android:layout_gravity="top"
style="@style/Widget.ownCloud.TopProgressBar"
android:indeterminate="false"
android:indeterminateOnly="false"
android:visibility="visible"
/>

</merge>
</merge>
2 changes: 1 addition & 1 deletion src/com/owncloud/android/ui/activity/FileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public void onCancelCertificate() {
*/
public void showSnackMessage(String message) {
Snackbar snackbar = Snackbar.make(
findViewById(android.R.id.content),
findViewById(R.id.coordinator_layout),
message,
Snackbar.LENGTH_LONG
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void onClick(DialogInterface dialog, int which) {
*/
private void showSnackMessage(int messageResource) {
Snackbar snackbar = Snackbar.make(
getActivity().findViewById(android.R.id.content),
getActivity().findViewById(R.id.coordinator_layout),
messageResource,
Snackbar.LENGTH_LONG
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ private void saveGridAsPreferred(boolean setGrid){
*/
private void showSnackMessage(int messageResource) {
Snackbar snackbar = Snackbar.make(
getActivity().findViewById(android.R.id.content),
getActivity().findViewById(R.id.coordinator_layout),
messageResource,
Snackbar.LENGTH_LONG
);
Expand Down

0 comments on commit c6e527f

Please sign in to comment.