খণ্ড
| সর্বশেষ আপডেট | স্থিতিশীল রিলিজ | রিলিজ প্রার্থী | বিটা রিলিজ | আলফা রিলিজ |
|---|---|---|---|---|
| ১৩ আগস্ট, ২০২৫ | ১.৮.৯ | - | - | - |
নির্ভরতা ঘোষণা করা
Fragment-এর উপর ডিপেন্ডেন্সি যোগ করতে হলে, আপনাকে আপনার প্রজেক্টে Google Maven রিপোজিটরিটি যুক্ত করতে হবে। আরও তথ্যের জন্য Google-এর Maven রিপোজিটরি সম্পর্কে পড়ুন।
আপনার অ্যাপ বা মডিউলের build.gradle ফাইলে প্রয়োজনীয় আর্টিফ্যাক্টগুলোর ডিপেন্ডেন্সি যোগ করুন:
গ্রোভি
dependencies { def fragment_version = "1.8.9" // Java language implementation implementation "androidx.fragment:fragment:$fragment_version" // Kotlin implementation "androidx.fragment:fragment-ktx:$fragment_version" // Compose implementation "androidx.fragment:fragment-compose:$fragment_version" // Testing Fragments in Isolation debugImplementation "androidx.fragment:fragment-testing-manifest:$fragment_version" androidTestImplementation "androidx.fragment:fragment-testing:$fragment_version" }
কোটলিন
dependencies { val fragment_version = "1.8.9" // Java language implementation implementation("androidx.fragment:fragment:$fragment_version") // Kotlin implementation("androidx.fragment:fragment-ktx:$fragment_version") // Compose implementation("androidx.fragment:fragment-compose:$fragment_version") // Testing Fragments in Isolation debugImplementation("androidx.fragment:fragment-testing:$fragment_version") }
নির্ভরতা সম্পর্কে আরও তথ্যের জন্য, 'বিল্ড নির্ভরতা যোগ করুন ' দেখুন।
প্রতিক্রিয়া
আপনার মতামত জেটপ্যাককে আরও উন্নত করতে সাহায্য করে। আপনি যদি নতুন কোনো সমস্যা খুঁজে পান অথবা এই লাইব্রেরিটি উন্নত করার জন্য কোনো ধারণা থাকে, তবে আমাদের জানান। নতুন কোনো সমস্যা তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরির বিদ্যমান সমস্যাগুলো দেখে নিন। আপনি তারকা বোতামে ক্লিক করে কোনো বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।
আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।
সংস্করণ ১.৮
সংস্করণ ১.৮.৯
১৩ আগস্ট, ২০২৫
androidx.fragment:fragment-*:1.8.9 প্রকাশিত হয়েছে। সংস্করণ 1.8.9-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- অ্যানিমেটর ব্যবহার করার সময়, একটি হাইড অপারেশন পপ-আপ করে এমন একটি প্রেডিক্টিভ ব্যাক জেসচার বাতিল করলে পরবর্তী জেসচারটি সঠিকভাবে অ্যানিমেট না হওয়ার সমস্যাটি সমাধান করা হয়েছে। ( I0a400 , b/384765586 )
- একটি ত্রুটি সংশোধন করা হয়েছে যেখানে
setMaxLifecycleএবংpopBackStackএর সংমিশ্রণ শীর্ষ ফ্র্যাগমেন্টটিকে RESUMED অবস্থায় নিয়ে যেতে ব্যর্থ হতে পারতো। ( I3448b , b/406127576 )
সংস্করণ ১.৮.৮
৪ জুন, ২০২৫
androidx.fragment:fragment-*:1.8.8 প্রকাশিত হয়েছে। সংস্করণ 1.8.8-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
setMaxLifecycle(Lifecycle.State.INITIALIZED)ব্যবহার করে যোগ করা Fragment-গুলির স্টেট সেভ করার চেষ্টা করার সময়FragmentManagerক্র্যাশ করার সমস্যাটি সমাধান করা হয়েছে। এই Fragment-গুলি কখনওonCreate()মধ্যে না যাওয়ায়, তাদের আর কোনো স্টেট সেভ করা থাকত না বাonSaveInstanceState()কল করা হতো না। ( I6e37a )
সংস্করণ ১.৮.৭
২০ মে, ২০২৫
androidx.fragment:fragment-*:1.8.7 প্রকাশিত হয়েছে। সংস্করণ 1.8.7-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- একই ফ্রেমে পপ এবং রিপ্লেস অপারেশনের পর
FragmentManagerসঠিক অবস্থায় না থাকার সমস্যাটি সমাধান করা হয়েছে, যাpopBackStackঅথবা প্রেডিক্টিভ ব্যাক জেসচারের মাধ্যমে ব্যাকস্ট্যাক পপ করার সাথে মিলিতভাবে ক্র্যাশের কারণ হতে পারতো। ( I50ad1 ) - AndroidX Transitions ব্যবহারের কারণে সৃষ্ট একটি ক্র্যাশ সংশোধন করা হয়েছে। এই ক্র্যাশটি এমন একটি পরিস্থিতিতে ঘটত যেখানে দ্রুত পরপর ফ্র্যাগমেন্ট ট্রানজ্যাকশনগুলো একটি শুরু না হওয়া ট্রানজিশন বাতিল করার চেষ্টা করত এবং AndroidX Transition লাইব্রেরিটি ট্রানজিশনের অবস্থা সঠিকভাবে পরিষ্কার করত না। (দেখুন b/414612221 )। ( Ib5235 )
সংস্করণ ১.৮.৬
১২ ফেব্রুয়ারী, ২০২৫
androidx.fragment:fragment-*:1.8.6 প্রকাশিত হয়েছে। সংস্করণ 1.8.6-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
FragmentContainerViewএরsetOnApplyWindowInsetsListenerওভাররাইডটি এখন একটি নাল লিসেনার গ্রহণ করে, যা ফ্রেমওয়ার্কের অনুমোদনের সাথে সামঞ্জস্যপূর্ণ। ( I575f0 , b/282790626 )
সংস্করণ ১.৮.৫
৩০ অক্টোবর, ২০২৪
androidx.fragment:fragment-*:1.8.5 প্রকাশিত হয়েছে। সংস্করণ 1.8.5-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- একটি Predictive Back জেসচার বাতিল বা বাধাগ্রস্ত হওয়ার পরেই
saveBackStackদ্বারা ট্রিগার হওয়া একটিIllegalStateExceptionঠিক করা হয়েছে। ( I3387d , b/342419080 )
সংস্করণ ১.৮.৪
২ অক্টোবর, ২০২৪
androidx.fragment:fragment-*:1.8.4 প্রকাশিত হয়েছে। সংস্করণ 1.8.4-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- Androidx Transitions ব্যবহার করার সময় দ্রুত সিস্টেম ব্যাক বাটন চাপলে বা দ্রুত জেসচার ব্যাক করলে Fragments ক্র্যাশ করার সমস্যাটি সমাধান করা হয়েছে। ( Ibc038 , b/364804225 )
- ফ্র্যাগমেন্টে একটি সমস্যা সমাধান করা হয়েছে যেখানে একটি প্রেডিক্টিভ ব্যাক জেসচার বাধা দিলে ফ্র্যাগমেন্ট ম্যানেজার একটি অনির্ধারিত অবস্থায় চলে যেত এবং এমনকি ভুল ফ্র্যাগমেন্টও দেখাতো। ( If82e2 , b/338624457 )
- আপনার
AndroidFragmentইনস্ট্যান্স যে ক্লাসটি ব্যবহার করছে, সেটি ডায়নামিকভাবে পরিবর্তন করার সময়AndroidFragmentএ একটিUninitializedPropertyAccessExceptionদেখা দেওয়ার সমস্যাটি সমাধান করা হয়েছে। ( I12dea )
সংস্করণ ১.৮.৩
৪ সেপ্টেম্বর, ২০২৪
androidx.fragment:fragment-*:1.8.3 প্রকাশিত হয়েছে। সংস্করণ 1.8.3-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
FragmentManagerএখন Predictive Back জেসচারটি পরিচালনা করার সময় অপেক্ষমান অপারেশনগুলো সঠিকভাবে বিবেচনা করে। এর ফলে, সিস্টেম ব্যাক করার কারণে আরIndexOutOfBoundsExceptionঘটবে না। ( I9ba32 , b/342316801 ) - ধারণকারী অ্যাক্টিভিটি/ফ্র্যাগমেন্টের স্টেট আগে থেকেই সেভ করা থাকা অবস্থায়
AndroidFragmentকম্পোজিশনে যোগ করলে সেটি আর ক্র্যাশ করে না। ( I985e9 , b/356643968 )
সংস্করণ ১.৮.২
২৪ জুলাই, ২০২৪
androidx.fragment:fragment-*:1.8.2 প্রকাশিত হয়েছে। সংস্করণ 1.8.2-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
AndroidFragmentএখন সেইসব পরিস্থিতি সঠিকভাবে সামাল দেয় যখন প্যারেন্ট ফ্র্যাগমেন্টটি Fragment ব্যাক স্ট্যাকে রাখা হয়, ফলে সেই ফ্র্যাগমেন্টে পপ ব্যাক করার সময় 'No view found for id' সমস্যাটি এড়ানো যায়। ( I94608 ) -
FragmentTransaction.addমেথডের মাধ্যমে যোগ করা Fragment-গুলো, যেগুলো একটিViewGroupগ্রহণ করে, এখনonStart()এ যাওয়ার আগেonContainerAvailableএর জন্য অপেক্ষা করে। এটিAndroidFragmentমতো ঐ API-এর ব্যবহারকারীদের প্রভাবিত করে, যা এখনonStart()এর মধ্য দিয়ে যাওয়ার আগেAndroidFragmentকম্পোজিশনে পুনরায় প্রবেশের জন্য অপেক্ষা করে। ( I94608 )
সংস্করণ ১.৮.১
২৬ জুন, ২০২৪
androidx.fragment:fragment-*:1.8.1 প্রকাশিত হয়েছে। সংস্করণ 1.8.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- একটি প্রেডিক্টিভ ব্যাক জেসচার শুরু করার সময় কন্টেইনারবিহীন ফ্র্যাগমেন্টগুলো তাৎক্ষণিকভাবে
DESTROYEDসমস্যাটি সমাধান করা হয়েছে। এখন জেসচারটি সম্পূর্ণ না হওয়া পর্যন্ত সেগুলোকেCREATEDঅবস্থায় রাখা হয়। ( If6b83 , b/345244539 )
সংস্করণ ১.৮.০
১২ জুন, ২০২৪
androidx.fragment:fragment-*:1.8.0 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
১.৭.০ সংস্করণ থেকে গুরুত্বপূর্ণ পরিবর্তনসমূহ
-
fragment-composeআর্টিফ্যাক্টটিতে এখন একটিAndroidFragmentComposableরয়েছে, যা fragment ক্লাসের নাম ব্যবহার করে Compose হায়ারার্কিতে fragment যোগ করার সুযোগ দেয়। এটি স্বয়ংক্রিয়ভাবে Fragment-এর স্টেট সংরক্ষণ এবং পুনরুদ্ধার করার কাজটি পরিচালনা করে। Fragment ইনফ্লেট করার জন্য পূর্বে প্রস্তাবিতAndroidViewBindingপদ্ধতির সরাসরি বিকল্প হিসেবে এটি ব্যবহার করা উচিত। -
FragmentManagerএরOnBackStackChangedListenerইন্টারফেসেরonBackStackChangeCancelledকলব্যাকটি এখনFragmentManagerএর অপারেশনগুলো সম্পাদনের অংশ হিসেবে ফায়ার হয়, ফলে এটিonBackStackChangeCommittedকলব্যাকের টাইমিংয়ের আরও কাছাকাছি চলে আসে।
সংস্করণ 1.8.0-rc01
২৯ মে, ২০২৪
androidx.fragment:fragment-*:1.8.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-rc01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
FragmentManagers OnBackStackChangedListenerইন্টারফেসেরonBackStackChangeCancelledকলব্যাকটি এখনFragmentManagerএর অপারেশনগুলো সম্পাদনের অংশ হিসেবে ফায়ার হয়, যা এটিকেonBackStackChangeCommittedকলব্যাকের টাইমিংয়ের আরও কাছাকাছি নিয়ে আসে। ( I5ebfb , b/332916112 )
সংস্করণ 1.8.0-beta01
১৪ মে, ২০২৪
androidx.fragment:fragment-*:1.8.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-beta01-এ এই কমিটগুলো রয়েছে।
বাগ সংশোধন
- ফ্র্যাগমেন্ট
1.7.1থেকে: প্রেডিক্টিভ ব্যাক এখন থেকে শুধুমাত্র সেইসব ট্রানজ্যাকশনের জন্য চলবে, যেগুলোর সব ফ্র্যাগমেন্টে একটি অ্যানিমেটর অথবা একটি সিকেবল অ্যান্ড্রয়েডএক্স ট্রানজিশন রয়েছে। এর মাধ্যমে সেই সমস্যার সমাধান করা হয়েছে যেখানে একটি আংশিকভাবে সিকেবল ট্রানজ্যাকশন বাতিল করলে কালো স্ক্রিন দেখা যেত। ( I43037 , b/339169168 )
সংস্করণ 1.8.0-alpha02
১৭ এপ্রিল, ২০২৪
androidx.fragment:fragment-*:1.8.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-alpha02-এ এই কমিটগুলো রয়েছে।
বাগ সংশোধন
- ফ্র্যাগমেন্ট
1.7.0-rc02থেকে: অন্য কোনো ট্রানজিশন ছাড়া একটিsharedElementসেট করলে কেন তা চলতে ব্যর্থ হবে, তা নির্দেশ করার জন্য লগ যোগ করা হয়েছে। ( Iec48e ) - ফ্র্যাগমেন্ট
1.7.0-rc02থেকে: একটি বাগ সংশোধন করা হয়েছে যেখানে যদি কোনো ট্রানজ্যাকশনে একটি নন-সিকযোগ্য শেয়ার্ড এলিমেন্ট যোগ করা হতো এবং সেই ট্রানজ্যাকশনের অন্য সব ট্রানজিশন সিকযোগ্য হতো, তাহলে প্রোগ্রামটি ক্র্যাশ করত। এখন থেকে ট্রানজ্যাকশনটিকে সঠিকভাবে নন-সিকযোগ্য হিসেবে বিবেচনা করা হবে। ( I18ccd )
সংস্করণ 1.8.0-alpha01
৩ এপ্রিল, ২০২৪
androidx.fragment:fragment-*:1.8.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-alpha01-এ এই কমিটগুলো রয়েছে।
নতুন বৈশিষ্ট্য
- নতুন
AndroidFragmentComposableমাধ্যমে ফ্র্যাগমেন্ট ক্লাসের নাম ব্যবহার করে Compose হায়ারার্কিতে ফ্র্যাগমেন্ট যুক্ত করা যায়। এটি স্বয়ংক্রিয়ভাবে ফ্র্যাগমেন্টের স্টেট সংরক্ষণ এবং পুনরুদ্ধার করে। এটি AndroidViewBindingComposableএর সরাসরি বিকল্প হিসেবে ব্যবহার করা যেতে পারে। ( b/312895363 , Icf841 )
ডকুমেন্টেশন পরিবর্তন
-
OnBackStackChangedListenerAPI-গুলোর ডকুমেন্টেশন আপডেট করা হয়েছে, যাতে এগুলো কখন কল করা হয় এবং কীভাবে ব্যবহার করা উচিত তা নির্দেশ করা যায়। ( I0bfd9 )
নির্ভরতা আপডেট
- ফ্র্যাগমেন্টটি এখন প্রোফাইল ইনস্টলার ১.৩.১ এর উপর নির্ভরশীল।
সংস্করণ ১.৭
সংস্করণ ১.৭.১
১৪ মে, ২০২৪
androidx.fragment:fragment-*:1.7.1 প্রকাশিত হয়েছে। সংস্করণ 1.7.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- এখন থেকে প্রেডিক্টিভ ব্যাক শুধুমাত্র সেইসব ট্রানজ্যাকশনের জন্য চলবে, যেগুলোর সমস্ত ফ্র্যাগমেন্টে একটি অ্যানিমেটর অথবা একটি সিকেবল অ্যান্ড্রয়েডএক্স ট্রানজিশন রয়েছে। এর মাধ্যমে সেই সমস্যার সমাধান করা হয়েছে, যেখানে আংশিকভাবে সিকেবল কোনো ট্রানজ্যাকশন বাতিল করলে একটি ফাঁকা স্ক্রিন দেখা যেত। ( I43037 , b/339169168 )
সংস্করণ ১.৭.০
১ মে, ২০২৪
androidx.fragment:fragment-*:1.7.0 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
পূর্বাভাসমূলক ব্যাক জেসচার সাপোর্ট
- এখন ফ্র্যাগমেন্টগুলো
Animatorঅথবা অ্যান্ড্রয়েডএক্স ট্রানজিশন ১.৫.০ ব্যবহার করার সময় প্রেডিক্টিভ ইন-অ্যাপ ব্যাক সাপোর্ট প্রদান করে। এর ফলে, ব্যবহারকারীরা জেসচারটি সম্পন্ন করে ট্রানজ্যাকশনটি কমিট করবেন নাকি বাতিল করবেন, সেই সিদ্ধান্ত নেওয়ার আগে ব্যাক জেসচারের মাধ্যমে তাদের অ্যানিমেটর/ট্রানজিশনটি সিক করে পূর্ববর্তী ফ্র্যাগমেন্টটি দেখতে পারেন।
| রূপান্তর ব্যবস্থা | এক্সএমএল রিসোর্স | প্রেডিক্টিভ ব্যাক সমর্থন করে |
|---|---|---|
Animation | R.anim | না |
Animator | R.animator | হ্যাঁ |
কাঠামো Transition | R.transition | না |
Transition 1.4.1 বা তার কম সংস্করণের সাথে AndroidX Transition | R.transition | না |
Transition 1.5.0 সহ AndroidX Transition | R.transition | হ্যাঁ |
আপনি প্রেডিক্টিভ ব্যাক জেসচারটি চালু করার পর ফ্র্যাগমেন্টে প্রেডিক্টিভ ব্যাক সাপোর্ট নিয়ে কোনো সমস্যা দেখলে, অনুগ্রহ করে আপনার সমস্যাটি পুনরুৎপাদন করে এমন একটি নমুনা প্রজেক্ট সহ ফ্র্যাগমেন্টটির বিরুদ্ধে একটি ইস্যু ফাইল করুন । আপনি আপনার অ্যাক্টিভিটির onCreate() ফাংশনে FragmentManager.enabledPredictiveBack(false) ব্যবহার করে প্রেডিক্টিভ ব্যাক নিষ্ক্রিয় করতে পারেন।
FragmentManager.OnBackStackChangedListener() এখন যথাক্রমে প্রত্যাশিত ব্যাক প্রগ্রেস এবং বাতিল ইভেন্ট গ্রহণ করার জন্য onBackStackChangeProgressed() এবং onBackStackChangeCancelled() প্রদান করে।
খণ্ড রচনা নিদর্শন
একটি নতুন fragment-compose আর্টিফ্যাক্ট তৈরি করা হয়েছে, যা মূলত সেইসব অ্যাপকে সমর্থন করার উপর আলোকপাত করে, যেগুলো Fragment-ভিত্তিক আর্কিটেকচার থেকে সম্পূর্ণ Compose-ভিত্তিক আর্কিটেকচারে স্থানান্তরিত হচ্ছে।
এই নতুন আর্টিফ্যাক্টে উপলব্ধ প্রথম ফিচারটি হলো Fragment এর একটি content এক্সটেনশন মেথড, যা আপনার জন্য একটি ComposeView তৈরি করে এবং সঠিক ViewCompositionStrategy সেট করার মাধ্যমে একটি স্বতন্ত্র Fragment-এর UI-এর জন্য Compose-এর ব্যবহারকে সহজতর করে তোলে।
class ExampleFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
) = content {
// Write your @Composable content here
val viewModel: ExampleViewModel = viewModel()
// or extract it into a separate, testable method
ExampleComposable(viewModel)
}
}
সংস্করণ 1.7.0-rc02
১৭ এপ্রিল, ২০২৪
androidx.fragment:fragment-*:1.7.0-rc02 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-rc02-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- অন্য কোনো ট্রানজিশন ছাড়া শুধু একটি
sharedElementসেট করলে কেন তা রান করতে ব্যর্থ হবে, তা নির্দেশ করার জন্য লগ যোগ করা হয়েছে। ( Iec48e ) - একটি বাগ সংশোধন করা হয়েছে যেখানে কোনো ট্রানজ্যাকশনে অন্য সব ট্রানজিশন সিকযোগ্য হলে, সেখানে একটি নন-সিকযোগ্য শেয়ার্ড এলিমেন্ট যোগ করার ফলে প্রোগ্রামটি ক্র্যাশ করত। এখন ট্রানজ্যাকশনটিকে সঠিকভাবে নন-সিকযোগ্য হিসেবে বিবেচনা করা হবে। ( I18ccd )
সংস্করণ 1.7.0-rc01
৩ এপ্রিল, ২০২৪
androidx.fragment:fragment-*:1.7.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-rc01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
নির্ভরতা আপডেট
- ফ্র্যাগমেন্টটি এখন প্রোফাইল ইনস্টলার ১.৩.১ এর উপর নির্ভরশীল।
সংস্করণ 1.7.0-beta01
২০ মার্চ, ২০২৪
androidx.fragment:fragment-*:1.7.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-beta01-এ এই কমিটগুলো রয়েছে।
এপিআই পরিবর্তন
-
FragmentHostCallbackএখন কোটলিনে এমনভাবে লেখা হয়েছে যাতে Host-এর জেনেরিক টাইপের নালিবিলিটিonGetHost()এর রিটার্ন টাইপের নালিবিলিটির সাথে মিলে যায়। ( I40af5 )
বাগ সংশোধন
- একটি সমস্যার সমাধান করা হয়েছে যেখানে কন্টেইনারের বাইরে থাকা কোনো ফ্র্যাগমেন্টে প্রেডিক্টিভ ব্যাক জেসচার প্রয়োগ করলে, সেই ফ্র্যাগমেন্টটি কখনোই ডেস্ট্রয় হতো না। এখন থেকে ফ্র্যাগমেন্টটি অবিলম্বে চূড়ান্ত অবস্থায় চলে যাবে। ( Ida0d9 )
- Fragments-এর একটি সমস্যা সমাধান করা হয়েছে, যেখানে একটি Predictive back gesture দিয়ে ইনকামিং ট্রানজিশন বাধা দিলে প্রবেশকারী ভিউটি নষ্ট হয়ে যেত এবং একটি ফাঁকা স্ক্রিন দেখা যেত। ( Id3f22 , b/319531491 )
সংস্করণ 1.7.0-alpha10
৭ ফেব্রুয়ারী, ২০২৪
androidx.fragment:fragment-*:1.7.0-alpha10 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha10-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- Fragment-এর পূর্ববর্তী রিলিজে থাকা একটি পরিচিত সমস্যার সমাধান করা হয়েছে, যেখানে
Animatorবা AndroidX Transition-এর জন্য Fragment-এর Predictive Back সাপোর্ট ব্যবহার করার সময়, যদিaddOnBackStackChangedListenerমাধ্যমে কোনোFragmentManager.OnBackStackChangedListenerআগে থেকে যোগ করা না হয়ে থাকে, তাহলে Fragment-গুলোhandleOnBackProgressedথেকে একটিNullPointerExceptionথ্রো করত। ( I7c835 )
সংস্করণ 1.7.0-alpha09
২৪ জানুয়ারী, ২০২৪
androidx.fragment:fragment-*:1.7.0-alpha09 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha09-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
খণ্ড রচনা নিদর্শন
একটি নতুন fragment-compose আর্টিফ্যাক্ট তৈরি করা হয়েছে, যা মূলত সেইসব অ্যাপকে সমর্থন করার উপর আলোকপাত করে, যেগুলো Fragment-ভিত্তিক আর্কিটেকচার থেকে সম্পূর্ণ Compose-ভিত্তিক আর্কিটেকচারে স্থানান্তরিত হচ্ছে।
এই নতুন আর্টিফ্যাক্টে উপলব্ধ প্রথম বৈশিষ্ট্যটি হল Fragment উপর একটি content এক্সটেনশন মেথড, যা আপনার জন্য একটি ComposeView তৈরি করে এবং সঠিক ViewCompositionStrategy সেট করার মাধ্যমে একটি স্বতন্ত্র Fragment-এর UI-এর জন্য Compose ব্যবহার করা সহজ করে তোলে। ( 561cb7 , b/258046948 )
class ExampleFragment : Fragment() {
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
) = content {
// Write your @Composable content here
val viewModel: ExampleViewModel = viewModel()
// or extract it into a separate, testable method
ExampleComposable(viewModel)
}
}
নতুন বৈশিষ্ট্য
-
FragmentManager.OnBackStackChangedListener()এখন যথাক্রমে পূর্বাভাসমূলক ব্যাক প্রগ্রেস এবং বাতিল ইভেন্ট গ্রহণ করার জন্যonBackStackChangeProgressed()এবংonBackStackChangeCancelled()প্রদান করে। ( 214b87 )
পরিচিত সমস্যা
-
Animatorবা AndroidX Transition-এর জন্য Fragment-এর Predictive Back সাপোর্ট ব্যবহার করার সময়, যদিaddOnBackStackChangedListenerএর মাধ্যমে কোনোFragmentManager.OnBackStackChangedListenerযোগ করা না হয়ে থাকে, তাহলে FragmenthandleOnBackProgressedথেকে একটিNullPointerExceptionথ্রো করবে। ম্যানুয়ালি একটি লিসেনার যোগ করলে এই ক্র্যাশটি এড়ানো যাবে। Fragments-এর পরবর্তী রিলিজে এর একটি সমাধান পাওয়া যাবে।
সংস্করণ 1.7.0-alpha08
১০ জানুয়ারী, ২০২৪
androidx.fragment:fragment-*:1.7.0-alpha08 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha08-এ এই কমিটগুলো রয়েছে।
পরিষ্কার করা
- Transition
1.5.0-alpha06এ সমাধান করা Transition লাইব্রেরির জন্য ওয়ার্কঅ্যারাউন্ডটি সরিয়ে ফেলা হয়েছে। ( I04356 )
সংস্করণ 1.7.0-alpha07
২৯ নভেম্বর, ২০২৩
androidx.fragment:fragment-*:1.7.0-alpha07 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha07-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- একটি শেয়ার্ড এলিমেন্ট ট্রানজিশন সেট করার সময় এন্টার/এক্সিট ট্রানজিশনও সেট করতে ব্যর্থ হওয়ার কারণে সৃষ্ট
NullPointerExceptionসংশোধন করা হয়েছে। ( I8472b ) - ফ্র্যাগমেন্ট
1.6.2থেকে: যখন একটিFragmentContainerViewএর ফ্র্যাগমেন্ট ইনফ্লেট করা হয়, তখন এর স্টেট যেমনFragmentManager, Host, এবং id এখনonInflateকলব্যাকে অ্যাক্সেসযোগ্য হবে। ( I1e44c , b/307427423 ) - ফ্র্যাগমেন্ট
1.6.2থেকে:clearBackStackব্যবহার করে একগুচ্ছ ফ্র্যাগমেন্ট অপসারণ করার সময়, এখন থেকে প্যারেন্ট ফ্র্যাগমেন্টেরViewModelক্লিয়ার করার সাথে সাথে যেকোনো নেস্টেড ফ্র্যাগমেন্টেরViewModelsক্লিয়ার হয়ে যাবে। ( I6d83c , b/296173018 )
সংস্করণ 1.7.0-alpha06
৪ অক্টোবর, ২০২৩
androidx.fragment:fragment-*:1.7.0-alpha06 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha06-এ এই কমিটগুলো রয়েছে।
নির্ভরতা আপডেট
- Transition
1.5.0-alpha04এ যুক্ত হওয়া নতুনanimateToStartAPI-এর উপর নির্ভর করার জন্য Fragments-কে আপডেট করা হয়েছে।
সংস্করণ 1.7.0-alpha05
২০ সেপ্টেম্বর, ২০২৩
androidx.fragment:fragment-*:1.7.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha05-এ এই কমিটগুলো রয়েছে।
নতুন বৈশিষ্ট্য
- Androidx Transition ব্যবহার করার সময় Fragment-গুলো এখন Predictive back সাপোর্ট প্রদান করে। এর ফলে, Completed gesture-এর মাধ্যমে ট্রানজ্যাকশনটি Commit বা Cancel করার সিদ্ধান্ত নেওয়ার আগে, আপনি ব্যাক জেসচার ব্যবহার করে আপনার কাস্টম Androidx Transition সহ পূর্ববর্তী Fragment-এ ফিরে যেতে পারবেন। এই ফিচারটি চালু করার জন্য আপনাকে অবশ্যই Transition
1.5.0-alpha03রিলিজটি ব্যবহার করতে হবে। ( Ib49b4 , b/285175724 )
পরিচিত সমস্যা
- বর্তমানে একটি সমস্যা রয়েছে যেখানে আপনি একবার ট্রানজিশন সহ একটি ব্যাক জেসচার বাতিল করার পর, পরের বার ব্যাক জেসচার শুরু করলে ট্রানজিশনটি চলতে ব্যর্থ হয়, যার ফলে একটি ফাঁকা স্ক্রিন দেখা যায়। এটি ট্রানজিশন লাইব্রেরির একটি সমস্যার কারণে হতে পারে। ( b/300157785 )। আপনি যদি এই সমস্যাটি দেখতে পান, তাহলে অনুগ্রহ করে আপনার সমস্যাটি পুনরুৎপাদন করে এমন একটি নমুনা প্রজেক্ট সহ Fragment-এর বিরুদ্ধে একটি ইস্যু ফাইল করুন । আপনি আপনার Activity-র
onCreate()ফাংশনেFragmentManager.enabledPredictiveBack(false)ব্যবহার করে প্রেডিক্টিভ ব্যাক নিষ্ক্রিয় করতে পারেন।
সংস্করণ 1.7.0-alpha04
৬ সেপ্টেম্বর, ২০২৩
androidx.fragment:fragment-*:1.7.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha04-এ এই কমিটগুলো রয়েছে।
বাগ সংশোধন
- প্রেডিক্টিভ ব্যাক জেসচার বাতিল করার সময় একটি সমস্যা সমাধান করা হয়েছে, যেখানে ফ্র্যাগমেন্টগুলি সঠিক লাইফসাইকেল স্টেটে পৌঁছাতে ব্যর্থ হচ্ছিল। ( I7cffe , b/297379023 )
- একটি রিগ্রেশন সংশোধন করা হয়েছে যেখানে অ্যানিমেশনগুলিকে ট্রানজিশনের সাথে চলার অনুমতি দেওয়া হচ্ছিল। ( I59f36 )
- ফ্র্যাগমেন্টের সাথে প্রেডিক্টিভ ব্যাক ব্যবহার করার সময় একটি সমস্যা সমাধান করা হয়েছে, যেখানে ব্যাক স্ট্যাকের শেষের আগের ফ্র্যাগমেন্টে দ্রুত পরপর দুইবার ফিরে যাওয়ার চেষ্টা করলে ক্র্যাশ হতো। ( Ifa1a4 )
সংস্করণ 1.7.0-alpha03
২৩শে আগস্ট, ২০২৩
androidx.fragment:fragment-*:1.7.0-alpha03 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha03-এ এই কমিটগুলো রয়েছে।
বাগ সংশোধন
- ৩-বাটন নেভিগেশন বা প্রেডিক্টিভ ব্যাক জেসচারের মাধ্যমে সিস্টেম ব্যাক ব্যবহার করার সময়, প্রেডিক্টিভ ব্যাক ব্যবহার ফ্র্যাগমেন্ট সংক্রান্ত একটি সমস্যা সমাধান করা হয়েছে, যার ফলে ফ্র্যাগমেন্ট ম্যানেজারের ব্যাক স্ট্যাকের প্রথম ফ্র্যাগমেন্টটি বাদ পড়ে যেত এবং অ্যাক্টিভিটিটি শেষ হয়ে যেত। ( I0664b , b/295231788 )
সংস্করণ 1.7.0-alpha02
৯ আগস্ট, ২০২৩
androidx.fragment:fragment-*:1.7.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha02-এ এই কমিটগুলো রয়েছে।
বাগ সংশোধন
- API 34-এর প্রেডিক্টিভ ব্যাক জেসচারের সাথে ফ্র্যাগমেন্ট ব্যবহার করার সময়, যদি আপনি এমন কোনো ট্রানজিশন সিস্টেম ব্যবহার করেন যা সিকিং (seeking) সাপোর্ট করে না (
Animations,Transitions) অথবা কোনো ট্রানজিশনই ব্যবহার করেন না, তাহলে ফ্র্যাগমেন্ট এখন ব্যাক অ্যাকশনটি কার্যকর করার আগে জেসচারটি সম্পূর্ণ হওয়া পর্যন্ত অপেক্ষা করবে। ( I8100c )
সংস্করণ 1.7.0-alpha01
৭ জুন, ২০২৩
androidx.fragment:fragment-*:1.7.0-alpha01 প্রকাশিত হয়েছে। এই সংস্করণটি একটি অভ্যন্তরীণ শাখায় তৈরি করা হয়েছে।
নতুন বৈশিষ্ট্য
- এখন
Animatorব্যবহার করার সময় ফ্র্যাগমেন্টগুলো প্রেডিক্টিভ ইন-অ্যাপ ব্যাক সাপোর্ট প্রদান করে। এর ফলে, আপনি কমপ্লিটেড জেসচারের মাধ্যমে ট্রানজ্যাকশনটি কমিট করবেন নাকি বাতিল করবেন, সেই সিদ্ধান্ত নেওয়ার আগে ব্যাক জেসচার ব্যবহার করে আপনার কাস্টম অ্যানিমেটরসহ পূর্ববর্তী ফ্র্যাগমেন্টটি দেখতে পারবেন। আপনি এক্সপেরিমেন্টালenablePredictiveBack()ব্যবহার করে এবংfalseপাস করে এই নতুন আচরণটি নিষ্ক্রিয়ও করতে পারেন।
সংস্করণ ১.৬
সংস্করণ ১.৬.২
১ নভেম্বর, ২০২৩
androidx.fragment:fragment-*:1.6.2 প্রকাশিত হয়েছে। সংস্করণ 1.6.2-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- যখন একটি
FragmentContainerViewএর Fragment ইনফ্লেট করা হয়, তখন এরFragmentManager, Host, এবং id-এর মতো স্টেটগুলো এখনonInflateকলব্যাকে অ্যাক্সেস করা যায়। ( I1e44c , b/307427423 ) -
clearBackStackব্যবহার করে একগুচ্ছ ফ্র্যাগমেন্ট অপসারণ করার সময়, এখন থেকে প্যারেন্ট ফ্র্যাগমেন্টেরViewModelক্লিয়ার করার সাথে সাথে যেকোনো নেস্টেড ফ্র্যাগমেন্টেরViewModelsও ক্লিয়ার হয়ে যাবে। ( I6d83c , b/296173018 )
সংস্করণ ১.৬.১
২৬ জুলাই, ২০২৩
androidx.fragment:fragment-*:1.6.1 প্রকাশিত হয়েছে। সংস্করণ 1.6.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- একটি সমস্যার সমাধান করা হয়েছে যেখানে অ্যাক্টিভিটি বন্ধ থাকা অবস্থায় কিন্তু ধ্বংস না হওয়া পর্যন্ত সংরক্ষিত স্টেটটি, ফ্র্যাগমেন্ট ইনস্ট্যান্সটিকে আবার
RESUMEDঅবস্থায় ফিরিয়ে আনার পরেও ভুলভাবে ক্যাশ হয়ে যেত। এর ফলে, একাধিক ব্যাক স্ট্যাক API ব্যবহার করে ফ্র্যাগমেন্টটি সেভ এবং রিস্টোর করার সময় যদি সেই ফ্র্যাগমেন্ট ইনস্ট্যান্সটি ব্যাক স্ট্যাকে থাকত, তবে সেই ক্যাশ করা স্টেটটি পুনরায় ব্যবহৃত হতো। ( I71288 , b/246289075 )
নির্ভরতা আপডেট
- Fragment এখন Activity 1.7.2-এর উপর নির্ভরশীল। এর মাধ্যমে সেই সমস্যার সমাধান করা হয়েছে, যেখানে Kotlin ব্যবহারকারীরা Activity-র উপর সুস্পষ্ট নির্ভরতা ছাড়া
ComponentDialogএক্সটেন্ড করতে পারতেন না। ( b/287509323 )
সংস্করণ ১.৬.০
৭ জুন, ২০২৩
androidx.fragment:fragment-*:1.6.0 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
১.৫.০ সংস্করণ থেকে গুরুত্বপূর্ণ পরিবর্তনসমূহ
-
Fragmentএর সংরক্ষিত স্টেটকে সম্পূর্ণরূপে দুটি ভাগে ভাগ করা হয়েছে: একটি হলো প্রাইভেট লাইব্রেরি স্টেট (কাস্টমParcelableক্লাস) এবং অন্যটি ডেভেলপারের সরবরাহ করা স্টেট। এই ডেভেলপারের সরবরাহ করা স্টেট এখন সর্বদা একটিBundleএ সংরক্ষিত থাকে, যা থেকে একটি Fragment-এর স্টেটের উৎস সুনির্দিষ্টভাবে নির্ধারণ করা যায়। -
FragmentManager.OnBackStackChangedListenerইন্টারফেসটিকেonBackStackChangeStartedএবংonBackStackChangeCommittedনামে দুটি অতিরিক্ত কলব্যাক দিয়ে সম্প্রসারিত করা হয়েছে, যেগুলো যথাক্রমে প্রতিটিFragmentফ্র্যাগমেন্ট ব্যাক স্ট্যাক থেকে যুক্ত/অপসারণ করার ঠিক আগে এবং ট্রানজ্যাকশন কমিট হওয়ার ঠিক পরে কল করা হয়। -
FragmentStrictModeএকটি নতুনWrongNestedHierarchyViolationযোগ করা হয়েছে, যা শনাক্ত করে যখন কোনো চাইল্ড ফ্র্যাগমেন্ট তার প্যারেন্টের View হায়ারার্কির মধ্যে নেস্টেড থাকে, কিন্তু প্যারেন্টেরchildFragmentManagerএ যুক্ত করা হয় না। -
FragmentএবংFragmentManagerAPI-গুলো, যেগুলোIntentবাIntentSenderগ্রহণ করে, সেগুলোকে এখন@NonNullদিয়ে যথাযথভাবে অ্যানোটেট করা হয়েছে। এর ফলে null ভ্যালু পাস করা প্রতিরোধ করা যায়, কারণ null ভ্যালু পাস করলে এই মেথডগুলো যে সংশ্লিষ্ট অ্যান্ড্রয়েড ফ্রেমওয়ার্ক API-গুলোকে কল করে, সেগুলো তাৎক্ষণিকভাবে ক্র্যাশ করে। -
DialogFragmentএখনrequireComponentDialog()API-এর মাধ্যমে অন্তর্নিহিতComponentDialogএ অ্যাক্সেস প্রদান করে। - ফ্র্যাগমেন্টটি এখন লাইফসাইকেল
2.6.1এর উপর নির্ভরশীল। - Fragment এখন SavedState
1.2.1এর উপর নির্ভরশীল। - ফ্র্যাগমেন্টটি এখন ProfileInstaller
1.3.0এর উপর নির্ভরশীল। fragment-testing-manifestআর্টিফ্যাক্টটি `fragment-testing`-এর বাকি উপাদানগুলো থেকে `manifest` এন্ট্রিগুলোকে আলাদা করে। এর মানে হলো, আপনি নিম্নলিখিত কাজগুলো করতে পারবেন:debugImplementation("androidx.fragment:fragment-testing-manifest:X.Y.Z") androidTestImplementation("androidx.fragment:fragment-testing:X.Y.Z")এর ফলে
fragment-testingএবংandroidx.testএর মধ্যে ভার্সনের অসামঞ্জস্যজনিত দ্বন্দ্ব এড়ানো যায়।
সংস্করণ 1.6.0-rc01
১০ মে, ২০২৩
androidx.fragment:fragment-*:1.6.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-rc01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- পরপর একাধিক
startActivityForResultঅনুরোধ পাঠানোর ফলেActivityResultগুলো ভুল অনুরোধ কোডসহ পাঠানো হচ্ছিল, এই সমস্যাটি সমাধান করা হয়েছে। ( If0b9d , b/249519359 ) - এমন একটি সমস্যার সমাধান করা হয়েছে যেখানে ব্যাক স্ট্যাক পরিবর্তন করে এমন ট্রানজ্যাকশনের সাথে মিশ্রিত থাকলে, যে ট্রানজ্যাকশনগুলো প্রকৃতপক্ষে ব্যাক স্ট্যাক পরিবর্তন করে না, সেগুলোর জন্যও
onBackStackChangeListenerকলব্যাকগুলো ডিসপ্যাচ হয়ে যাচ্ছিল। ( I0eb5c , b/279306628 )
সংস্করণ 1.6.0-beta01
১৯ এপ্রিল, ২০২৩
androidx.fragment:fragment-*:1.6.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-beta01-এ এই কমিটগুলো রয়েছে।
বাগ সংশোধন
- টাইমআউট সহ
postponeEnterTransitionব্যবহার করে এবং তারপর স্থগিত করা ফ্র্যাগমেন্টটি প্রতিস্থাপন করলে, স্থগিত ফ্র্যাগমেন্টটি আর লিক হয় না। ( I2ec7d , b/276375110 ) - নতুন
onBackStackChangeStartedএবংonBackStackChangeCommittedকলব্যাকগুলো এখন থেকে একটি ফ্র্যাগমেন্টকে শুধুমাত্র একবারই ডিসপ্যাচ করবে, এমনকি যদি একাধিক ট্রানজ্যাকশনে একই ফ্র্যাগমেন্ট থাকে। ( Ic6b69 )
সংস্করণ 1.6.0-alpha09
৫ এপ্রিল, ২০২৩
androidx.fragment:fragment-*:1.6.0-alpha09 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha09-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
-
DialogFragmentএখনrequireComponentDialog()API-এর মাধ্যমে অন্তর্নিহিতComponentDialogএ অ্যাক্সেস প্রদান করে। ( I022e3 , b/234274777 ) -
commitNow(),executePendingTransactions(), এবংpopBackStackImmediate()API-গুলোকে@MainThreadদিয়ে অ্যানোটেট করা হয়েছে। এর মানে হলো, এখন থেকে এগুলো মেইন থ্রেড থেকে কল করা না হলে রানটাইমে ফেইল করার জন্য অপেক্ষা না করে বিল্ড এরর দেখাবে। ( Ic9665 , b/236538905 )
বাগ সংশোধন
-
FragmentManagerএর একটি বাগ সংশোধন করা হয়েছে, যেখানে একই ফ্রেমে সেভ এবং রিস্টোর করলে ক্র্যাশ হতে পারতো। ( Ib36af , b/246519668 ) -
OnBackStackChangedListeneronBackStackChangeStartedএবংonBackStackChangeCommittedকলব্যাকগুলো এখন থেকে শুধুমাত্র তখনই কার্যকর হবে যখনFragmentManagerব্যাক স্ট্যাক পরিবর্তিত হবে। ( I66055 , b/274788957 )
সংস্করণ 1.6.0-alpha08
২২ মার্চ, ২০২৩
androidx.fragment:fragment-*:1.6.0-alpha08 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha08-এ এই কমিটগুলো রয়েছে।
আচরণ পরিবর্তন
-
OnBackStackChangedListener.onBackStackChangeCommitedকলব্যাকের সময় এমনভাবে সমন্বয় করা হয়েছে যাতে এটি ফ্র্যাগমেন্ট অপারেশনগুলো সম্পাদিত হওয়ার আগে কার্যকর হয়। এটি নিশ্চিত করে যে কলব্যাকটিতে কখনই কোনো ডিটাচড ফ্র্যাগমেন্ট পাস করা হবে না। ( I66a76 , b/273568280 )
বাগ সংশোধন
- ফ্র্যাগমেন্ট
1.5.6থেকে: একটি সমস্যার সমাধান করা হয়েছে যেখানেLifecycleইতিমধ্যেSTARTEDএবং একটি ফলাফল উপলব্ধ থাকলে,setFragmentResultListenerভিতরেclearFragmentResultListenerকল করলে তা কাজ করত না। ( If7458 )
নির্ভরতা আপডেট
- ফ্র্যাগমেন্টটি এখন লাইফসাইকেল
2.6.1এর উপর নির্ভরশীল। ( 586fe7 ) - Fragment এখন SavedState
1.2.1এর উপর নির্ভরশীল। ( 078e4e ) - ফ্র্যাগমেন্টটি এখন ProfileInstaller
1.3.0এর উপর নির্ভরশীল। ( 3fc05b )
সংস্করণ 1.6.0-alpha07
৮ মার্চ, ২০২৩
androidx.fragment:fragment-*:1.6.0-alpha07 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha07-এ এই কমিটগুলো রয়েছে।
বাগ সংশোধন
- ফ্র্যাগমেন্ট
1.5.6থেকে: এমন একটি সমস্যার সমাধান করা হয়েছে যেখানে মেনু আইটেম যোগ করা থাকুক বা না থাকুক, যেকোনো ফ্র্যাগমেন্ট অপসারণ করলে অ্যাক্টিভিটির মেনুটি অকার্যকর হয়ে যেত। ( 50f098 , b/244336571 )
সংস্করণ 1.6.0-alpha06
২২ ফেব্রুয়ারী, ২০২৩
androidx.fragment:fragment-*:1.6.0-alpha06 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha06-এ এই কমিটগুলো রয়েছে।
আচরণ পরিবর্তন
-
FragmentManagerএরonBackStackChangedListenerএর নতুনonBackStackChangedStartedকলব্যাকটি এখন থেকে ফ্র্যাগমেন্টগুলো তাদের টার্গেট স্টেটে যাওয়া শুরু করার আগেই এক্সিকিউট হবে। ( I34726 )
সংস্করণ 1.6.0-alpha05
৮ ফেব্রুয়ারী, ২০২৩
androidx.fragment:fragment-*:1.6.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha05-এ এই কমিটগুলো রয়েছে।
নতুন বৈশিষ্ট্য
-
FragmentManager.OnBackStackChagnedListenerইন্টারফেসটি এখনonBackStackChangeStartedএবংonBackStackChangeCommittedনামে দুটি অতিরিক্ত কলব্যাক প্রদান করে, যাFragmentManagerএ ব্যাক স্ট্যাক পরিবর্তন ঘটলে অতিরিক্ত তথ্য এবং নিয়ন্ত্রণের সুযোগ দেয়। ( Ib7ce5 , b/238686802 )
এপিআই পরিবর্তন
-
FragmentএবংFragmentManagerAPI-গুলো, যেগুলোIntentবাIntentSenderগ্রহণ করে, সেগুলোকে এখন@NonNullদিয়ে যথাযথভাবে অ্যানোটেট করা হয়েছে। এর ফলে null ভ্যালু পাস করা প্রতিরোধ করা সম্ভব হচ্ছে, কারণ null ভ্যালু পাস করলে এই মেথডগুলো যে সংশ্লিষ্ট অ্যান্ড্রয়েড ফ্রেমওয়ার্ক API-গুলোকে কল করে, সেগুলো তাৎক্ষণিকভাবে ক্র্যাশ করত। ( I06fd4 )
সংস্করণ 1.6.0-alpha04
৭ ডিসেম্বর, ২০২২
androidx.fragment:fragment-*:1.6.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha04-এ এই কমিটগুলো রয়েছে।
নতুন বৈশিষ্ট্য
-
FragmentStrictModeএকটি নতুনWrongNestedHierarchyViolationযোগ করেছে যা শনাক্ত করে যখন একটি চাইল্ড ফ্র্যাগমেন্ট তার প্যারেন্টের View হায়ারার্কির মধ্যে নেস্টেড থাকে, কিন্তু প্যারেন্টেরchildFragmentManagerএ যোগ করা হয় না। ( I72521 , b/249299268 )
আচরণগত পরিবর্তন
- Fragments এখন
onAttach()এর আগে তাদেরSavedStateRegistryস্টেট পুনরুদ্ধার করে, যা নিশ্চিত করে যে এটি পরবর্তী সমস্ত লাইফসাইকেল মেথড থেকে উপলব্ধ থাকে। ( I1e2b1 )
এপিআই পরিবর্তন
-
fragment-testing-manifestআর্টিফ্যাক্টটি `fragment-testing`-এর বাকি উপাদানগুলো থেকে `manifest` এন্ট্রিগুলোকে আলাদা করে। এর মানে হলো, আপনি নিম্নলিখিত কাজগুলো করতে পারবেন:
debugImplementation("androidx.fragment:fragment-testing-manifest:X.Y.Z")
androidTestImplementation("androidx.fragment:fragment-testing:X.Y.Z")
এর ফলে fragment-testing এবং androidx.test এর মধ্যে ভার্সনের অসামঞ্জস্যজনিত দ্বন্দ্ব এড়ানো যায়। ( I8e534 , b/128612536 )
বাগ সংশোধন
- ফ্র্যাগমেন্ট
1.5.5থেকে: ফ্র্যাগমেন্টগুলো এখন থেকে আর ভুলভাবেViewModelস্টেটকে ভিউ রেজিস্ট্রি সেভড স্টেটের অংশ হিসেবে সংরক্ষণ করবে না। ( I10d2b , b/253546214 )
সংস্করণ 1.6.0-alpha03
৫ অক্টোবর, ২০২২
androidx.fragment:fragment:1.6.0-alpha03 , androidx.fragment:fragment-ktx:1.6.0-alpha03 , এবং androidx.fragment:fragment-testing:1.6.0-alpha03 রিলিজ করা হয়েছে। ভার্সন 1.6.0-alpha03-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
এপিআই পরিবর্তন
-
DialogFragmentএক্সটেন্ড করা ক্লাসগুলোকে এখন থেকে তাদেরonDismiss()ওভাররাইডে super কল করতে হবে। ( I14798 , b/238928865 )
বাগ সংশোধন
- নতুন প্রোভাইডার কলব্যাক ইন্টারফেস (
OnConfigurationChangedProvider,OnMultiWindowModeChangedProvider,OnTrimMemoryProvider,OnPictureInPictureModeChangedProvider) একীভূত করার কারণে সৃষ্ট রিগ্রেশনগুলি সংশোধন করা হয়েছে, যাতে ফ্র্যাগমেন্টগুলি সর্বদা সঠিক কলব্যাকগুলি পায়। ( I9b380 , I34581 , ( I8dfe6 , b/242570955 ), If9d6b , Id0096 , I690b3 , I2cba2 )
সংস্করণ 1.6.0-alpha02
২৪ আগস্ট, ২০২২
androidx.fragment:fragment:1.6.0-alpha02 , androidx.fragment:fragment-ktx:1.6.0-alpha02 , এবং androidx.fragment:fragment-testing:1.6.0-alpha02 রিলিজ করা হয়েছে। ভার্সন 1.6.0-alpha02-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- ফ্র্যাগমেন্ট
1.5.2থেকে: এমন একটি সমস্যা সমাধান করা হয়েছে যেখানে একই সাথেpopBackStack()এবংreplace()ট্রানজ্যাকশন সম্পাদন করলে এক্সিট করা ফ্র্যাগমেন্টগুলো ভুলAnimation/Animatorরান করতে পারতো। ( Ib1c07 , b/214835303 )
সংস্করণ 1.6.0-alpha01
২৭ জুলাই, ২০২২
androidx.fragment:fragment:1.6.0-alpha01 , androidx.fragment:fragment-ktx:1.6.0-alpha01 , এবং androidx.fragment:fragment-testing:1.6.0-alpha01 রিলিজ করা হয়েছে। ভার্সন 1.6.0-alpha01-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
আচরণগত পরিবর্তন
-
Fragmentএর সংরক্ষিত স্টেটকে এখন সম্পূর্ণরূপে দুটি ভাগে ভাগ করা হয়েছে: প্রাইভেট লাইব্রেরি স্টেট (কাস্টমParcelableক্লাস) এবং ডেভেলপারের দেওয়া স্টেট। এই ডেভেলপারের দেওয়া স্টেট এখন সর্বদা একটিBundleএ সংরক্ষিত থাকে, যা একটি Fragment-এর স্টেটের উৎস ঠিক কোথায় তা নির্ধারণ করতে সাহায্য করে। ( b/207158202 )
বাগ সংশোধন
- ফ্র্যাগমেন্ট
1.5.1থেকে:DialogFragmentCallbacksDetectorএর একটি রিগ্রেশন সংশোধন করা হয়েছে, যেখানে AGP 7.4-এর সাথে বান্ডেল করা lint সংস্করণটি ব্যবহার করলে lint ক্র্যাশ করত। ( b/237567009 )
নির্ভরতা আপডেট
- ফ্র্যাগমেন্ট
1.5.1থেকে: ফ্র্যাগমেন্ট লাইব্রেরিটি এখন লাইফসাইকেল2.5.1এর উপর নির্ভরশীল। ( আইডি২০৪সি ) - ফ্র্যাগমেন্ট
1.5.1থেকে: ফ্র্যাগমেন্ট লাইব্রেরিটি এখন অ্যাক্টিভিটি1.5.1উপর নির্ভরশীল। ( I10f07 )
সংস্করণ ১.৫
সংস্করণ ১.৫.৭
১৯ এপ্রিল, ২০২৩
androidx.fragment:fragment:1.5.7 , androidx.fragment:fragment-ktx:1.5.7 , এবং androidx.fragment:fragment-testing:1.5.7 রিলিজ করা হয়েছে। ভার্সন 1.5.7-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- টাইমআউট সহ
postponeEnterTransitionব্যবহার করে এবং তারপর স্থগিত করা ফ্র্যাগমেন্টটি প্রতিস্থাপন করলে, স্থগিত ফ্র্যাগমেন্টটি আর লিক হয় না। ( I2ec7d , b/276375110 )
সংস্করণ ১.৫.৬
২২ মার্চ, ২০২৩
androidx.fragment:fragment:1.5.6 , androidx.fragment:fragment-ktx:1.5.6 , এবং androidx.fragment:fragment-testing:1.5.6 রিলিজ করা হয়েছে। ভার্সন 1.5.6-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- এমন একটি সমস্যার সমাধান করা হয়েছে যেখানে মেনু আইটেম যোগ করা থাকুক বা না থাকুক, যেকোনো ফ্র্যাগমেন্ট সরিয়ে ফেললে অ্যাক্টিভিটির মেনুটি অকার্যকর হয়ে যেত। ( 50f098 , b/244336571 )
- একটি সমস্যার সমাধান করা হয়েছে যেখানে
Lifecycleইতিমধ্যেSTARTEDএবং একটি ফলাফল উপলব্ধ থাকলে,setFragmentResultListenerভিতরেclearFragmentResultListenerকল করলে তা কাজ করত না। ( If7458 )
সংস্করণ ১.৫.৫
৭ ডিসেম্বর, ২০২২
androidx.fragment:fragment:1.5.5 , androidx.fragment:fragment-ktx:1.5.5 , এবং androidx.fragment:fragment-testing:1.5.5 রিলিজ করা হয়েছে। ভার্সন 1.5.5-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- ফ্র্যাগমেন্টগুলি এখন থেকে আর ভুলবশত ভিউ রেজিস্ট্রি সেভড স্টেটের অংশ হিসেবে
ViewModelস্টেট সংরক্ষণ করবে না। ( I10d2b , b/253546214 )
সংস্করণ ১.৫.৪
২৪ অক্টোবর, ২০২২
androidx.fragment:fragment:1.5.4 , androidx.fragment:fragment-ktx:1.5.4 , এবং androidx.fragment:fragment-testing:1.5.4 রিলিজ করা হয়েছে। ভার্সন 1.5.4-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- এমন একটি ত্রুটি সংশোধন করা হয়েছে যেখানে প্রোভাইডার কলব্যাক ইন্টারফেস (
OnConfigurationChangedProvider,OnMultiWindowModeChangedProvider,OnTrimMemoryProvider,OnPictureInPictureModeChangedProvider) ইমপ্লিমেন্ট করে না এমন হোস্টের সাথে কাস্টমFragmentControllerব্যবহার করার সময় এবং এর ডেপ্রিকেটেড ডিসপ্যাচ ফাংশন কল করলে চাইল্ড ফ্র্যাগমেন্টগুলিতে ডিসপ্যাচ ব্যর্থ হতো। ( I9b380 )
সংস্করণ ১.৫.৩
২১ সেপ্টেম্বর, ২০২২
androidx.fragment:fragment:1.5.3 , androidx.fragment:fragment-ktx:1.5.3 , এবং androidx.fragment:fragment-testing:1.5.3 রিলিজ করা হয়েছে। ভার্সন 1.5.3-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- একটি ত্রুটি সংশোধন করা হয়েছে যার কারণে ব্যাক স্ট্যাকের ফ্র্যাগমেন্টগুলি
onMultiWindowModeChanged(),onPictureInPictureModeChanged(),onLowMemory(), এবংonConfigurationChanged()কলব্যাকগুলি পেয়ে যাচ্ছিল। ( I34581 , I8dfe6 , b/242570955 ) - নেস্টেড চাইল্ড ফ্র্যাগমেন্টগুলো এখন থেকে আর একাধিক
onMultiWindowModeChanged(),onPictureInPictureModeChanged(),onLowMemory(), বাonConfigurationChanged()কলব্যাক পাবে না। ( I690b3 , Id0096 , If9d6b , I2cba2 )
সংস্করণ ১.৫.২
১০ আগস্ট, ২০২২
androidx.fragment:fragment:1.5.2 , androidx.fragment:fragment-ktx:1.5.2 , এবং androidx.fragment:fragment-testing:1.5.2 রিলিজ করা হয়েছে। ভার্সন 1.5.2-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
- এমন একটি সমস্যার সমাধান করা হয়েছে যেখানে একই সাথে `
popBackStack()এবং `replace()ট্রানজ্যাকশন সম্পাদন করলে এক্সিট করা ফ্র্যাগমেন্টগুলিতে ভুলAnimation/Animatorচালু হয়ে যেত। ( Ib1c07 , b/214835303 )
সংস্করণ ১.৫.১
২৭ জুলাই, ২০২২
androidx.fragment:fragment:1.5.1 , androidx.fragment:fragment-ktx:1.5.1 , এবং androidx.fragment:fragment-testing:1.5.1 রিলিজ করা হয়েছে। ভার্সন 1.5.1-এ এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
বাগ সংশোধন
-
DialogFragmentCallbacksDetectorএর একটি রিগ্রেশন সংশোধন করা হয়েছে, যেখানে AGP 7.4-এর সাথে বান্ডেল করা lint সংস্করণটি ব্যবহার করলে lint ক্র্যাশ করত। ( b/237567009 )
নির্ভরতা আপডেট
- Fragment লাইব্রেরিটি এখন Lifecycle
2.5.1এর উপর নির্ভরশীল। ( Id204c ) - Fragment লাইব্রেরিটি এখন Activity
1.5.1এর উপর নির্ভরশীল। ( I10f07 )
সংস্করণ ১.৫.০
২৯ জুন, ২০২২
androidx.fragment:fragment:1.5.0 , androidx.fragment:fragment-ktx:1.5.0 , এবং androidx.fragment:fragment-testing:1.5.0 রিলিজ করা হয়েছে। ভার্সন 1.5.0-তে এই কমিটগুলো অন্তর্ভুক্ত রয়েছে।
১.৪.০ সংস্করণ থেকে গুরুত্বপূর্ণ পরিবর্তনসমূহ
- CreationExtras ইন্টিগ্রেশন -
Fragmentএখন Lifecycle2.5.0-এরCreationExtrasএর মাধ্যমে একটি স্টেটলেসViewModelProvider.Factoryপ্রদান করতে পারে। - কম্পোনেন্ট ডায়ালগ ইন্টিগ্রেশন -
DialogFragmentএখন Activity1.5.0এর মাধ্যমেonCreateDialog()দ্বারা ফেরত আসা ডিফল্ট ডায়ালগ হিসেবেComponentDialogব্যবহার করে। - সংরক্ষিত ইনস্ট্যান্স স্টেট রিফ্যাক্টরিং - ফ্র্যাগমেন্টগুলো তাদের ইনস্ট্যান্স স্টেট সংরক্ষণ করার পদ্ধতিতে পরিবর্তন আনতে শুরু করেছে। এর উদ্দেশ্য হলো ফ্র্যাগমেন্টে কোন স্টেট সংরক্ষিত হয়েছে এবং সেই স্টেটের উৎস কী, তা স্পষ্টভাবে শনাক্ত করতে সাহায্য করা। বর্তমান পরিবর্তনগুলোর মধ্যে নিম্নলিখিত বিষয়গুলো অন্তর্ভুক্ত রয়েছে:
-
FragmentManagerএখন তার সংরক্ষিত ইনস্ট্যান্স স্টেট সরাসরি একটি কাস্টমParcelableপরিবর্তে একটিBundleএ সংরক্ষণ করে। -
Fragment Result APIsএর মাধ্যমে সেট করা যে ফলাফলগুলো এখনও ডেলিভার করা হয়নি, সেগুলো এখনFragmentManagerএর অভ্যন্তরীণ অবস্থা থেকে আলাদাভাবে সংরক্ষণ করা হয়। - এখন প্রতিটি স্বতন্ত্র ফ্র্যাগমেন্টের সাথে সম্পর্কিত স্টেট
FragmentManagerএর অভ্যন্তরীণ স্টেট থেকে আলাদাভাবে সংরক্ষিত হয়, যার ফলে আপনি একটি স্বতন্ত্র ফ্র্যাগমেন্টের সাথে সম্পর্কিত সংরক্ষিত স্টেটের পরিমাণকেFragmentডিবাগ লগিং-এ উপস্থিত অনন্য আইডিগুলোর সাথে সম্পর্কযুক্ত করতে পারেন।
-
অন্যান্য পরিবর্তন
-
FragmentStrictModenow offers the ability for private third-party fragments to bypass specific violation penalties by usingallowViolation()with the class name. - The Fragment APIs for providing a menu to your activity's
ActionBarhave been deprecated. TheMenuHostandMenuProviderAPIs added in Activity1.4.0provide a testable, lifecycle aware equivalent API surface that fragments should use.
Version 1.5.0-rc01
১১ মে, ২০২২
androidx.fragment:fragment:1.5.0-rc01 , androidx.fragment:fragment-ktx:1.5.0-rc01 , and androidx.fragment:fragment-testing:1.5.0-rc01 are released. Version 1.5.0-rc01 contains these commits.
Saved Instance State Refactoring
- The state associated with each individual fragment is now saved separately from the internal state of the
FragmentManager, thus allowing you to correlate the amount of saved state associated with an individual fragment with the unique IDs present in the Fragment debug logging . ( a153e0 , b/207158202 )
Version 1.5.0-beta01
২০ এপ্রিল, ২০২২
androidx.fragment:fragment:1.5.0-beta01 , androidx.fragment:fragment-ktx:1.5.0-beta01 , and androidx.fragment:fragment-testing:1.5.0-beta01 are released. Version 1.5.0-beta01 contains these commits.
এপিআই পরিবর্তন
-
DialogFragmenthas added a newdismissNowmethod that usescommitNowfor parity with theshowNowfunction. Note that this will not make theDialogbe dismissed immediately, it will only synchronously update the state of theFragmentManager. ( I15c36 , b/72644830 )
Saved Instance State Refactoring
-
FragmentManagernow saves its saved instance state into aBundleinstead of directly in a customParcelable. This is the first step in providing additional transparency into what is actually being saved by Fragments. ( I93807 , b/207158202 ) - Results set via the Fragment Result APIs that have not yet been delivered are now saved separately from the internal state of the
FragmentManager. This will allow for additional transparency into what results are being saved as part of your saved instance state. ( I6ea12 , b/207158202 )
Version 1.5.0-alpha05
৬ এপ্রিল, ২০২২
androidx.fragment:fragment:1.5.0-alpha05 , androidx.fragment:fragment-ktx:1.5.0-alpha05 , and androidx.fragment:fragment-testing:1.5.0-alpha05 are released. Version 1.5.0-alpha05 contains these commits.
এপিআই পরিবর্তন
-
Fragment'ssetHasOptionsMenu()has been deprecated. To manage menus and their menu items, the new menu APIs should be used instead as per the Fragment1.5.0-alpha04release notes . ( I7b4b4 , b/226438239 )
Version 1.5.0-alpha04
March 23, 2022
androidx.fragment:fragment:1.5.0-alpha04 , androidx.fragment:fragment-ktx:1.5.0-alpha04 , and androidx.fragment:fragment-testing:1.5.0-alpha04 are released. Version 1.5.0-alpha04 contains these commits.
এপিআই পরিবর্তন
- The Fragment APIs for providing a menu to your activity's
ActionBarhave been deprecated as they tightly couple your fragment to your activity and are not testable in isolation. TheMenuHostandMenuProviderAPIs added in Activity1.4.0-alpha01provide a testable, lifecycle aware equivalent API surface that fragments should use. ( I50a59 , I20758 )
বাগ সংশোধন
-
SavedStateViewFactorynow supports usingCreationExtraseven when it was initialized with aSavedStateRegistryOwner. If extras are provided, the initialized arguments are ignored. ( I6c43b , b/224844583 )
Version 1.5.0-alpha03
February 23, 2022
androidx.fragment:fragment:1.5.0-alpha03 , androidx.fragment:fragment-ktx:1.5.0-alpha03 , and androidx.fragment:fragment-testing:1.5.0-alpha03 are released. Version 1.5.0-alpha03 contains these commits.
এপিআই পরিবর্তন
- You can now pass
CreationExtrasto theby viewModels()andby activityViewModels()functions. ( Ibefe7 , b/217601110 )
আচরণগত পরিবর্তন
-
DialogFragmentnow usesComponentDialogas the default dialog returned byonCreateDialog(). ( If3784 , b/217618170 )
Version 1.5.0-alpha02
৯ ফেব্রুয়ারী, ২০২২
androidx.fragment:fragment:1.5.0-alpha02 , androidx.fragment:fragment-ktx:1.5.0-alpha02 , and androidx.fragment:fragment-testing:1.5.0-alpha02 are released. Version 1.5.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
-
FragmentStrictModenow offers the ability for private third-party fragments to bypass specific violation penalties by usingallowViolation()with the class name. ( I8f678 )
Version 1.5.0-alpha01
২৬ জানুয়ারী, ২০২২
androidx.fragment:fragment:1.5.0-alpha01 , androidx.fragment:fragment-ktx:1.5.0-alpha01 , and androidx.fragment:fragment-testing:1.5.0-alpha01 are released. Version 1.5.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
-
Fragmentnow integrates with ViewModel CreationExtras, introduced as part of Lifecycle2.5.0-alpha01. ( I3060b , b/207012585 )
বাগ সংশোধন
- From Fragment
1.4.1:FragmentContainerViewno longer throws an illegal state exception when view IDs generated from xml have negative values. ( Ic185b , b/213086140 ) - From Fragment
1.4.1: When using a customownerProducerlambda with theby viewModels()lazy function, it will now use thedefaultViewModelProviderFactoryfrom that owner if a customViewModelProvider.Factoryis not provided instead of always using the fragment's factory. ( I56170 , b/214106513 ) - Fixed a crash when accessing a
ViewModelfor the very first time from aregisterForActivityResult()callback of aFragment. ( Iea2b3 )
Version 1.4
Version 1.4.1
২৬ জানুয়ারী, ২০২২
androidx.fragment:fragment:1.4.1 , androidx.fragment:fragment-ktx:1.4.1 , and androidx.fragment:fragment-testing:1.4.1 are released. Version 1.4.1 contains these commits.
বাগ সংশোধন
-
FragmentContainerViewno longer throws an illegal state exception when view IDs generated from xml have negative values. ( Ic185b , b/213086140 ) - When using a custom
ownerProducerlambda with theby viewModels()lazy function, it will now use thedefaultViewModelProviderFactoryfrom that owner if a customViewModelProvider.Factoryis not provided instead of always using the fragment's factory. ( I56170 , b/214106513 )
Version 1.4.0
November 17, 2021
androidx.fragment:fragment:1.4.0 , androidx.fragment:fragment-ktx:1.4.0 , and androidx.fragment:fragment-testing:1.4.0 are released. Version 1.4.0 contains these commits.
Important changes since 1.3.0
- The
FragmentStrictModeAPIs provide runtime checks that allow you to verify that your app or libraries you depend on are not calling deprecated fragment APIs. When a violation is detected, you can choose to print a log message, trigger your own custom listener, or crash your app. TheFragmentStrictMode.Policythat controls what checks are enabled and what “penalties” are triggered can be set on aFragmentManagervia the newsetStrictModePolicy()method. That policy applies to thatFragmentManagerand transitively to any child fragment managers that do not set their own unique policy. See StrictMode for fragments . FragmentContainerViewnow provides agetFragment()method which returns the fragment that was most recently added to the container. This uses the same logic asfindFragmentById()with the ID of theFragmentContainerView, but allows chaining the call.val navController = binding.container.getFragment<NavHostFragment>().navControllerFragmentScenarionow implementsCloseable, allowing you to use it with Kotlin'susemethod or try-with-resources .Added
FragmentTransaction#TRANSIT_FRAGMENT_MATCH_ACTIVITY_{OPEN, CLOSE}to specify whether to enable the standard Activity-transition animation taken from your theme in Fragments transition.The experimental API of
FragmentManager.enableNewStateManager(boolean)has been removed and the new state manager is now the only option available.
Multiple back stacks
The FragmentManager maintains a back stack made up of fragment transactions that used addToBackStack() . This allows you to pop those transactions and return to the previous state, using the mechanisms for Saving state with fragments to allow your fragments to restore their state appropriately.
This release expands on these mechanisms by providing three new FragmentManager APIs: saveBackStack(String name) , restoreBackStack(String name) , and clearBackStack(String name) . These APIs use the same name as addToBackStack() to save the state of the FragmentTransaction and the state of every fragment that was added in those transactions and allow you to later restore those transactions and their fragments with their state in tact. This allows you to effectively 'swap' between multiple back stacks by saving the current back stack and restoring a saved back stack.
saveBackStack() operates similarly to popBackStack() in that it is asynchronous and results in all the fragment transactions back to that specific name to be reversed ('popped') and any added fragments to be destroyed and removed, but it differs in a few important ways:
-
saveBackStack()is always inclusive. - Unlike
popBackStack()which will pop all transactions on the back stack if the specified name is not found on the back stack or if a null name is provided,saveBackStack()does nothing if you haven't previously committed a fragment transaction usingaddToBackStack()with that exact, non-null name. - The state of all fragments added from those transactions is saved. This means that the View state of every fragment is stored,
onSaveInstanceState()of every fragment is called and that state is restored, and anyViewModelinstances associated with those fragments are retained (andonCleared()is not called on them).
The fragment transactions that can be used with saveBackStack() must meet certain criteria:
- Every fragment transaction must use
setReorderingAllowed(true)to ensure the transactions can be restored as a single, atomic operation. - The set of transactions saved must be self-contained (ie, they must not explicitly reference any fragments outside of that set of transactions) to ensure that they can be restored at any later time, no matter what changes have been made to the back stack in the intervening time.
- No fragment that is saved can be a retained fragment or have a retained fragment in their transitive set of child fragments to ensure that the
FragmentManagerdoes not return any references to saved fragments after the back stack is saved.
Similar to saveBackStack() , restoreBackStack() and clearBackStack() , which would restore a previously saved back stack or clear a previously saved back stack, respectively, both do nothing if you have not previously called saveBackStack() with the same name.
For more information, see Multiple back stacks: A deep dive .
Version 1.4.0-rc01
November 3, 2021
androidx.fragment:fragment:1.4.0-rc01 released with no changes from Fragment 1.4.0-beta01. Version 1.4.0-rc01 contains these commits.
Version 1.4.0-beta01
October 27, 2021
androidx.fragment:fragment:1.4.0-beta01 , androidx.fragment:fragment-ktx:1.4.0-beta01 , and androidx.fragment:fragment-testing:1.4.0-beta01 are released. Version 1.4.0-beta01 contains these commits.
বাগ সংশোধন
- Parent fragments will now dispatch
onHiddenChanged()down their entire hierarchy before launching their own callback. ( Iedc20 , b/77504618 ) - The keyboard will now close automatically when going from a fragment with an open keyboard to a fragment with a recycler view. ( I8b842 , b/196852211 )
-
DialogFragmentnow usessetReorderingAllowed(true)for all transactions it creates when you callshow(),showNow(), ordismiss(). ( Ie2c14 ) - The extremely long Lint warning of
DetachAndAttachFragmentInSameFragmentTransactionhas been shortened toDetachAndAttachSameFragment. ( e9eca3 )
Version 1.4.0-alpha10
September 29, 2021
androidx.fragment:fragment:1.4.0-alpha10 , androidx.fragment:fragment-ktx:1.4.0-alpha10 , and androidx.fragment:fragment-testing:1.4.0-alpha10 are released. Version 1.4.0-alpha10 contains these commits.
লিন্ট
- Added the
DetachAndAttachFragmentInSameFragmentTransactionlint warning for detecting calling bothdetach()andattach()on the sameFragmentin the sameFragmentTransaction- as these complementary operations cancel each other out when done in the same transaction, they must be split into separate transactions to actually do anything. ( aosp/1832956 , b/200867930 ) - Added the
FragmentAddMenuProviderlint error for correcting usages of the Fragment Lifecycle to the Fragment view Lifecycle when using theaddMenuProviderAPI ofMenuHost. ( aosp/1830457 , b/200326272 )
Documentation Updates
- The deprecation message for APIs now handled by the Activity Result APIs , namely
startActivityForResult,startIntentSenderForResult,onActivityResult,requestPermissions, andonRequestPermissionsResult, have all been expanded with more details. ( cce80f ) - The deprecation message for
onActivityCreated()for bothFragmentandDialogFragmenthas all been expanded with more details. ( 224db4 )
Version 1.4.0-alpha09
১৫ সেপ্টেম্বর, ২০২১
androidx.fragment:fragment:1.4.0-alpha09 , androidx.fragment:fragment-ktx:1.4.0-alpha09 , and androidx.fragment:fragment-testing:1.4.0-alpha09 are released. Version 1.4.0-alpha09 contains these commits.
নতুন বৈশিষ্ট্য
- You can now call
clearBackStack(name)to clear any state previously saved withsaveBackStack(name). ( I70cd7 )
এপিআই পরিবর্তন
- The
FragmentContainerViewclass has been rewritten in Kotlin ensuring that thegetFragmentfunction will properly respect nullability. ( If694a , b/189629145 ) - FragmentStrictMode is now written in Kotlin ( I11767 , b/199183506 )
বাগ সংশোধন
- Fixed an issue where the state of a Fragment that was added with
setReorderingAllowed(true)and then immediately removed before executing pending transactions would not be properly cleaned up. ( I8ccb8 )
Version 1.4.0-alpha08
১ সেপ্টেম্বর, ২০২১
androidx.fragment:fragment:1.4.0-alpha08 , androidx.fragment:fragment-ktx:1.4.0-alpha08 , and androidx.fragment:fragment-testing:1.4.0-alpha08 are released. Version 1.4.0-alpha08 contains these commits.
বাগ সংশোধন
- Improved the
UseRequireInsteadOfGetLint check to better handle redundant parenthesis. ( I2d865 ) - Improved the
UseGetLayoutInflaterLint check to handle additional edge cases. ( Ie5423 )
Version 1.4.0-alpha07
১৮ আগস্ট, ২০২১
androidx.fragment:fragment:1.4.0-alpha07 , androidx.fragment:fragment-ktx:1.4.0-alpha07 , and androidx.fragment:fragment-testing:1.4.0-alpha07 are released with no notable changes. Version 1.4.0-alpha07 contains these commits.
Version 1.4.0-alpha06
August 4, 2021
androidx.fragment:fragment:1.4.0-alpha06 , androidx.fragment:fragment-ktx:1.4.0-alpha06 , and androidx.fragment:fragment-testing:1.4.0-alpha06 are released. Version 1.4.0-alpha06 contains these commits.
বাগ সংশোধন
- Fixed an issue with multiple back stacks when rapidly swapping between back stacks that would appear as an
IllegalStateExceptionwhile restoring aFragmentTransactionor as a second copy of a fragment appearing. ( I9039f ) - Fixed an issue where
FragmentManagerwould hold onto a copy of state previously saved viasaveBackStack()even after that state was restored. ( Ied212 ) - The
dismissAllowingStateLoss()method ofDialogFragmentno longer crashes when you call it after the state is saved when specifically adding the DialogFragment via theshow(FragmentTransaction, String)method. ( I84422 )
Version 1.4.0-alpha05
২১ জুলাই, ২০২১
androidx.fragment:fragment:1.4.0-alpha05 , androidx.fragment:fragment-ktx:1.4.0-alpha05 , and androidx.fragment:fragment-testing:1.4.0-alpha05 are released. Version 1.4.0-alpha05 contains these commits.
বাগ সংশোধন
- From Fragment
1.3.6: The Fragment's view is now properly set toGONEwhen usinghide()when the root view hastransitionGroup=”true”set. ( aosp/1766655 , b/193603427 ) - From Fragment
1.3.6:FragmentActivitynow always unlocks the saved state as its first operation in lifecycle callbacks it overrides. ( I6db7a )
Dependency update
- From Fragment
1.3.6: Fragments now depends on Activity1.2.4( I3a66c )
Version 1.4.0-alpha04
৩০ জুন, ২০২১
androidx.fragment:fragment:1.4.0-alpha04 , androidx.fragment:fragment-ktx:1.4.0-alpha04 , and androidx.fragment:fragment-testing:1.4.0-alpha04 are released. Version 1.4.0-alpha04 contains these commits.
এপিআই পরিবর্তন
-
FragmentManagernow usesSavedStateRegistryunder the hood to save its state. ThesaveAllState()andrestoreSavedState()methods have also been deprecated inFragmentController. If you are usingFragmentControllerto host fragments outside ofFragmentActivity, you should have yourFragmentHostCallbacksimplementSavedStateRegistryOwner. ( Iba68e , b/188734238 )
বাগ সংশোধন
- Fixed an issue where the call to
saveBackStack()as part of supporting multiple back stacks would fail when done at the same time as running aFragmentTransactionthat usedreplace(). ( I73137 ) - Fixed a
NullPointerExceptionthat would occur after manually restoring a saved back stack that contained multiple transactions when using therestoreBackStack()API for multiple back stack support. This also fixed an issue wheresetReorderingAllowed(true)was not being checked for all transactions. ( I8c593 ) - Fixed an issue where
FragmentManagerwould incorrectly continue to restore previously saved state of fragments even after those fragments were removed from theFragmentManager, thus causing the saved state to continuously grow over time. ( I1fb8e )
Version 1.4.0-alpha03
১৬ জুন, ২০২১
androidx.fragment:fragment:1.4.0-alpha03 , androidx.fragment:fragment-ktx:1.4.0-alpha03 , and androidx.fragment:fragment-testing:1.4.0-alpha03 are released. Version 1.4.0-alpha03 contains these commits.
নতুন বৈশিষ্ট্য
- All Fragment StrictMode
Violationclasses have been updated with more detailed error messages that explain the details of the violation. ( b/187871638 )-
FragmentTagUsageViolationnow contains more detailed error message that container the parent container that the fragment would have been added to. ( Ic33a7 ) -
WrongFragmentContainerViolationnow has more detailed error message that includes the container that the fragment was being added to. ( Ib55f8 ) - The use case classes for
TargetFragmentUsageViolationnow have more detailed error messages to include the fragment causing the violation and any other contained information. ( Icc6ac ) - The classes extending
RetainInstanceUsageViolationnow have more detailed error messages that include the fragment causing the violation. ( I6bd55 ) -
FragmentReuseViolationnow has more detailed error message that includes the previous id of the fragment. ( I28ce2 ) -
SetUserVisibleHintViolationnow has more detailed error message that includes what the user visible hint was being set to. ( Ib2d5f )
-
আচরণগত পরিবর্তন
- Reverted the restriction on calling
fitsSystemWindowson aFragmentContainerView- this no longer crashes your app. ( 6b8ddd , b/190622202 )
বাগ সংশোধন
- From Fragment
1.3.5: Fixed a regression in shared element transitions introduced in Fragment1.3.4by aosp/1679887 . Fragments now correctly handle transition groups (either set directly viatransitionGroup="true"or indirectly via atransitionNameorbackground) and shared elements will no longer throwIndexOutOfBoundsExceptions. ( I16484 , b/188679569 , b/188969304 ) - The
FragmentManagerwill no longer crash when you attempt to hide a removing fragment. ( I573dd , b/183634730 ) - The
OnCreateDialogIncorrectCallbacklint check will no longer crash when evaluating a top level variable. ( 0a9efa , b/189967522 )
Version 1.4.0-alpha02
June 2, 2021
androidx.fragment:fragment:1.4.0-alpha02 , androidx.fragment:fragment-ktx:1.4.0-alpha02 , and androidx.fragment:fragment-testing:1.4.0-alpha02 are released. Version 1.4.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
-
FragmentStrictModewill now always log violations when logging is enabled via theFragmentManager, regardless of the current strict mode policy being used. ( I02df6 , b/187872638 ) FragmentStrictModenow supports exempting particularFragmentclasses from strict modeViolations allowing that class to bypass any penalties. ( Ib4e5d , b/184786736 )The
FragmentStrictModeViolationclass has been expanded to add structure information based on each violation. This allows you to verify exactly what caused the violation along with the violating fragment ( If5118 , b/187871150 ), eachViolationcontains the following:-
WrongFragmentContainerViolationnow contains theViewGroupthat theFragmentwas attempting to be added to. ( I83c75 , b/187871150 ) -
TargetFragmentUsageViolationhas been expanded into,SetTargetFragmentUsageViolation,GetTargetFragmentUsageViolation, andGetTargetFragmentRequestCodeUsageViolation, withSetTargetFragmentUsageViolationcontaining the target fragment and request code. ( I741b4 , b/187871150 ) -
SetUserVisibleHintViolationnow contains the boolean value passed intosetUserVisibleHint(). ( I00585 , b/187871150 ) -
FragmentTagUsageViolationnow contains the ViewGroup that the<fragment>tag was attempting to inflate a fragment into.( I5dbbc , b/187871150 ) -
FragmentReuseViolationnow contains the unique ID of the previous instance of theFragmentthat caused the viotion. ( I0544d , b/187871150 ) -
RetainInstanceUsageViolationis now abstract and has two subclasses,SetRetainInstanceUsageViolationandGetRetainInstanceUsageViolation, representing the two cases for the violation type. ( Ic81e5 , b/187871150 )
-
আচরণগত পরিবর্তন
-
FragmentContainerViewnow throws an exception when attempting to change thefitsSystemWindowattribute programmatically or via XML. Insets should be handled by each individual fragment's view. ( Ie6651 , b/187304502 )
Version 1.4.0-alpha01
১৮ মে, ২০২১
androidx.fragment:fragment:1.4.0-alpha01 , androidx.fragment:fragment-ktx:1.4.0-alpha01 , and androidx.fragment:fragment-testing:1.4.0-alpha01 are released. Version 1.4.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
FragmentContainerViewnow provides agetFragment()method which returns the fragment that was most recently added to the container. This uses the same logic asfindFragmentById()with the ID of theFragmentContainerView, but allows chaining the call. ( Ife17a , b/162527857 )val navController = binding.container.getFragment<NavHostFragment>().navControllerAdded
FragmentTransaction#TRANSIT_FRAGMENT_MATCH_ACTIVITY_{OPEN, CLOSE}to specify whether to enable the standard Activity-transition animation taken from your theme in Fragments transition. ( I46652 )
Multiple back stacks
The FragmentManager maintains a back stack made up of fragment transactions that used addToBackStack() . This allows you to pop those transactions and return to the previous state, using the mechanisms for Saving state with fragments to allow your fragments to restore their state appropriately.
This release expands on these mechanisms by providing two new FragmentManager APIs: saveBackStack(String name) and restoreBackStack(String name) . These APIs use the same name as addToBackStack() to save the state of the FragmentTransaction and the state of every fragment that was added in those transactions and allow you to later restore those transactions and their fragments with their state in tact. This allows you to effectively 'swap' between multiple back stacks by saving the current back stack and restoring a saved back stack.
saveBackStack() operates similarly to popBackStack() in that it is asynchronous and results in all the fragment transactions back to that specific name to be reversed ('popped') and any added fragments to be destroyed and removed, but it differs in a few important ways:
-
saveBackStack()is always inclusive. - Unlike
popBackStack()which will pop all transactions on the back stack if the specified name is not found on the back stack or if a null name is provided,saveBackStack()does nothing if you haven't previously committed a fragment transaction usingaddToBackStack()with that exact, non-null name. - The state of all fragments added from those transactions is saved. This means that the View state of every fragment is stored,
onSaveInstanceState()of every fragment is called and that state is restored, and anyViewModelinstances associated with those fragments are retained (andonCleared()is not called on them).
The fragment transactions that can be used with saveBackStack() must meet certain criteria:
- Every fragment transaction must use
setReorderingAllowed(true)to ensure the transactions can be restored as a single, atomic operation. - The set of transactions saved must be self-contained (ie, they must not explicitly reference any fragments outside of that set of transactions) to ensure that they can be restored at any later time, no matter what changes have been made to the back stack in the intervening time.
- No fragment that is saved can be a retained fragment or have a retained fragment in their transitive set of child fragments to ensure that the
FragmentManagerdoes not return any references to saved fragments after the back stack is saved.
Similar to saveBackStack() , restoreBackStack() does nothing if you have not previously called saveBackStack() with the same name. ( b/80029773 )
Fragment StrictMode
The FragmentStrictMode APIs provide runtime checks that allow you to verify that your app or libraries you depend on are not calling deprecated fragment APIs. When a violation is detected, you can choose to print a log message, trigger your own custom listener, or crash your app. The FragmentStrictMode.Policy that controls what checks are enabled and what “penalties” are triggered can be set on a FragmentManager via the new setStrictModePolicy() method. That policy applies to that FragmentManager and transitively to any child fragment managers that do not set their own unique policy. ( #123 , #131 , #150 , b/143774122 )
-
detectFragmentReuse()detects whether a previously removedFragmentinstance is being re-added to aFragmentManager. You should never interact with or keep a reference to aFragmentinstance after it has been destroyed and removed from aFragmentManager. ( #142 , b/153738653 ) -
detectFragmentTagUsage()detects when you are using the<fragment>tag in your layout XML. You should always useFragmentContainerViewwhen inflating fragments as part of your layout. ( #141 , b/153738235 ) -
detectWrongFragmentContainer()detects when you add a fragment to a container that is not aFragmentContainerView. You should always useFragmentContainerViewas the container for fragments in your layout. ( #146 , b/181137036 ) -
detectRetainInstanceUsage()detects when you use the deprecatedsetRetainInstance()orgetRetainInstance()APIs. ( #140 , b/153737954 ) -
detectSetUserVisibleHint()detects when you use the deprecatedsetUserVisibleHint()API. ( #136 , b/153738974 ) -
detectTargetFragmentUsage()detects when you use the deprecatedsetTargetFragment(),getTargetFragment()orgetTargetRequestCode()APIs. ( #139 , b/153737745 )
এপিআই পরিবর্তন
- The experimental API of
FragmentManager.enableNewStateManager(boolean)has been removed and the new state manager is now the only option available. ( I90036 , b/162776418 ) -
FragmentScenarionow implementsCloseable, allowing you to use it with Kotlin'susemethod or try-with-resources . ( #121 , b/143774122 )
New Lint checks
- The
UseGetLayoutInflaterLint check now warns when usingLayoutInflater.from(Context)within aDialogFragment- you should always use the dialog fragment'sgetLayoutInflater()method to get the appropriate forLayoutInflater. ( #156 , b/170781346 ) - The
DialogFragmentCallbacksDetectorLint check now warns when callingsetOnCancelListenerorsetOnDismissListenerin theonCreateDialog()method of aDialogFragment- these listeners are owned by theDialogFragmentitself and you should overrideonCancel()andonDismiss()to receive these callbacks. ( #171 , b/181780047 , b/187524311 )
বাগ সংশোধন
- From Fragment 1.3.4 : Fixed a regression introduced in Fragment
1.3.3when using theViewTreeViewModelStoreOwner.get()API withViewModelProvideror the Jetpack Compose method ofviewModel()inside a Fragment. These use cases now correctly use theViewModelProvider.Factoryprovided by your Fragment if it overridesgetDefaultViewModelProviderFactory()(as@AndroidEntryPointannotated Fragments do when using Hilt). If you do not override that method, aSavedStateViewModelFactorythat saves and restores its state alongside the Fragment's view is created as the default factory. ( I5cbfa , b/186097368 ) - From Fragment 1.3.4 : When using
FragmentContainerViewon API 29, insets will no longer dispatch indefinitely, fixing issues withBottomNavigationBarandFloatingActionButtoninstances. ( I1bb78 , b/186012452 ) - From Fragment 1.3.4 : You can now retrieve your Parcelable from the fragment result bundle after process death. ( I65932 , b/187443158 )
- From Fragment 1.3.4 : When doing a shared element transition on a ViewGroup, if the ViewGroup has
transitionGroupset to false, it will now properly transition. ( I99675 )
External Contribution
- Thanks simonschiller for making
FragmentScenarioimplementCloseable. ( #121 , b/143774122 ) - Thanks simonschiller for adding the entirety of the
FragmentStrictModeAPI for this release! ( #123 , #131 , #150 , b/143774122 , #142 , b/153738653 , #141 , b/153738235 , #146 , b/181137036 , #140 , b/153737954 , #136 , b/153738974 , #139 , b/153737745 ) - Thanks tatocaster for adding the
UseGetLayoutInflaterLint check. ( #156 , b/170781346 ) - Thanks tatocaster for adding the
DialogFragmentCallbacksDetectorLint check. ( #171 , b/181780047 )
Version 1.3
Version 1.3.6
২১ জুলাই, ২০২১
androidx.fragment:fragment:1.3.6 , androidx.fragment:fragment-ktx:1.3.6 , and androidx.fragment:fragment-testing:1.3.6 are released. Version 1.3.6 contains these commits.
বাগ সংশোধন
- From Fragment
1.4.0-alpha03: TheFragmentManagerwill no longer crash when you attempt to hide a removing fragment. ( I573dd , b/183634730 ) - The Fragment's view is now properly set to
GONEwhen usinghide()when the root view hastransitionGroup=”true”set. ( aosp/1766655 , b/193603427 ) -
FragmentActivitynow always unlocks the saved state as its first operation in lifecycle callbacks it overrides. ( I6db7a )
Dependency update
- From Fragment
1.3.6: Fragments now depends on Activity1.2.4( I3a66c )
Version 1.3.5
১৬ জুন, ২০২১
androidx.fragment:fragment:1.3.5 , androidx.fragment:fragment-ktx:1.3.5 , and androidx.fragment:fragment-testing:1.3.5 are released. Version 1.3.5 contains these commits.
বাগ সংশোধন
- Fixed a regression in shared element transitions introduced in Fragment
1.3.4by aosp/1679887 . Fragments now correctly handle transition groups (either set directly viatransitionGroup="true"or indirectly via atransitionNameorbackground) and shared elements will no longer throwIndexOutOfBoundsExceptions. ( I16484 , b/188679569 , b/188969304 )
Version 1.3.4
১৮ মে, ২০২১
androidx.fragment:fragment:1.3.4 , androidx.fragment:fragment-ktx:1.3.4 , and androidx.fragment:fragment-testing:1.3.4 are released. Version 1.3.4 contains these commits.
বাগ সংশোধন
- Fixed a regression introduced in Fragment
1.3.3when using theViewTreeViewModelStoreOwner.get()API withViewModelProvideror the Jetpack Compose method ofviewModel()inside a Fragment when using Hilt. These use cases now correctly use theViewModelProvider.Factoryprovided by your Fragment if it overridesgetDefaultViewModelProviderFactory()(as@AndroidEntryPointannotated Fragments do). If you do not override that method, aSavedStateViewModelFactorythat saves and restores its state alongside the Fragment's view is created as the default factory. ( I5cbfa , b/186097368 ) - When using
FragmentContainerViewon API 29, insets will no longer dispatch indefinitely, fixing issues withBottomNavigationBarandFloatingActionButtoninstances. ( I1bb78 , b/186012452 ) - You can now retrieve your Parcelable from the fragment result bundle after process death. ( I65932 , b/187443158 )
- When doing a shared element transition on a ViewGroup, if the ViewGroup has
transitionGroupset to false, it will now properly transition. ( I99675 )
Version 1.3.3
April 21, 2021
androidx.fragment:fragment:1.3.3 , androidx.fragment:fragment-ktx:1.3.3 , and androidx.fragment:fragment-testing:1.3.3 are released. Version 1.3.3 contains these commits.
নতুন বৈশিষ্ট্য
- Using
SavedStateViewModelFactorynow works when used with theSavedStateRegistryOwnerreturned by usingViewTreeSavedStateRegistryOwner.get()with the Fragment's View. ( I21acf , b/181577191 )
বাগ সংশোধন
- Fixed a regression introduced in Fragment
1.3.2which would causepopEnteranimations to not run when popping aFragmentTransactionthat included asetPrimaryNavFragmentoperation, such as those used byNavHostFragment. ( I38c87 , b/183877426 ) -
FragmentContainerViewnow ensures that everyFragmentis dispatched a new set ofWindowInsets, ensuring that each fragment can now independently consume the insets. ( I63f68 , b/172153900 ) -
DialogFragmentnow properly handles cases where a child fragment is added to a container that has the same ID as a container in your customDialogclass, fixing view hierarchy issues when reusing IDs that are used internally by dialogs such asBottomSheetDialog. ( Ie6279 , b/180021387 ) -
FragmentManager.dump()now properly indents the first fragment in the list of active fragments. ( If5c33 , b/183705451 )
New State Manager Bug Fixes
- The new fragment state manager now properly handles exit transitions with hide operations. ( I9e4de , b/184830265 )
Version 1.3.2
২৪ মার্চ, ২০২১
androidx.fragment:fragment:1.3.2 , androidx.fragment:fragment-ktx:1.3.2 , and androidx.fragment:fragment-testing:1.3.2 are released. Version 1.3.2 contains these commits.
New State Manager Bug Fixes
- When running both
popBackStack()andcommit()operations together, the last operation will now set the direction for all animations rather than running some pop animations and some enter animations. ( I7072e , b/181142246 ) - Views within in a shared element hierarchy will no longer have their transition name cleared when doing a shared element transition. ( I4d4a6 , b/179934757 )
নির্ভরতা আপডেট
- Fragment now depends on Activity 1.2.2 , fixing an issue with Activity's
InvalidFragmentVersionForActivityResultlint check when using Fragment 1.3.1 or higher. - Fragment now depends on Lifecycle 2.3.1 .
Version 1.3.1
March 10, 2021
androidx.fragment:fragment:1.3.1 , androidx.fragment:fragment-ktx:1.3.1 , and androidx.fragment:fragment-testing:1.3.1 are released. Version 1.3.1 contains these commits.
নতুন বৈশিষ্ট্য
- Dialogs within a
DialogFragmentcan now get access to ViewTree owners through their DecorView, ensuring thatDialogFragmentcan be used withComposeView. ( Ib9290 , b/180691023 )
বাগ সংশোধন
- Fragments inflated into an already
RESUMEDactivity using FragmentContainerView are now properly shown after a configuration change. ( Ie14c8 , b/180538371 ) - There is no longer an extra
}at the end of the fragmenttoString()( I54705 , b/177761088 ) - Overridden methods in FragmentActivity now properly inherit the base method javaDoc ( I736ce , b/139548782 )
- The docs for
setFragmentResultandsetFragmentResultListenerhave updated their parameters docs to reflect that they no longer accept nullables ( I990ba , b/178348386 )
New State Manager Bug Fixes
- Fixed a memory leak in fragments caused by
mFocusedView( Ib4e9e , b/179925887 ) - Fragments now properly call
onCreateOptionsMenuwhen using show/hide transactions ( I8bce8 , b/180255554 ) - Child fragments with transitions that start prior to the fragment being laid out will now properly reach
RESUMED( Ic11e6 , b/180825150 ) - Fragments inflated using the
<fragment>tag will now always make it toRESUMED( I452ac , ( I9fa49 )
নির্ভরতা আপডেট
- Fragment 1.3.1 depends on Activity
1.2.1. ( I557b9 )
Version 1.3.0
February 10, 2021
androidx.fragment:fragment:1.3.0 , androidx.fragment:fragment-ktx:1.3.0 , and androidx.fragment:fragment-testing:1.3.0 are released. Version 1.3.0 contains these commits.
Major changes since 1.2.0
- New State Manager : A significant rewrite of the internals of
FragmentManagerhas fixed numerous issues around the dispatch of lifecycle events, animations and transitions, and how postponed fragments are handled. Activity Result API Integration : Added support for the
ActivityResultRegistryAPI introduced in Activity1.2.0to handlestartActivityForResult()+onActivityResult()as well asrequestPermissions()+onRequestPermissionsResult()flows without overriding methods in your Fragment in addition to providing hooks for testing these flows. See the updated Getting a Result from an Activity .- This release fixes a number of issues around invalid request codes and the dispatch of permission requests that prevent the Activity Result API from working on previous versions of
FragmentActivity. You must upgrade to Fragment 1.3.0 to use the Activity Result APIs in aFragmentActivityorAppCompatActivity.
- This release fixes a number of issues around invalid request codes and the dispatch of permission requests that prevent the Activity Result API from working on previous versions of
Fragment Result API : Added support for passing results between two Fragments via new APIs on
FragmentManager. This works for hierarchy fragments (parent/child), DialogFragments, and fragments in Navigation and ensures that results are only sent to your Fragment while it is at leastSTARTED. The target fragment APIs have been deprecated in favor of these new APIs. See Get Results using the Fragment Result API .FragmentOnAttachListener: TheonAttachFragment()callback onFragmentActivityandFragmenthave been deprecated. A newFragmentOnAttachListenerhas been added to provide a more flexible alternative, allowing delegation ofonAttachFragment()to separate, testable listeners and support for adding a listener to FragmentManagers other than your direct child FragmentManager.FragmentScenarioImprovements : TheFragmentScenarioclass from thefragment-testingartifact has been rewritten in Kotlin and has received a number of improvements:-
FragmentScenarionow usessetMaxLifecycle()to implementmoveToState(), ensuring consistent behavior on all API levels and decoupling the Fragment's state from the underlying Activity. -
FragmentScenarionow supports setting an initialLifecycle.Stateto support asserting the fragment's state before moving to eachLifecycle.Statefor the first time. - There is now an alternative to the
FragmentScenarioAPI ofonFragmentin the form of the Kotlin reified extension methodwithFragmentthat allows you to return a value. Notably, it rethrows exceptions raised in the given block.
-
ViewTreeSupport :Fragmentnow supports theViewTreeLifecycleOwner.get(View),ViewTreeViewModelStoreOwner.get(View), andViewTreeSavedStateRegistryOwnerAPIs added in Lifecycle2.3.0and SavedState1.1.0such that it will return the Fragment as theViewModelStoreOwner, and aSavedStateRegistryOwnerandLifecycleOwnertied to the fragment's view Lifecycle when using aViewwithin aFragment.TRANSIT_animation changes : The fragment default effects,TRANSIT_FRAGMENT_OPEN,TRANSIT_FRAGMENT_CLOSE, andTRANSIT_FRAGMENT_FADE, now useAnimatorinstead ofAnimation. The resources used to build these animators are now private.setRetainInstance()deprecation : ThesetRetainInstance()method on Fragments has been deprecated. With the introduction of ViewModels , developers have a specific API for retaining state that can be associated with Activities, Fragments, and Navigation graphs. This allows developers to use a normal, not retained Fragment and keep the specific state they want retained separate, avoiding a common source of leaks while maintaining the useful properties of a single creation and destruction of the retained state (namely, the constructor of theViewModeland theonCleared()callback it receives).ViewPager 1 adapter deprecation : With the release of ViewPager2
1.0.0, theFragmentPagerAdapterandFragmentStatePagerAdapterclasses for interacting withViewPagerhave been deprecated. See Migrate from ViewPager to ViewPager2 .
Version 1.3.0-rc02
January 27, 2021
androidx.fragment:fragment:1.3.0-rc02 , androidx.fragment:fragment-ktx:1.3.0-rc02 , and androidx.fragment:fragment-testing:1.3.0-rc02 are released. Version 1.3.0-rc02 contains these commits.
বাগ সংশোধন
- Fixed an issue where a parent
DialogFragmentwould appear above a childDialogFragmentafter a configuration change; child dialog fragments now always appear above a parent dialog fragment. ( I30806 , b/177439520 ) - Fixed issue where doing a
hideoperation with anAnimationwould cause the hiding fragment to flash at the end of the animation. ( I57e22 , b/175417675 ) - Fragments with transitions added before the view hierarchy is attached now properly reach
RESUMED. ( I1fc1d , b/177154873 )
New State Manager Bug Fixes
- The Fragment's view
Lifecyclenow properly handles cases where the Fragment's view is destroyed before theLifecyclereachesCREATED, avoiding exceptions stating “no event down from INITIALIZED”. ( eda2bd , b/176138645 ) - Fragments that use an
Animatornow appear in the proper order when usingFragmentContainerView. ( Id9aa3 , b/176089197 )
Version 1.3.0-rc01
December 16, 2020
androidx.fragment:fragment:1.3.0-rc01 , androidx.fragment:fragment-ktx:1.3.0-rc01 , and androidx.fragment:fragment-testing:1.3.0-rc01 are released. Version 1.3.0-rc01 contains these commits.
বাগ সংশোধন
-
onPrepareOptionsMenu()now follows the same logic asonCreateOptionsMenu()and is no longer called when a parent fragment callssetMenuVisibility(false). ( Id7de8 , b/173203654 )
New State Manager Bug Fixes
- Fixed leak and visual artifact when adding a fragment with an
Animationto aFragmentContainerViewand then interrupting that addition with a pop operation. ( I952d8 ) - Fixed an issue where the fragment's view would remain in the view hierarchy if it was replaced during its
onCreate()oronViewCreated()methods. ( I8a7d5 ) - Focus is now properly restored to Fragment root views when they are resumed. ( Ifc84b )
- Combining pop and replace operations in the same fragment transaction will now show the proper animations ( Ifd4e4 , b/170328691 )
Version 1.3.0-beta02
December 2, 2020
androidx.fragment:fragment:1.3.0-beta02 , androidx.fragment:fragment-ktx:1.3.0-beta02 , and androidx.fragment:fragment-testing:1.3.0-beta02 are released. Version 1.3.0-beta02 contains these commits.
নতুন বৈশিষ্ট্য
-
FragmentScenariohas been fully converted to Kotlin while maintaining source and binary compatibility via usage of Kotlin 1.4's functional interfaces forFragmentAction. ( I19d31 )
আচরণগত পরিবর্তন
- FragmentContainerViews that do not inflate a fragment using the
classorandroid:nameattribute can now be used outside of aFragmentActivity. ( Id4397 , b/172266337 ) - Attempting to set the max lifecycle of a fragment to
DESTROYEDwill now throw anIllegalArgumentException( Ie7651 , b/170765622 ) - Initializing a FragmentScenario with a
DESTROYEDstate will now throw anIllegalArgumentException( I73590 , b/170765622 )
New State Manager Bug Fixes
- Fixed an issue where the view would not reach its final state if you interrupt a fragment transition that was using an
Animatoror one of theTRANSIT_FRAGMENT_options. ( I92426 , b/169874632 ) - Fixed an issue that prevented fragments with an exiting
Animationfrom being properly destroyed. ( I83d65 ) - Exiting fragments that have their effects reversed now correctly cancel and restart with the proper entering effect. ( I62226 , b/167092035 )
- Fixed an issue where the exit
Animatorof ahide()would not run. ( Id7ffe ) - Fragments now properly appear when postponed and then immediately started. ( Ie713b , b/170022857 )
- Fragments that remove their focused view during an animation will no longer attempt to restore the focus on the detached view once they reach
RESUMED( I38c65 , b/172925703 )
External Contribution
-
FragmentFactorynow caches fragment classes separately for differentClassLoaderinstances. Thanks Simon Schiller! ( #87 , b/113886460 )
Version 1.3.0-beta01
October 1, 2020
androidx.fragment:fragment:1.3.0-beta01 , androidx.fragment:fragment-ktx:1.3.0-beta01 , and androidx.fragment:fragment-testing:1.3.0-beta01 are released. Version 1.3.0-beta01 contains these commits.
নতুন বৈশিষ্ট্য
-
setMaxLifecycle()now supports setting theLifecyclestate toINITIALIZINGas long as the fragment has not been moved toCREATED. ( b/159662173 )
এপিআই পরিবর্তন
- Upgrade androidx to use Kotlin 1.4 ( Id6471 , b/165307851 , b/165300826 )
আচরণগত পরিবর্তন
- Fragment resource files have been correctly made private. ( aosp/1425237 )
বাগ সংশোধন
- Fragments inflated using the
<fragment>tag will now properly wait until their views are added to a container before moving to STARTED ( I02f4c ) - Fragments that are visible and then
setMaxLifecycle()toCREATEDnow properly run their exit effects. ( b/165822335 ) - Removing a detached fragment that is not added to the back stack no longer causes a memory leak. Courtesy of Nicklas Ansman Giertz! ( b/166489383 )
- Active fragments will now always have a non-null
FragmentManagerand fragments with a non-nullFragmentManagerwill always be considered active. ( aosp/1422346 ) - The fragment default effects,
TRANSIT_FRAGMENT_OPEN,TRANSIT_FRAGMENT_CLOSE, andTRANSIT_FRAGMENT_FADE, now useAnimatorinstead ofAnimation. ( b/166155034 )
New State Manager Bug Fixes
- Fragments now properly restore their view focus state from right before they start their animation. ( Icc256 )
- Fragments that only have a shared element transition now properly complete their special effects meaning they actually move to their final state ( Iaebc7 , b/166658128 )
- Fragment views are now always removed from the container before being destroyed. ( Id5876 )
- The new state manager now consistently removes the exiting fragment view before adding the entering one. ( I41a6e )
- Explicit changes to a fragment view's visibility are now respected by the new state manager. This means that if you set an entering fragment's view to
INVISIBLEbefore the animation begins, it will actually stay invisible. ( b/164481490 ) - Fragments now prioritize
AnimatorsoverAnimations, meaning a fragment with both will only run theAnimatorand ignore theAnimation. ( b/167579557 ) - The new state manager no longer causes fragments to flash when using entering animations. ( b/163084315 )
Known Issue
When using the new state manager, if you press back during an entering special effect instead of returning to the previous fragment, the old fragment is never re-added, resulting in a blank screen. ( b/167259187 , b/167092035 , b/168442830 )
Version 1.3.0-alpha08
August 19, 2020
androidx.fragment:fragment:1.3.0-alpha08 , androidx.fragment:fragment-ktx:1.3.0-alpha08 , and androidx.fragment:fragment-testing:1.3.0-alpha08 are released. Version 1.3.0-alpha08 contains these commits.
New State Manager
This release includes a major refactoring of the internal state management of FragmentManager which affects the dispatch of lifecycle methods, animations and transitions, and how postponed transactions are handled. This is enabled by default. See the Fragments: Rebuilding the Internals blog post for more details. ( b/139536619 , b/147749580 )
- An experimental API in
FragmentManager.enableNewStateManager(boolean)can be used to control whether FragmentManager uses the new state manager. ( I7b6ee )
The following issues are fixed only when using the new state manager:
- The previous fragment of a
replaceoperation is now correctly stopped before the new fragment is started. ( b/161654580 ) - Fragments now prevent multiple competing animations on the same fragments, avoiding cases where an
Animationwould override allTransitioneffects or anAnimatorand aTransitionon an individual fragment would both run. ( b/149569323 ) - The
enterTransitionandexitTranstionof all fragments entering and exiting are now ran rather than only the last entering fragment and the first exiting fragment. ( b/149344150 ) - Postponed fragments no longer get stuck at the
CREATEDstate but instead move toSTARTEDwith other fragments. ( b/129035555 ) - Fixed an issue where
FragmentManagerwould execute operations out of order when mixing a postponed re-ordered transaction and a non-reordered transaction. ( b/147297731 ) - Popping multiple fragments simultaneously will no longer result in intermediate fragments being temporarily visible when postponing fragments. ( b/37140383 )
-
FragmentManagernow returns the correct fragments when callingfindFragmentById()orfindFragmentByTag()from within theonAttachFragment()callback. ( b/153082833 ) - Fragments no longer call
onCreateView()on fragments being destroyed when the fragment replacing them is postponed. ( b/143915710 ) - The error message when attempting to combine framework
Transitionand AndroidXTransitioninstances now mentions the fragment with the invalid transition. ( b/155574969 )
আচরণগত পরিবর্তন
- You can now call
launch()on anActivityResultLauncherin theonCreate()lifecycle method of a fragment. ( b/161464278 ) - Calling
registerForActivityResult()afteronCreate()now throws an exception indicating that this is not allowed rather than silently failing to deliver results after a configuration change. ( b/162255449 ) -
FragmentActivitynow uses theOnContextAvailableListenerAPI introduced in Activity1.2.0-alpha08to restore the state of theFragmentManager. Any listeners added to subclasses ofFragmentActivitywill run after this listener. ( I513da )
বাগ সংশোধন
-
ActivityOptionspassed through when usingstartIntentSenderForResult()are now respected. ( b/162247961 )
Known Issue
- When using the new state manager, directly setting the visibility of the fragment's root view after
onViewCreated()and beforeonResume()results in the visibility you set being overridden byFragmentManager, who controls the visibility of the root view. As a workaround, you should always use thehide()andshow()operations to change the visibility of your fragment. ( b/164481490 )
Version 1.3.0-alpha07
July 22, 2020
androidx.fragment:fragment:1.3.0-alpha07 , androidx.fragment:fragment-ktx:1.3.0-alpha07 , and androidx.fragment:fragment-testing:1.3.0-alpha07 are released. Version 1.3.0-alpha07 contains these commits.
নতুন বৈশিষ্ট্য
-
FragmentScenarionow supports setting an initial Lifecycle state ofCREATED,STARTED, orRESUMEDrather than always moving the Fragment to theRESUMEDstate. ( b/159662750 ) - Added an alternative to the
FragmentScenarioAPI ofonFragmentin the form of the Kotlin reified extension methodwithFragmentthat allows you to return a value. Notably, it rethrows exceptions raised in the given block. ( b/158697631 )
আচরণগত পরিবর্তন
-
FragmentScenarionow usessetMaxLifecycle()to implementmoveToState(), ensuring consistent behavior on all API levels and decoupling the Fragment's state from the underlying Activity. ( b/156527405 ) - The
SavedStateRegistryOwnerreturned byViewTreeSavedStateRegistryOwneris now tied to the fragment view's Lifecycle. This ensures that it has its state saved and restore at the same time as the fragment's view. ( b/158503763 )
বাগ সংশোধন
- Fragments now wait for the fragment's view to be attached before calling
ViewCompat.requestApplyInsets(), avoiding cases where the inset request was being dropped. ( b/158095749 ) - Calling
clearFragmentResultListenernow properly clears the lifecycle observer. ( b/159274993 )
Version 1.3.0-alpha06
১০ জুন, ২০২০
androidx.fragment:fragment:1.3.0-alpha06 , androidx.fragment:fragment-ktx:1.3.0-alpha06 , and androidx.fragment:fragment-testing:1.3.0-alpha06 are released. Version 1.3.0-alpha06 contains these commits.
নতুন বৈশিষ্ট্য
- The
onAttachFragment()callback onFragmentActivityandFragmenthave been deprecated. A newFragmentOnAttachListenerhas been added to provide a more flexible alternative, allowing delegation ofonAttachFragment()to separate, testable listeners and support for adding a listener to FragmentManagers other than your direct child FragmentManager. ( I06d3d )
বাগ সংশোধন
- Parent fragments now have their view state restored before their child fragments, fixing a visual ordering issue after a configuration change when a
DialogFragmentwould show anotherDialogFragmentas a child fragment. ( b/157195715 ) - Fixed an issue where the
UseRequireInsteadOfGetLint check would not handle chained usages of the?.and!!operators correctly. ( b/157677616 )
Version 1.3.0-alpha05
২০ মে, ২০২০
androidx.fragment:fragment:1.3.0-alpha05 , androidx.fragment:fragment-ktx:1.3.0-alpha05 , and androidx.fragment:fragment-testing:1.3.0-alpha05 are released. Version 1.3.0-alpha05 contains these commits.
নতুন বৈশিষ্ট্য
- Added support for
ViewTreeViewModelStoreOwnerfrom Lifecycle2.3.0-alpha03, andViewTreeSavedStateRegistryOwnerfrom SavedState1.1.0-alpha01when using aViewwithin aFragment. ( aosp/1297993 , aosp/1300264 )
এপিআই পরিবর্তন
- The
setFragmentResult()andsetFragmentResultListener()APIs now take a non-nullBundleandFragmentResultListener, respectively. To explicitly clear a previously set result or listener, use the newclearFragmentResult()andclearFragmentResultListener()methods. ( b/155416778 ) - The
setFragmentResultListener()Kotlin extensions that take a lambda are now marked asinline. ( b/155323404 )
আচরণগত পরিবর্তন
- The previously deprecated
startActivityForResult(),startIntentSenderForResult(), andrequestPermissionsonFragmentnow internally useActivityResultRegistry, thus removing the restriction on using only the lower bits (below0xFFFF) for your request codes when using those APIs. ( b/155518741 )
Documentation Updates
- Expanded the documentation on the
Fragment(@LayoutRes int)andDialogFragment(@LayoutRes int)constructors to clarify that they should be called from your subclasses' no argument constructor when using the defaultFragmentFactory. ( b/153042497 )
Version 1.3.0-alpha04
April 29, 2020
androidx.fragment:fragment:1.3.0-alpha04 , androidx.fragment:fragment-ktx:1.3.0-alpha04 , and androidx.fragment:fragment-testing:1.3.0-alpha04 are released. Version 1.3.0-alpha04 contains these commits.
নতুন বৈশিষ্ট্য
- Added support for passing results between two Fragments via new APIs on
FragmentManager. This works for hierarchy fragments (parent/child), DialogFragments, and fragments in Navigation and ensures that results are only sent to your Fragment while it is at leastSTARTED. ( b/149787344 )
এপিআই পরিবর্তন
- The target fragment APIs have been deprecated. To pass data between fragments the new Fragment Result APIs should be used instead. ( b/149787344 )
- The
startActivityForResult()/onActivityResult()andrequestPermissions()/onRequestPermissionsResult()APIs on Fragment have been deprecated. Please use the Activity Result APIs . ( aosp/1290887 ) - Breaking change from Activity
1.2.0-alpha04: theprepareCall()method has been renamed toregisterForActivityResult(). ( aosp/1278717 )
বাগ সংশোধন
- The fragment's
getViewLifecycleOwner()is now stopped beforeonSaveInstanceState()is called, mirroring the behavior of the fragment's lifecycle. ( b/154645875 ) - Calling
setMenuVisibility(false)on a fragment now correctly changes the visibility of menus provided by its child fragments. ( b/153593580 ) - Fixed an
illegalStateExceptionwhen adding a fragment to aDialogFragment's view hierarchy withFragmentContainerView. ( b/154366601 ) - The
getDefaultViewModelProviderFactory()method on fragments no longer crashes when hosting your fragments outside of an activity. ( b/153762914 )
Version 1.3.0-alpha03
১ এপ্রিল, ২০২০
androidx.fragment:fragment:1.3.0-alpha03 , androidx.fragment:fragment-ktx:1.3.0-alpha03 , and androidx.fragment:fragment-testing:1.3.0-alpha03 are released. Version 1.3.0-alpha03 contains these commits.
এপিআই পরিবর্তন
- The
prepareCallmethods onFragmentare nowfinal. ( b/152439361 )
বাগ সংশোধন
- Fixed a regression introduced in Fragment
1.3.0-alpha02when usingBottomSheetDialogFragment. ( b/151652127 , aosp/1263328 , aosp/1265163 ) - Fixed a crash when using
prepareCallfrom a fragment after a configuration change. ( b/152137004 ) - Fixed an issue where shared element and exit transitions are ignored when using
setTargetFragment(). ( b/152023196 ) - From Fragment
1.2.4: Updated the Fragment ProGuard rules to allow obfuscation of kept fragments. ( b/151605338 ) - From Fragment
1.2.4: Disabled theFragmentLiveDataObserveLint rule onDialogFragmentclasses as their lifecycle and view lifecycle are always in sync, making it safe to use eitherthisorviewLifecycleOwnerwhen callingobserve. ( b/151765086 )
Dependency Changes
- Fragments depend on Activity
1.2.0-alpha03, which had significant improvements to the Activity Result API introduced in Activity1.2.0-alpha02.
Version 1.3.0-alpha02
১৮ মার্চ, ২০২০
androidx.fragment:fragment:1.3.0-alpha02 , androidx.fragment:fragment-ktx:1.3.0-alpha02 , and androidx.fragment:fragment-testing:1.3.0-alpha02 are released. Version 1.3.0-alpha02 contains these commits.
নতুন বৈশিষ্ট্য
- Added support for the
ActivityResultRegistryAPI introduced in Activity1.2.0-alpha02to handle thestartActivityForResult()+onActivityResult()as well asrequestPermissions()+onRequestPermissionsResult()flows without overriding methods in your Fragment in addition to providing hooks for testing these flows. See the updated Getting a Result from an Activity . ( b/125158199 )
এপিআই পরিবর্তন
-
DialogFragmentnow provides a constructor that takes a@LayoutResthat indicates the layout thatonCreateView()should inflate by default. ( b/150327080 ) - The
onActivityCreated()method is now deprecated. Code touching the fragment's view should be done inonViewCreated()(which is called immediately beforeonActivityCreated()) and other initialization code should be inonCreate(). To receive a callback specifically when the activity'sonCreate()is complete, aLifeCycleObservershould be registered on the activity'sLifecycleinonAttach(), and removed once theonCreate()callback is received. ( b/144309266 )
বাগ সংশোধন
- From Fragment
1.2.3: Fixed a bug inDialogFragmentthat caused aStackOverflowErrorwhen callinggetLayoutInflater()from withinonCreateDialog(). ( b/117894767 , aosp/1258664 ) - From Fragment
1.2.3: Reduced the scope of Fragment's included ProGuard rules to ensure that unused Fragment classes can be stripped. ( b/149665169 ) - From Fragment
1.2.3: Fixed false positives in theUseRequireInsteadOfGetLint check when using a local variable name that shadowed the Kotlin property name. ( b/149891163 ) - From Fragment
1.2.3:FragmentContainerViewno longer throws anUnsupportedOperationExceptionfor using the incorrect constructor in layout preview. ( b/149707833 )
পরিচিত সমস্যা
-
BottomSheetDialogFragmentno longer properly positions its dialog on the screen. ( b/151652127 )
Version 1.3.0-alpha01
March 4, 2020
androidx.fragment:fragment:1.3.0-alpha01 , androidx.fragment:fragment-ktx:1.3.0-alpha01 , and androidx.fragment:fragment-testing:1.3.0-alpha01 are released. Version 1.3.0-alpha01 contains these commits.
নতুন বৈশিষ্ট্য
- Added support for the
ViewTreeLifecycleOwner.get(View)API added in Lifecycle2.3.0-alpha01such that it will return the Fragment'sviewLifecycleOwneras theLifecycleOwnerfor any Views returned byonCreateView(). ( aosp/1182955 )
এপিআই পরিবর্তন
- The
setRetainInstance()method on Fragments has been deprecated. With the introduction of ViewModels , developers have a specific API for retaining state that can be associated with Activities, Fragments, and Navigation graphs. This allows developers to use a normal, not retained Fragment and keep the specific state they want retained separate, avoiding a common source of leaks while maintaining the useful properties of a single creation and destruction of the retained state (namely, the constructor of theViewModeland theonCleared()callback it receives). ( b/143911815 ) - With the release of ViewPager2
1.0.0, theFragmentPagerAdapterandFragmentStatePagerAdapterclasses for interacting withViewPagerhave been deprecated. See Migrate from ViewPager to ViewPager2 . ( b/145132715 )
বাগ সংশোধন
- Fragment ProGuard rules now correctly only keep the default constructors
Fragmentclasses that are used rather than for allFragmentinstances, fixing a regression introduced in Fragment1.2.1. ( b/149665169 - The
require___()Lint rules added in Fragment1.2.2no longer false positive on local variables that share the same name as the shadowed Kotlin property names (ie,view). ( b/149891163 ) -
FragmentContainerViewno longer throws anUnsupportedOperationExceptionwhen using the layout preview in Android Studio. ( b/149707833 ) - Fixed an issue where retained fragments that were added after the state is saved would not be continually recreated and then destroyed after each configuration change. ( b/145832397 )
Version 1.2.5
Version 1.2.5
১০ জুন, ২০২০
androidx.fragment:fragment:1.2.5 , androidx.fragment:fragment-ktx:1.2.5 , and androidx.fragment:fragment-testing:1.2.5 are released. Version 1.2.5 contains these commits.
বাগ সংশোধন
- The fragment's
getViewLifecycleOwner()is now stopped beforeonSaveInstanceState()is called, mirroring the behavior of the fragment's lifecycle. This was previously released in Fragment1.3.0-alpha04. ( b/154645875 ) - Calling
setMenuVisibility(false)on a fragment now correctly changes the visibility of menus provided by its child fragments. This was previously released in Fragment1.3.0-alpha04. ( b/153593580 )
Version 1.2.4
Version 1.2.4
১ এপ্রিল, ২০২০
androidx.fragment:fragment:1.2.4 , androidx.fragment:fragment-ktx:1.2.4 , and androidx.fragment:fragment-testing:1.2.4 are released. Version 1.2.4 contains these commits.
বাগ সংশোধন
- Updated the Fragment ProGuard rules to allow obfuscation of kept fragments. ( b/151605338 )
- Disabled the
FragmentLiveDataObserveLint rule onDialogFragmentclasses as their lifecycle and view lifecycle are always in sync, making it safe to use eitherthisorviewLifecycleOwnerwhen callingobserve. ( b/151765086 )
Version 1.2.3
Version 1.2.3
১৮ মার্চ, ২০২০
androidx.fragment:fragment:1.2.3 , androidx.fragment:fragment-ktx:1.2.3 , and androidx.fragment:fragment-testing:1.2.3 are released. Version 1.2.3 contains these commits.
বাগ সংশোধন
- Fixed a bug in
DialogFragmentthat caused aStackOverflowErrorwhen callinggetLayoutInflater()from withinonCreateDialog(). ( b/117894767 , aosp/1258665 ) - Reduced the scope of Fragment's included ProGuard rules to ensure that unused Fragment classes can be stripped. ( b/149665169 )
- Fixed false positives in the
UseRequireInsteadOfGetLint check when using a local variable name that shadowed the Kotlin property name. ( b/149891163 ) -
FragmentContainerViewno longer throws anUnsupportedOperationExceptionfor using the incorrect constructor in layout preview. ( b/149707833 )
Version 1.2.2
Version 1.2.2
February 19, 2020
androidx.fragment:fragment:1.2.2 , androidx.fragment:fragment-ktx:1.2.2 , and androidx.fragment:fragment-testing:1.2.2 are released. Version 1.2.2 contains these commits.
New Lint checks
- Lint suggests using the
viewLifecycleOwneras theLifecycleOwnerto calls intoOnBackPressedDispatcherinonCreateView(),onViewCreated(), andonActivityCreated(). ( b/142117657 ) - Added a new Lint check that confirms that you are using the correct
debugImplementationwhen using thefragment-testingartifact. ( b/141500106 ) - Fragments now suggest using the associated
require___()methods for more descriptive error messages instead ofcheckNotNull(get___()),requireNonNull(get___()), orget___()!!for all of the Fragment APIs that include both agetandrequireequivalent. ( aosp/1202883 )
বাগ সংশোধন
- Fixed the Fragment ProGuard files to avoid R8 warnings ( b/148963981 )
- Improved the existing Lint check suggesting using
viewLifecycleOwnerwhen usingobserveto also handle thelivedata-ktxextension method version ofobserve. ( b/148996309 ) - Fixed the formatting for many of the Lint checks ( aosp/1157012 )
External contributions
- Thanks to Zac Sweers for contributing the
require___()Lint checks on behalf of Slack! ( aosp/1202883 )
Version 1.2.1
Version 1.2.1
৫ ফেব্রুয়ারি, ২০২০
androidx.fragment:fragment:1.2.1 , androidx.fragment:fragment-ktx:1.2.1 , and androidx.fragment:fragment-testing:1.2.1 are released. Version 1.2.1 contains these commits .
বাগ সংশোধন
- Fragments added via the
addandreplacemethods that take aClassinstance (or the Kotlin reified versions) now have their default constructor kept by ProGuard. ( b/148181315 ) -
FragmentStatePagerAdapterandFragmentPagerAdapterno longer catch exceptions thrown byFragmentManagerwhen runningfinishUpdate(). ( aosp/1208711 ) - Fixed an issue where
FragmentManager.findFragment()did not work with fragments added via the<fragment>tag. ( b/147784323 ) - Fragments inflated using the
<fragment>tag now always receive a call toonInflate()beforeonCreate()when in the layout. ( aosp/1215856 ) - Calling
toString()on aFragmentManagerinstance no longer throws aNullPointerExceptionwhen the Activity is already destroyed. ( b/148189412 )
নির্ভরশীলতার পরিবর্তন
- Fragments
1.2.1now depends on Lifecycle ViewModel SavedState2.2.0.
সংস্করণ ১.২.০
সংস্করণ ১.২.০
January 22, 2020
androidx.fragment:fragment:1.2.0 , androidx.fragment:fragment-ktx:1.2.0 , and androidx.fragment:fragment-testing:1.2.0 are released. Version 1.2.0 contains these commits .
১.১.০ সংস্করণ থেকে গুরুত্বপূর্ণ পরিবর্তনসমূহ
- FragmentContainerView : The
FragmentContainerViewis the strongly recommended container for dynamically added Fragments, replacing usage ofFrameLayoutor other layouts. It also supports the sameclass,android:name, and optionalandroid:tagas the<fragment>tag, but uses a normalFragmentTransactionto add this initial fragment, instead of the custom code path used by<fragment>. -
onDestroyView()timing : Fragments now wait for exit animations, exit framework transitions, and exit AndroidX transitions (when using Transition1.3.0) to complete before callingonDestroyView(). - Class based
add()andreplace(): Added new overloads ofadd()andreplace()onFragmentTransactionthat take aClass<? extends Fragment>and optionalBundleof arguments. These methods use yourFragmentFactoryto construct an instance of the Fragment to add. Kotlin extensions that use reified types (ie,fragmentTransaction.replace<YourFragment>(R.id.container)) have also been added tofragment-ktx. - Lifecycle ViewModel SavedState Integration :
SavedStateViewModelFactoryis now the default factory used when usingby viewModels(),by activityViewModels(), theViewModelProviderconstructor, orViewModelProviders.of()with a Fragment. - New Lint checks : Added a new Lint check that ensures you are using
getViewLifecycleOwner()when observingLiveDatafromonCreateView(),onViewCreated(), oronActivityCreated(). -
getFragmentManager()deprecation : ThegetFragmentManager()andrequireFragmentManager()methods on Fragment have been deprecated and replaced with a singlegetParentFragmentManager()method, which returns the non-nullFragmentManagerthe Fragment is added to (you can useisAdded()to determine if it is safe to call). -
FragmentManager.enableDebugLogging()deprecation : The staticFragmentManager.enableDebugLoggingmethod has been deprecated. FragmentManager now respectsLog.isLoggable()for the tagFragmentManager, allowing you to enable eitherDEBUGorVERBOSElogging without re-compiling your app.
পরিচিত সমস্যা
- Fragments referenced only via the
classorandroid:nameattribute on aFragmentContainerVieware not kept by ProGuard automatically, requiring that you manually add a keep rule for each fragment class. ( b/142601969 ) - When adding a
NavHostFragmentusingclassorandroid:namein XML withFragmentContainerView, you cannot usefindNavController()inonCreate()of your Activity. ( b/142847973 )
Version 1.2.0-rc05
৮ জানুয়ারী, ২০২০
androidx.fragment:fragment:1.2.0-rc05 , androidx.fragment:fragment-ktx:1.2.0-rc05 , and androidx.fragment:fragment-testing:1.2.0-rc05 are released. Version 1.2.0-rc05 contains these commits .
বাগ সংশোধন
- Fixed a regression in Fragment
1.2.0-rc04when using the<fragment>tag which causedonViewCreated()to be called incorrectly during activity destruction. ( b/146290333 ) - Fragments added with the
<fragment>tag now properly have their non-config cleared even when they are only sometimes in the layout (ie, only in your landscape layout). As a consequence, these Fragments are now correctly moved toCREATEDeven when not in your layout instead of being instantiated but never moving through any lifecycle methods. ( b/145769287 )
Version 1.2.0-rc04
December 18, 2019
androidx.fragment:fragment:1.2.0-rc04 , androidx.fragment:fragment-ktx:1.2.0-rc04 , and androidx.fragment:fragment-testing:1.2.0-rc04 are released. Version 1.2.0-rc04 contains these commits .
বাগ সংশোধন
- Adjusted the animations for
TRANSIT_FRAGMENT_OPEN,TRANSIT_FRAGMENT_CLOSE, andTRANSIT_FRAGMENT_FADEto avoid visual issues. ( b/145468417 )
Version 1.2.0-rc03
December 4, 2019
androidx.fragment:fragment:1.2.0-rc03 , androidx.fragment:fragment-ktx:1.2.0-rc03 , and androidx.fragment:fragment-testing:1.2.0-rc03 are released. Version 1.2.0-rc03 contains these commits .
বাগ সংশোধন
- Fixed an unintentional behavior change where Fragments who have been removed are still returned by
findFragmentById()/findFragmentByTag()while their exit animations/transitions run. ( b/143982969 , aosp/1167585 ) - Child fragments are now correctly stopped before their parents when the containing activity calls
onSaveInstanceState(). ( b/144380645 ) - Fixed an issue where Views were incorrectly marked
INVISIBLEafter popping a hidden Fragment. ( b/70793925 ) - Fragment shared element transitions now handle Views that have been rotated, scaled, etc. ( b/142835261 )
Documentation Updates
- Clarified the deprecation documentation around
setUserVisibleHint(). ( b/143897055 ) - Improved the documentation on
setFragmentFactory()andgetFragmentFactory()to better indicate that setting aFragmentFactorywill also affect child FragmentManagers. ( aosp/1170095 )
নির্ভরশীলতার পরিবর্তন
- Fragments now depends on Lifecycle
2.2.0-rc03, Lifecycle ViewModel SavedState1.0.0-rc03, and Activity1.1.0-rc03.
Version 1.2.0-rc02
November 7, 2019
androidx.fragment:fragment:1.2.0-rc02 , androidx.fragment:fragment-ktx:1.2.0-rc02 , and androidx.fragment:fragment-testing:1.2.0-rc02 are released. Version 1.2.0-rc02 contains these commits .
বাগ সংশোধন
- When in Kotlin, the LintFix for using
getViewLifecycleOwner()when observingLiveDatafromonCreateView(),onViewCreated(), oronActivityCreated()(introduced in Fragment1.2.0-rc01) now uses the Kotlin property access syntaxviewLifecycleOwnerinstead ofgetViewLifecycleOwner(). ( aosp/1143821 )
সংস্করণ 1.2.0-rc01
২৩ অক্টোবর, ২০১৯
androidx.fragment:fragment:1.2.0-rc01 , androidx.fragment:fragment-ktx:1.2.0-rc01 , and androidx.fragment:fragment-testing:1.2.0-rc01 are released. Version 1.2.0-rc01 contains these commits .
নতুন বৈশিষ্ট্য
-
FragmentContainerViewnow supports theclassattribute in addition toandroid:name, mirroring the functionality of the<fragment>tag. ( b/142722242 ) - Added a new Lint check that ensures you are using
getViewLifecycleOwner()when observingLiveDatafromonCreateView(),onViewCreated(), oronActivityCreated(). ( b/137122478 )
বাগ সংশোধন
- The
onDismissandonCancelcallbacks onDialogFragmentnow guarantee that theDialogInterfacepassed to them is non-null and thatgetDialog()returns non-null when they are executed. ( b/141974033 ) -
FragmentContainerViewnow adds the Fragment defined byclassorandroid:nameas part of inflation, ensuring thatfindFragmentById()andfindFragmentByTag()work immediately afterwards. ( b/142520327 ) - Fixed an
IllegalStateExceptioninFragmentContainerViewdue to the state being saved. ( b/142580713 ) - Fixed an
UnsupportedOperationExceptioninFragmentContainerViewwhen theFragmentContainerViewclass is obfuscated. ( b/142657034 )
পরিচিত সমস্যা
- Fragments referenced only via the
classorandroid:nameattribute on aFragmentContainerVieware not kept by ProGuard automatically, requiring that you manually add a keep rule for each fragment class. We have disabled the Lint rule suggesting moving toFragmentContainerViewuntil this is fixed viaaapt2. ( b/142601969 )
Version 1.2.0-beta02
October 11, 2019
androidx.fragment:fragment:1.2.0-beta02 , androidx.fragment:fragment-ktx:1.2.0-beta02 , and androidx.fragment:fragment-testing:1.2.0-beta02 are released. Version 1.2.0-beta02 contains these commits .
বাগ সংশোধন
- Fixed an issue where Fragment's
onInflate()did not receive proper attributes fromFragmentContainerView, breaking cases such asNavHostFragment. ( b/142421837 )
সংস্করণ 1.2.0-beta01
October 9, 2019
androidx.fragment:fragment:1.2.0-beta01 , androidx.fragment:fragment-ktx:1.2.0-beta01 , and androidx.fragment:fragment-testing:1.2.0-beta01 are released. Version 1.2.0-beta01 contains these commits .
নতুন বৈশিষ্ট্য
-
FragmentContainerViewadds support for adding an initial fragment with added support for theandroid:nameand optionalandroid:tagXML attributes. Unlike the<fragment>tag,FragmentContainerViewuses a normalFragmentTransactionunder the hood to add the initial fragment, allowing furtherFragmentTransactionoperations on theFragmentContainerViewand enables the usage of View Binding for the layout. ( b/139830628 , b/141177981 ) - Fragments now contains a Lint warning offering a quick fix to replace
<fragment>withFragmentContainerView. ( b/139830056 )
বাগ সংশোধন
- Fixed a
ClassCastExceptionwhen usingandroidx.transition. ( b/140680619 ) - When using Transition
1.3.0-beta01, Fragments now wait forandroidx.transitiontransitions (in addition to framework transitions and animations, which were fixed in Fragment1.2.0-alpha03and Fragment1.2.0-alpha02, respectively) to finish before dispatchingonDestroyView(). ( aosp/1119841 ) - When using Transition
1.3.0-beta01, Fragments now properly cancelandroidx.transitiontransitions before starting new transitions / animations on the same container. ( aosp/1119841 ) - Fixed an issue on API 17 and lower when using
androidx.transitiontransitions on the root view of your Fragment when usingFragmentContainerView. ( b/140361893 ) - The
fragment-testingartifact now depends on AndroidX Test1.2.0, fixing an incompatibility with the latest Espresso 3.2.0. ( b/139100149 ) - Removed usage of
Log.win FragmentManager. ( aosp/1126468 )
পরিচিত সমস্যা
- Fragment's
onInflate()do not receive proper attributes fromFragmentContainerView, breaking cases such asNavHostFragment. ( b/142421837 )
সংস্করণ 1.2.0-alpha04
১৮ সেপ্টেম্বর, ২০১৯
androidx.fragment:fragment:1.2.0-alpha04 , androidx.fragment-ktx:example:1.2.0-alpha04 , and androidx.fragment:fragment-testing:1.2.0-alpha04 are released. Version 1.2.0-alpha04 contains these commits .
API changes
- The
getFragmentManager()andrequireFragmentManager()methods onFragmenthave been deprecated and replaced with a singlegetParentFragmentManager()method, which returns the non-nullFragmentManagerthe Fragment is added to (you can useisAdded()to determine if it is safe to call). ( b/140574496 ) - The static
FragmentManager.enableDebugLoggingmethod has been deprecated. FragmentManager now respectsLog.isLoggable()for the tagFragmentManager, allowing you to enable eitherDEBUGorVERBOSElogging without re-compiling your app. ( aosp/1116591 )
বাগ সংশোধন
- Fragments are now properly destroyed while exit animations on other fragments are running. ( b/140574199 )
- Fixed an issue where Fragments would call
Activity.findViewById()where before it did not. ( aosp/1116431 )
সংস্করণ 1.2.0-alpha03
September 5, 2019
androidx.fragment:fragment:1.2.0-alpha03 , androidx.fragment:fragment-ktx:1.2.0-alpha03 , and androidx.fragment:fragment-testing:1.2.0-alpha03 are released. The commits included in this version can be found here .
API changes
-
FragmentContainerViewis nowfinal. ( b/140133091 )
বাগ সংশোধন
-
FragmentContainerViewnow properly reverses the draw order when popping fragments off the back stack. ( b/139104187 ) - Fixed an issue where the wrong animation would run when both popping a fragment and adding a new fragment at the same time. ( b/111659726 )
- Fragments now wait for transitions (in addition to animations, which was fixed in Fragment
1.2.0-alpha02) to finish before dispatchingonDestroyView(). ( b/138741697 )
সংস্করণ 1.2.0-alpha02
August 7, 2019
androidx.fragment:fragment:1.2.0-alpha02 , androidx.fragment:fragment-ktx:1.2.0-alpha02 , and androidx.fragment:fragment-testing:11.2.0-alpha02 is released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
-
SavedStateViewModelFactoryis now the default factory used when usingby viewModels(),by activityViewModels(), theViewModelProviderconstructor, orViewModelProviders.of()with aFragment. ( b/135716331 ) - The default animations when using
TRANSIT_FRAGMENT_OPEN,TRANSIT_FRAGMENT_CLOSE,TRANSIT_FRAGMENT_FADEwithsetTransitionon aFragmentTransactionhave been updated to match the animations used by activities on Android 10 devices. ( aosp/1012812 , aosp/1014730 )
API changes
- Introduces
FragmentContainerViewas the strongly recommended container for dynamically added Fragments, replacing usage ofFrameLayout, etc. as it fixes animation z-ordering issues and window insets dispatching to Fragments. ( b/37036000 , aosp/985243 , b/136494650 ) - Added a static
FragmentManager.findFragment(View)method to retrieve the containing Fragment from a view inflated by a fragment. A Kotlin extension is also available infragment-ktx. ( aosp/1090757 ) - Added new overloads of
add()andreplace()onFragmentTransactionthat take aClass<? extends Fragment>and optionalBundleof arguments. These methods use yourFragmentFactoryto construct an instance of the Fragment to add. Kotlin extension that use reified types (ie,fragmentTransaction.replace<YourFragment>(R.id.container)) have also been added tofragment-ktx. ( b/126124987 ) -
@MainThreadannotations have been added toFragmentlifecycle callbacks. ( b/127272564 ) - The breadcrumb title related APIs on
FragmentTransactionandFragmentManager.BackStackEntryhave been deprecated. ( b/138252944 ) - The
setTransitionStylemethod onFragmentTransactionhas been deprecated. ( aosp/1011537 ) - Many of the methods in
FragmentManagerare no longerabstract.FragmentManageritself remainsabstractand should not be directly instantiated or extended; you should continue to only get an existing instance fromgetSupportFragmentManager(),getChildFragmentManager(), etc.
বাগ সংশোধন
- From Fragment
1.1.0-rc04: Fragments now correctly cancel postponed transitions on Fragments have been popped. ( b/138251858 ) - From Fragment
1.1.0-rc03: Fixed an issue where callingpostponeEnterTransition()with a timeout more than once would not cancel previous timeouts. ( b/137797118 ) - From Fragment
1.1.0-rc02: Fixed a crash inFragmentPagerAdapterandFragmentStatePagerAdapterwhen removing the current item. ( b/137209870 ) - Fragments now wait for animations to finish before dispatching
onDestroyView(). ( b/136110528 ) - Fragment animations from child fragments and their descendants are now properly handled when animating the parent Fragment. ( b/116675313 )
- Fixed a
NullPointerExceptionwhen using shared element transitions and combining a pop and add operation. ( b/120507394 ) - Added a workaround to
IllegalStateExceptions when usingFragmentPagerAdapterandFragmentStatePagerAdapterin Robolectric tests. ( b/137201343 )
সংস্করণ 1.2.0-alpha01
২ জুলাই, ২০১৯
androidx.fragment:fragment:1.2.0-alpha01 , androidx.fragment:fragment-ktx:1.2.0-alpha01 , and androidx.fragment:fragment-testing:1.2.0-alpha01 are released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- FragmentManager now calls
requestApplyInsets()after attaching the Fragment's view and directly before callingonViewCreated(), ensuring that your view always has the correct insets. ( b/135945162 )
বাগ সংশোধন
- Fixed a
NullPointerExceptionwhen popping aFragmentTransactionthat usedsetPrimaryNavigationFragment()beforereplace(). ( b/134673465 )
সংস্করণ ১.১.০
সংস্করণ ১.১.০
September 5, 2019
androidx.fragment:fragment:1.1.0 , androidx.fragment:fragment-ktx:1.1.0 , and androidx.fragment:fragment-testing:1.1.0 are released. The commits included in this version can be found here .
Important Changes since 1.0.0
- fragment-testing : The
fragment-testingartifact provides aFragmentScenarioclass for testing a fragment in isolation. See Test your app's fragments documentation for more details. - FragmentFactory : You can now set a
FragmentFactoryon aFragmentManagerto manage the creation of fragment instances, removing the strict requirement to have a no-argument constructor. - Kotlin Property Delegates for ViewModels : The
fragment-ktxartifact now contains two Kotlin property delegates:by viewModels()for accessing ViewModels associated with the individual fragment andby activityViewModels()for accessing ViewModels scoped to the activity. - Max Lifecycle : You can now set a max Lifecycle state for a Fragment by calling
setMaxLifecycle()on aFragmentTransaction. This replaces the now deprecatedsetUserVisibleHint().FragmentPagerAdapterandFragmentStatePagerAdapterhave a new constructor that allows you to switch to the new behavior. - FragmentActivity LayoutId constructor : Subclasses of
FragmentActivitycan now optionally call into a constructor onFragmentActivitythat takes anR.layoutID, indicating the layout that should be set as the content view as an alternative to callingsetContentView()inonCreate(). This does not change the requirement that your subclass have a no-argument constructor. - Fragment LayoutId constructor : Subclasses of
Fragmentcan now optionally call into a constructor onFragmentthat takes anR.layoutID, indicating the layout that should be used for this fragment as an alternative to overridingonCreateView(). The inflated layout can be configured inonViewCreated(). - Postpone with a timeout : A new overload of
postponeEnterTransition()has been added that takes a timeout.
Version 1.1.0-rc04
August 7, 2019
androidx.fragment:fragment:1.1.0-rc04 , androidx.fragment:fragment-ktx:1.1.0-rc04 , and androidx.fragment:fragment-testing:1.1.0-rc04 is released. The commits included in this version can be found here .
বাগ সংশোধন
- Fragments now correctly cancel postponed transitions on Fragments have been popped. ( b/138251858 )
Version 1.1.0-rc03
July 19, 2019
androidx.fragment:fragment:1.1.0-rc03 , androidx.fragment:fragment-ktx:1.1.0-rc03 , and androidx.fragment:fragment-testing:1.1.0-rc03 is released. The commits included in this version can be found here .
বাগ সংশোধন
- Fixed an issue where calling
postponeEnterTransition()with a timeout more than once would not cancel previous timeouts. ( b/137797118 )
Version 1.1.0-rc02
July 17, 2019
androidx.fragment:fragment:1.1.0-rc02 , androidx.fragment:fragment-ktx:1.1.0-rc02 , and androidx.fragment-testing:fragment:1.1.0-rc02 are released. The commits included in this version can be found here .
বাগ সংশোধন
- Fixed a crash in
FragmentPagerAdapterandFragmentStatePagerAdapterwhen removing the current item. ( b/137209870 )
সংস্করণ 1.1.0-rc01
২ জুলাই, ২০১৯
androidx.fragment:fragment:1.1.0-rc01 , androidx.fragment:fragment-ktx:1.1.0-rc01 , and androidx.fragment:fragment-testing:1.1.0-rc01 are released. The commits included in this version can be found here .
বাগ সংশোধন
- Fragments now properly update their visibility when using
show()orhide()operations while the transition is running. ( b/133385058 ) - Fixed a
NullPointerExceptionwhen popping aFragmentTransactionthat usedsetPrimaryNavigationFragment()beforereplace(). ( b/134673465 )
সংস্করণ 1.1.0-beta01
৫ জুন, ২০১৯
androidx.fragment:fragment:1.1.0-beta01 , androidx.fragment:fragment-ktx:1.1.0-beta01 , and androidx.fragment:fragment-testing:1.1.0-beta01 are released. The commits included in this version can be found here .
বাগ সংশোধন
-
androidx.lifecycle.Lifecyclecallbacks (specifically related toSTARTED,RESUMED,PAUSED,STOPPED, andDESTROYED) for nested Fragments are now properly nested. ( b/133497591 ) -
OnBackPressedCallbackinstances registered in a Fragment'sonCreate()now properly take precedence over the child FragmentManager. ( b/133175997 ) - Child fragments are no longer animated when their parent fragment is being replaced. ( b/121017790 )
- Fragments animations and transitions are now ignored when using
animateLayoutChanges="true", fixing an issue where Fragments were not properly destroyed. ( b/116257087 )
Version 1.1.0-alpha09
May 16, 2019
androidx.fragment:fragment:1.1.0-alpha09 , androidx.fragment:fragment-ktx:1.1.0-alpha09 , and androidx.fragment:fragment-testing:1.1.0-alpha09 are released. The commits included in this version can be found here .
API changes
- Fragments now receive a callback to a new
onPrimaryNavigationFragmentChanged(boolean)method when the primary navigation fragment changes. aosp/960857
বাগ সংশোধন
- Menu Items inflated by a child Fragment are now correctly removed when the Parent Fragment is removed. b/131581013
Version 1.1.0-alpha08
May 7, 2019
androidx.fragment:fragment:1.1.0-alpha08 , androidx.fragment:fragment-ktx:1.1.0-alpha08 , and androidx.fragment:fragment-testing:1.1.0-alpha08 are released. The commits included in this version can be found here .
This release is incompatible with Preferences 1.1.0-alpha01 through 1.1.0-alpha04. Please upgrade to Preferences 1.1.0-alpha05 when using this version of Fragments.
নতুন বৈশিষ্ট্য
- Added a new overload of
postponeEnterTransition()that takes a timeout, after which the Fragment will automatically callstartPostponedEnterTransition()b/120803208
API changes
- Breaking change: the previously deprecated
FragmentFactoryinstantiatemethod that took aBundlehas been removed. aosp/953856 - Breaking change: The
RESUME_ONLY_CURRENT_FRAGMENTandUSE_SET_USER_VISIBLE_HINTconstants inFragmentPagerAdapterandFragmentStatePagerAdapterhave been renamed toBEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENTandBEHAVIOR_SET_USER_VISIBLE_HINT, respectively. aosp/954782
বাগ সংশোধন
- Fragments that have had their lifecycle capped via
setMaxLifecycle()no longer get resumed before reaching their final state. b/131557151 - When using
setMaxLifecycle(Lifecycle.State.CREATED), Fragments will properly have their view destroyed. aosp/954180
Version 1.1.0-alpha07
April 25, 2019
androidx.fragment:fragment:1.1.0-alpha07 , androidx.fragment:fragment-ktx:1.1.0-alpha07 , and androidx.fragment:fragment-testing:1.1.0-alpha07 are released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- You can now set a max Lifecycle state for a Fragment by calling
setMaxLifecycle()on aFragmentTransaction. This replaces the now deprecatedsetUserVisibleHint().FragmentPagerAdapterandFragmentStatePagerAdapterhave a new constructor that allows you to switch to the new behavior. ( b/129780800 )
এপিআই পরিবর্তন
-
moveToState(STARTED)onFragmentScenariocan now only be called on API 24+ devices. ( b/129880016 )
আচরণগত পরিবর্তন
- As a consequence of ( b/129907905 ), fragments on the back stack will not get a callback to
onCreateView()when the hosting activity is recreated.onCreateView()will now only be called when the fragment becomes visible (ie, the back stack is popped).
বাগ সংশোধন
- Fixed an issue when using a
<fragment>tag in XML and thecontentLayoutIdconstructor ofFragmentActivityorAppCompatActivity. ( b/129907905 ) - Corrected an issue where fragments on the back stack would not be moved to at least
CREATEDafter a configuration change, causing ViewModels and child retained fragments to not be properly disposed. ( b/129593351 ) - Fixed a crash in
restoreSaveStatecaused by a desync of the retained fragments after the instance state is saved. ( b/130433793 ) ( aosp/947824 ) - Fixed issues where an
OnBackPressedCallbackadded with a fragment lifecycle would not be called if theFragmentManagerhad a back stack. See androidx.activity 1.0.0-alpha07 for more details. ( aosp/948209 ) - Fragments no longer enforce
LAYER_TYPE_HARDWAREfor animations. If you specifically need a hardware layer animation, please set it as part of your animation. ( b/129486478 )
Version 1.1.0-alpha06
April 3, 2019
androidx.fragment:fragment:1.1.0-alpha06 , androidx.fragment:fragment-ktx:1.1.0-alpha06 , and androidx.fragment:fragment-testing:1.1.0-alpha06 are released. The commits included in this version can be found here .
নতুন বৈশিষ্ট্য
- Exceptions thrown by FragmentManager now include the Fragment's name in the message. ( b/67759402 )
এপিআই পরিবর্তন
-
FragmentandFragmentActivitynow contain a second constructor that takes a@LayoutRes int, which replaces the previous behavior of annotating your class with@ContentView. This approach works in both app and library modules. ( b/128352521 ) - FragmentActivity's
onActivityResult()is now properly marked as@CallSuper. ( b/127971684 ) - The FragmentFactory's
instantiatemethod that takes an argument Bundle has been deprecated and apps should use the newinstantiateoverload that does not take a Bundle. ( b/128836103 ) -
FragmentScenariomethods are now properly annotated with@StyleRes. ( aosp/924193 ) -
FragmentTabHosthas been deprecated. ( b/127971835 ) - FragmentActivity's
getThemedContext()has been removed. ( aosp/934078 )
বাগ সংশোধন
- Fixed a regression in 1.1.0-alpha05 that caused the incoming Fragment to flash on the screen. ( b/129405432 )
- Fixed an issue where the primary navigation fragment would be lost after a popBackStack+replace+popBackStack series of operations. ( b/124332597 )
- Fixed an issue when using
@ContentViewconstructors on your Activity when restoring Fragment state. ( b/127313094 ) - Corrected the logic of
setTargetFragment()when replacing an existing target Fragment with a Fragment not yet attached to the FragmentManager. ( aosp/932156 )
Version 1.1.0-alpha05
March 13, 2019
androidx.fragment:fragment:1.1.0-alpha05 , androidx.fragment:fragment-ktx:1.1.0-alpha05 , and androidx.fragment:fragment-testing:1.1.0-alpha05 are released. The full list of commits included in this version can be found here .
নতুন বৈশিষ্ট্য
-
@ContentViewannotation lookups are now cached ( b/123709449 )
Behavior changes
- Calling
remove(),hide(),show(),detach(), andsetPrimaryNavigationFragment()with a Fragment attached to a different FragmentManager now throws anIllegalStateExceptionrather than silently failing ( aosp/904301 )
বাগ সংশোধন
-
onNewIntentforFragmentActivityis now correctly marked with@CallSuper( b/124120586 ) - Fixed an issue where
DialogFragment'sonDismiss()could be called twice when usinggetDialog().dismiss()orgetDialog().cancel()( b/126563750 )
Version 1.1.0-alpha04
February 7, 2019
androidx.fragment:fragment 1.1.0-alpha04 , androidx.fragment:fragment-ktx 1.1.0-alpha04 , and androidx.fragment:fragment-testing 1.1.0-alpha04 are released.
নতুন বৈশিষ্ট্য
- Added support for the
@ContentViewclass annotation that allows you to indicate which layout XML file should be inflated as an alternative to overridingonCreateView(). It is recommended to do view related work inonViewCreated(). ( aosp/837619 ) -
fragment-testingnow depends onandroidx.test:core-ktx1.1.0 stable ( b/121209673 ) - You can now use
openActionBarOverflowOrOptionsMenuwithFragmentScenarioto test Fragment hosted options menus ( b/121126668 )
API changes
- Added a
requireArguments()method which returns a@NonNull Bundleor throws anIllegalStateException( b/121196360 ) - Added a note that
getLifecycle(),getViewLifecycleOwner(), andgetViewLifecycleOwnerLiveData()should not be overridden and will be made final in a future release. Please file a feature request if you are currently overriding this method. ( aosp/880714 ) - Added a note that
getViewModelStore()should not be overridden and will be made final in a future release. Please file a feature request if you are currently overriding this method. ( aosp/880713 ) - Fixed an issue with binary compatibility with previous releases of Fragments. ( aosp/887877 ) ( aosp/889834 )
বাগ সংশোধন
- Target fragments are correctly cleared out when you pass
nulltosetTargetFragment(). ( aosp/849969 ) - Fixed an issue where target Fragments were sometimes unavailable in or after
onDestroy(). ( b/122312935 ) - DialogFragment's onDismiss() is now called before
onDestroy(). ( aosp/874133 ) ( aosp/890734 )
Version 1.1.0-alpha03
December 17, 2018
নতুন বৈশিষ্ট্য
- Fragment now implements
BundleSavedStateRegistryOwnerand depends on the newly released SavedState library [ aosp/824380 ] - A
by activityViewModelsKotlin property delegate has been added to retrieve ViewModels associated with the containing Activity [ b/119050253 ] - The
by viewModelsKotlin property delegate has been expanded to take an optional lambda method for getting theViewModelStoreOwner, allowing you to pass in the parent Fragment or other customViewModelStoreOwnerwith code such asval viewModel: MyViewModel by viewModels(::requireParentFragment)[ b/119050253 ]
API changes
-
FragmentScenarionow allows you to specify a theme such asTheme.AppCompat[ b/119054431 ]. This is a breaking change. - Added a
requireView()method which returns a@NonNull Viewor throws anIllegalStateException[ b/120241368 ] - Added a
requireParentFragment()method which returns a@NonNull Fragmentor throws anIllegalStateException[ b/112103783 ]
বাগ সংশোধন
- Fixed IllegalStateException: Failure saving state b/120814739
- Fragments being restored from saved instance state will now always receive a non-null
Bundle[ b/119794496 ] - Removed Fragments no longer reuse their
Lifecycleobject if re-added [ b/118880674 ]
Version 1.1.0-alpha02
December 3, 2018
নতুন বৈশিষ্ট্য
- FragmentScenario's Kotlin extensions now let you use a lambda for Fragment construction as an alternative to passing in a
FragmentFactoryinstance. ( aosp/812913 )
বাগ সংশোধন
- Fixed an IllegalStateException when using nested Fragments on the back stack ( b/119256498 )
- Fixed crash when using
FragmentScenario.recreate()with aFragmentFactory( aosp/820540 ) - Fixed an issue where target Fragments were not accessible after the Fragment was removed ( aosp/807634 )
সংস্করণ 1.1.0-alpha01
November 5, 2018
This is the first release of the fragment-testing artifact and FragmentScenario which is built on top of the androidx.test:core APIs. See the Fragment testing documentation for more details.
নতুন বৈশিষ্ট্য
- New FragmentScenario class for testing Fragments in isolation.
- You can now set a
FragmentFactoryon anyFragmentManagerto control how new Fragment instances are instantiated. - Added a new
by viewModels()Kotlin property delegate for retrieving ViewModels from a Fragment. - Pending input events (such as clicks) are now canceled in a Fragment's
onStop().
API changes
- Significantly expanded the nullability annotations across the Fragment API surface.
বাগ সংশোধন
- Fix an issue which caused Fragment operations to fail from within LiveData (b/77944637)
পরিচিত সমস্যা
- Target Fragments cannot be accessed after a Fragment has been removed from the FragmentManager.
-
fragment-testingdepends onandroidx.test:core:1.0.0-beta01instead of the correctandroidx.test:core:1.0.0.