Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
zhwanng committed Dec 18, 2024
1 parent 737f80d commit 1987d30
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ protected void onBindViewHolder(@NonNull DocsCommentViewHolder holder, int i, @N
}


//![](https://dev.seafile.com/e-Hek4ng6iRbCw7h-bXsc6jA.png)\n是是是\n
private void addViews(DocsCommentViewHolder holder, DocsCommentModel model) {
int index = 0;
for (RichEditText.RichContentModel commentModel : model.commentList) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

import com.bumptech.glide.Glide;
import com.seafile.seadroid2.R;
import com.seafile.seadroid2.annotation.Todo;
import com.seafile.seadroid2.databinding.ItemUserAvatarBinding;
import com.seafile.seadroid2.framework.data.model.user.UserModel;
import com.seafile.seadroid2.ui.base.adapter.BaseAdapter;

@Todo
public class DocsCommentUserAdapter extends BaseAdapter<UserModel, DocsCommentUserViewHolder> {
@Override
protected void onBindViewHolder(@NonNull DocsCommentUserViewHolder holder, int i, @Nullable UserModel model) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import androidx.annotation.NonNull;

import com.seafile.seadroid2.annotation.Todo;
import com.seafile.seadroid2.databinding.ItemUserAvatarBinding;
import com.seafile.seadroid2.ui.base.viewholder.BaseViewHolder;

@Todo
public class DocsCommentUserViewHolder extends BaseViewHolder {

public ItemUserAvatarBinding binding;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,15 +283,11 @@ private void uploadFile(Uri o) {
binding.richEditText.insertImage(o);

ContentResolver contentResolver = getContentResolver();
// https://dev.seafile.com/seafhttp/repos/bc1db6db-afa8-4e85-8479-6eb3f50f3d1c/files/images/sdoc/e4c22460-e99d-4687-9081-1f30d156625d/image-UFB28ta7TVOskNE0uAZ_Ww.jpeg/?op=download
// https://dev.seafile.com/seahub/lib/bc1db6db-afa8-4e85-8479-6eb3f50f3d1c/file/images/sdoc/e4c22460-e99d-4687-9081-1f30d156625d/image-UFB28ta7TVOskNE0uAZ_Ww.jpeg
// https://dev.seafile.com/seafhttp/files/73372487-3bb8-4f1d-925e-6e21bb72305c/image-UFB28ta7TVOskNE0uAZ_Ww.jpeg
// https://dev.seafile.com/seafhttp/files/b1d6e2d7-8b28-4a8e-af93-f3ca70bf51ea/image-UFB28ta7TVOskNE0uAZ_Ww.jpeg
// https://dev.seafile.com/seahub/api/v2.1/seadoc/download-image/e4c22460-e99d-4687-9081-1f30d156625d/image-UFB28ta7TVOskNE0uAZ_Ww.jpeg

//upload file
getViewModel().uploadFile(contentResolver, o, pageOptionsModel.docUuid, pageOptionsModel.seadocAccessToken, new Consumer<String>() {
@Override
public void accept(String absUrl) throws Exception {
public void accept(String absUrl) {
binding.richEditText.updateUploadState(o.toString(), absUrl);
}
}, new Consumer<String>() {
Expand Down Expand Up @@ -325,6 +321,7 @@ private void submitData() {
return;
}

// 0 is root comment
getViewModel().postComment(pageOptionsModel, sb.toString(), "0");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ private List<RichEditText.RichContentModel> getImageMdResult(String s) {
models.add(m);
}

//![](https://dev.seafile.com/seahub/api/v2.1/seadoc/download-image/e4c22460-e99d-4687-9081-1f30d156625d/image-eEy2ClPsSV6nlef3v1FW-g.jpg)
String sss = org.apache.commons.lang3.StringUtils.substring(s, start + 4, end);
String content = sss.trim();// URLEncoder.encode(,"utf-8");
if (!TextUtils.isEmpty(content) && !TextUtils.equals("null", content.toLowerCase(Locale.getDefault()))) {
Expand Down Expand Up @@ -439,7 +438,6 @@ public void accept(Throwable throwable) {
}


//{"relative_path":["/image-UFB28ta7TVOskNE0uAZ_Ww.jpeg"]}
public void uploadFile(ContentResolver contentResolver, Uri uri, String docUid, String token, Consumer<String> consumer, Consumer<String> errorCallBack) {
String fileName = ContentResolvers.getFileNameFromUri(contentResolver, uri);

Expand All @@ -463,8 +461,6 @@ public void accept(DocsUploadResultModel resultModel) throws Exception {
String sUrl = HttpIO.getCurrentInstance().getServerUrl();
String absUrl = Utils.pathJoin(sUrl, "api", "v2.1", "seadoc", "download-image", docUid, sName);

//https://dev.seafile.com/seahub/api/v2.1/seadoc/download-image/e4c22460-e99d-4687-9081-1f30d156625d/+::

consumer.accept(absUrl);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup c
@NonNull
@Override
public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
BottomSheetDialog bottomSheetDialog = new BottomSheetDialog(requireContext());
// bottomSheetDialog.setContentView(binding.getRoot());
//
// View bottomSheetInternal = bottomSheetDialog.findViewById(R.id.design_bottom_sheet);
//// BottomSheetBehavior.from(bottomSheetInternal).setPeekHeight(800);
//
// View bottomSheetContent = bottomSheetInternal.findViewById(R.id.bottom_drawer_2);
// ViewUtils.doOnApplyWindowInsets(bottomSheetContent, new ViewUtils.OnApplyWindowInsetsListener() {
// @Override
// public WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat insets, ViewUtils.RelativePadding initialPadding) {
// // Add the inset in the inner NestedScrollView instead to make the edge-to-edge behavior
// // consistent - i.e., the extra padding will only show at the bottom of all content, i.e.,
// // only when you can no longer scroll down to show more content.
// ViewCompat.setPaddingRelative(bottomSheetContent,
// initialPadding.start,
// initialPadding.top,
// initialPadding.end,
// initialPadding.bottom + insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom);
// return insets;
// }
// });

return bottomSheetDialog;
return new BottomSheetDialog(requireContext());
}

@Override
Expand Down

0 comments on commit 1987d30

Please sign in to comment.