View in other app (#591)

This commit is contained in:
vvb2060 2021-05-16 04:37:31 +08:00 committed by GitHub
parent 5ec10c89bb
commit d395365e2c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 16 deletions

View File

@ -296,9 +296,9 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
}
} else if (itemId == R.id.menu_compile_speed) {
CompileDialogFragment.speed(activity.getSupportFragmentManager(), info);
} else if (itemId == R.id.menu_app_store) {
Uri uri = Uri.parse("market://details?id=" + info.packageName);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
} else if (itemId == R.id.menu_other_app) {
var intent = new Intent(Intent.ACTION_SHOW_APP_INFO);
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, module.packageName);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
activity.startActivity(intent);
@ -422,7 +422,6 @@ public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder>
if (android) {
menu.findItem(R.id.menu_force_stop).setTitle(R.string.reboot);
menu.removeItem(R.id.menu_compile_speed);
menu.removeItem(R.id.menu_app_store);
}
});

View File

@ -257,9 +257,9 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi
Snackbar.make(binding.snackbar, R.string.module_no_ui, Snackbar.LENGTH_LONG).show();
}
return true;
} else if (itemId == R.id.menu_app_store) {
Uri uri = Uri.parse("market://details?id=" + module.packageName);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
} else if (itemId == R.id.menu_other_app) {
var intent = new Intent(Intent.ACTION_SHOW_APP_INFO);
intent.putExtra(Intent.EXTRA_PACKAGE_NAME, module.packageName);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
startActivity(intent);

View File

@ -24,8 +24,8 @@
android:id="@+id/menu_launch"
android:title="@string/module_settings" />
<item
android:id="@+id/menu_app_store"
android:title="@string/modules_app_store" />
android:id="@+id/menu_other_app"
android:title="@string/modules_other_app" />
<item
android:id="@+id/menu_repo"
android:title="@string/view_in_repo" />

View File

@ -29,9 +29,9 @@
android:id="@+id/menu_compile_speed"
android:title="@string/compile_speed" />
<item
android:id="@+id/menu_app_store"
android:title="@string/modules_app_store" />
android:id="@+id/menu_other_app"
android:title="@string/modules_other_app" />
<item
android:id="@+id/menu_app_info"
android:title="@string/module_app_info" />
</menu>
</menu>

View File

@ -127,7 +127,7 @@
<string name="menu_filter">过滤…</string>
<!-- ModulesActivity and AppListActivity -->
<string name="modules_app_store">在应用商店查看</string>
<string name="modules_other_app">在其它应用中查看</string>
<string name="module_app_info">应用信息</string>
<!-- SettingsActivity -->

View File

@ -126,7 +126,7 @@
<string name="menu_filter">Filter…</string>
<!-- ModulesActivity and AppListActivity -->
<string name="modules_app_store">在應用商店查看</string>
<string name="modules_other_app">在其他應用中查看</string>
<string name="module_app_info">應用資訊</string>
<!-- SettingsActivity -->

View File

@ -126,7 +126,7 @@
<string name="menu_filter">過濾…</string>
<!-- ModulesActivity and AppListActivity -->
<string name="modules_app_store">在 Play 商店檢視</string>
<string name="modules_other_app">在其他應用程式中檢視</string>
<string name="module_app_info">程式資訊</string>
<!-- SettingsActivity -->

View File

@ -127,7 +127,7 @@
<string name="menu_filter">Filter…</string>
<!-- ModulesActivity and AppListActivity -->
<string name="modules_app_store">View in App Store</string>
<string name="modules_other_app">View in other app</string>
<string name="module_app_info">App info</string>
<!-- SettingsActivity -->