mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-26 17:53:14 +00:00
combine実装
This commit is contained in:
parent
f9df1379f4
commit
b9c1c521cf
|
@ -19,6 +19,7 @@ import com.google.android.material.textfield.TextInputLayout;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import dagger.hilt.android.AndroidEntryPoint;
|
import dagger.hilt.android.AndroidEntryPoint;
|
||||||
|
import one.nem.lacerta.component.common.picker.LacertaFilePickerDialog;
|
||||||
import one.nem.lacerta.data.Document;
|
import one.nem.lacerta.data.Document;
|
||||||
import one.nem.lacerta.data.LacertaLibrary;
|
import one.nem.lacerta.data.LacertaLibrary;
|
||||||
import one.nem.lacerta.model.document.page.Page;
|
import one.nem.lacerta.model.document.page.Page;
|
||||||
|
@ -156,6 +157,9 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
} else if (item.getItemId() == R.id.action_move) {
|
} else if (item.getItemId() == R.id.action_move) {
|
||||||
Toast.makeText(getContext(), "Work in progress", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getContext(), "Work in progress", Toast.LENGTH_SHORT).show();
|
||||||
return true;
|
return true;
|
||||||
|
} else if (item.getItemId() == R.id.action_combine) {
|
||||||
|
combineDocument();
|
||||||
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -163,6 +167,23 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void combineDocument() {
|
||||||
|
LacertaFilePickerDialog lacertaFilePickerDialog = new LacertaFilePickerDialog();
|
||||||
|
lacertaFilePickerDialog.setListener((fileName, selectedId) -> {
|
||||||
|
lacertaLibrary.combineDocument(documentId, selectedId).thenAccept(aVoid -> {
|
||||||
|
getActivity().runOnUiThread(() -> {
|
||||||
|
Toast.makeText(getContext(), "結合しました", Toast.LENGTH_SHORT).show();
|
||||||
|
getActivity().finish(); // TODO-rca: 終了させずにUIを更新したい
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
lacertaFilePickerDialog
|
||||||
|
.setTitle("ファイルの結合")
|
||||||
|
.setMessage("結合するファイルを選択してください")
|
||||||
|
.setNegativeButtonText("キャンセル")
|
||||||
|
.show(getChildFragmentManager(), "LacertaFilePickerDialog");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ドキュメント名を変更する
|
* ドキュメント名を変更する
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user