Skip to content

Commit

Permalink
Upload bottom sheet bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
shashvat-kedia committed Feb 8, 2018
1 parent 38b17e2 commit c00baa6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Binary file removed res/drawable-xxxhdpi/bottom_sheets_camera.png
Binary file not shown.
24 changes: 13 additions & 11 deletions src/com/owncloud/android/ui/fragment/OCFileListFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
package com.owncloud.android.ui.fragment;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
Expand Down Expand Up @@ -104,11 +105,6 @@ public class OCFileListFragment extends ExtendedListFragment {
private OCFile mFile = null;
private FileListListAdapter mAdapter;

private LinearLayout uploadFilesLinearLayout;
private LinearLayout uploadFromCameraLinearLayout;
private TextView uploadToTextView;
private BottomSheetBehavior uploadBottomSheetBehavior;

private int mStatusBarColorActionMode;
private int mStatusBarColor;

Expand Down Expand Up @@ -267,12 +263,12 @@ private void registerFabUploadListeners() {
@Override
public void onClick(View v) {
Log_OC.e(TAG,"Clicked" + getContext().toString());
View uploadBottomSheet = getLayoutInflater().inflate(R.layout.upload_bottom_sheet_fragment,null);
final View uploadBottomSheet = getLayoutInflater().inflate(R.layout.upload_bottom_sheet_fragment,null);
final BottomSheetDialog dialog = new BottomSheetDialog(getContext());
dialog.setContentView(uploadBottomSheet);
uploadFilesLinearLayout = (LinearLayout) uploadBottomSheet.findViewById(R.id.files_linear_layout);
uploadFromCameraLinearLayout = (LinearLayout) uploadBottomSheet.findViewById(R.id.upload_from_camera_linear_layout);
uploadToTextView = (TextView) uploadBottomSheet.findViewById(R.id.upload_to_text_view);
LinearLayout uploadFilesLinearLayout = (LinearLayout) uploadBottomSheet.findViewById(R.id.files_linear_layout);
LinearLayout uploadFromCameraLinearLayout = (LinearLayout) uploadBottomSheet.findViewById(R.id.upload_from_camera_linear_layout);
TextView uploadToTextView = (TextView) uploadBottomSheet.findViewById(R.id.upload_to_text_view);
uploadFilesLinearLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
Expand All @@ -292,8 +288,14 @@ public boolean onTouch(View v, MotionEvent event) {
}
});
uploadToTextView.setText(String.format(getResources().getString(R.string.upload_to),getResources().getString(R.string.app_name)));
uploadBottomSheetBehavior = BottomSheetBehavior.from((View) uploadBottomSheet.getParent());
uploadBottomSheetBehavior.setPeekHeight(-1);
final BottomSheetBehavior uploadBottomSheetBehavior = BottomSheetBehavior.from((View) uploadBottomSheet.getParent());
uploadBottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
dialog.setOnShowListener(new DialogInterface.OnShowListener() {
@Override
public void onShow(DialogInterface dialog) {
uploadBottomSheetBehavior.setPeekHeight(uploadBottomSheet.getMeasuredHeight());
}
});
dialog.show();
getFabMain().collapse();
recordMiniFabClick();
Expand Down

0 comments on commit c00baa6

Please sign in to comment.