[app] Add view in repo for modules
This commit is contained in:
parent
264065275a
commit
e9e19e1d1d
|
|
@ -60,6 +60,7 @@ import java.util.List;
|
|||
import io.github.lsposed.manager.ConfigManager;
|
||||
import io.github.lsposed.manager.R;
|
||||
import io.github.lsposed.manager.adapters.AppHelper;
|
||||
import io.github.lsposed.manager.repo.RepoLoader;
|
||||
import io.github.lsposed.manager.ui.activity.base.ListActivity;
|
||||
import io.github.lsposed.manager.util.GlideApp;
|
||||
import io.github.lsposed.manager.util.ModuleUtil;
|
||||
|
|
@ -139,6 +140,12 @@ public class ModulesActivity extends ListActivity implements ModuleUtil.ModuleLi
|
|||
} else if (itemId == R.id.menu_uninstall) {
|
||||
startActivity(new Intent(Intent.ACTION_UNINSTALL_PACKAGE, Uri.fromParts("package", module.packageName, null)));
|
||||
return true;
|
||||
} else if (itemId == R.id.menu_repo) {
|
||||
Intent intent = new Intent();
|
||||
intent.setClass(this, RepoItemActivity.class);
|
||||
intent.putExtra("modulePackageName", module.packageName);
|
||||
intent.putExtra("moduleName", module.getAppName());
|
||||
startActivity(intent);
|
||||
}
|
||||
return super.onContextItemSelected(item);
|
||||
}
|
||||
|
|
@ -220,6 +227,9 @@ public class ModulesActivity extends ListActivity implements ModuleUtil.ModuleLi
|
|||
if (intent == null) {
|
||||
menu.removeItem(R.id.menu_launch);
|
||||
}
|
||||
if (RepoLoader.getInstance().getOnlineModule(item.packageName) == null) {
|
||||
menu.removeItem(R.id.menu_repo);
|
||||
}
|
||||
});
|
||||
|
||||
holder.itemView.setOnClickListener(v -> {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@
|
|||
<item
|
||||
android:id="@+id/menu_app_store"
|
||||
android:title="@string/modules_app_store" />
|
||||
<item
|
||||
android:id="@+id/menu_repo"
|
||||
android:title="@string/view_in_repo" />
|
||||
<item
|
||||
android:id="@+id/menu_app_info"
|
||||
android:title="@string/module_app_info" />
|
||||
|
|
|
|||
|
|
@ -174,4 +174,5 @@
|
|||
<string name="module_release_no_more">没有更旧的版本</string>
|
||||
<string name="theme_color">主题颜色</string>
|
||||
<string name="logs_clear_failed_2">日志清理失败</string>
|
||||
<string name="view_in_repo">在仓库中查看</string>
|
||||
</resources>
|
||||
|
|
|
|||
|
|
@ -173,4 +173,5 @@
|
|||
<string name="module_release_no_more">No more release</string>
|
||||
<string name="theme_color">Theme color</string>
|
||||
<string name="logs_clear_failed_2">Failed to clear the log</string>
|
||||
<string name="view_in_repo">View in Repo</string>
|
||||
</resources>
|
||||
|
|
|
|||
Loading…
Reference in New Issue