mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
ポップアップメニューに変更
This commit is contained in:
parent
8a64d84ff7
commit
6413ffae88
|
@ -10,6 +10,7 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.PopupMenu;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
@ -148,11 +149,24 @@ public class ViewerContainerFragment extends Fragment {
|
||||||
|
|
||||||
ImageButton imageButton = customView.findViewById(R.id.tab_modify);
|
ImageButton imageButton = customView.findViewById(R.id.tab_modify);
|
||||||
imageButton.setOnClickListener(v -> {
|
imageButton.setOnClickListener(v -> {
|
||||||
renameCombinedDocument(
|
PopupMenu popupMenu = new PopupMenu(getContext(), v);
|
||||||
this.documentId,
|
popupMenu.inflate(R.menu.viewer_tab_menu);
|
||||||
viewerViewPagerAdapter.getFragmentTargetId(position),
|
popupMenu.setOnMenuItemClickListener(item -> {
|
||||||
viewerViewPagerAdapter.getFragmentTitle(position),
|
if (item.getItemId() == R.id.action_rename) {
|
||||||
position);
|
renameCombinedDocument(
|
||||||
|
documentId,
|
||||||
|
viewerViewPagerAdapter.getFragmentTargetIdList().get(position),
|
||||||
|
viewerViewPagerAdapter.getFragmentTitle(position),
|
||||||
|
position);
|
||||||
|
return true;
|
||||||
|
} else if (item.getItemId() == R.id.action_delete) {
|
||||||
|
Toast.makeText(getContext(), "Work in progress", Toast.LENGTH_SHORT).show();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
popupMenu.show();
|
||||||
});
|
});
|
||||||
|
|
||||||
tab.setCustomView(customView);
|
tab.setCustomView(customView);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user