{"id":21129999,"url":"https://github.com/takahirom/PreLollipopTransition","last_synced_at":"2025-07-09T01:31:59.180Z","repository":{"id":29341189,"uuid":"32875196","full_name":"takahirom/PreLollipopTransition","owner":"takahirom","description":"Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices.","archived":false,"fork":false,"pushed_at":"2017-04-29T09:59:12.000Z","size":399,"stargazers_count":1295,"open_issues_count":8,"forks_count":226,"subscribers_count":57,"default_branch":"master","last_synced_at":"2024-10-30T02:36:39.610Z","etag":null,"topics":[],"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/takahirom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-25T16:00:32.000Z","updated_at":"2024-10-29T16:38:11.000Z","dependencies_parsed_at":"2022-08-28T00:12:52.070Z","dependency_job_id":null,"html_url":"https://github.com/takahirom/PreLollipopTransition","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahirom%2FPreLollipopTransition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahirom%2FPreLollipopTransition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahirom%2FPreLollipopTransition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takahirom%2FPreLollipopTransition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takahirom","download_url":"https://codeload.github.com/takahirom/PreLollipopTransition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225428243,"owners_count":17472790,"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":[],"created_at":"2024-11-20T05:32:09.776Z","updated_at":"2024-11-20T05:32:11.091Z","avatar_url":"https://github.com/takahirom.png","language":"Java","funding_links":[],"categories":["Libs","\u003ca name=\"Transition\"\u003eTransition\u003c/a\u003e"],"sub_categories":["\u003cA NAME=\"Animations\"\u003e\u003c/A\u003eAnimations","Personal Blog"],"readme":"# PreLollipopTransition\n\n![build status](https://circleci.com/gh/takahirom/PreLollipopTransition/tree/master.svg?style=shield\u0026circle-token=1759143e61c73eeca59280337c8c95ab9f8dbafb) [![API](https://img.shields.io/badge/API-14%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=14)\n\nSimple tool which help you to implement activity and fragment transition for pre-Lollipop devices.\n\n![prelollipopanimation](https://cloud.githubusercontent.com/assets/1386930/7614211/53ca12d8-f9d0-11e4-8b98-b6d98272f67d.gif)\n\n## Download\nIn your app build.gradle add\n\n```groovy\ndependencies {\n    compile 'com.kogitune:pre-lollipop-activity-transition:1.x.x'\n}\n```\n\n[ ![Download](https://api.bintray.com/packages/takahirom/maven/PreLollipopTransition/images/download.svg) ](https://bintray.com/takahirom/maven/PreLollipopTransition/_latestVersion)\n\n## Code\n### Activity\nStart Activity in first activity.\n\n```java\nfindViewById(R.id.imageView).setOnClickListener(new View.OnClickListener() {\n    @Override\n    public void onClick(View v) {\n        final Intent intent = new Intent(MainActivity.this, SubActivity.class);\n        ActivityTransitionLauncher.with(MainActivity.this).from(v).launch(intent);\n    }\n});\n```\n\nReceive intent in second activity.\n\n```java\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.activity_sub);\n    ActivityTransition.with(getIntent()).to(findViewById(R.id.sub_imageView)).start(savedInstanceState);\n}\n```\n\n#### If you want the exit animation, you can do like this.\n\n```java\nprivate ExitActivityTransition exitTransition;\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n    super.onCreate(savedInstanceState);\n    setContentView(R.layout.activity_sub2);\n    exitTransition = ActivityTransition.with(getIntent()).to(findViewById(R.id.sub_imageView)).start(savedInstanceState);\n}\n@Override\npublic void onBackPressed() {\n    exitTransition.exit(this);\n}\n```\n\n#### If you want to use `startActivityForResult`, you should do below.\n1. Use `createBundle()`.\n2. Put Extra to intent.\n3. Call overridePendingTransition after `startActivityForResult`.\n\n```java\nBundle transitionBundle = ActivityTransitionLauncher.with(MainActivity.this).from(v).createBundle();\nintent.putExtras(transitionBundle);\nstartActivityForResult(intent, REQUEST_CODE);\n// you should prevent default activity transition animation\noverridePendingTransition(0, 0);\n```\n\n### Fragment\nStart fragment transition in first fragment.\n\n```java\n@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n    View v = inflater.inflate(R.layout.support_fragment_start, container, false);\n    v.setOnClickListener(new View.OnClickListener() {\n        @Override\n        public void onClick(View view) {\n            final EndFragment toFragment = new EndFragment();\n            FragmentTransitionLauncher\n                    .with(view.getContext())\n                    .image(BitmapFactory.decodeResource(getResources(), R.drawable.photo))\n                    .from(view.findViewById(R.id.imageView)).prepare(toFragment);\n            getFragmentManager().beginTransaction().replace(R.id.content, toFragment).addToBackStack(null).commit();\n        }\n    });\n    return v;\n}\n```\n\nStart animation in second fragment.\n```java\n@Override\npublic View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {\n    View v = inflater.inflate(R.layout.support_fragment_end, container, false);\n    final ExitFragmentTransition exitFragmentTransition = FragmentTransition.with(this).to(v.findViewById(R.id.fragment_imageView)).start(savedInstanceState);\n    exitFragmentTransition.startExitListening();\n    return v;\n}\n```\n\nIf you want to pass argument to second fragment, you should use `Fragment#getArguments()` after call prepare().\n\n```java\nfinal EndFragment toFragment = new EndFragment();\nFragmentTransitionLauncher\n        .with(view.getContext())\n        .image(BitmapFactory.decodeResource(getResources(), R.drawable.photo))\n        .from(view.findViewById(R.id.imageView)).prepare(toFragment);\ntoFragment.getArguments().putString(\"stringArgKey\", \"this is value\");\ngetFragmentManager().beginTransaction().replace(R.id.content, toFragment).addToBackStack(null).commit();\n```\n\n## Sample\n![image](https://cloud.githubusercontent.com/assets/1386930/7668974/019262a0-fc95-11e4-906a-84a2b744a12c.gif)\n\n## Contributors\n* [shiraji](http://www.github.com/shiraji)\n* [lovejjfg](https://github.com/lovejjfg)\n\n## Thanks\nSample Photo\nLuke Ma\nhttps://www.flickr.com/photos/lukema/12499338274/in/photostream/\n\nDevBytes: Custom Activity Animations\nhttps://www.youtube.com/watch?v=CPxkoe2MraA\n\n## License\n\nThis project is released under the Apache License, Version 2.0.\n\n* [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakahirom%2FPreLollipopTransition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakahirom%2FPreLollipopTransition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakahirom%2FPreLollipopTransition/lists"}