Feat[launcher]: add "Open game directory" button

- Also refactors the file sending mechanism.
This commit is contained in:
Maksim Belov 2024-10-14 13:26:13 +03:00 committed by Maksim Belov
parent ce2d81eaae
commit 9a2cabb628
8 changed files with 160 additions and 90 deletions

View File

@ -510,38 +510,20 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
b.show(); b.show();
} }
private static void setUri(Context context, String input, Intent intent) {
if(input.startsWith("file:")) {
int truncLength = 5;
if(input.startsWith("file://")) truncLength = 7;
input = input.substring(truncLength);
Log.i("MainActivity", input);
boolean isDirectory = new File(input).isDirectory();
if(isDirectory) {
intent.setType(DocumentsContract.Document.MIME_TYPE_DIR);
}else{
String type = null;
String extension = MimeTypeMap.getFileExtensionFromUrl(input);
if(extension != null) type = MimeTypeMap.getSingleton().getMimeTypeFromExtension(extension);
if(type == null) type = "*/*";
intent.setType(type);
}
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
intent.setData(DocumentsContract.buildDocumentUri(
context.getString(R.string.storageProviderAuthorities), input
));
return;
}
intent.setDataAndType(Uri.parse(input), "*/*");
}
public static void openLink(String link) { public static void openLink(String link) {
Context ctx = touchpad.getContext(); // no more better way to obtain a context statically Context ctx = touchpad.getContext(); // no more better way to obtain a context statically
((Activity)ctx).runOnUiThread(() -> { ((Activity)ctx).runOnUiThread(() -> {
try { try {
if(link.startsWith("file:")) {
int truncLength = 5;
if(link.startsWith("file://")) truncLength = 7;
String path = link.substring(truncLength);
Tools.openPath(ctx, new File(path), false);
}else {
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW);
setUri(ctx, link, intent); intent.setDataAndType(Uri.parse(link), "*/*");
ctx.startActivity(intent); ctx.startActivity(intent);
}
} catch (Throwable th) { } catch (Throwable th) {
Tools.showError(ctx, th); Tools.showError(ctx, th);
} }
@ -552,9 +534,7 @@ public class MainActivity extends BaseActivity implements ControlButtonMenuListe
Context ctx = touchpad.getContext(); // no more better way to obtain a context statically Context ctx = touchpad.getContext(); // no more better way to obtain a context statically
((Activity)ctx).runOnUiThread(() -> { ((Activity)ctx).runOnUiThread(() -> {
try { try {
Intent intent = new Intent(Intent.ACTION_VIEW); Tools.openPath(ctx, new File(path), false);
intent.setDataAndType(DocumentsContract.buildDocumentUri(ctx.getString(R.string.storageProviderAuthorities), path), "*/*");
ctx.startActivity(intent);
} catch (Throwable th) { } catch (Throwable th) {
Tools.showError(ctx, th); Tools.showError(ctx, th);
} }

View File

@ -72,6 +72,7 @@ import org.apache.commons.codec.binary.Hex;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.lwjgl.glfw.CallbackBridge; import org.lwjgl.glfw.CallbackBridge;
import java.io.BufferedInputStream;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -82,6 +83,7 @@ import java.io.PrintWriter;
import java.io.StringWriter; import java.io.StringWriter;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.ParseException; import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
@ -1108,17 +1110,55 @@ public final class Tools {
/** Triggers the share intent chooser, with the latestlog file attached to it */ /** Triggers the share intent chooser, with the latestlog file attached to it */
public static void shareLog(Context context){ public static void shareLog(Context context){
Uri contentUri = DocumentsContract.buildDocumentUri(context.getString(R.string.storageProviderAuthorities), Tools.DIR_GAME_HOME + "/latestlog.txt"); openPath(context, new File(Tools.DIR_GAME_HOME, "latestlog.txt"), true);
}
Intent shareIntent = new Intent(); /**
shareIntent.setAction(Intent.ACTION_SEND); * Determine the MIME type of a File.
shareIntent.putExtra(Intent.EXTRA_STREAM, contentUri); * @param file The file to determine the type of
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); * @return the type, or the default value *slash* if cannot be determined
shareIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); */
shareIntent.setType("text/plain"); public static String getMimeType(File file) {
if(file.isDirectory()) return DocumentsContract.Document.MIME_TYPE_DIR;
String mimeType = null;
try (FileInputStream fileInputStream = new FileInputStream(file)){
// Theoretically we don't even need the buffer since we don't care about the
// contents of the file after the guess, but mark-supported streams
// are a requirement of URLConnection.guessContentTypeFromStream()
try(BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream)) {
mimeType = URLConnection.guessContentTypeFromStream(bufferedInputStream);
}
}catch (IOException e) {
Log.w("FileMimeType", "Failed to determine MIME type by stream", e);
}
if(mimeType != null) return mimeType;
mimeType = URLConnection.guessContentTypeFromName(file.getName());
if(mimeType != null) return mimeType;
return "*/*";
}
Intent sendIntent = Intent.createChooser(shareIntent, "latestlog.txt"); /**
context.startActivity(sendIntent); * Open the path specified by a File in a file explorer or in a relevant application.
* @param context the current Context
* @param file the File to open
* @param share whether to open a "Share" or an "Open" dialog.
*/
public static void openPath(Context context, File file, boolean share) {
Uri contentUri = DocumentsContract.buildDocumentUri(context.getString(R.string.storageProviderAuthorities), file.getAbsolutePath());
String mimeType = getMimeType(file);
Intent intent = new Intent();
if(share) {
intent.setAction(Intent.ACTION_SEND);
intent.setType(getMimeType(file));
intent.putExtra(Intent.EXTRA_STREAM, contentUri);
}else {
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(contentUri, mimeType);
}
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Intent chooserIntent = Intent.createChooser(intent, file.getName());
context.startActivity(chooserIntent);
} }
/** Mesure the textview height, given its current parameters */ /** Mesure the textview height, given its current parameters */

View File

@ -1,5 +1,6 @@
package net.kdt.pojavlaunch.fragments; package net.kdt.pojavlaunch.fragments;
import static net.kdt.pojavlaunch.Tools.openPath;
import static net.kdt.pojavlaunch.Tools.shareLog; import static net.kdt.pojavlaunch.Tools.shareLog;
import android.content.Intent; import android.content.Intent;
@ -20,7 +21,12 @@ import net.kdt.pojavlaunch.R;
import net.kdt.pojavlaunch.Tools; import net.kdt.pojavlaunch.Tools;
import net.kdt.pojavlaunch.extra.ExtraConstants; import net.kdt.pojavlaunch.extra.ExtraConstants;
import net.kdt.pojavlaunch.extra.ExtraCore; import net.kdt.pojavlaunch.extra.ExtraCore;
import net.kdt.pojavlaunch.prefs.LauncherPreferences;
import net.kdt.pojavlaunch.progresskeeper.ProgressKeeper; import net.kdt.pojavlaunch.progresskeeper.ProgressKeeper;
import net.kdt.pojavlaunch.value.launcherprofiles.LauncherProfiles;
import net.kdt.pojavlaunch.value.launcherprofiles.MinecraftProfile;
import java.io.File;
public class MainMenuFragment extends Fragment { public class MainMenuFragment extends Fragment {
public static final String TAG = "MainMenuFragment"; public static final String TAG = "MainMenuFragment";
@ -38,6 +44,7 @@ public class MainMenuFragment extends Fragment {
Button mCustomControlButton = view.findViewById(R.id.custom_control_button); Button mCustomControlButton = view.findViewById(R.id.custom_control_button);
Button mInstallJarButton = view.findViewById(R.id.install_jar_button); Button mInstallJarButton = view.findViewById(R.id.install_jar_button);
Button mShareLogsButton = view.findViewById(R.id.share_logs_button); Button mShareLogsButton = view.findViewById(R.id.share_logs_button);
Button mOpenDirectoryButton = view.findViewById(R.id.open_files_button);
ImageButton mEditProfileButton = view.findViewById(R.id.edit_profile_button); ImageButton mEditProfileButton = view.findViewById(R.id.edit_profile_button);
Button mPlayButton = view.findViewById(R.id.play_button); Button mPlayButton = view.findViewById(R.id.play_button);
@ -57,12 +64,24 @@ public class MainMenuFragment extends Fragment {
mShareLogsButton.setOnClickListener((v) -> shareLog(requireContext())); mShareLogsButton.setOnClickListener((v) -> shareLog(requireContext()));
mOpenDirectoryButton.setOnClickListener((v)-> openPath(v.getContext(), getCurrentProfileDirectory(), false));
mNewsButton.setOnLongClickListener((v)->{ mNewsButton.setOnLongClickListener((v)->{
Tools.swapFragment(requireActivity(), GamepadMapperFragment.class, GamepadMapperFragment.TAG, null); Tools.swapFragment(requireActivity(), GamepadMapperFragment.class, GamepadMapperFragment.TAG, null);
return true; return true;
}); });
} }
private File getCurrentProfileDirectory() {
String currentProfile = LauncherPreferences.DEFAULT_PREF.getString(LauncherPreferences.PREF_KEY_CURRENT_PROFILE, null);
if(!Tools.isValidString(currentProfile)) return new File(Tools.DIR_GAME_NEW);
LauncherProfiles.load();
MinecraftProfile profileObject = LauncherProfiles.mainProfileJson.profiles.get(currentProfile);
if(profileObject == null) return new File(Tools.DIR_GAME_NEW);
return Tools.getGameDirPath(profileObject);
}
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();

View File

@ -30,11 +30,8 @@
app:layout_constraintGuide_percent="0.5"/> app:layout_constraintGuide_percent="0.5"/>
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/news_button" android:id="@+id/news_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@drawable/ic_menu_news" android:drawableStart="@drawable/ic_menu_news"
android:text="@string/mcl_tab_wiki" android:text="@string/mcl_tab_wiki"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -42,9 +39,7 @@
app:layout_constraintEnd_toStartOf="@id/social_divider"/> app:layout_constraintEnd_toStartOf="@id/social_divider"/>
<View <View
android:id="@+id/social_divider" android:id="@+id/social_divider"
android:layout_width="@dimen/padding_tiny" style="@style/LauncherFragment_Divider"
android:layout_height="0dp"
android:background="@color/divider"
android:layout_marginVertical="@dimen/padding_heavy" android:layout_marginVertical="@dimen/padding_heavy"
app:layout_constraintTop_toTopOf="@id/news_button" app:layout_constraintTop_toTopOf="@id/news_button"
app:layout_constraintStart_toStartOf="@id/center_guideline" app:layout_constraintStart_toStartOf="@id/center_guideline"
@ -52,11 +47,8 @@
app:layout_constraintBottom_toBottomOf="@id/news_button"/> app:layout_constraintBottom_toBottomOf="@id/news_button"/>
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/discord_button" android:id="@+id/discord_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@drawable/ic_discord" android:drawableStart="@drawable/ic_discord"
android:text="@string/mcl_button_discord" android:text="@string/mcl_button_discord"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -65,36 +57,48 @@
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/custom_control_button" android:id="@+id/custom_control_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@drawable/ic_menu_custom_controls" android:drawableStart="@drawable/ic_menu_custom_controls"
android:text="@string/mcl_option_customcontrol" android:text="@string/mcl_option_customcontrol"
app:layout_constraintTop_toBottomOf="@id/news_button"/> app:layout_constraintTop_toBottomOf="@id/news_button"/>
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/install_jar_button" android:id="@+id/install_jar_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@drawable/ic_menu_install_jar" android:drawableStart="@drawable/ic_menu_install_jar"
android:text="@string/main_install_jar_file" android:text="@string/main_install_jar_file"
app:layout_constraintTop_toBottomOf="@id/custom_control_button"/> app:layout_constraintTop_toBottomOf="@id/custom_control_button"
tools:layout_editor_absoluteX="0dp" />
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/share_logs_button" android:id="@+id/share_logs_button"
android:layout_width="match_parent" style="@style/LauncherMenuButton.Universal"
android:layout_height="wrap_content" android:layout_width="0dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@android:drawable/ic_menu_share" android:drawableStart="@android:drawable/ic_menu_share"
android:text="@string/main_share_logs" android:text="@string/main_share_logs"
app:layout_constraintTop_toBottomOf="@id/install_jar_button"/> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/install_jar_button"
app:layout_constraintEnd_toStartOf="@id/files_divider"/>
<View
android:id="@+id/files_divider"
style="@style/LauncherFragment_Divider"
android:layout_marginVertical="@dimen/padding_heavy"
app:layout_constraintTop_toTopOf="@id/share_logs_button"
app:layout_constraintStart_toStartOf="@id/center_guideline"
app:layout_constraintEnd_toEndOf="@id/center_guideline"
app:layout_constraintBottom_toBottomOf="@id/share_logs_button"/>
<com.kdt.mcgui.LauncherMenuButton
android:id="@+id/open_files_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="0dp"
android:drawableStart="@drawable/ic_folder"
android:text="@string/mcl_button_open_directory"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/files_divider"
app:layout_constraintTop_toBottomOf="@id/install_jar_button" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@ -26,10 +26,8 @@
app:layout_constraintGuide_percent="0.5"/> app:layout_constraintGuide_percent="0.5"/>
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/news_button" android:id="@+id/news_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/_66sdp"
android:background="?android:attr/selectableItemBackground"
android:text="@string/mcl_tab_wiki" android:text="@string/mcl_tab_wiki"
android:drawableStart="@drawable/ic_menu_news" android:drawableStart="@drawable/ic_menu_news"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -37,9 +35,7 @@
app:layout_constraintEnd_toStartOf="@id/social_divider" /> app:layout_constraintEnd_toStartOf="@id/social_divider" />
<View <View
android:id="@+id/social_divider" android:id="@+id/social_divider"
android:layout_width="@dimen/padding_tiny" style="@style/LauncherFragment_Divider"
android:layout_height="0dp"
android:background="@color/divider"
android:layout_marginVertical="@dimen/padding_large" android:layout_marginVertical="@dimen/padding_large"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="@id/center_guideline" app:layout_constraintStart_toStartOf="@id/center_guideline"
@ -47,10 +43,8 @@
app:layout_constraintBottom_toBottomOf="@id/news_button"/> app:layout_constraintBottom_toBottomOf="@id/news_button"/>
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/discord_button" android:id="@+id/discord_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/_66sdp"
android:background="?android:attr/selectableItemBackground"
android:text="@string/mcl_button_discord" android:text="@string/mcl_button_discord"
android:drawableStart="@drawable/ic_discord" android:drawableStart="@drawable/ic_discord"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
@ -60,36 +54,48 @@
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/custom_control_button" android:id="@+id/custom_control_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_66sdp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@drawable/ic_menu_custom_controls" android:drawableStart="@drawable/ic_menu_custom_controls"
android:text="@string/mcl_option_customcontrol" android:text="@string/mcl_option_customcontrol"
app:layout_constraintTop_toBottomOf="@id/news_button" app:layout_constraintTop_toBottomOf="@id/news_button" />
/>
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/install_jar_button" android:id="@+id/install_jar_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/_66sdp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@drawable/ic_menu_install_jar" android:drawableStart="@drawable/ic_menu_install_jar"
android:text="@string/main_install_jar_file" android:text="@string/main_install_jar_file"
app:layout_constraintTop_toBottomOf="@id/custom_control_button" />
app:layout_constraintTop_toBottomOf="@id/custom_control_button"
/>
<com.kdt.mcgui.LauncherMenuButton <com.kdt.mcgui.LauncherMenuButton
android:id="@+id/share_logs_button" android:id="@+id/share_logs_button"
android:layout_width="match_parent" style="@style/LauncherMenuButton.Universal"
android:layout_height="@dimen/_66sdp" android:layout_width="0dp"
android:background="?android:attr/selectableItemBackground"
android:drawableStart="@android:drawable/ic_menu_share" android:drawableStart="@android:drawable/ic_menu_share"
android:text="@string/main_share_logs" android:text="@string/main_share_logs"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/install_jar_button" app:layout_constraintTop_toBottomOf="@id/install_jar_button"
/> app:layout_constraintEnd_toStartOf="@id/files_divider"/>
<View
android:id="@+id/files_divider"
style="@style/LauncherFragment_Divider"
android:layout_marginVertical="@dimen/padding_large"
app:layout_constraintTop_toTopOf="@id/share_logs_button"
app:layout_constraintStart_toStartOf="@id/center_guideline"
app:layout_constraintEnd_toEndOf="@id/center_guideline"
app:layout_constraintBottom_toBottomOf="@id/share_logs_button"/>
<com.kdt.mcgui.LauncherMenuButton
android:id="@+id/open_files_button"
style="@style/LauncherMenuButton.Universal"
android:layout_width="0dp"
android:drawableStart="@drawable/ic_folder"
android:text="@string/mcl_button_open_directory"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/files_divider"
app:layout_constraintTop_toBottomOf="@id/install_jar_button" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView> </ScrollView>

View File

@ -12,4 +12,11 @@
<item name="android:textSize">@dimen/_14ssp</item> <item name="android:textSize">@dimen/_14ssp</item>
</style> </style>
<style name="LauncherMenuButton.Universal" parent="LauncherMenuButton">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:layout_marginBottom">8dp</item>
</style>
</resources> </resources>

View File

@ -415,6 +415,7 @@
<string name="preference_remap_controller_title">Change controller key bindings</string> <string name="preference_remap_controller_title">Change controller key bindings</string>
<string name="preference_remap_controller_description">Allows you to modify the keyboard keys bound to each controller button</string> <string name="preference_remap_controller_description">Allows you to modify the keyboard keys bound to each controller button</string>
<string name="mcl_button_discord">Discord</string> <string name="mcl_button_discord">Discord</string>
<string name="mcl_button_open_directory">Open game directory</string>
<string name="discord_invite" translatable="false">https://discord.gg/pojavlauncher-724163890803638273</string> <string name="discord_invite" translatable="false">https://discord.gg/pojavlauncher-724163890803638273</string>
<string name="local_login_bad_username_title">Unsuitable username</string> <string name="local_login_bad_username_title">Unsuitable username</string>
<string name="local_login_bad_username_text">The username must be between 316 characters long, and must only contain latin letters, arabic numerals and underscores.</string> <string name="local_login_bad_username_text">The username must be between 316 characters long, and must only contain latin letters, arabic numerals and underscores.</string>

View File

@ -13,6 +13,19 @@
</style> </style>
<style name="LauncherFragment_Divider">
<item name="android:layout_width">@dimen/padding_tiny</item>
<item name="android:layout_height">0dp</item>
<item name="android:background">@color/divider</item>
</style>
<style name="LauncherMenuButton" parent="Widget.AppCompat.Button">
<item name="android:background">?android:attr/selectableItemBackground</item>
</style>
<style name="LauncherMenuButton.Universal" parent="LauncherMenuButton">
<item name="android:layout_height">@dimen/_66sdp</item>
</style>
<style name="ThickDivider"> <style name="ThickDivider">
<item name="android:layout_width">match_parent</item> <item name="android:layout_width">match_parent</item>