{"id":19304128,"url":"https://github.com/foolishchow/auto-param","last_synced_at":"2026-05-17T10:32:47.532Z","repository":{"id":126855758,"uuid":"311267353","full_name":"foolishchow/auto-param","owner":"foolishchow","description":"generate type safe arguments for activity,fragment with annotation processor","archived":false,"fork":false,"pushed_at":"2021-08-02T06:46:14.000Z","size":350,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-05T23:42:57.735Z","etag":null,"topics":["android","androidx","bundle","intent"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foolishchow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-09T08:12:58.000Z","updated_at":"2021-08-02T06:43:55.000Z","dependencies_parsed_at":"2023-06-18T08:00:15.157Z","dependency_job_id":null,"html_url":"https://github.com/foolishchow/auto-param","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fauto-param","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fauto-param/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fauto-param/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foolishchow%2Fauto-param/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foolishchow","download_url":"https://codeload.github.com/foolishchow/auto-param/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240404754,"owners_count":19796064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","androidx","bundle","intent"],"created_at":"2024-11-09T23:28:46.655Z","updated_at":"2026-05-17T10:32:42.484Z","avatar_url":"https://github.com/foolishchow.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Auto Param\n-----\n\ngenerate param jumper for Activity and Fragment\n\n[![](https://jitpack.io/v/foolishchow/auto-param.svg)](https://jitpack.io/#foolishchow/auto-param)\n\n\n## usage\n\n- dependence\n  ```gradle\n  implementation 'com.github.foolishchow.auto-param:utils:0.0.22'\n  annotationProcessor 'com.github.foolishchow.auto-param:processor:0.0.22'\n  ```\n- activity   \n  ```java\n  public MyActivity extends XXXActivity{\n    @IntentParam\n    int param;\n\n  }\n  ```\n  this will generate `MyActivityJumper`\n  ```java\n  public class MyActivityJumper extends IntentBuilder {\n    private static final String PARAM = \"eca07335a33c5aeb5e1bc7c98b4b9d80\";\n\n    public static MyActivityJumper with(Context context) {\n      MainActivityJumper var = new MyActivityJumper();\n      var.setContext(context);\n      var.setIntent(new Intent(context,MyActivityJumper.class));\n      return var;\n    }\n\n    public MyActivityJumper Param(int param) {\n      mIntent.putExtra(PARAM,param);\n      return this;\n    }\n\n    public static void parse(MyActivity activity) {\n      if(activity == null || activity.isFinishing() || activity.isDestroyed()) {\n        return;\n      }\n      Intent intent = activity.getIntent();\n      if (intent == null) {\n        return;\n      }\n      if (intent.hasExtra(PARAM)) {\n        activity.param = intent.getIntExtra(PARAM,Integer.MIN_VALUE);\n      }\n    }\n  }\n\n  ```\n  then you can use `MyActivityJumper` to start `MyActivity`\n  ```java\n  MyActivityJumper.with(context).Param(1).start();\n  ```\n\n- fragment\n  ```java\n  public class MyFragment extends Fragment {\n\n    @FragmentParam\n    int param;\n\n    @FragmentParam\n    String param1;\n  }\n  ```\n  this will generate `MyFragmentJumper`\n  ```java\n  public class MyFragmentJumper {\n    private static final String PARAM = \"eca07335a33c5aeb5e1bc7c98b4b9d80\";\n\n    private static final String PARAM1 = \"a2cbb63ab0f80334d9a100be6c372d35\";\n\n    private final Bundle mBundle = new Bundle();\n\n    public Bundle getBundle() {\n      return mBundle;\n    }\n\n    public static MyFragmentJumper with() {\n      return new ChildFragmentJumper();\n    }\n\n    public MyFragmentJumper Param(int param) {\n      mBundle.putInt(PARAM,param);\n      return this;\n    }\n\n    public MyFragmentJumper Param1(String param) {\n      mBundle.putString(PARAM1,param);\n      return this;\n    }\n\n    public MyFragment build() {\n      MyFragment fragment = null;\n      try {\n        fragment = MyFragment.class.newInstance();\n        fragment.setArguments(mBundle);\n      } catch (Throwable e) {\n        e.printStackTrace();\n      }\n      assert fragment != null;\n      return fragment;\n    }\n\n    public static void parse(MyFragment fragment) {\n      if (fragment == null) {\n        return;\n      }\n      Bundle bundle = fragment.getArguments();\n      if (bundle == null) {\n        return;\n      }\n      if (bundle.containsKey(PARAM)) {\n        fragment.param = bundle.getInt(PARAM,Integer.MIN_VALUE);\n      }\n      if (bundle.containsKey(PARAM1)) {\n        fragment.param1 = bundle.getString(PARAM1);\n      }\n    }\n  }\n  ```\n  then you can use\n  ```java\n  MyFragment fragment = MyFragmentJumper.with().Param(1).Param1(\"\").build();\n  ```\n\n- jetpack navigation\n  ```java\n  @Navigation(actions = {\n        @NavigationAction(\n                name = \"fromMain\",\n                actionId = R.id.action_main_to_child,\n                description = \"jump from main to child\"\n        )\n  })\n  public class MyFragment extends Fragment {\n\n      @FragmentParam\n      int param;\n\n      @FragmentParam\n      String param1;\n\n  }\n  ```\n  this will generate \n  ```java\n  public class MyFragmentJumper {\n    private static final String PARAM = \"eca07335a33c5aeb5e1bc7c98b4b9d80\";\n\n    private static final String PARAM1 = \"a2cbb63ab0f80334d9a100be6c372d35\";\n\n    private final Bundle mBundle = new Bundle();\n\n    /**\n    * jump from main to child\n    */\n    public void fromMain(View view) {\n      Navigation.findNavController(view).navigate(2131230775,mBundle) ;\n    }\n\n    public Bundle getBundle() {\n      return mBundle;\n    }\n\n    public static MyFragmentJumper with() {\n      return new MyFragmentJumper();\n    }\n\n    public MyFragmentJumper Param(int param) {\n      mBundle.putInt(PARAM,param);\n      return this;\n    }\n\n    public MyFragmentJumper Param1(String param) {\n      mBundle.putString(PARAM1,param);\n      return this;\n    }\n\n    public MyFragment build() {\n      MyFragment fragment = null;\n      try {\n        fragment = MyFragment.class.newInstance();\n        fragment.setArguments(mBundle);\n      } catch (Throwable e) {\n        e.printStackTrace();\n      }\n      assert fragment != null;\n      return fragment;\n    }\n\n    public static void parse(MyFragment fragment) {\n      if (fragment == null) {\n        return;\n      }\n      Bundle bundle = fragment.getArguments();\n      if (bundle == null) {\n        return;\n      }\n      if (bundle.containsKey(PARAM)) {\n        fragment.param = bundle.getInt(PARAM,Integer.MIN_VALUE);\n      }\n      if (bundle.containsKey(PARAM1)) {\n        fragment.param1 = bundle.getString(PARAM1);\n      }\n    }\n  }\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolishchow%2Fauto-param","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoolishchow%2Fauto-param","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoolishchow%2Fauto-param/lists"}