টুকরা

আপনার অ্যাপটিকে একাধিক, স্বাধীন স্ক্রীনে ভাগ করুন যা একটি কার্যকলাপের মধ্যে হোস্ট করা হয়।
সর্বশেষ আপডেট স্থিতিশীল রিলিজ মুক্তির প্রার্থী বিটা রিলিজ আলফা রিলিজ
জুলাই 24, 2024 1.8.2 - - -

নির্ভরতা ঘোষণা করা

ফ্র্যাগমেন্টের উপর নির্ভরতা যোগ করতে, আপনাকে অবশ্যই আপনার প্রকল্পে Google Maven সংগ্রহস্থল যোগ করতে হবে। আরও তথ্যের জন্য Google এর Maven সংগ্রহস্থল পড়ুন।

আপনার অ্যাপ বা মডিউলের জন্য build.gradle ফাইলে আপনার প্রয়োজনীয় আর্টিফ্যাক্টগুলির জন্য নির্ভরতা যোগ করুন:

গ্রোভি

dependencies {
    def fragment_version = "1.8.2"

    // 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.2"

    // 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")
}

নির্ভরতা সম্পর্কে আরও তথ্যের জন্য, বিল্ড নির্ভরতা যুক্ত করুন দেখুন।

প্রতিক্রিয়া

আপনার প্রতিক্রিয়া জেটপ্যাককে আরও ভাল করতে সাহায্য করে। আপনি যদি নতুন সমস্যা আবিষ্কার করেন বা এই লাইব্রেরির উন্নতির জন্য ধারনা পান তাহলে আমাদের জানান। আপনি একটি নতুন তৈরি করার আগে অনুগ্রহ করে এই লাইব্রেরিতে বিদ্যমান সমস্যাগুলি দেখুন৷ আপনি তারকা বোতামে ক্লিক করে একটি বিদ্যমান সমস্যায় আপনার ভোট যোগ করতে পারেন।

একটি নতুন সমস্যা তৈরি করুন

আরও তথ্যের জন্য ইস্যু ট্র্যাকার ডকুমেন্টেশন দেখুন।

সংস্করণ 1.8

সংস্করণ 1.8.2

জুলাই 24, 2024

androidx.fragment:fragment-*:1.8.2 প্রকাশিত হয়েছে। সংস্করণ 1.8.2- এ এই কমিটগুলি রয়েছে।

বাগ ফিক্স

  • AndroidFragment এখন সঠিকভাবে সেগুলি পরিচালনা করে যেখানে প্যারেন্ট ফ্র্যাগমেন্টটি ফ্র্যাগমেন্ট ব্যাক স্ট্যাকে রাখা হয়, সেই খণ্ডটিতে ফিরে আসার সময় 'আইডির জন্য কোনও ভিউ পাওয়া যায়নি' সমস্যাগুলি এড়িয়ে যায়। ( I94608 )
  • FragmentTransaction.add পদ্ধতির মাধ্যমে যোগ করা টুকরা যা একটি ViewGroup নেয় এখন onStart() এ অগ্রসর হওয়ার আগে onContainerAvailable জন্য অপেক্ষা করুন। এটি সেই API-এর ব্যবহারকারীদের প্রভাবিত করে, যেমন AndroidFragment , যা এখন onStart() এর মাধ্যমে সরানোর আগে AndroidFragment কম্পোজিশন পুনরায় প্রবেশ করার জন্য অপেক্ষা করে। ( I94608 )

সংস্করণ 1.8.1

জুন 26, 2024

androidx.fragment:fragment-*:1.8.1 প্রকাশিত হয়েছে। সংস্করণ 1.8.1- এ এই কমিটগুলি রয়েছে।

বাগ ফিক্স

  • একটি সমস্যা সমাধান করা হয়েছে যেখানে একটি ভবিষ্যদ্বাণীমূলক ব্যাক জেসচার শুরু করার সময় একটি ধারক ছাড়া টুকরোগুলি অবিলম্বে DESTROYED হয়ে গিয়েছিল৷ অঙ্গভঙ্গি সম্পূর্ণ না হওয়া পর্যন্ত এখন সেগুলি CREATED অবস্থায় রাখা হয়। ( if6b83 , b/345244539 )

সংস্করণ 1.8.0

জুন 12, 2024

androidx.fragment:fragment-*:1.8.0 প্রকাশিত হয়েছে। সংস্করণ 1.8.0- এ এই কমিট রয়েছে।

1.7.0 থেকে গুরুত্বপূর্ণ পরিবর্তন

  • fragment-compose আর্টিফ্যাক্টে এখন একটি AndroidFragment Composable রয়েছে যা ফ্র্যাগমেন্ট ক্লাস নামের মাধ্যমে কম্পোজ হায়ারার্কিতে টুকরো যোগ করার অনুমতি দেয়। এটি স্বয়ংক্রিয়ভাবে ফ্র্যাগমেন্টের অবস্থা সংরক্ষণ এবং পুনরুদ্ধার পরিচালনা করে। এটি একটি ফ্র্যাগমেন্ট স্ফীত করার জন্য AndroidViewBinding ব্যবহার করার পূর্বে প্রস্তাবিত পদ্ধতির সরাসরি প্রতিস্থাপন হিসাবে ব্যবহার করা উচিত।
  • FragmentManager এর OnBackStackChangedListener ইন্টারফেসে onBackStackChangeCancelled কলব্যাকটি এখন FragmentManager এ ক্রিয়াকলাপ সম্পাদনের অংশ হিসাবে ফায়ার করে, এটিকে onBackStackChangeCommitted কলব্যাকের সময়ের সাথে সঙ্গতিপূর্ণ করে।

সংস্করণ 1.8.0-rc01

29 মে, 2024

androidx.fragment:fragment-*:1.8.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-rc01-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • FragmentManagers-এ onBackStackChangeCancelled কলব্যাক FragmentManagers OnBackStackChangedListener ইন্টারফেসটি এখন FragmentManager এ ক্রিয়াকলাপ চালানোর অংশ হিসাবে ফায়ার করে, এটিকে onBackStackChangeCommitted কলব্যাকের সময়ের সাথে সঙ্গতিপূর্ণ করে। ( I5ebfb , b/332916112 )

সংস্করণ 1.8.0-beta01

14 মে, 2024

androidx.fragment:fragment-*:1.8.0-beta01 প্রকাশিত হয়েছে। 1.8.0-beta01 সংস্করণে এই কমিটগুলি রয়েছে।

বাগ ফিক্স

  • ফ্র্যাগমেন্ট 1.7.1 থেকে : ভবিষ্যদ্বাণীমূলক ব্যাক এখন শুধুমাত্র লেনদেনের জন্য চলবে যেখানে সমস্ত খণ্ডের একটি অ্যানিমেটর বা একটি অনুসন্ধানযোগ্য Androidx ট্রানজিশন রয়েছে৷ এটি এমন একটি সমস্যার সমাধান করে যেখানে আংশিকভাবে চাওয়া-পাওয়া লেনদেন বাতিল করলে কালো স্ক্রিন হবে। ( I43037 , b/339169168 )

সংস্করণ 1.8.0-alpha02

এপ্রিল 17, 2024

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

3 এপ্রিল, 2024

androidx.fragment:fragment-*:1.8.0-alpha01 প্রকাশিত হয়েছে। সংস্করণ 1.8.0-alpha01-এ এই কমিট রয়েছে।

নতুন বৈশিষ্ট

  • নতুন AndroidFragment Composable ফ্র্যাগমেন্ট ক্লাস নামের মাধ্যমে কম্পোজ হায়ারার্কিতে টুকরো যোগ করার অনুমতি দেয়। এটি স্বয়ংক্রিয়ভাবে ফ্র্যাগমেন্টের অবস্থা সংরক্ষণ এবং পুনরুদ্ধার পরিচালনা করে। এটি AndroidViewBinding Composable এর সরাসরি প্রতিস্থাপন হিসাবে ব্যবহার করা যেতে পারে।( b/312895363 , Icf841 )

ডকুমেন্টেশন পরিবর্তন

  • OnBackStackChangedListener API-এর জন্য হালনাগাদ করা ডকুমেন্টেশন নির্দেশ করে যে কখন তাদের কল করা হবে এবং কীভাবে সেগুলি ব্যবহার করা উচিত। ( I0bfd9 )

নির্ভরতা আপডেট

সংস্করণ 1.7

সংস্করণ 1.7.1

14 মে, 2024

androidx.fragment:fragment-*:1.7.1 প্রকাশিত হয়েছে। সংস্করণ 1.7.1- এ এই কমিটগুলি রয়েছে।

বাগ ফিক্স

  • ভবিষ্যদ্বাণীমূলক ব্যাক এখন শুধুমাত্র লেনদেনের জন্য চালানো হবে যেখানে সমস্ত অংশে একটি অ্যানিমেটর বা একটি অনুসন্ধানযোগ্য Androidx ট্রানজিশন রয়েছে৷ এটি একটি সমস্যার সমাধান করে যেখানে আংশিকভাবে চাওয়া যোগ্য লেনদেন বাতিল করলে একটি ফাঁকা স্ক্রীন হবে। ( I43037 , b/339169168 )

সংস্করণ 1.7.0

1 মে, 2024

androidx.fragment:fragment-*:1.7.0 প্রকাশিত হয়েছে। সংস্করণ 1.7.0- এ এই কমিটগুলি রয়েছে।

পূর্বাভাসমূলক পিছনে অঙ্গভঙ্গি সমর্থন

  • Animator ব্যবহার করার সময় বা AndroidX ট্রানজিশন 1.5.0 ব্যবহার করার সময় ফ্র্যাগমেন্টগুলি এখন ভবিষ্যদ্বাণীমূলক ইন-অ্যাপ-এর জন্য সমর্থন প্রদান করে। এটি ব্যবহারকারীদের ইঙ্গিত সম্পূর্ণ বা বাতিল করার মাধ্যমে লেনদেন করার সিদ্ধান্ত নেওয়ার আগে আপনার অ্যানিমেটর/ট্রানজিশন খোঁজার মাধ্যমে পূর্ববর্তী খণ্ডটি দেখতে পিছনের অঙ্গভঙ্গি ব্যবহার করতে দেয়।
ট্রানজিশন সিস্টেম এক্সএমএল রিসোর্স ভবিষ্যদ্বাণীপূর্ণ পিছনে সমর্থন করে
Animation R.anim না
Animator R.animator হ্যাঁ
ফ্রেমওয়ার্ক Transition R.transition না
1.4.1 বা তার কম ট্রানজিশন সহ AndroidX Transition R.transition না
ট্রানজিশন 1.5.0 সহ AndroidX Transition R.transition হ্যাঁ

আপনি যদি ভবিষ্যদ্বাণীমূলক ব্যাক জেসচার বেছে নেওয়ার পরে ফ্র্যাগমেন্টে ভবিষ্যদ্বাণীমূলক ব্যাক সমর্থনে কোনো সমস্যা দেখতে পান, তাহলে অনুগ্রহ করে একটি নমুনা প্রকল্পের সাথে ফ্র্যাগমেন্টের বিরুদ্ধে একটি সমস্যা ফাইল করুন যা আপনার সমস্যাটি পুনরুত্পাদন করে। আপনি আপনার কার্যকলাপের onCreate()FragmentManager.enabledPredictiveBack(false) ব্যবহার করে ভবিষ্যদ্বাণীমূলক ব্যাক অক্ষম করতে পারেন।

FragmentManager.OnBackStackChangedListener() এখন যথাক্রমে পূর্বাভাসমূলক ব্যাক অগ্রগতি এবং বাতিল ইভেন্টগুলি পাওয়ার জন্য onBackStackChangeProgressed() এবং onBackStackChangeCancelled() প্রদান করে।

খণ্ড রচনা আর্টিফ্যাক্ট

একটি নতুন fragment-compose আর্টিফ্যাক্ট তৈরি করা হয়েছে যা একটি ফ্র্যাগমেন্ট ভিত্তিক আর্কিটেকচার থেকে সম্পূর্ণ কম্পোজ ভিত্তিক আর্কিটেকচারে যাওয়ার প্রক্রিয়ায় থাকা অ্যাপগুলিকে সমর্থন করে।

এই নতুন আর্টিফ্যাক্টে উপলব্ধ প্রথম বৈশিষ্ট্যটি হল Fragment একটি content এক্সটেনশন পদ্ধতি যা আপনার জন্য একটি ComposeView তৈরি করে এবং সঠিক ViewCompositionStrategy সেট করে একটি পৃথক ফ্র্যাগমেন্টের UI-এর জন্য রচনা ব্যবহার করা সহজ করতে চায়।

  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

এপ্রিল 17, 2024

androidx.fragment:fragment-*:1.7.0-rc02 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-rc02-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • অন্য কোনো ট্রানজিশন ছাড়াই কেন sharedElement সেট করা ব্যর্থ হবে তা নির্দেশ করতে লগ যোগ করা হয়েছে। ( Iec48e )
  • একটি বাগ সংশোধন করা হয়েছে যেখানে যদি একটি অ-অনুসন্ধানযোগ্য ভাগ করা উপাদান একটি লেনদেনে যোগ করা হয় যেখানে অন্য সমস্ত রূপান্তর অনুসন্ধানযোগ্য ছিল, সেখানে একটি ক্র্যাশ হবে৷ এখন লেনদেনটি সঠিকভাবে অপ্রার্থিত বলে বিবেচিত হবে৷ ( I18ccd )

সংস্করণ 1.7.0-rc01

3 এপ্রিল, 2024

androidx.fragment:fragment-*:1.7.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-rc01-এ এই কমিট রয়েছে।

নির্ভরতা আপডেট

সংস্করণ 1.7.0-beta01

20 মার্চ, 2024

androidx.fragment:fragment-*:1.7.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-beta01-এ এই কমিট রয়েছে।

এপিআই পরিবর্তন

  • FragmentHostCallback এখন Kotlin-এ লেখা হয়েছে যাতে হোস্টের জেনেরিক টাইপের শূন্যতা onGetHost() এর রিটার্ন টাইপের শূন্যতার সাথে মিলে যায়। ( I40af5 )

বাগ ফিক্স

  • একটি সমস্যা স্থির করা হয়েছে যেখানে একটি ভবিষ্যদ্বাণীমূলক পিছনের অঙ্গভঙ্গি করার সময় একটি খণ্ডের উপর যা একটি পাত্রে নেই, সেই খণ্ডটি কখনই ধ্বংস হবে না। খণ্ডটি এখন অবিলম্বে চূড়ান্ত অবস্থায় স্থানান্তরিত হবে। ( Ida0d9 )
  • ফ্র্যাগমেন্টে একটি সমস্যা সমাধান করা হয়েছে যেখানে একটি ভবিষ্যদ্বাণীমূলক ব্যাক জেসচারের সাথে ইনকামিং ট্রানজিশন বাধাগ্রস্ত করা প্রবেশের দৃশ্যকে ধ্বংস করবে এবং একটি ফাঁকা স্ক্রীন ছেড়ে দেবে। ( Id3f22 , b/319531491 )

সংস্করণ 1.7.0-আলফা10

7 ফেব্রুয়ারি, 2024

androidx.fragment:fragment-*:1.7.0-alpha10 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha10 এই কমিট ধারণ করে।

বাগ ফিক্স

  • পূর্ববর্তী ফ্র্যাগমেন্ট রিলিজে পরিচিত সমস্যাটির সমাধান করা হয়েছে যেখানে Animator বা অ্যান্ড্রয়েডএক্স ট্রানজিশনের জন্য ফ্র্যাগমেন্টের প্রেডিকটিভ ব্যাক সমর্থন ব্যবহার করে, FragmentManager.OnBackStackChangedListener addOnBackStackChangedListener OnBackStackChangedListener কখনও add না হয়ে থাকলে handleOnBackProgressed থেকে একটি NullPointerException নিক্ষেপ করবে। ( I7c835 )

সংস্করণ 1.7.0-alpha09

24 জানুয়ারী, 2024

androidx.fragment:fragment-*:1.7.0-alpha09 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha09 এই কমিট ধারণ করে।

খণ্ড রচনা আর্টিফ্যাক্ট

একটি নতুন fragment-compose আর্টিফ্যাক্ট তৈরি করা হয়েছে যা একটি ফ্র্যাগমেন্ট ভিত্তিক আর্কিটেকচার থেকে সম্পূর্ণ কম্পোজ ভিত্তিক আর্কিটেকচারে যাওয়ার প্রক্রিয়ায় থাকা অ্যাপগুলিকে সমর্থন করে।

এই নতুন আর্টিফ্যাক্টে উপলব্ধ প্রথম বৈশিষ্ট্যটি হল Fragment একটি content এক্সটেনশন পদ্ধতি যা আপনার জন্য একটি ComposeView তৈরি করে এবং সঠিক ViewCompositionStrategy সেট করে একটি পৃথক ফ্র্যাগমেন্টের UI-এর জন্য রচনা ব্যবহার করা সহজ করতে চায়। ( 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 বা অ্যান্ড্রয়েডএক্স ট্রানজিশনের জন্য ফ্র্যাগমেন্টের প্রেডিকটিভ ব্যাক সমর্থন ব্যবহার করার সময়, যদি কোনো FragmentManager.OnBackStackChangedListener কখনও addOnBackStackChangedListener এর মাধ্যমে যোগ করা না থাকে তাহলে ফ্র্যাগমেন্টগুলি handleOnBackProgressed থেকে একটি NullPointerException নিক্ষেপ করবে। ম্যানুয়ালি একজন শ্রোতা যোগ করা ক্র্যাশের চারপাশে কাজ করবে। ফ্র্যাগমেন্টের পরবর্তী রিলিজে এর জন্য একটি ফিক্স পাওয়া যাবে।

সংস্করণ 1.7.0-alpha08

জানুয়ারী 10, 2024

androidx.fragment:fragment-*:1.7.0-alpha08 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha08 এই কমিট ধারণ করে।

পরিষ্কার কর

সংস্করণ 1.7.0-alpha07

নভেম্বর 29, 2023

androidx.fragment:fragment-*:1.7.0-alpha07 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha07 এই কমিট ধারণ করে।

বাগ ফিক্স

  • একটি শেয়ার্ড এলিমেন্ট ট্রানজিশন সেট করার এবং পাশাপাশি এন্টার/এক্সিট ট্রানজিশন সেট করতে ব্যর্থ হওয়ার কারণে একটি NullPointerException স্থির করা হয়েছে। ( I8472b )
  • ফ্র্যাগমেন্ট 1.6.2 থেকে: যখন একটি FragmentContainerView -এর ফ্র্যাগমেন্ট স্ফীত হয়, তখন এর স্টেট যেমন FragmentManager , হোস্ট এবং আইডি এখন onInflate কলব্যাকে অ্যাক্সেসযোগ্য। ( I1e44c , b/307427423 )
  • ফ্র্যাগমেন্ট 1.6.2 থেকে : টুকরোগুলির একটি সেট সরানোর জন্য clearBackStack ব্যবহার করার সময়, প্যারেন্ট ফ্র্যাগমেন্টের ViewModel ViewModels সাফ হয়ে যাবে৷ ( I6d83c , b/296173018 )

সংস্করণ 1.7.0-alpha06

4 অক্টোবর, 2023

androidx.fragment:fragment-*:1.7.0-alpha06 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha06 এই কমিট ধারণ করে।

নির্ভরতা আপডেট

  • ট্রানজিশন 1.5.0-alpha04 এ যোগ করা নতুন animateToStart API-এর উপর নির্ভর করতে ফ্র্যাগমেন্ট আপডেট করা হয়েছে।

সংস্করণ 1.7.0-alpha05

20 সেপ্টেম্বর, 2023

androidx.fragment:fragment-*:1.7.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha05 এই কমিট ধারণ করে।

নতুন বৈশিষ্ট

  • অ্যান্ড্রয়েডক্স ট্রানজিশন ব্যবহার করার সময় ফ্র্যাগমেন্টগুলি এখন ভবিষ্যদ্বাণীমূলক ব্যাকের জন্য সমর্থন প্রদান করে। এটি আপনাকে সম্পূর্ণ অঙ্গভঙ্গির মাধ্যমে লেনদেনটি প্রতিশ্রুতিবদ্ধ বা বাতিল করার সিদ্ধান্ত নেওয়ার আগে আপনার কাস্টম অ্যান্ড্রয়েডক্স ট্রানজিশনের সাথে পূর্ববর্তী অংশটি সন্ধান করতে পিছনের অঙ্গভঙ্গি ব্যবহার করতে দেয়। এই বৈশিষ্ট্যটি সক্ষম করতে আপনাকে অবশ্যই ট্রানজিশন 1.5.0-alpha03 রিলিজের উপর নির্ভর করতে হবে। ( Ib49b4 , b/285175724 )

জ্ঞাত সমস্যা

  • বর্তমানে একটি সমস্যা রয়েছে যেখানে আপনি একবার ট্রানজিশন সহ একটি পিছনের অঙ্গভঙ্গি বাতিল করার পরে, পরের বার যখন আপনি পিছনের অঙ্গভঙ্গিটি শুরু করবেন তখন এটি রূপান্তরটি চালাতে ব্যর্থ হবে, যার ফলে একটি ফাঁকা স্ক্রীন হবে৷ এটি ট্রানজিশন লাইব্রেরিতে একটি সমস্যার কারণে হতে পারে। ( b/300157785 )। আপনি যদি এই সমস্যাটি দেখতে পান, অনুগ্রহ করে একটি নমুনা প্রকল্পের সাথে ফ্র্যাগমেন্টের বিরুদ্ধে একটি সমস্যা ফাইল করুন যা আপনার সমস্যাটি পুনরুত্পাদন করে। আপনি আপনার কার্যকলাপের onCreate()FragmentManager.enabledPredictiveBack(false) ব্যবহার করে ভবিষ্যদ্বাণীমূলক ব্যাক অক্ষম করতে পারেন।

সংস্করণ 1.7.0-alpha04

6 সেপ্টেম্বর, 2023

androidx.fragment:fragment-*:1.7.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha04 এই কমিট ধারণ করে।

বাগ ফিক্স

  • একটি ভবিষ্যদ্বাণীমূলক ব্যাক জেসচার বাতিল করার সময় একটি সমস্যা সমাধান করা হয়েছে যেখানে টুকরোগুলি সঠিক জীবনচক্র অবস্থায় এটি তৈরি করতে ব্যর্থ হয়েছে৷ ( I7cffe , b/297379023 )
  • একটি রিগ্রেশন ঠিক করা হয়েছে যেখানে ট্রানজিশনের সাথে অ্যানিমেশন চালানোর অনুমতি দেওয়া হয়েছে। ( I59f36 )
  • ফ্র্যাগমেন্ট সহ ভবিষ্যদ্বাণীমূলক ব্যাক ব্যবহার করার সময় একটি সমস্যা সমাধান করা হয়েছে যেখানে ব্যাক স্ট্যাকের দ্বিতীয় থেকে শেষ ফ্র্যাগমেন্টে দ্রুত পরপর দুবার ফিরে যাওয়ার চেষ্টা করা ক্র্যাশের কারণ হবে। ( IFa1a4 )

সংস্করণ 1.7.0-alpha03

23 আগস্ট, 2023

androidx.fragment:fragment-*:1.7.0-alpha03 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha03 এই কমিট ধারণ করে।

বাগ ফিক্স

  • ভবিষ্যদ্বাণীমূলক ব্যাক ব্যবহার করার সময় ফ্র্যাগমেন্টের সাথে একটি সমস্যা সমাধান করা হয়েছে যার ফলে ফ্র্যাগমেন্ট ম্যানেজারের ব্যাক স্ট্যাকের প্রথম খণ্ডটি এড়িয়ে যাওয়া হয়েছে এবং 3 বোতাম নেভিগেশন বা ভবিষ্যদ্বাণীমূলক ব্যাক জেসচারের মাধ্যমে সিস্টেম ব্যাক ব্যবহার করার সময় কার্যকলাপ শেষ হয়েছে৷ ( I0664b , b/295231788 )

সংস্করণ 1.7.0-alpha02

9 আগস্ট, 2023

androidx.fragment:fragment-*:1.7.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 1.7.0-alpha02 এই কমিট ধারণ করে।

বাগ ফিক্স

  • API 34 থেকে ভবিষ্যদ্বাণীমূলক ব্যাক জেসচার সহ ফ্র্যাগমেন্টগুলি ব্যবহার করার সময়, আপনি যদি এমন একটি ট্রানজিশন সিস্টেম ব্যবহার করেন যা চাওয়াকে সমর্থন করে না ( Animations , Transitions ) বা কোনও ট্রানজিশন নেই, তাহলে ফ্র্যাগমেন্টগুলি এখন ব্যাক অ্যাকশন চালানোর আগে অঙ্গভঙ্গি সম্পূর্ণ না হওয়া পর্যন্ত অপেক্ষা করবে৷ ( I8100c )

সংস্করণ 1.7.0-alpha01

7 জুন, 2023

androidx.fragment:fragment-*:1.7.0-alpha01 প্রকাশিত হয়েছে। এই সংস্করণটি একটি অভ্যন্তরীণ শাখায় তৈরি করা হয়েছে।

নতুন বৈশিষ্ট

  • Animator ব্যবহার করার সময় ফ্র্যাগমেন্টগুলি এখন ভবিষ্যদ্বাণীমূলক ইন-অ্যাপ-এর জন্য সমর্থন প্রদান করে৷ এটি আপনাকে সম্পূর্ণ অঙ্গভঙ্গির মাধ্যমে লেনদেন করার বা বাতিল করার সিদ্ধান্ত নেওয়ার আগে আপনার কাস্টম অ্যানিমেটরের সাথে আগের খণ্ডটি দেখতে পিছনের অঙ্গভঙ্গি ব্যবহার করতে দেয়। আপনি পরীক্ষামূলক enablePredictiveBack() ব্যবহার করে এবং false পাস করে এই নতুন আচরণটি নিষ্ক্রিয় করতে পারেন।

সংস্করণ 1.6

সংস্করণ 1.6.2

নভেম্বর 1, 2023

androidx.fragment:fragment-*:1.6.2 প্রকাশিত হয়েছে। সংস্করণ 1.6.2-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • যখন একটি FragmentContainerView এর ফ্র্যাগমেন্ট স্ফীত হয়, তখন এর স্টেট যেমন FragmentManager , Host এবং id এখন onInflate কলব্যাকে অ্যাক্সেসযোগ্য। ( I1e44c , b/307427423 )
  • খণ্ডের একটি সেট সরানোর জন্য clearBackStack ব্যবহার করার সময়, প্যারেন্ট ফ্র্যাগমেন্টের ViewModel ViewModels সাফ হয়ে যাবে৷ ( I6d83c , b/296173018 )

সংস্করণ 1.6.1

জুলাই 26, 2023

androidx.fragment:fragment-*:1.6.1 প্রকাশিত হয়েছে। সংস্করণ 1.6.1-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • একটি সমস্যা সমাধান করা হয়েছে যেখানে সংরক্ষিত অবস্থা সংরক্ষিত হয় যখন কার্যকলাপ বন্ধ করা হয় কিন্তু ধ্বংস না করা হয়, এমনকি টুকরো দৃষ্টান্তটি পুনরায় RESUMED অবস্থায় সরানোর পরেও ভুলভাবে ক্যাশে করা হবে। এই খণ্ডটি সংরক্ষণ এবং পুনরুদ্ধার করার জন্য একাধিক ব্যাক স্ট্যাক API ব্যবহার করার সময় যদি সেই খণ্ডের উদাহরণটি ব্যাক স্ট্যাকে থাকে তবে এটি সেই ক্যাশে করা অবস্থাটিকে পুনরায় ব্যবহার করা হবে। ( I71288 , b/246289075 )

নির্ভরতা আপডেট

  • ফ্র্যাগমেন্ট এখন কার্যকলাপ 1.7.2 এর উপর নির্ভর করে। এটি একটি সমস্যার সমাধান করে যেখানে কোটলিন ব্যবহারকারীরা ক্রিয়াকলাপের উপর সুস্পষ্ট নির্ভরতা ছাড়া ComponentDialog প্রসারিত করতে পারে না। ( b/287509323 )

সংস্করণ 1.6.0

7 জুন, 2023

androidx.fragment:fragment-*:1.6.0 প্রকাশিত হয়েছে। সংস্করণ 1.6.0 এই কমিট ধারণ করে.

1.5.0 থেকে গুরুত্বপূর্ণ পরিবর্তন

  • Fragment s-এর সংরক্ষিত অবস্থাটি সম্পূর্ণরূপে ব্যক্তিগত লাইব্রেরি স্টেট (কাস্টম Parcelable ক্লাস) এবং বিকাশকারী দ্বারা প্রদত্ত রাজ্যের মধ্যে বিভক্ত করা হয়েছে, যা এখন সর্বদা একটি Bundle সংরক্ষিত থাকে যা একটি খণ্ডের অবস্থা ঠিক কোথায় উৎপন্ন হচ্ছে তা নির্ধারণ করতে দেয়।
  • FragmentManager.OnBackStackChangedListener ইন্টারফেসটি onBackStackChangeStarted এবং onBackStackChangeCommitted এর দুটি অতিরিক্ত কলব্যাক সহ প্রসারিত করা হয়েছে যেগুলিকে ফ্র্যাগমেন্ট ব্যাক স্ট্যাক থেকে যুক্ত/মুছে ফেলার আগে এবং লেনদেন করার ঠিক পরেই প্রতিটি Fragment সাথে কল করা হয়।
  • FragmentStrictMode একটি নতুন WrongNestedHierarchyViolation যোগ করেছে যা শনাক্ত করে যখন একটি শিশু খণ্ডটি পিতামাতার ভিউ অনুক্রমের মধ্যে নেস্ট করা হয়, কিন্তু পিতামাতার childFragmentManager যোগ করা হয় না।
  • Fragment এবং FragmentManager APIগুলি যেগুলি একটি Intent বা IntentSender নেয় সেগুলি এখন @NonNull এর সাথে সঠিকভাবে টীকা করা হয়েছে যাতে একটি নাল মান পাস হওয়া রোধ করা যায় কারণ একটি নাল মান সর্বদা অবিলম্বে সংশ্লিষ্ট অ্যান্ড্রয়েড ফ্রেমওয়ার্ক APIগুলিকে এই পদ্ধতিগুলি কল করে ক্র্যাশ করে।
  • DialogFragment এখন requireComponentDialog() API-এর মাধ্যমে অন্তর্নিহিত ComponentDialog এ অ্যাক্সেস প্রদান করে।
  • ফ্র্যাগমেন্ট এখন লাইফসাইকেল 2.6.1 এর উপর নির্ভর করে।
  • ফ্র্যাগমেন্ট এখন SavedState 1.2.1 এর উপর নির্ভর করে।
  • ফ্র্যাগমেন্ট এখন প্রোফাইলইনস্টলার 1.3.0 এর উপর নির্ভর করে।
  • 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

10 মে, 2023

androidx.fragment:fragment-*:1.6.0-rc01 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-rc01-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • একাধিক startActivityForResult অনুরোধ পরপর করা হলে ভুল অনুরোধ কোড সহ ActivityResult পাঠানোর জন্য সমস্যা সৃষ্টি করা হয়েছে। ( if0b9d , b/249519359 )
  • একটি সমস্যা সমাধান করা হয়েছে যেখানে onBackStackChangeListener কলব্যাকগুলি লেনদেনের জন্য পাঠানো হচ্ছে যা আসলে ব্যাক স্ট্যাকের পরিবর্তন করে না যদি সেগুলি লেনদেনের সাথে মিশ্রিত হয়। ( I0eb5c , b/279306628 )

সংস্করণ 1.6.0-beta01

এপ্রিল 19, 2023

androidx.fragment:fragment-*:1.6.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-beta01-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • একটি টাইমআউটের সাথে postponeEnterTransition ব্যবহার করে এবং তারপর স্থগিত করা খণ্ডটি প্রতিস্থাপন করার ফলে আর স্থগিত খণ্ডটি ফাঁস হয় না। ( I2ec7d , b/276375110 )
  • নতুন onBackStackChangeStarted এবং onBackStackChangeCommitted কলব্যাকগুলি এখন শুধুমাত্র একটি খণ্ডকে একবারে প্রেরণ করবে, এমনকি একাধিক লেনদেনে একই টুকরো থাকলেও৷ ( IC6b69 )

সংস্করণ 1.6.0-alpha09

5 এপ্রিল, 2023

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 )
  • OnBackStackChangedListener onBackStackChangeStarted এবং onBackStackChangeCommitted কলব্যাকগুলি এখন শুধুমাত্র তখনই কার্যকর হয় যখন FragmentManager ব্যাক স্ট্যাক পরিবর্তন করা হয়। ( I66055 , b/274788957 )

সংস্করণ 1.6.0-alpha08

22 মার্চ, 2023

androidx.fragment:fragment-*:1.6.0-alpha08 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha08 এই কমিট ধারণ করে।

আচরণ পরিবর্তন

  • OnBackStackChangedListener.onBackStackChangeCommited কলব্যাকের সময়টি ফ্র্যাগমেন্ট অপারেশন চালানোর আগে কার্যকর করার জন্য সামঞ্জস্য করা হয়েছে। এটি নিশ্চিত করে যে কলব্যাকটি কখনই বিচ্ছিন্ন একটি অংশ পাস করা হবে না। ( I66a76 , b/273568280 )

বাগ ফিক্স

  • ফ্র্যাগমেন্ট 1.5.6 থেকে: একটি সমস্যা সমাধান করা হয়েছে যেখানে Lifecycle ইতিমধ্যেই STARTED থাকলে এবং ফলাফল ইতিমধ্যেই পাওয়া গেলে একটি setFragmentResultListener ভিতরে clearFragmentResultListener কল করা কাজ করবে না। ( if7458 )

নির্ভরতা আপডেট

সংস্করণ 1.6.0-alpha07

8 মার্চ, 2023

androidx.fragment:fragment-*:1.6.0-alpha07 প্রকাশিত হয়েছে। 1.6.0-alpha07 সংস্করণে এই কমিট রয়েছে।

বাগ ফিক্স

  • ফ্র্যাগমেন্ট 1.5.6 থেকে : একটি সমস্যা সমাধান করা হয়েছে যেখানে কোনও ফ্র্যাগমেন্ট অপসারণ, এটি মেনু আইটেম যোগ করেছে বা না করেছে, কার্যকলাপের মেনুটিকে বাতিল করে দেবে। ( 50f098 , b/244336571 )

সংস্করণ 1.6.0-alpha06

22 ফেব্রুয়ারি, 2023

androidx.fragment:fragment-*:1.6.0-alpha06 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha06 এই কমিট ধারণ করে।

আচরণ পরিবর্তন

  • FragmentManager এর onBackStackChangedListener এ নতুন onBackStackChangedStarted কলব্যাক এখন খণ্ডগুলি তাদের লক্ষ্য অবস্থায় যেতে শুরু করার আগে কার্যকর করা হবে। ( I34726 )

সংস্করণ 1.6.0-alpha05

ফেব্রুয়ারী 8, 2023

androidx.fragment:fragment-*:1.6.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.6.0-alpha05 এই কমিট ধারণ করে।

নতুন বৈশিষ্ট

  • FragmentManager.OnBackStackChagnedListener ইন্টারফেস এখন দুটি অতিরিক্ত কলব্যাক অফার করে, onBackStackChangeStarted এবং onBackStackChangeCommitted , যা FragmentManager এ ব্যাক স্ট্যাকের পরিবর্তন ঘটলে অতিরিক্ত তথ্য এবং নিয়ন্ত্রণের অনুমতি দেয়। ( Ib7ce5 , b/238686802 )

এপিআই পরিবর্তন

  • Fragment এবং FragmentManager APIগুলি যেগুলি একটি Intent বা IntentSender নেয় সেগুলি এখন @NonNull এর সাথে সঠিকভাবে টীকা করা হয়েছে যাতে একটি নাল মান পাস হওয়া রোধ করা না হয় কারণ একটি নাল মান সর্বদা অবিলম্বে সংশ্লিষ্ট অ্যান্ড্রয়েড ফ্রেমওয়ার্ক APIগুলিকে এই পদ্ধতিগুলি কল করে। ( I06fd4 )

সংস্করণ 1.6.0-alpha04

7 ডিসেম্বর, 2022

androidx.fragment:fragment-*:1.6.0-alpha04 প্রকাশিত হয়েছে। 1.6.0-alpha04 সংস্করণে এই কমিট রয়েছে।

নতুন বৈশিষ্ট

  • FragmentStrictMode একটি নতুন WrongNestedHierarchyViolation যোগ করেছে যা শনাক্ত করে যখন একটি শিশু খণ্ডটি পিতামাতার ভিউ অনুক্রমের মধ্যে নেস্ট করা হয়, কিন্তু পিতামাতার childFragmentManager যোগ করা হয় না। ( I72521 , b/249299268 )

আচরণ পরিবর্তন

  • টুকরা এখন onAttach() এর আগে তাদের SavedStateRegistry অবস্থা পুনরুদ্ধার করে, এটি নিশ্চিত করে যে এটি সমস্ত ঊর্ধ্বগামী জীবনচক্র পদ্ধতি থেকে উপলব্ধ। ( I1e2b1 )

এপিআই পরিবর্তন

  • 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

5 অক্টোবর, 2022

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() ওভাররাইডগুলিতে সুপার কল করতে হবে। ( I14798 , b/238928865 )

বাগ ফিক্স

  • নতুন প্রদানকারী কলব্যাক ইন্টারফেসগুলির একীকরণের কারণে স্থির রিগ্রেশনগুলি ( OnConfigurationChangedProvider , OnMultiWindowModeChangedProvider , OnTrimMemoryProvider , OnPictureInPictureModeChangedProvider ) যাতে খণ্ডগুলি সর্বদা সঠিক কলব্যাক পায় তা নিশ্চিত করতে৷ ( I9b380 , I34581 , ( I8dfe6 , b/242570955 ), If9d6b , Id0096 , I690b3 , I2cba2 )

সংস্করণ 1.6.0-alpha02

24 আগস্ট, 2022

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

জুলাই 27, 2022

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 s-এর সংরক্ষিত অবস্থাটি সম্পূর্ণরূপে ব্যক্তিগত লাইব্রেরি স্টেট (কাস্টম Parcelable ক্লাস) এবং বিকাশকারী দ্বারা প্রদত্ত রাজ্যের মধ্যে বিভক্ত করা হয়েছে, যা এখন সর্বদা একটি Bundle সংরক্ষিত থাকে যা একটি খণ্ডের অবস্থা ঠিক কোথায় উৎপন্ন হচ্ছে তা নির্ধারণ করতে দেয়। ( b/207158202 )

বাগ ফিক্স

  • ফ্র্যাগমেন্ট 1.5.1 থেকে : DialogFragmentCallbacksDetector এ একটি রিগ্রেশন ফিক্স করুন যেখানে AGP 7.4 এর সাথে বান্ডিল করা লিন্ট সংস্করণ ব্যবহার করলে লিন্ট ক্র্যাশ হবে। ( b/237567009 )

নির্ভরতা আপডেট

সংস্করণ 1.5

সংস্করণ 1.5.7

এপ্রিল 19, 2023

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 )

সংস্করণ 1.5.6

22 মার্চ, 2023

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 )

সংস্করণ 1.5.5

7 ডিসেম্বর, 2022

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 )

সংস্করণ 1.5.4

24 অক্টোবর, 2022

androidx.fragment:fragment:1.5.4 , androidx.fragment:fragment-ktx:1.5.4 , এবং androidx.fragment:fragment-testing:1.5.4 প্রকাশ করা হয়েছে। সংস্করণ 1.5.4 এই কমিট ধারণ করে.

বাগ ফিক্স

  • একটি ত্রুটি সংশোধন করা হয়েছে যেখানে একটি হোস্টের সাথে একটি কাস্টম FragmentController ব্যবহার করা হয়েছে যা একটি প্রদানকারীর কলব্যাক ইন্টারফেস প্রয়োগ করে না ( OnConfigurationChangedProvider , OnMultiWindowModeChangedProvider , OnTrimMemoryProvider , OnPictureInPictureModeChangedProvider এটির ফাংশন ডিসপ্রেচ করতে চাইল্ড ডিসপ্রিচ্পা ডিসপ্রিচ করতে চাইবে)। ( I9b380 )

সংস্করণ 1.5.3

21শে সেপ্টেম্বর, 2022

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 )

সংস্করণ 1.5.2

10 আগস্ট, 2022

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 )

সংস্করণ 1.5.1

জুলাই 27, 2022

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 এর সাথে বান্ডিল করা লিন্ট সংস্করণ ব্যবহার করলে লিন্ট ক্র্যাশ হবে। ( b/237567009 )

নির্ভরতা আপডেট

সংস্করণ 1.5.0

জুন 29, 2022

androidx.fragment:fragment:1.5.0 , androidx.fragment:fragment-ktx:1.5.0 , এবং androidx.fragment:fragment-testing:1.5.0 প্রকাশ করা হয়েছে। সংস্করণ 1.5.0 এই কমিট ধারণ করে.

1.4.0 থেকে গুরুত্বপূর্ণ পরিবর্তন

  • CreationExtras ইন্টিগ্রেশন - Fragment এখন লাইফসাইকেল 2.5.0 এর CreationExtras এর মাধ্যমে একটি স্টেটলেস ViewModelProvider.Factory ফ্যাক্টরি প্রদান করার ক্ষমতা রয়েছে।
  • কম্পোনেন্ট ডায়ালগ ইন্টিগ্রেশন - DialogFragment এখন ComponentDialog ব্যবহার করে Activity 1.5.0 এর মাধ্যমে onCreateDialog() দ্বারা প্রত্যাবর্তিত ডিফল্ট ডায়ালগ হিসেবে।
  • সংরক্ষিত ইনস্ট্যান্স স্টেট রিফ্যাক্টরিং - টুকরাগুলি তাদের ইনস্ট্যান্স স্টেট সংরক্ষণ করার উপায় পরিবর্তন করতে শুরু করেছে। এটি একটি প্রয়াস যাতে স্পষ্টভাবে সনাক্ত করা যায় যে কোন রাষ্ট্রটি টুকরো টুকরো এবং রাষ্ট্রের উৎসে সংরক্ষণ করা হয়েছে। বর্তমান পরিবর্তনগুলির মধ্যে নিম্নলিখিতগুলি অন্তর্ভুক্ত রয়েছে:
    • FragmentManager এখন তার সংরক্ষিত ইনস্ট্যান্স স্টেটকে সরাসরি কাস্টম Parcelable পরিবর্তে একটি Bundle সংরক্ষণ করে।
    • Fragment Result APIs এর মাধ্যমে সেট করা ফলাফলগুলি যেগুলি এখনও বিতরণ করা হয়নি সেগুলি এখন FragmentManager এর অভ্যন্তরীণ অবস্থা থেকে আলাদাভাবে সংরক্ষণ করা হয়েছে৷
    • প্রতিটি পৃথক খণ্ডের সাথে যুক্ত অবস্থা এখন FragmentManager -এর অভ্যন্তরীণ অবস্থা থেকে আলাদাভাবে সংরক্ষিত হয়েছে, এইভাবে আপনি Fragment ডিবাগ লগিং-এ উপস্থিত অনন্য আইডিগুলির সাথে একটি পৃথক খণ্ডের সাথে যুক্ত সংরক্ষিত অবস্থার পরিমাণকে পারস্পরিক সম্পর্ক স্থাপন করতে পারবেন।

অন্যান্য পরিবর্তন

  • FragmentStrictMode এখন ক্লাসের নামের সাথে allowViolation() ব্যবহার করে নির্দিষ্ট লঙ্ঘনের শাস্তি বাইপাস করার জন্য ব্যক্তিগত থার্ড-পার্টি ফ্র্যাগমেন্টের ক্ষমতা প্রদান করে।
  • আপনার ক্রিয়াকলাপের ActionBar একটি মেনু প্রদানের জন্য ফ্র্যাগমেন্ট এপিআইগুলি বাতিল করা হয়েছে৷ অ্যাক্টিভিটি 1.4.0 -তে যোগ করা MenuHost এবং MenuProvider APIগুলি একটি পরীক্ষাযোগ্য, জীবনচক্র সচেতন সমতুল্য API পৃষ্ঠ প্রদান করে যা খণ্ডগুলি ব্যবহার করা উচিত।

সংস্করণ 1.5.0-rc01

11 মে, 2022

androidx.fragment:fragment:1.5.0-rc01 , androidx.fragment:fragment-ktx:1.5.0-rc01 , এবং androidx.fragment:fragment-testing:1.5.0-rc01 প্রকাশ করা হয়েছে। 1.5.0-rc01 সংস্করণে এই কমিট রয়েছে।

সংরক্ষিত ইনস্ট্যান্স স্টেট রিফ্যাক্টরিং

  • প্রতিটি পৃথক খণ্ডের সাথে যুক্ত অবস্থা এখন FragmentManager -এর অভ্যন্তরীণ অবস্থা থেকে আলাদাভাবে সংরক্ষিত হয়েছে, এইভাবে আপনি ফ্র্যাগমেন্ট ডিবাগ লগিং -এ উপস্থিত অনন্য আইডিগুলির সাথে একটি পৃথক খণ্ডের সাথে যুক্ত সংরক্ষিত অবস্থার পরিমাণকে সম্পর্কযুক্ত করতে পারবেন৷ ( a153e0 , b/207158202 )

সংস্করণ 1.5.0-beta01

20 এপ্রিল, 2022

androidx.fragment:fragment:1.5.0-beta01 , androidx.fragment:fragment-ktx:1.5.0-beta01 , এবং androidx.fragment:fragment-testing:1.5.0-beta01 প্রকাশ করা হয়েছে। সংস্করণ 1.5.0-beta01-এ এই কমিট রয়েছে।

এপিআই পরিবর্তন

  • DialogFragment একটি নতুন dismissNow পদ্ধতি যোগ করেছে যা showNow ফাংশনের সাথে সমতার জন্য commitNow ব্যবহার করে। মনে রাখবেন যে এটি Dialog অবিলম্বে বরখাস্ত করবে না, এটি শুধুমাত্র FragmentManager অবস্থা সিঙ্ক্রোনাসভাবে আপডেট করবে। ( I15c36 , b/72644830 )

সংরক্ষিত ইনস্ট্যান্স স্টেট রিফ্যাক্টরিং

  • FragmentManager এখন তার সংরক্ষিত ইনস্ট্যান্স স্টেটকে সরাসরি কাস্টম Parcelable পরিবর্তে একটি Bundle সংরক্ষণ করে। ফ্র্যাগমেন্টস দ্বারা প্রকৃতপক্ষে যা সংরক্ষণ করা হচ্ছে তাতে অতিরিক্ত স্বচ্ছতা প্রদানের এটি প্রথম পদক্ষেপ। ( I93807 , b/207158202 )
  • Fragment Result API- এর মাধ্যমে সেট করা ফলাফলগুলি যেগুলি এখনও বিতরণ করা হয়নি সেগুলি এখন FragmentManager এর অভ্যন্তরীণ অবস্থা থেকে আলাদাভাবে সংরক্ষণ করা হয়েছে৷ এটি আপনার সংরক্ষিত দৃষ্টান্ত অবস্থার অংশ হিসাবে কী ফলাফলগুলি সংরক্ষণ করা হচ্ছে তাতে অতিরিক্ত স্বচ্ছতার অনুমতি দেবে। ( I6ea12 , b/207158202 )

সংস্করণ 1.5.0-alpha05

6 এপ্রিল, 2022

androidx.fragment:fragment:1.5.0-alpha05 , androidx.fragment:fragment-ktx:1.5.0-alpha05 , এবং androidx.fragment:fragment-testing:1.5.0-alpha05 প্রকাশ করা হয়েছে। 1.5.0-alpha05 সংস্করণে এই কমিট রয়েছে।

এপিআই পরিবর্তন

সংস্করণ 1.5.0-alpha04

23 মার্চ, 2022

androidx.fragment:fragment:1.5.0-alpha04 , androidx.fragment:fragment-ktx:1.5.0-alpha04 , এবং androidx.fragment:fragment-testing:1.5.0-alpha04 প্রকাশ করা হয়েছে। সংস্করণ 1.5.0-alpha04 এই কমিট ধারণ করে।

এপিআই পরিবর্তন

  • আপনার কার্যকলাপের ActionBar একটি মেনু প্রদানের জন্য ফ্র্যাগমেন্ট এপিআইগুলিকে অবমূল্যায়ন করা হয়েছে কারণ তারা আপনার ক্রিয়াকলাপের সাথে আপনার খণ্ডটিকে শক্তভাবে সংযুক্ত করে এবং বিচ্ছিন্নভাবে পরীক্ষাযোগ্য নয়৷ অ্যাক্টিভিটি 1.4.0-alpha01 এ যোগ করা MenuHost এবং MenuProvider APIগুলি একটি পরীক্ষাযোগ্য, জীবনচক্র সচেতন সমতুল্য API পৃষ্ঠ প্রদান করে যা খণ্ডগুলি ব্যবহার করা উচিত। ( I50a59 , I20758 )

বাগ ফিক্স

  • SavedStateViewFactory এখন CreationExtras ব্যবহার করে সমর্থন করে এমনকি যখন এটি একটি SavedStateRegistryOwner দিয়ে শুরু করা হয়েছিল। অতিরিক্ত প্রদান করা হলে, প্রাথমিক আর্গুমেন্ট উপেক্ষা করা হয়। ( I6c43b , b/224844583 )

সংস্করণ 1.5.0-alpha03

23 ফেব্রুয়ারি, 2022

androidx.fragment:fragment:1.5.0-alpha03 , androidx.fragment:fragment-ktx:1.5.0-alpha03 , এবং androidx.fragment:fragment-testing:1.5.0-alpha03 প্রকাশ করা হয়েছে। সংস্করণ 1.5.0-alpha03 এই কমিট ধারণ করে।

এপিআই পরিবর্তন

  • আপনি এখন by viewModels() এবং by activityViewModels() ফাংশনে CreationExtras পাস করতে পারেন। ( Ibefe7 , b/217601110 )

আচরণ পরিবর্তন

  • DialogFragment এখন ComponentDialog ব্যবহার করে ডিফল্ট ডায়ালগ হিসেবে যা onCreateDialog() দ্বারা প্রত্যাবর্তিত হয়। ( if3784 , b/217618170 )

সংস্করণ 1.5.0-alpha02

ফেব্রুয়ারী 9, 2022

androidx.fragment:fragment:1.5.0-alpha02 , androidx.fragment:fragment-ktx:1.5.0-alpha02 , এবং androidx.fragment:fragment-testing:1.5.0-alpha02 প্রকাশ করা হয়েছে। সংস্করণ 1.5.0-alpha02 এই কমিট ধারণ করে।

নতুন বৈশিষ্ট

  • FragmentStrictMode এখন ক্লাসের নামের সাথে allowViolation() ব্যবহার করে নির্দিষ্ট লঙ্ঘনের শাস্তি বাইপাস করার জন্য ব্যক্তিগত থার্ড-পার্টি ফ্র্যাগমেন্টের ক্ষমতা প্রদান করে। ( I8f678 )

সংস্করণ 1.5.0-alpha01

জানুয়ারী 26, 2022

androidx.fragment:fragment:1.5.0-alpha01 , androidx.fragment:fragment-ktx:1.5.0-alpha01 , এবং androidx.fragment:fragment-testing:1.5.0-alpha01 প্রকাশ করা হয়েছে। সংস্করণ 1.5.0-alpha01 এই কমিট ধারণ করে।

নতুন বৈশিষ্ট

বাগ ফিক্স

  • ফ্র্যাগমেন্ট 1.4.1 থেকে : যখন xml থেকে তৈরি ভিউ আইডির নেতিবাচক মান থাকে তখন FragmentContainerView আর একটি অবৈধ স্টেট ব্যতিক্রম নিক্ষেপ করে না। ( IC185b , b/213086140 )
  • খণ্ড 1.4.1 থেকে: by viewModels() অলস ফাংশন সহ একটি কাস্টম ownerProducer ল্যাম্বডা ব্যবহার করার সময়, এটি এখন সেই মালিকের কাছ থেকে defaultViewModelProviderFactory ব্যবহার করবে যদি কোনও কাস্টম ViewModelProvider.Factory সর্বদা খণ্ডের কারখানার পরিবর্তে সরবরাহ না করা হয়। ( I56170 , বি/214106513 )
  • একটি Fragment registerForActivityResult() কলব্যাক থেকে প্রথমবারের মতো ViewModel অ্যাক্সেস করার সময় একটি ক্র্যাশ স্থির করে। ( আইইএ 2 বি 3 )

সংস্করণ 1.4

সংস্করণ 1.4.1

জানুয়ারী 26, 2022

androidx.fragment:fragment:1.4.1 , androidx.fragment:fragment-ktx:1.4.1 , এবং androidx.fragment:fragment-testing:1.4.1 প্রকাশিত হয়েছে। সংস্করণ 1.4.1 এ এই কমিটস রয়েছে।

বাগ ফিক্স

  • এক্সএমএল থেকে উত্পন্ন ভিউ আইডিগুলির নেতিবাচক মান থাকে যখন FragmentContainerView আর কোনও অবৈধ রাষ্ট্রের ব্যতিক্রম ছুঁড়ে দেয় না। ( আইসি 185 বি , বি/213086140 )
  • by viewModels() অলস ফাংশন সহ একটি কাস্টম ownerProducer ল্যাম্বডা ব্যবহার করার সময়, এটি এখন যদি কোনও কাস্টম ViewModelProvider.Factory সর্বদা খণ্ডের কারখানাটি ব্যবহার না করে সরবরাহ করা হয় না তবে সেই মালিকের কাছ থেকে defaultViewModelProviderFactory ব্যবহার করবে। ( I56170 , বি/214106513 )

সংস্করণ 1.4.0

17 নভেম্বর, 2021

androidx.fragment:fragment:1.4.0 , androidx.fragment:fragment-ktx:1.4.0 , এবং androidx.fragment:fragment-testing:1.4.0 প্রকাশিত হয়েছে। সংস্করণ 1.4.0 এই কমিট ধারণ করে.

1.3.0 সাল থেকে গুরুত্বপূর্ণ পরিবর্তন

  • FragmentStrictMode এপিআইগুলি রানটাইম চেক সরবরাহ করে যা আপনাকে যাচাই করতে দেয় যে আপনার অ্যাপ্লিকেশন বা লাইব্রেরিগুলির উপর নির্ভর করে তা যাচাই করতে দেয় যে অবনমিত খণ্ড এপিআই কল করছে না। যখন কোনও লঙ্ঘন সনাক্ত করা হয়, আপনি কোনও লগ বার্তা মুদ্রণ করতে, আপনার নিজের কাস্টম শ্রোতার ট্রিগার করতে বা আপনার অ্যাপ্লিকেশনটি ক্র্যাশ করতে বেছে নিতে পারেন। FragmentStrictMode.Policy যা চেকগুলি সক্ষম করা হয় এবং কী "জরিমানা" ট্রিগার করা হয় তা নিয়ন্ত্রণ করে এমন নতুন setStrictModePolicy() পদ্ধতির মাধ্যমে একটি FragmentManager সেট করা যেতে পারে। এই নীতিটি সেই FragmentManager ক্ষেত্রে প্রযোজ্য এবং যে কোনও শিশু খণ্ড পরিচালকদের কাছে ট্রানজিটিভভাবে তাদের নিজস্ব অনন্য নীতি নির্ধারণ করে না। টুকরো টুকরো করার জন্য স্ট্রাইকমোড দেখুন।
  • FragmentContainerView এখন একটি getFragment() পদ্ধতি সরবরাহ করে যা সম্প্রতি ধারকটিতে যুক্ত হওয়া টুকরোটি ফেরত দেয়। এটি FragmentContainerView আইডি সহ findFragmentById() হিসাবে একই যুক্তি ব্যবহার করে তবে কলটি শৃঙ্খলার অনুমতি দেয়।

    val navController = binding.container.getFragment<NavHostFragment>().navController
    
  • FragmentScenario এখন Closeable প্রয়োগ করে, আপনাকে কোটলিনের use পদ্ধতি বা চেষ্টা-রিসোর্সগুলির সাথে ব্যবহার করার অনুমতি দেয়।

  • FragmentTransaction#TRANSIT_FRAGMENT_MATCH_ACTIVITY_{OPEN, CLOSE} যুক্ত করা হয়েছে যাতে টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো

  • FragmentManager.enableNewStateManager(boolean) পরীক্ষামূলক এপিআই

একাধিক ব্যাক স্ট্যাক

FragmentManager ফ্রেগমেন্ট লেনদেনের সমন্বয়ে গঠিত একটি ব্যাক স্ট্যাক বজায় রাখে যা addToBackStack() ব্যবহার করে। এটি আপনাকে সেই লেনদেনগুলি পপ করতে এবং পূর্ববর্তী অবস্থায় ফিরে আসতে দেয়, আপনার টুকরোগুলি তাদের রাজ্যকে যথাযথভাবে পুনরুদ্ধার করতে দেয় যাতে টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো

এই রিলিজটি তিনটি নতুন FragmentManager এপিআই সরবরাহ করে এই প্রক্রিয়াগুলিতে প্রসারিত হয়: saveBackStack(String name) , restoreBackStack(String name) এবং clearBackStack(String name) । এই এপিআইগুলি এই লেনদেনগুলিতে যুক্ত হওয়া প্রতিটি FragmentTransaction অবস্থা এবং প্রতিটি খণ্ডের অবস্থা বাঁচাতে addToBackStack() হিসাবে একই name ব্যবহার করে এবং আপনাকে পরবর্তীকালে সেই লেনদেনগুলি এবং তাদের টুকরোগুলি কৌশলগতভাবে পুনরুদ্ধার করতে দেয়। এটি আপনাকে বর্তমান ব্যাক স্ট্যাকটি সংরক্ষণ করে এবং একটি সংরক্ষিত ব্যাক স্ট্যাক পুনরুদ্ধার করে একাধিক ব্যাক স্ট্যাকের মধ্যে কার্যকরভাবে 'অদলবদল' করতে দেয়।

saveBackStack() popBackStack() এর সাথে একইভাবে পরিচালনা করে যে এটি অ্যাসিঙ্ক্রোনাস এবং ফলস্বরূপ সমস্ত খণ্ডের লেনদেনগুলি সেই নির্দিষ্ট নামটিতে বিপরীত হতে পারে ('পপড') এবং কোনও যুক্ত করা টুকরো ধ্বংস এবং অপসারণ করতে পারে, তবে এটি কয়েকটি পৃথক পৃথক গুরুত্বপূর্ণ উপায়:

  • saveBackStack() সর্বদা অন্তর্ভুক্ত থাকে।
  • popBackStack() এর বিপরীতে যা ব্যাক স্ট্যাকের সমস্ত লেনদেন পপ করবে যদি নির্দিষ্ট নামটি ব্যাক স্ট্যাকের উপরে না পাওয়া যায় বা যদি কোনও নাল নাম সরবরাহ করা হয় তবে saveBackStack() কিছু করে না যদি আপনি addToBackStack() সেই সঠিক, নন-নুল নাম সহ।
  • এই লেনদেনগুলি থেকে যুক্ত সমস্ত টুকরোগুলির অবস্থা সংরক্ষণ করা হয়। এর অর্থ হ'ল প্রতিটি খণ্ডের দৃশ্যের অবস্থা সংরক্ষণ করা হয়, প্রতিটি খণ্ডের onSaveInstanceState() বলা হয় এবং সেই রাষ্ট্রটি পুনরুদ্ধার করা হয়, এবং সেই টুকরোগুলির সাথে সম্পর্কিত যে কোনও ViewModel দৃষ্টান্তগুলি ধরে রাখা হয় (এবং onCleared() তাদের কাছে ডাকা হয় না )।

saveBackStack() এর সাথে ব্যবহার করা যেতে পারে এমন টুকরো লেনদেনগুলি অবশ্যই কিছু মানদণ্ড পূরণ করতে হবে:

  • প্রতিটি খণ্ড লেনদেন অবশ্যই একক, পারমাণবিক অপারেশন হিসাবে লেনদেনগুলি পুনরুদ্ধার করা যায় তা নিশ্চিত করতে setReorderingAllowed(true) ব্যবহার করতে হবে।
  • সংরক্ষিত লেনদেনের সেটটি অবশ্যই স্বনির্ভর হওয়া উচিত (অর্থাত্, তাদের অবশ্যই লেনদেনের সেটের বাইরে কোনও টুকরো স্পষ্টভাবে উল্লেখ করা উচিত নয় ) নিশ্চিত করার জন্য যে তারা পরবর্তী সময়ে পুনরুদ্ধার করা যেতে পারে, পিছনের স্ট্যাকটিতে কী পরিবর্তন হয়েছে তা বিবেচনা না করেই মধ্যবর্তী সময়ে।
  • সংরক্ষণ করা কোনও খণ্ডটি একটি রক্ষিত খণ্ড হতে পারে না বা তাদের সন্তানের টুকরোগুলির ট্রানজিটিভ সেটে একটি রক্ষিত খণ্ড থাকতে পারে না তা নিশ্চিত করার জন্য যে FragmentManager টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো

saveBackStack() , restoreBackStack() এবং clearBackStack() এর অনুরূপ, যা পূর্বে সংরক্ষিত ব্যাক স্ট্যাকটি পুনরুদ্ধার করবে বা যথাক্রমে পূর্বে সংরক্ষিত ব্যাক স্ট্যাকটি সাফ করবে, উভয়ই একই নামের সাথে saveBackStack() বলা না হলে উভয়ই কিছু করে না।

আরও তথ্যের জন্য, একাধিক ব্যাক স্ট্যাকগুলি দেখুন: একটি গভীর ডুব

সংস্করণ 1.4.0-rc01

3 নভেম্বর, 2021

androidx.fragment:fragment:1.4.0-rc01 খণ্ড থেকে কোনও পরিবর্তন ছাড়াই প্রকাশিত হয়েছে 1.4.0-BETA01। সংস্করণ 1.4.0-rc01-এ এই কমিট রয়েছে।

সংস্করণ 1.4.0-beta01

27 অক্টোবর, 2021

androidx.fragment:fragment:1.4.0-beta01 , androidx.fragment:fragment-ktx:1.4.0-beta01 , এবং androidx.fragment:fragment-testing:1.4.0-beta01 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-beta01-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • পিতামাতার টুকরোগুলি এখন তাদের নিজস্ব কলব্যাক চালু করার আগে তাদের পুরো শ্রেণিবিন্যাসকে নীচে নামিয়ে দেবে onHiddenChanged() । ( আইইডিসি 20 , বি/77504618 )
  • পুনর্ব্যবহারকারী ভিউ সহ একটি খোলা কীবোর্ড সহ একটি খণ্ড থেকে যাওয়ার সময় কীবোর্ডটি এখন স্বয়ংক্রিয়ভাবে বন্ধ হয়ে যাবে। ( I8b842 , বি/196852211 )
  • DialogFragment এখন আপনি যখন show() , showNow() , বা dismiss() কল করার সময় এটি তৈরি করে এমন সমস্ত লেনদেনের জন্য setReorderingAllowed(true) ব্যবহার করে। ( আই 2 সি 14 )
  • DetachAndAttachFragmentInSameFragmentTransaction ট্রান্সঅ্যাকশনটির অত্যন্ত দীর্ঘ লিন্ট সতর্কতাটি সংক্ষিপ্ত করে DetachAndAttachSameFragment সংক্ষিপ্ত করা হয়েছে। ( E9ECA3 )

সংস্করণ 1.4.0-আলফা 10

29 সেপ্টেম্বর, 2021

androidx.fragment:fragment:1.4.0-alpha10 , androidx.fragment:fragment-ktx:1.4.0-alpha10 , এবং androidx.fragment:fragment-testing:1.4.0-alpha10 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-আলফা 10 এ এই কমিটগুলি রয়েছে।

লিন্ট

  • একই FragmentTransaction একই Fragment detach() এবং attach() সংযুক্ত করে সনাক্ত করার জন্য DetachAndAttachFragmentInSameFragmentTransaction ট্রান্সঅ্যাকশন লিন্ট সতর্কতা যুক্ত করেছেন - কারণ এই পরিপূরক ক্রিয়াকলাপগুলি একই লেনদেনে সম্পন্ন করার সময় একে অপরকে বাতিল করে দিতে হবে, আসলে তাদের পৃথক লেনদেনে বিভক্ত করা উচিত, কিছু। ( এওএসপি/1832956 , বি/200867930 )
  • MenuHost addMenuProvider এপিআই ব্যবহার করার সময় FragmentAddMenuProvider টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো। ( এওএসপি/1830457 , বি/200326272 )

ডকুমেন্টেশন আপডেট

  • এপিআইগুলির জন্য অবমূল্যায়নের বার্তাটি এখন ক্রিয়াকলাপের ফলাফল এপিআই দ্বারা পরিচালিত, যথা startActivityForResult , startIntentSenderForResult , onActivityResult , requestPermissions এবং onRequestPermissionsResult , আরও বিশদ দিয়ে প্রসারিত করা হয়েছে। ( সিসিই 80 এফ )
  • উভয় Fragment এবং DialogFragment জন্য onActivityCreated() এর জন্য অবমূল্যায়ন বার্তাটি আরও বিশদ সহ প্রসারিত করা হয়েছে। ( 224 ডিবি 4 )

সংস্করণ 1.4.0-আলফা 09

15 সেপ্টেম্বর, 2021

androidx.fragment:fragment:1.4.0-alpha09 , androidx.fragment:fragment-ktx:1.4.0-alpha09 , এবং androidx.fragment:fragment-testing:1.4.0-alpha09 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-ALPHA09 এ এই কমিটস রয়েছে।

নতুন বৈশিষ্ট

  • আপনি এখন saveBackStack(name) clearBackStack(name) (নাম) কল করতে পারেন। ( I70cd7 )

এপিআই পরিবর্তন

  • FragmentContainerView ক্লাসটি কোটলিনে পুনরায় লিখিত হয়েছে তা নিশ্চিত করে যে getFragment ফাংশনটি যথাযথভাবে নালিবিলিটিকে সম্মান করবে। ( If694a , খ/189629145 )
  • ফ্রেগমেন্টস্ট্রিকমোড এখন কোটলিনে লেখা হয়েছে ( আই 11767 , বি/199183506 )

বাগ ফিক্স

  • এমন একটি সমস্যা স্থির করা হয়েছে যেখানে setReorderingAllowed(true) দিয়ে যুক্ত করা একটি খণ্ডের অবস্থা এবং তারপরে মুলতুবি লেনদেন কার্যকর করার আগে অবিলম্বে সরানো হয়েছিল সঠিকভাবে পরিষ্কার করা হবে না। ( I8ccb8 )

সংস্করণ 1.4.0-alpha08

1 সেপ্টেম্বর, 2021

androidx.fragment:fragment:1.4.0-alpha08 , androidx.fragment:fragment-ktx:1.4.0-alpha08 , এবং androidx.fragment:fragment-testing:1.4.0-alpha08 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-ALPHA08 এ এই কমিটগুলি রয়েছে।

বাগ ফিক্স

  • রিডানড্যান্ট প্রথম বন্ধনীকে আরও ভালভাবে পরিচালনা করতে UseRequireInsteadOfGet লিন্ট চেক উন্নত। ( I2d865 )
  • অতিরিক্ত প্রান্তের কেসগুলি পরিচালনা করতে UseGetLayoutInflater লিন্ট চেকটি উন্নত করুন। ( Ie5423 )

সংস্করণ 1.4.0-আলফা 07

18 আগস্ট, 2021

androidx.fragment:fragment:1.4.0-alpha07 , androidx.fragment:fragment-ktx:1.4.0-alpha07 , এবং androidx.fragment:fragment-testing:1.4.0-alpha07 কোনও উল্লেখযোগ্য পরিবর্তন ছাড়াই প্রকাশিত হয় না। সংস্করণ 1.4.0-ALPHA07 এর মধ্যে এই কমিটগুলি রয়েছে।

সংস্করণ 1.4.0-alpha06

4 আগস্ট, 2021

androidx.fragment:fragment:1.4.0-alpha06 , androidx.fragment:fragment-ktx:1.4.0-alpha06 , এবং androidx.fragment:fragment-testing:1.4.0-alpha06 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-ALPHA06 এর মধ্যে এই কমিট রয়েছে।

বাগ ফিক্স

  • পিছনে স্ট্যাকগুলির মধ্যে দ্রুত অদলবদল করার সময় একাধিক ব্যাক স্ট্যাকের সাথে একটি সমস্যা স্থির করা হয়েছে যা একটি FragmentTransaction পুনরুদ্ধার করার সময় বা একটি খণ্ডের দ্বিতীয় অনুলিপি হিসাবে উপস্থিত হওয়ার সময় একটি IllegalStateException হিসাবে উপস্থিত হবে। ( I9039f )
  • এমন একটি সমস্যা স্থির করা হয়েছে যেখানে FragmentManager সেই রাজ্যটি পুনরুদ্ধার হওয়ার পরেও saveBackStack() এর মাধ্যমে সংরক্ষণ করা রাজ্যের একটি অনুলিপি ধরে রাখবে। ( আইইডি 212 )
  • DialogFragment জন্য dismissAllowingStateLoss() পদ্ধতিটি যখন আপনি শোয়ের পরে কল করার পরে এটি কল করার পরে এটি কল করার পরে আর ক্র্যাশ হয় না যখন বিশেষত show(FragmentTransaction, String) পদ্ধতির মাধ্যমে ডায়ালগফ্র্যাগমেন্ট যুক্ত করে। ( I84422 )

সংস্করণ 1.4.0-আলফা 05

জুলাই 21, 2021

androidx.fragment:fragment:1.4.0-alpha05 , androidx.fragment:fragment-ktx:1.4.0-alpha05 , এবং androidx.fragment:fragment-testing:1.4.0-alpha05 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-ALPHA05 এ এই কমিটগুলি রয়েছে।

বাগ ফিক্স

নির্ভরতা আপডেট

সংস্করণ 1.4.0-আলফা 04

৩০ জুন, ২০২১

androidx.fragment:fragment:1.4.0-alpha04 , androidx.fragment:fragment-ktx:1.4.0-alpha04 , এবং androidx.fragment:fragment-testing:1.4.0-alpha04 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-ALPHA04 এ এই কমিটগুলি রয়েছে।

এপিআই পরিবর্তন

  • FragmentManager এখন তার রাজ্য বাঁচাতে হুডের নীচে SavedStateRegistry ব্যবহার করে। saveAllState() এবং restoreSavedState() পদ্ধতিগুলিও FragmentController অবমূল্যায়ন করা হয়েছে। আপনি যদি FragmentActivity বাইরে টুকরো টুকরো FragmentController টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো FragmentHostCallbacks টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো SavedStateRegistryOwner ( আইবিএ 68 ই , বি/188734238 )

বাগ ফিক্স

  • একাধিক ব্যাক স্ট্যাককে সমর্থন করার অংশ হিসাবে saveBackStack() এর কলটি এমন একটি সমস্যা স্থির করেছে যেখানে একই সাথে একটি FragmentTransaction চালানোর মতো একই সময়ে করা হয়েছিল যা replace() ব্যবহার করা হয়েছিল। ( I73137 )
  • একাধিক ব্যাক স্ট্যাক সমর্থনের জন্য restoreBackStack() এপিআই ব্যবহার করার সময় একাধিক লেনদেন ধারণ করে এমন একটি সংরক্ষিত ব্যাক স্ট্যাকটি ম্যানুয়ালি পুনরুদ্ধার করার পরে ঘটবে এমন একটি NullPointerException স্থির করে। এটি এমন একটি সমস্যাও সমাধান করেছে যেখানে setReorderingAllowed(true) সমস্ত লেনদেনের জন্য পরীক্ষা করা হচ্ছে না। ( I8c593 )
  • এমন একটি সমস্যা স্থির করা হয়েছে যেখানে FragmentManager ভুলভাবে টুকরো FragmentManager টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো ( I1fb8e )

সংস্করণ 1.4.0-আলফা 03

16 জুন, 2021

androidx.fragment:fragment:1.4.0-alpha03 , androidx.fragment:fragment-ktx:1.4.0-alpha03 , এবং androidx.fragment:fragment-testing:1.4.0-alpha03 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-Alpha03 এ এই কমিটগুলি রয়েছে।

নতুন বৈশিষ্ট

  • সমস্ত খণ্ডিত স্ট্রিটমোড Violation ক্লাসগুলি আরও বিশদ ত্রুটি বার্তাগুলির সাথে আপডেট করা হয়েছে যা লঙ্ঘনের বিশদটি ব্যাখ্যা করে। ( বি/187871638 )
    • FragmentTagUsageViolation এখন আরও বিশদ ত্রুটি বার্তা রয়েছে যা পিতামাতার ধারকটিকে ধারক করে যা খণ্ডটি যুক্ত করা হত। ( আইসি 33 এ 7 )
    • WrongFragmentContainerViolation এখন আরও বিস্তারিত ত্রুটি বার্তা রয়েছে যার মধ্যে খণ্ডটি যুক্ত করা হচ্ছে এমন ধারকটি অন্তর্ভুক্ত রয়েছে। ( আইবি 55 এফ 8 )
    • TargetFragmentUsageViolation জন্য ব্যবহারের কেস ক্লাসগুলিতে এখন লঙ্ঘনের কারণ এবং অন্য কোনও অন্তর্ভুক্ত তথ্য অন্তর্ভুক্ত করার জন্য আরও বিশদ ত্রুটি বার্তা রয়েছে। ( আইসিসি 6 এসি )
    • RetainInstanceUsageViolation প্রসারিত ক্লাসগুলিতে এখন আরও বিশদ ত্রুটি বার্তা রয়েছে যা লঙ্ঘনের কারণ হিসাবে খণ্ডটি অন্তর্ভুক্ত করে। ( I6bd55 )
    • FragmentReuseViolation এখন আরও বিশদ ত্রুটি বার্তা রয়েছে যা খণ্ডের পূর্ববর্তী আইডি অন্তর্ভুক্ত করে। ( I28ce2 )
    • SetUserVisibleHintViolation এখন আরও বিশদ ত্রুটি বার্তা রয়েছে যা ব্যবহারকারী দৃশ্যমান ইঙ্গিতটি কী সেট করা হচ্ছে তা অন্তর্ভুক্ত করে। ( আইবি 2 ডি 5 এফ )

আচরণ পরিবর্তন

  • একটি FragmentContainerView fitsSystemWindows কল করার ক্ষেত্রে নিষেধাজ্ঞাকে ফিরিয়ে দিয়েছে - এটি আপনার অ্যাপটিকে আর ক্র্যাশ করে না। ( 6 বি 8 ডিডিডি , বি/190622202 )

বাগ ফিক্স

  • খণ্ড থেকে 1.3.5 থেকে: এওএসপি/1679887 দ্বারা খণ্ড 1.3.4 এ প্রবর্তিত ভাগ করা উপাদান ট্রানজিশনে একটি রিগ্রেশন স্থির করা হয়েছে। টুকরোগুলি এখন সঠিকভাবে ট্রানজিশন গ্রুপগুলি পরিচালনা করে (হয় সরাসরি transitionGroup="true" বা পরোক্ষভাবে একটি transitionName বা background মাধ্যমে সেট করা) এবং ভাগ করা উপাদানগুলি আর IndexOutOfBoundsException এস নিক্ষেপ করবে না। ( I16484 , বি/188679569 , বি/188969304 )
  • আপনি যখন কোনও অপসারণ খণ্ডকে আড়াল করার চেষ্টা করেন তখন FragmentManager আর ক্র্যাশ হবে না। ( I573dd , খ/183634730 )
  • শীর্ষ স্তরের ভেরিয়েবলের মূল্যায়ন করার সময় OnCreateDialogIncorrectCallback লিন্ট চেক আর ক্র্যাশ হবে না। ( 0 এ 9 এফএ , বি/189967522 )

সংস্করণ 1.4.0-আলফা 02

2 জুন, 2021

androidx.fragment:fragment:1.4.0-alpha02 , androidx.fragment:fragment-ktx:1.4.0-alpha02 , এবং androidx.fragment:fragment-testing:1.4.0-alpha02 প্রকাশিত হয়েছে। সংস্করণ 1.4.0-ALPHA02 এ এই কমিটগুলি রয়েছে।

নতুন বৈশিষ্ট

  • বর্তমান কঠোর মোড নীতি ব্যবহার করা নির্বিশেষে লগিং FragmentManager মাধ্যমে সক্ষম করা হলে FragmentStrictMode এখন সর্বদা লঙ্ঘন লগ করবে। ( I02df6 , বি/187872638 )
  • FragmentStrictMode এখন কঠোর মোড Violation থেকে নির্দিষ্ট Fragment ক্লাসকে ছাড় দেওয়ার পক্ষে সমর্থন করে যে শ্রেণিকে কোনও জরিমানা বাইপাস করতে দেয়। ( আইবি 4 ই 5 ডি , বি/184786736 )

  • প্রতিটি লঙ্ঘনের ভিত্তিতে কাঠামোর তথ্য যুক্ত করতে FragmentStrictMode Violation শ্রেণিটি প্রসারিত করা হয়েছে। এটি আপনাকে লঙ্ঘনকারী খণ্ড ( আইএফ 5118 , বি/187871150 ) এর সাথে লঙ্ঘনের কারণে ঠিক কী কারণে ঘটেছে তা যাচাই করতে দেয়, প্রতিটি Violation নিম্নলিখিত রয়েছে:

    • WrongFragmentContainerViolation এখন ViewGroup রয়েছে যা Fragment যুক্ত করার চেষ্টা করছে। ( I83c75 , বি/187871150 )
    • TargetFragmentUsageViolation প্রসারিত করা হয়েছে, SetTargetFragmentUsageViolation , GetTargetFragmentUsageViolation এবং GetTargetFragmentRequestCodeUsageViolation , লক্ষ্য খণ্ড এবং অনুরোধ কোডযুক্ত SetTargetFragmentUsageViolation সহ। ( I741b4 , বি/187871150 )
    • SetUserVisibleHintViolation এখন বুলিয়ান মানটি setUserVisibleHint() এ পাস করা রয়েছে। ( I00585 , বি/187871150 )
    • FragmentTagUsageViolation এখন ভিউগ্রুপ রয়েছে যে <fragment> ট্যাগটি একটি খণ্ডকে স্ফীত করার চেষ্টা করছে (( আই 5 ডিবিবিসি , বি/187871150 )
    • FragmentReuseViolation এখন Fragment পূর্ববর্তী উদাহরণের অনন্য আইডি রয়েছে যা ভাইরেশনকে সৃষ্টি করেছিল। ( I0544d , খ/187871150 )
    • RetainInstanceUsageViolation এখন বিমূর্ত এবং দুটি সাবক্লাস রয়েছে, SetRetainInstanceUsageViolation এবং GetRetainInstanceUsageViolation , যা লঙ্ঘনের ধরণের জন্য দুটি কেসকে উপস্থাপন করে। ( আইসি 81 ই 5 , বি/187871150 )

আচরণ পরিবর্তন

  • fitsSystemWindow অ্যাট্রিবিউট প্রোগ্রামেভাবে বা এক্সএমএল এর মাধ্যমে পরিবর্তন করার চেষ্টা করার সময় FragmentContainerView এখন একটি ব্যতিক্রম ছুঁড়ে দেয়। পোকামাকড় প্রতিটি পৃথক খণ্ডের দৃশ্য দ্বারা পরিচালনা করা উচিত। ( Ie6651 , খ/187304502 )

সংস্করণ 1.4.0-alpha01

18 মে, 2021

androidx.fragment:fragment:1.4.0-alpha01 , androidx.fragment:fragment-ktx:1.4.0-alpha01 , এবং androidx.fragment:fragment-testing:1.4.0-alpha01 প্রকাশিত হয়েছে। 1.4.0-alpha01 সংস্করণে এই কমিট রয়েছে।

নতুন বৈশিষ্ট

  • FragmentContainerView এখন একটি getFragment() পদ্ধতি সরবরাহ করে যা সম্প্রতি ধারকটিতে যুক্ত হওয়া টুকরোটি ফেরত দেয়। এটি FragmentContainerView আইডি সহ findFragmentById() হিসাবে একই যুক্তি ব্যবহার করে তবে কলটি শৃঙ্খলার অনুমতি দেয়। ( আইএফই 17 এ , বি/162527857 )

    val navController = binding.container.getFragment<NavHostFragment>().navController
    
  • FragmentTransaction#TRANSIT_FRAGMENT_MATCH_ACTIVITY_{OPEN, CLOSE} যুক্ত করা হয়েছে যাতে টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো ( I46652 )

একাধিক ব্যাক স্ট্যাক

FragmentManager ফ্রেগমেন্ট লেনদেনের সমন্বয়ে গঠিত একটি ব্যাক স্ট্যাক বজায় রাখে যা addToBackStack() ব্যবহার করে। এটি আপনাকে সেই লেনদেনগুলি পপ করতে এবং পূর্ববর্তী অবস্থায় ফিরে আসতে দেয়, আপনার টুকরোগুলি তাদের রাজ্যকে যথাযথভাবে পুনরুদ্ধার করতে দেয় যাতে টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো

এই রিলিজটি দুটি নতুন FragmentManager এপিআই সরবরাহ করে এই প্রক্রিয়াগুলিতে প্রসারিত হয়: saveBackStack(String name) এবং restoreBackStack(String name) । এই এপিআইগুলি এই লেনদেনগুলিতে যুক্ত হওয়া প্রতিটি FragmentTransaction অবস্থা এবং প্রতিটি খণ্ডের অবস্থা বাঁচাতে addToBackStack() হিসাবে একই name ব্যবহার করে এবং আপনাকে পরবর্তীকালে সেই লেনদেনগুলি এবং তাদের টুকরোগুলি কৌশলগতভাবে পুনরুদ্ধার করতে দেয়। এটি আপনাকে বর্তমান ব্যাক স্ট্যাকটি সংরক্ষণ করে এবং একটি সংরক্ষিত ব্যাক স্ট্যাক পুনরুদ্ধার করে একাধিক ব্যাক স্ট্যাকের মধ্যে কার্যকরভাবে 'অদলবদল' করতে দেয়।

saveBackStack() popBackStack() এর সাথে একইভাবে পরিচালনা করে যে এটি অ্যাসিঙ্ক্রোনাস এবং ফলস্বরূপ সমস্ত খণ্ডের লেনদেনগুলি সেই নির্দিষ্ট নামটিতে বিপরীত হতে পারে ('পপড') এবং কোনও যুক্ত করা টুকরো ধ্বংস এবং অপসারণ করতে পারে, তবে এটি কয়েকটি পৃথক পৃথক গুরুত্বপূর্ণ উপায়:

  • saveBackStack() সর্বদা অন্তর্ভুক্ত থাকে।
  • popBackStack() এর বিপরীতে যা ব্যাক স্ট্যাকের সমস্ত লেনদেন পপ করবে যদি নির্দিষ্ট নামটি ব্যাক স্ট্যাকের উপরে না পাওয়া যায় বা যদি কোনও নাল নাম সরবরাহ করা হয় তবে saveBackStack() কিছু করে না যদি আপনি addToBackStack() সেই সঠিক, নন-নুল নাম সহ।
  • এই লেনদেনগুলি থেকে যুক্ত সমস্ত টুকরোগুলির অবস্থা সংরক্ষণ করা হয়। এর অর্থ হ'ল প্রতিটি খণ্ডের দৃশ্যের অবস্থা সংরক্ষণ করা হয়, প্রতিটি খণ্ডের onSaveInstanceState() বলা হয় এবং সেই রাষ্ট্রটি পুনরুদ্ধার করা হয়, এবং সেই টুকরোগুলির সাথে সম্পর্কিত যে কোনও ViewModel দৃষ্টান্তগুলি ধরে রাখা হয় (এবং onCleared() তাদের কাছে ডাকা হয় না )।

saveBackStack() এর সাথে ব্যবহার করা যেতে পারে এমন টুকরো লেনদেনগুলি অবশ্যই কিছু মানদণ্ড পূরণ করতে হবে:

  • প্রতিটি খণ্ড লেনদেন অবশ্যই একক, পারমাণবিক অপারেশন হিসাবে লেনদেনগুলি পুনরুদ্ধার করা যায় তা নিশ্চিত করতে setReorderingAllowed(true) ব্যবহার করতে হবে।
  • সংরক্ষিত লেনদেনের সেটটি অবশ্যই স্বনির্ভর হওয়া উচিত (অর্থাত্, তাদের অবশ্যই লেনদেনের সেটের বাইরে কোনও টুকরো স্পষ্টভাবে উল্লেখ করা উচিত নয় ) নিশ্চিত করার জন্য যে তারা পরবর্তী সময়ে পুনরুদ্ধার করা যেতে পারে, পিছনের স্ট্যাকটিতে কী পরিবর্তন হয়েছে তা বিবেচনা না করেই মধ্যবর্তী সময়ে।
  • সংরক্ষণ করা কোনও খণ্ডটি একটি রক্ষিত খণ্ড হতে পারে না বা তাদের সন্তানের টুকরোগুলির ট্রানজিটিভ সেটে একটি রক্ষিত খণ্ড থাকতে পারে না তা নিশ্চিত করার জন্য যে FragmentManager টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো

saveBackStack() এর অনুরূপ, restoreBackStack() আপনি যদি একই নামের সাথে saveBackStack() না বলে থাকেন তবে কিছুই করেন না। ( খ/80029773 )

টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো

FragmentStrictMode এপিআইগুলি রানটাইম চেক সরবরাহ করে যা আপনাকে যাচাই করতে দেয় যে আপনার অ্যাপ্লিকেশন বা লাইব্রেরিগুলির উপর নির্ভর করে তা যাচাই করতে দেয় যে অবনমিত খণ্ড এপিআই কল করছে না। যখন কোনও লঙ্ঘন সনাক্ত করা হয়, আপনি কোনও লগ বার্তা মুদ্রণ করতে, আপনার নিজের কাস্টম শ্রোতার ট্রিগার করতে বা আপনার অ্যাপ্লিকেশনটি ক্র্যাশ করতে বেছে নিতে পারেন। FragmentStrictMode.Policy যা চেকগুলি সক্ষম করা হয় এবং কী "জরিমানা" ট্রিগার করা হয় তা নিয়ন্ত্রণ করে এমন নতুন setStrictModePolicy() পদ্ধতির মাধ্যমে একটি FragmentManager সেট করা যেতে পারে। এই নীতিটি সেই FragmentManager ক্ষেত্রে প্রযোজ্য এবং যে কোনও শিশু খণ্ড পরিচালকদের কাছে ট্রানজিটিভভাবে তাদের নিজস্ব অনন্য নীতি নির্ধারণ করে না। ( #123 , #131 , #150 , খ/143774122 )

  • detectFragmentReuse() সনাক্ত করে যে পূর্বে সরানো Fragment উদাহরণটি কোনও FragmentManager পুনরায় যুক্ত করা হচ্ছে কিনা তা সনাক্ত করে। কোনও টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো Fragment টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো FragmentManager ( #142 , বি/153738653 )
  • আপনি যখন আপনার লেআউট এক্সএমএল -এ <fragment> detectFragmentTagUsage() ব্যবহার করছেন তখন সনাক্ত করে সনাক্ত করে। আপনার বিন্যাসের অংশ হিসাবে টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো FragmentContainerView টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো ( #141 , বি/153738235 )
  • আপনি যখন কোনও ধারকটিতে একটি খণ্ড যুক্ত করেন তখন সনাক্ত করে সনাক্ত detectWrongFragmentContainer() সনাক্ত করে সনাক্ত করে FragmentContainerView আপনার সর্বদা আপনার লেআউটে খণ্ডগুলির জন্য ধারক হিসাবে FragmentContainerView ব্যবহার করা উচিত। ( #146 , বি/181137036 )
  • আপনি যখন অবমূল্যায়িত setRetainInstance() বা getRetainInstance() APIS ব্যবহার করেন তখন detectRetainInstanceUsage() করে সনাক্ত করে সনাক্ত করে। ( #140 , বি/153737954 )
  • আপনি যখন অবমূল্যায়িত সেটসারভিসিবলহিন্ট () এপিআই ব্যবহার করেন তখন detectSetUserVisibleHint() setUserVisibleHint() করে। ( #136 , বি/153738974 )
  • আপনি যখন অবমূল্যায়িত setTargetFragment() , getTargetFragment() বা getTargetRequestCode() APIS ব্যবহার করেন তখন detectTargetFragmentUsage() সনাক্ত করে সনাক্ত করে। ( #139 , বি/153737745 )

এপিআই পরিবর্তন

নতুন লিন্ট চেক

  • DialogFragment মধ্যে UseGetLayoutInflater LayoutInflater.from(Context) getLayoutInflater() করার সময় ব্যবহার করার সময় LayoutInflater করে ব্যবহার করুন use ( #156 , বি/170781346 )
  • DialogFragmentCallbacksDetector লিন্ট চেক এখন সতর্ক করে দেয় যখন DialogFragment onCreateDialog() পদ্ধতিতে setOnCancelListener বা setOnDismissListener কল করার সময় সতর্ক করে দেয় - এই শ্রোতাদের নিজেই মালিকানাধীন DialogFragment মালিকানাধীন এবং আপনার এই কলব্যাকসকে onCancel() এবং onDismiss() ওভাররাইড করা উচিত। ( #171 , বি/181780047 , বি/187524311 )

বাগ ফিক্স

  • খণ্ড ১.৩.৪ থেকে: ViewTreeViewModelStoreOwner.get() বা ViewModelProvider বা জেটপ্যাক কমপোজ পদ্ধতিটি একটি খণ্ডের অভ্যন্তরে viewModel() এর জেটপ্যাক রচনা পদ্ধতি ব্যবহার করার সময় খণ্ড 1.3.3 এ প্রবর্তিত একটি রিগ্রেশন স্থির করা হয়েছে। এই ব্যবহারগুলি এখন সঠিকভাবে ViewModelProvider.Factory ব্যবহার করে your আপনার খণ্ডটি সরবরাহ করা ফ্যাক্টরিটি যদি এটি getDefaultViewModelProviderFactory() (যেমন @AndroidEntryPoint টীকাযুক্ত টুকরোগুলি হিল্ট ব্যবহার করার সময় করে) ওভাররাইড করে। আপনি যদি সেই পদ্ধতিটিকে ওভাররাইড না করেন তবে একটি SavedStateViewModelFactory যা খণ্ডের দৃশ্যের পাশাপাশি তার অবস্থা সংরক্ষণ এবং পুনরুদ্ধার করে তা ডিফল্ট কারখানা হিসাবে তৈরি করা হয়েছে। ( I5cbfa , খ/186097368 )
  • খণ্ড ১.৩.৪ থেকে: এপিআই ২৯ -এ FragmentContainerView ব্যবহার করার সময়, পোকামাকড়গুলি আর অনির্দিষ্টকালের জন্য প্রেরণ করবে না, BottomNavigationBar এবং FloatingActionButton উদাহরণগুলির সাথে সমস্যাগুলি ঠিক করবে। ( I1bb78 , খ/186012452 )
  • খণ্ড ১.৩.৪ থেকে: আপনি এখন প্রক্রিয়া মৃত্যুর পরে খণ্ডের ফলাফলের বান্ডিল থেকে আপনার পার্সেলেবলটি পুনরুদ্ধার করতে পারেন। ( I65932 , বি/187443158 )
  • খণ্ড থেকে ১.৩.৪ থেকে: ভিউগ্রুপে একটি ভাগ করা উপাদান রূপান্তর করার সময়, যদি ভিউগ্রুপে transitionGroup মিথ্যা হিসাবে সেট করা থাকে তবে এটি এখন সঠিকভাবে স্থানান্তরিত হবে। ( I99675 )

বাহ্যিক অবদান

সংস্করণ 1.3

সংস্করণ 1.3.6

জুলাই 21, 2021

androidx.fragment:fragment:1.3.6 , androidx.fragment:fragment-ktx:1.3.6 , এবং androidx.fragment:fragment-testing:1.3.6 প্রকাশিত হয়েছে। সংস্করণ 1.3.6 এই কমিট ধারণ করে.

বাগ ফিক্স

  • খণ্ড 1.4.0-alpha03 থেকে: আপনি যখন কোনও অপসারণ খণ্ডটি আড়াল করার চেষ্টা করেন তখন FragmentManager আর ক্র্যাশ হবে না। ( I573dd , খ/183634730 )
  • মূল ভিউটি যখন রুট ভিউতে transitionGroup=”true” সেট থাকে তখন GONE hide() ব্যবহার করার সময় খণ্ডটির দৃশ্যটি এখন সঠিকভাবে সেট করা আছে। ( এওএসপি/1766655 , বি/193603427 )
  • লাইফসাইকেল কলব্যাকস এটি ওভাররাইডে প্রথম অপারেশন হিসাবে এখন FragmentActivity সর্বদা সংরক্ষিত রাষ্ট্রকে আনলক করে। ( I6db7a )

নির্ভরতা আপডেট

সংস্করণ 1.3.5

16 জুন, 2021

androidx.fragment:fragment:1.3.5 , androidx.fragment:fragment-ktx:1.3.5 , এবং androidx.fragment:fragment-testing:1.3.5 প্রকাশিত হয়েছে। সংস্করণ 1.3.5 এই কমিট ধারণ করে.

বাগ ফিক্স

  • এওএসপি/1679887 দ্বারা খণ্ড 1.3.4 এ প্রবর্তিত ভাগ করা উপাদান ট্রানজিশনে একটি রিগ্রেশন স্থির করে। টুকরোগুলি এখন সঠিকভাবে ট্রানজিশন গ্রুপগুলি পরিচালনা করে (হয় সরাসরি transitionGroup="true" বা পরোক্ষভাবে একটি transitionName বা background মাধ্যমে সেট করা) এবং ভাগ করা উপাদানগুলি আর IndexOutOfBoundsException এস নিক্ষেপ করবে না। ( I16484 , বি/188679569 , বি/188969304 )

সংস্করণ 1.3.4

18 মে, 2021

androidx.fragment:fragment:1.3.4 , androidx.fragment:fragment-ktx:1.3.4 , এবং androidx.fragment:fragment-testing:1.3.4 প্রকাশিত হয়েছে। সংস্করণ 1.3.4 এই কমিট ধারণ করে.

বাগ ফিক্স

  • হিল্ট ব্যবহার করার সময় ভিউমোডেলপ্রোভিডার বা ViewModelProvider বা ভিউমোডেলের জেটপ্যাক রচনা পদ্ধতি ViewTreeViewModelStoreOwner.get() এর সাথে ভিউমোডেলপ্রোভিডার viewModel() জেটপ্যাক রচনা পদ্ধতিটি ব্যবহার করার সময় খণ্ড 1.3.3 এ প্রবর্তিত একটি রিগ্রেশন স্থির করা হয়েছে। এই ব্যবহারগুলি এখন সঠিকভাবে ViewModelProvider.Factory ব্যবহার করে your আপনার খণ্ড দ্বারা সরবরাহিত ফ্যাক্টরিটি যদি এটি getDefaultViewModelProviderFactory() (যেমন @AndroidEntryPoint টীকাযুক্ত টুকরোগুলি করে) ওভাররাইড করে। আপনি যদি সেই পদ্ধতিটিকে ওভাররাইড না করেন তবে একটি SavedStateViewModelFactory যা খণ্ডের দৃশ্যের পাশাপাশি তার অবস্থা সংরক্ষণ এবং পুনরুদ্ধার করে তা ডিফল্ট কারখানা হিসাবে তৈরি করা হয়েছে। ( I5cbfa , খ/186097368 )
  • এপিআই 29 -এ FragmentContainerView ব্যবহার করার সময়, পোকামাকড়গুলি আর অনির্দিষ্টকালের জন্য প্রেরণ করবে না, BottomNavigationBar এবং FloatingActionButton দৃষ্টান্তগুলির সাথে সমস্যাগুলি ঠিক করবে। ( I1bb78 , খ/186012452 )
  • প্রক্রিয়া মৃত্যুর পরে আপনি এখন খণ্ডের ফলাফলের বান্ডিল থেকে আপনার পার্সেলেবলটি পুনরুদ্ধার করতে পারেন। ( I65932 , বি/187443158 )
  • ভিউগ্রুপে একটি ভাগ করা উপাদান রূপান্তর করার সময়, যদি ভিউগ্রুপটিতে transitionGroup মিথ্যা হিসাবে সেট করা থাকে তবে এটি এখন সঠিকভাবে রূপান্তরিত হবে। ( I99675 )

সংস্করণ 1.3.3

21 এপ্রিল, 2021

androidx.fragment:fragment:1.3.3 , androidx.fragment:fragment-ktx:1.3.3 , এবং androidx.fragment:fragment-testing:1.3.3 প্রকাশিত হয়েছে। সংস্করণ 1.3.3 এই কমিট ধারণ করে.

নতুন বৈশিষ্ট

  • SavedStateViewModelFactory ব্যবহার করা এখন কাজ করে যখন SavedStateRegistryOwner সাথে ব্যবহার করা হয় যখন ViewTreeSavedStateRegistryOwner.get() ব্যবহার করে খণ্ডটির দৃশ্যের সাথে ব্যবহার করে। ( I21acf , খ/181577191 )

বাগ ফিক্স

  • খণ্ড 1.3.2 এ প্রবর্তিত একটি রিগ্রেশন স্থির করে যা popEnter অ্যানিমেশনগুলি কোনও টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো setPrimaryNavFragment টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো FragmentTransaction NavHostFragment ( I38c87 , বি/183877426 )
  • FragmentContainerView এখন নিশ্চিত করে যে প্রতিটি Fragment WindowInsets একটি নতুন সেট প্রেরণ করা হয়েছে, এটি নিশ্চিত করে যে প্রতিটি খণ্ড এখন স্বাধীনভাবে ইনসেটগুলি গ্রাস করতে পারে। ( I63f68 , বি/172153900 )
  • DialogFragment এখন যথাযথভাবে এমন কেসগুলি পরিচালনা করে যেখানে আপনার কাস্টম Dialog ক্লাসে একটি ধারক হিসাবে একই আইডি রয়েছে এমন একটি ধারকটিতে একটি শিশু খণ্ড যুক্ত করা হয়, ভিউ হায়ারার্কি ইস্যুগুলি ঠিক করা যখন আইডিগুলি পুনরায় ব্যবহার করা হয় যা অভ্যন্তরীণভাবে BottomSheetDialog মতো ডায়ালগগুলি দ্বারা ব্যবহৃত হয়। ( আই 6279 , বি/180021387 )
  • FragmentManager.dump() এখন সক্রিয় খণ্ডগুলির তালিকায় প্রথম খণ্ডটি সঠিকভাবে সজ্জিত করে। ( আইএফ 5 সি 33 , বি/183705451 )

নতুন স্টেট ম্যানেজার বাগ ফিক্স

  • নতুন ফ্রেগমেন্ট স্টেট ম্যানেজার এখন হাইড অপারেশনগুলির সাথে প্রস্থান ট্রানজিশনগুলি সঠিকভাবে পরিচালনা করে। ( I9e4de , খ/184830265 )

সংস্করণ 1.3.2

24 মার্চ, 2021

androidx.fragment:fragment:1.3.2 , androidx.fragment:fragment-ktx:1.3.2 , এবং androidx.fragment:fragment-testing:1.3.2 প্রকাশিত হয়েছে। সংস্করণ 1.3.2 এই কমিট ধারণ করে.

নতুন স্টেট ম্যানেজার বাগ ফিক্স

  • popBackStack() এবং commit() উভয়ই একসাথে চালানোর সময়, শেষ অপারেশনটি এখন কিছু পপ অ্যানিমেশন চালানোর পরিবর্তে সমস্ত অ্যানিমেশনগুলির জন্য দিক নির্ধারণ করবে এবং কিছু অ্যানিমেশনগুলিতে প্রবেশ করবে। ( I7072e , বি/181142246 )
  • ভাগ করা উপাদান শ্রেণিবিন্যাসের মধ্যে থাকা দৃশ্যগুলি ভাগ করে নেওয়া উপাদান রূপান্তর করার সময় তাদের ট্রানজিশনের নামটি পরিষ্কার করা হবে না। ( I4d4a6 , বি/179934757 )

নির্ভরতা আপডেট

সংস্করণ 1.3.1

10 মার্চ, 2021

androidx.fragment:fragment:1.3.1 , androidx.fragment:fragment-ktx:1.3.1 , এবং androidx.fragment:fragment-testing:1.3.1 প্রকাশিত হয়েছে। সংস্করণ 1.3.1 এই কমিট ধারণ করে.

নতুন বৈশিষ্ট

  • একটি DialogFragment মধ্যে ডায়ালগগুলি এখন তাদের সজ্জাভিউয়ের মাধ্যমে ভিউট্রি মালিকদের অ্যাক্সেস পেতে পারে, এটি নিশ্চিত করে যে DialogFragment ComposeView সাথে ব্যবহার করা যেতে পারে। ( আইবি 9290 , বি/180691023 )

বাগ ফিক্স

  • ফ্রেগমেন্টকন্টেনারভিউ ব্যবহার করে ইতিমধ্যে RESUMED ক্রিয়াকলাপে স্ফীত করা টুকরোগুলি এখন একটি কনফিগারেশন পরিবর্তনের পরে সঠিকভাবে প্রদর্শিত হয়েছে। ( আইই 14 সি 8 , বি/180538371 )
  • টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো টুকরো } toString() টুকরো
  • খণ্ডনএকটিভিটিতে ওভাররাইড পদ্ধতিগুলি এখন যথাযথভাবে বেস পদ্ধতি জাভাদোকের উত্তরাধিকারী ( i736ce , খ/139548782 )
  • setFragmentResult এবং setFragmentResultListener জন্য ডক্সগুলি তাদের প্যারামিটার ডক্স আপডেট করেছে যাতে তারা আর শূন্যযোগ্যতা গ্রহণ করে না ( আই 990 বিএ , বি/178348386 )

নতুন স্টেট ম্যানেজার বাগ ফিক্স

নির্ভরতা আপডেট

সংস্করণ 1.3.0

ফেব্রুয়ারী 10, 2021

androidx.fragment:fragment:1.3.0 , androidx.fragment:fragment-ktx:1.3.0 , এবং androidx.fragment:fragment-testing:1.3.0 প্রকাশিত হয়েছে। সংস্করণ 1.3.0 এই কমিট ধারণ করে.

1.2.0 থেকে প্রধান পরিবর্তন

  • নতুন স্টেট ম্যানেজার : FragmentManager ইন্টার্নালগুলির একটি উল্লেখযোগ্য পুনর্লিখন লাইফসাইকেল ইভেন্ট, অ্যানিমেশন এবং ট্রানজিশনগুলি এবং কীভাবে স্থগিত করা টুকরোগুলি পরিচালনা করা হয় তা প্রেরণে অসংখ্য সমস্যা স্থির করেছে।
  • ক্রিয়াকলাপের ফলাফল এপিআই ইন্টিগ্রেশন : startActivityForResult() requestPermissions() ActivityResultRegistry onActivityResult() যুক্ত onRequestPermissionsResult() 1.2.0 এই প্রবাহ। একটি ক্রিয়াকলাপ থেকে ফলাফল প্রাপ্ত আপডেট দেখুন।

    • এই রিলিজটি অবৈধ অনুরোধ কোডগুলি এবং অনুমতি অনুরোধের প্রেরণার আশেপাশে বেশ কয়েকটি সমস্যা সমাধান করে যা ক্রিয়াকলাপের ফলাফলের এপিআইকে FragmentActivity পূর্ববর্তী সংস্করণগুলিতে কাজ করতে বাধা দেয়। FragmentActivity বা AppCompatActivity ক্রিয়াকলাপের ফলাফল এপিআইগুলি ব্যবহার করতে আপনাকে অবশ্যই খণ্ড 1.3.0 এ আপগ্রেড করতে হবে।
  • খণ্ডের ফলাফল এপিআই : FragmentManager নতুন এপিআইয়ের মাধ্যমে দুটি টুকরোগুলির মধ্যে ফলাফলগুলি পাস করার জন্য সমর্থন যুক্ত করেছে। এটি হায়ারার্কি টুকরা (পিতামাতা/শিশু), ডায়ালগফ্র্যাগমেন্ট এবং নেভিগেশনে টুকরোগুলির জন্য কাজ করে এবং নিশ্চিত করে যে ফলাফলগুলি কেবলমাত্র আপনার খণ্ডে প্রেরণ করা হয়েছে যখন এটি কমপক্ষে STARTED । এই নতুন এপিআইগুলির পক্ষে লক্ষ্য খণ্ড APIগুলি হ্রাস করা হয়েছে। খণ্ডের ফলাফল এপিআই ব্যবহার করে ফলাফল পান দেখুন।

  • FragmentOnAttachListener : FragmentActivity এবং Fragment কলব্যাকটি অবমূল্যায়ন onAttachFragment() হয়েছে। A new FragmentOnAttachListener has been added to provide a more flexible alternative, allowing delegation of onAttachFragment() to separate, testable listeners and support for adding a listener to FragmentManagers other than your direct child FragmentManager.

  • FragmentScenario Improvements : The FragmentScenario class from the fragment-testing artifact has been rewritten in Kotlin and has received a number of improvements:

    • FragmentScenario now uses setMaxLifecycle() to implement moveToState() , ensuring consistent behavior on all API levels and decoupling the Fragment's state from the underlying Activity.
    • FragmentScenario now supports setting an initial Lifecycle.State to support asserting the fragment's state before moving to each Lifecycle.State for the first time.
    • There is now an alternative to the FragmentScenario API of onFragment in the form of the Kotlin reified extension method withFragment that allows you to return a value. Notably, it rethrows exceptions raised in the given block.
  • ViewTree Support : Fragment now supports the ViewTreeLifecycleOwner.get(View) , ViewTreeViewModelStoreOwner.get(View) , and ViewTreeSavedStateRegistryOwner APIs added in Lifecycle 2.3.0 and SavedState 1.1.0 such that it will return the Fragment as the ViewModelStoreOwner , and a SavedStateRegistryOwner and LifecycleOwner tied to the fragment's view Lifecycle when using a View within a Fragment .

  • TRANSIT_ animation changes : The fragment default effects, TRANSIT_FRAGMENT_OPEN , TRANSIT_FRAGMENT_CLOSE , and TRANSIT_FRAGMENT_FADE , now use Animator instead of Animation . The resources used to build these animators are now private.

  • setRetainInstance() deprecation : 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 the ViewModel and the onCleared() callback it receives).

  • ViewPager 1 adapter deprecation : With the release of ViewPager2 1.0.0 , the FragmentPagerAdapter and FragmentStatePagerAdapter classes for interacting with ViewPager have been deprecated. See Migrate from ViewPager to ViewPager2 .

সংস্করণ 1.3.0-rc02

জানুয়ারী 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. সংস্করণ 1.3.0-rc02 এই কমিট ধারণ করে।

বাগ ফিক্স

  • Fixed an issue where a parent DialogFragment would appear above a child DialogFragment after a configuration change; child dialog fragments now always appear above a parent dialog fragment. ( I30806 , b/177439520 )
  • Fixed issue where doing a hide operation with an Animation would 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 Lifecycle now properly handles cases where the Fragment's view is destroyed before the Lifecycle reaches CREATED , avoiding exceptions stating “no event down from INITIALIZED”. ( eda2bd , b/176138645 )
  • Fragments that use an Animator now appear in the proper order when using FragmentContainerView . ( Id9aa3 , b/176089197 )

সংস্করণ 1.3.0-rc01

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. সংস্করণ 1.3.0-rc01-এ এই কমিট রয়েছে।

বাগ ফিক্স

  • onPrepareOptionsMenu() now follows the same logic as onCreateOptionsMenu() and is no longer called when a parent fragment calls setMenuVisibility(false) . ( Id7de8 , b/173203654 )

New State Manager Bug Fixes

  • Fixed leak and visual artifact when adding a fragment with an Animation to a FragmentContainerView and 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() or onViewCreated() 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

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.

নতুন বৈশিষ্ট

  • FragmentScenario has been fully converted to Kotlin while maintaining source and binary compatibility via usage of Kotlin 1.4's functional interfaces for FragmentAction . ( I19d31 )

আচরণ পরিবর্তন

  • FragmentContainerViews that do not inflate a fragment using the class or android:name attribute can now be used outside of a FragmentActivity . ( Id4397 , b/172266337 )
  • Attempting to set the max lifecycle of a fragment to DESTROYED will now throw an IllegalArgumentException ( Ie7651 , b/170765622 )
  • Initializing a FragmentScenario with a DESTROYED state will now throw an IllegalArgumentException ( 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 Animator or one of the TRANSIT_FRAGMENT_ options. ( I92426 , b/169874632 )
  • Fixed an issue that prevented fragments with an exiting Animation from 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 Animator of a hide() 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

  • FragmentFactory now caches fragment classes separately for different ClassLoader instances. Thanks Simon Schiller! ( #87 , b/113886460 )

সংস্করণ 1.3.0-beta01

অক্টোবর 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. সংস্করণ 1.3.0-beta01-এ এই কমিট রয়েছে।

নতুন বৈশিষ্ট

  • setMaxLifecycle() now supports setting the Lifecycle state to INITIALIZING as long as the fragment has not been moved to CREATED . ( b/159662173 )

এপিআই পরিবর্তন

আচরণ পরিবর্তন

  • 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() to CREATED now 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 FragmentManager and fragments with a non-null FragmentManager will always be considered active. ( aosp/1422346 )
  • The fragment default effects, TRANSIT_FRAGMENT_OPEN , TRANSIT_FRAGMENT_CLOSE , and TRANSIT_FRAGMENT_FADE , now use Animator instead of Animation . ( 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 INVISIBLE before the animation begins, it will actually stay invisible. ( b/164481490 )
  • Fragments now prioritize Animators over Animations , meaning a fragment with both will only run the Animator and ignore the Animation . ( b/167579557 )
  • The new state manager no longer causes fragments to flash when using entering animations. ( b/163084315 )

পরিচিত সমস্যা

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

আগস্ট 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. এটি ডিফল্টরূপে সক্ষম। 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 replace operation 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 Animation would override all Transition effects or an Animator and a Transition on an individual fragment would both run. ( b/149569323 )
  • The enterTransition and exitTranstion of 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 CREATED state but instead move to STARTED with other fragments. ( b/129035555 )
  • Fixed an issue where FragmentManager would 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 )
  • FragmentManager now returns the correct fragments when calling findFragmentById() or findFragmentByTag() from within the onAttachFragment() 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 Transition and AndroidX Transition instances now mentions the fragment with the invalid transition. ( b/155574969 )

আচরণ পরিবর্তন

  • You can now call launch() on an ActivityResultLauncher in the onCreate() lifecycle method of a fragment. ( b/161464278 )
  • Calling registerForActivityResult() after onCreate() now throws an exception indicating that this is not allowed rather than silently failing to deliver results after a configuration change. ( b/162255449 )
  • FragmentActivity now uses the OnContextAvailableListener API introduced in Activity 1.2.0-alpha08 to restore the state of the FragmentManager . Any listeners added to subclasses of FragmentActivity will run after this listener. ( I513da )

বাগ ফিক্স

  • ActivityOptions passed through when using startIntentSenderForResult() are now respected. ( b/162247961 )

পরিচিত সমস্যা

  • When using the new state manager, directly setting the visibility of the fragment's root view after onViewCreated() and before onResume() results in the visibility you set being overridden by FragmentManager , who controls the visibility of the root view. As a workaround, you should always use the hide() and show() operations to change the visibility of your fragment. ( b/164481490 )

Version 1.3.0-alpha07

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.

নতুন বৈশিষ্ট

  • FragmentScenario now supports setting an initial Lifecycle state of CREATED , STARTED , or RESUMED rather than always moving the Fragment to the RESUMED state. ( b/159662750 )
  • Added an alternative to the FragmentScenario API of onFragment in the form of the Kotlin reified extension method withFragment that allows you to return a value. Notably, it rethrows exceptions raised in the given block. ( b/158697631 )

আচরণ পরিবর্তন

  • FragmentScenario now uses setMaxLifecycle() to implement moveToState() , ensuring consistent behavior on all API levels and decoupling the Fragment's state from the underlying Activity. ( b/156527405 )
  • The SavedStateRegistryOwner returned by ViewTreeSavedStateRegistryOwner is 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 clearFragmentResultListener now properly clears the lifecycle observer. ( b/159274993 )

Version 1.3.0-alpha06

জুন 10, 2020

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 on FragmentActivity and Fragment have been deprecated. A new FragmentOnAttachListener has been added to provide a more flexible alternative, allowing delegation of onAttachFragment() 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 DialogFragment would show another DialogFragment as a child fragment. ( b/157195715 )
  • Fixed an issue where the UseRequireInsteadOfGet Lint check would not handle chained usages of the ?. এবং !! operators correctly. ( b/157677616 )

Version 1.3.0-alpha05

20 মে, 2020

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.

নতুন বৈশিষ্ট

এপিআই পরিবর্তন

  • The setFragmentResult() and setFragmentResultListener() APIs now take a non-null Bundle and FragmentResultListener , respectively. To explicitly clear a previously set result or listener, use the new clearFragmentResult() and clearFragmentResultListener() methods. ( b/155416778 )
  • The setFragmentResultListener() Kotlin extensions that take a lambda are now marked as inline . ( b/155323404 )

আচরণ পরিবর্তন

  • The previously deprecated startActivityForResult() , startIntentSenderForResult() , and requestPermissions on Fragment now internally use ActivityResultRegistry , thus removing the restriction on using only the lower bits (below 0xFFFF ) for your request codes when using those APIs. ( b/155518741 )

ডকুমেন্টেশন আপডেট

  • Expanded the documentation on the Fragment(@LayoutRes int) and DialogFragment(@LayoutRes int) constructors to clarify that they should be called from your subclasses' no argument constructor when using the default FragmentFactory . ( b/153042497 )

Version 1.3.0-alpha04

এপ্রিল 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 least STARTED . ( 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() and requestPermissions() / onRequestPermissionsResult() APIs on Fragment have been deprecated. Please use the Activity Result APIs . ( aosp/1290887 )
  • Breaking change from Activity 1.2.0-alpha04 : the prepareCall() method has been renamed to registerForActivityResult() . ( aosp/1278717 )

বাগ ফিক্স

  • The fragment's getViewLifecycleOwner() is now stopped before onSaveInstanceState() 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 illegalStateException when adding a fragment to a DialogFragment 's view hierarchy with FragmentContainerView . ( 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

এপ্রিল 1, 2020

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. সংস্করণ 1.3.0-alpha03 এই কমিট ধারণ করে।

এপিআই পরিবর্তন

  • The prepareCall methods on Fragment are now final . ( b/152439361 )

বাগ ফিক্স

  • Fixed a regression introduced in Fragment 1.3.0-alpha02 when using BottomSheetDialogFragment . ( b/151652127 , aosp/1263328 , aosp/1265163 )
  • Fixed a crash when using prepareCall from 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 the FragmentLiveDataObserve Lint rule on DialogFragment classes as their lifecycle and view lifecycle are always in sync, making it safe to use either this or viewLifecycleOwner when calling observe . ( b/151765086 )

Dependency Changes

  • Fragments depend on Activity 1.2.0-alpha03 , which had significant improvements to the Activity Result API introduced in Activity 1.2.0-alpha02 .

সংস্করণ 1.3.0-alpha02

18 মার্চ, 2020

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. সংস্করণ 1.3.0-alpha02 এই কমিট ধারণ করে।

নতুন বৈশিষ্ট

  • Added support for the ActivityResultRegistry API introduced in Activity 1.2.0-alpha02 to handle the startActivityForResult() + onActivityResult() as well as requestPermissions() + 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 )

এপিআই পরিবর্তন

  • DialogFragment now provides a constructor that takes a @LayoutRes that indicates the layout that onCreateView() should inflate by default. ( b/150327080 )
  • The onActivityCreated() method is now deprecated. Code touching the fragment's view should be done in onViewCreated() (which is called immediately before onActivityCreated() ) and other initialization code should be in onCreate() . To receive a callback specifically when the activity's onCreate() is complete, a LifeCycleObserver should be registered on the activity's Lifecycle in onAttach() , and removed once the onCreate() callback is received. ( b/144309266 )

বাগ ফিক্স

  • From Fragment 1.2.3 : Fixed a bug in DialogFragment that caused a StackOverflowError when calling getLayoutInflater() from within onCreateDialog() . ( 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 the UseRequireInsteadOfGet Lint check when using a local variable name that shadowed the Kotlin property name. ( b/149891163 )
  • From Fragment 1.2.3 : FragmentContainerView no longer throws an UnsupportedOperationException for using the incorrect constructor in layout preview. ( b/149707833 )

জ্ঞাত সমস্যা

  • BottomSheetDialogFragment no longer properly positions its dialog on the screen. ( b/151652127 )

সংস্করণ 1.3.0-alpha01

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.

নতুন বৈশিষ্ট

এপিআই পরিবর্তন

  • 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 the ViewModel and the onCleared() callback it receives). ( b/143911815 )
  • With the release of ViewPager2 1.0.0 , the FragmentPagerAdapter and FragmentStatePagerAdapter classes for interacting with ViewPager have been deprecated. See Migrate from ViewPager to ViewPager2 . ( b/145132715 )

বাগ ফিক্স

  • Fragment ProGuard rules now correctly only keep the default constructors Fragment classes that are used rather than for all Fragment instances, fixing a regression introduced in Fragment 1.2.1 . ( b/149665169
  • The require___() Lint rules added in Fragment 1.2.2 no longer false positive on local variables that share the same name as the shadowed Kotlin property names (ie, view ). ( b/149891163 )
  • FragmentContainerView no longer throws an UnsupportedOperationException when 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 )

সংস্করণ 1.2.5

সংস্করণ 1.2.5

জুন 10, 2020

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 before onSaveInstanceState() is called, mirroring the behavior of the fragment's lifecycle. This was previously released in Fragment 1.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 Fragment 1.3.0-alpha04 . ( b/153593580 )

সংস্করণ 1.2.4

সংস্করণ 1.2.4

এপ্রিল 1, 2020

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 FragmentLiveDataObserve Lint rule on DialogFragment classes as their lifecycle and view lifecycle are always in sync, making it safe to use either this or viewLifecycleOwner when calling observe . ( b/151765086 )

সংস্করণ 1.2.3

সংস্করণ 1.2.3

18 মার্চ, 2020

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 DialogFragment that caused a StackOverflowError when calling getLayoutInflater() from within onCreateDialog() . ( 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 UseRequireInsteadOfGet Lint check when using a local variable name that shadowed the Kotlin property name. ( b/149891163 )
  • FragmentContainerView no longer throws an UnsupportedOperationException for using the incorrect constructor in layout preview. ( b/149707833 )

সংস্করণ 1.2.2

সংস্করণ 1.2.2

ফেব্রুয়ারী 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 viewLifecycleOwner as the LifecycleOwner to calls into OnBackPressedDispatcher in onCreateView() , onViewCreated() , and onActivityCreated() . ( b/142117657 )
  • Added a new Lint check that confirms that you are using the correct debugImplementation when using the fragment-testing artifact. ( b/141500106 )
  • Fragments now suggest using the associated require___() methods for more descriptive error messages instead of checkNotNull(get___()) , requireNonNull(get___()) , or get___()!! for all of the Fragment APIs that include both a get and require equivalent. ( aosp/1202883 )

বাগ ফিক্স

  • Fixed the Fragment ProGuard files to avoid R8 warnings ( b/148963981 )
  • Improved the existing Lint check suggesting using viewLifecycleOwner when using observe to also handle the livedata-ktx extension method version of observe . ( b/148996309 )
  • Fixed the formatting for many of the Lint checks ( aosp/1157012 )

বাহ্যিক অবদান

  • Thanks to Zac Sweers for contributing the require___() Lint checks on behalf of Slack! ( aosp/1202883 )

সংস্করণ 1.2.1

সংস্করণ 1.2.1

ফেব্রুয়ারি 5, 2020

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 add and replace methods that take a Class instance (or the Kotlin reified versions) now have their default constructor kept by ProGuard. ( b/148181315 )
  • FragmentStatePagerAdapter and FragmentPagerAdapter no longer catch exceptions thrown by FragmentManager when running finishUpdate() . ( 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 to onInflate() before onCreate() when in the layout. ( aosp/1215856 )
  • Calling toString() on a FragmentManager instance no longer throws a NullPointerException when the Activity is already destroyed. ( b/148189412 )

Dependency changes

সংস্করণ 1.2.0

সংস্করণ 1.2.0

জানুয়ারী 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 .

Important changes since 1.1.0

  • FragmentContainerView : The FragmentContainerView is the strongly recommended container for dynamically added Fragments, replacing usage of FrameLayout or other layouts. It also supports the same class , android:name , and optional android:tag as the <fragment> tag, but uses a normal FragmentTransaction to 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 Transition 1.3.0 ) to complete before calling onDestroyView() .
  • Class based add() and replace() : Added new overloads of add() and replace() on FragmentTransaction that take a Class<? extends Fragment> and optional Bundle of arguments. These methods use your FragmentFactory to 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 to fragment-ktx .
  • Lifecycle ViewModel SavedState Integration : SavedStateViewModelFactory is now the default factory used when using by viewModels() , by activityViewModels() , the ViewModelProvider constructor, or ViewModelProviders.of() with a Fragment.
  • New Lint checks : Added a new Lint check that ensures you are using getViewLifecycleOwner() when observing LiveData from onCreateView() , onViewCreated() , or onActivityCreated() .
  • getFragmentManager() deprecation : The getFragmentManager() and requireFragmentManager() methods on Fragment have been deprecated and replaced with a single getParentFragmentManager() method, which returns the non-null FragmentManager the Fragment is added to (you can use isAdded() to determine if it is safe to call).
  • FragmentManager.enableDebugLogging() deprecation : The static FragmentManager.enableDebugLogging method has been deprecated. FragmentManager now respects Log.isLoggable() for the tag FragmentManager , allowing you to enable either DEBUG or VERBOSE logging without re-compiling your app.

জ্ঞাত সমস্যা

  • Fragments referenced only via the class or android:name attribute on a FragmentContainerView are not kept by ProGuard automatically, requiring that you manually add a keep rule for each fragment class. ( b/142601969 )
  • When adding a NavHostFragment using class or android:name in XML with FragmentContainerView , you cannot use findNavController() in onCreate() of your Activity. ( b/142847973 )

Version 1.2.0-rc05

8 জানুয়ারী, 2020

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-rc04 when using the <fragment> tag which caused onViewCreated() 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 to CREATED even when not in your layout instead of being instantiated but never moving through any lifecycle methods. ( b/145769287 )

Version 1.2.0-rc04

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 , and TRANSIT_FRAGMENT_FADE to avoid visual issues. ( b/145468417 )

Version 1.2.0-rc03

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 INVISIBLE after popping a hidden Fragment. ( b/70793925 )
  • Fragment shared element transitions now handle Views that have been rotated, scaled, etc. ( b/142835261 )

ডকুমেন্টেশন আপডেট

  • Clarified the deprecation documentation around setUserVisibleHint() . ( b/143897055 )
  • Improved the documentation on setFragmentFactory() and getFragmentFactory() to better indicate that setting a FragmentFactory will also affect child FragmentManagers. ( aosp/1170095 )

Dependency changes

  • Fragments now depends on Lifecycle 2.2.0-rc03 , Lifecycle ViewModel SavedState 1.0.0-rc03 , and Activity 1.1.0-rc03 .

Version 1.2.0-rc02

নভেম্বর 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 observing LiveData from onCreateView() , onViewCreated() , or onActivityCreated() (introduced in Fragment 1.2.0-rc01 ) now uses the Kotlin property access syntax viewLifecycleOwner instead of getViewLifecycleOwner() . ( aosp/1143821 )

Version 1.2.0-rc01

23 অক্টোবর, 2019

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 .

নতুন বৈশিষ্ট

  • FragmentContainerView now supports the class attribute in addition to android:name , mirroring the functionality of the <fragment> tag. ( b/142722242 )
  • Added a new Lint check that ensures you are using getViewLifecycleOwner() when observing LiveData from onCreateView() , onViewCreated() , or onActivityCreated() . ( b/137122478 )

বাগ ফিক্স

  • The onDismiss and onCancel callbacks on DialogFragment now guarantee that the DialogInterface passed to them is non-null and that getDialog() returns non-null when they are executed. ( b/141974033 )
  • FragmentContainerView now adds the Fragment defined by class or android:name as part of inflation, ensuring that findFragmentById() and findFragmentByTag() work immediately afterwards. ( b/142520327 )
  • Fixed an IllegalStateException in FragmentContainerView due to the state being saved. ( b/142580713 )
  • Fixed an UnsupportedOperationException in FragmentContainerView when the FragmentContainerView class is obfuscated. ( b/142657034 )

জ্ঞাত সমস্যা

  • Fragments referenced only via the class or android:name attribute on a FragmentContainerView are 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 to FragmentContainerView until this is fixed via aapt2 . ( b/142601969 )

Version 1.2.0-beta02

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 from FragmentContainerView , breaking cases such as NavHostFragment . ( b/142421837 )

Version 1.2.0-beta01

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. সংস্করণ 1.2.0-beta01-এ এই কমিট রয়েছে

নতুন বৈশিষ্ট

  • FragmentContainerView adds support for adding an initial fragment with added support for the android:name and optional android:tag XML attributes. Unlike the <fragment> tag, FragmentContainerView uses a normal FragmentTransaction under the hood to add the initial fragment, allowing further FragmentTransaction operations on the FragmentContainerView and 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> with FragmentContainerView . ( b/139830056 )

বাগ ফিক্স

  • Fixed a ClassCastException when using androidx.transition . ( b/140680619 )
  • When using Transition 1.3.0-beta01 , Fragments now wait for androidx.transition transitions (in addition to framework transitions and animations, which were fixed in Fragment 1.2.0-alpha03 and Fragment 1.2.0-alpha02 , respectively) to finish before dispatching onDestroyView() . ( aosp/1119841 )
  • When using Transition 1.3.0-beta01 , Fragments now properly cancel androidx.transition transitions before starting new transitions / animations on the same container. ( aosp/1119841 )
  • Fixed an issue on API 17 and lower when using androidx.transition transitions on the root view of your Fragment when using FragmentContainerView . ( b/140361893 )
  • The fragment-testing artifact now depends on AndroidX Test 1.2.0 , fixing an incompatibility with the latest Espresso 3.2.0. ( b/139100149 )
  • Removed usage of Log.w in FragmentManager. ( aosp/1126468 )

জ্ঞাত সমস্যা

  • Fragment's onInflate() do not receive proper attributes from FragmentContainerView , breaking cases such as NavHostFragment . ( b/142421837 )

সংস্করণ 1.2.0-alpha04

সেপ্টেম্বর 18, 2019

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 .

এপিআই পরিবর্তন

  • The getFragmentManager() and requireFragmentManager() methods on Fragment have been deprecated and replaced with a single getParentFragmentManager() method, which returns the non-null FragmentManager the Fragment is added to (you can use isAdded() to determine if it is safe to কল)। ( b/140574496 )
  • The static FragmentManager.enableDebugLogging method has been deprecated. FragmentManager now respects Log.isLoggable() for the tag FragmentManager , allowing you to enable either DEBUG or VERBOSE logging 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

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 .

এপিআই পরিবর্তন

বাগ ফিক্স

  • FragmentContainerView now 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 dispatching onDestroyView() . ( b/138741697 )

সংস্করণ 1.2.0-alpha02

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 .

নতুন বৈশিষ্ট

  • SavedStateViewModelFactory is now the default factory used when using by viewModels() , by activityViewModels() , the ViewModelProvider constructor, or ViewModelProviders.of() with a Fragment . ( b/135716331 )
  • The default animations when using TRANSIT_FRAGMENT_OPEN , TRANSIT_FRAGMENT_CLOSE , TRANSIT_FRAGMENT_FADE with setTransition on a FragmentTransaction have been updated to match the animations used by activities on Android 10 devices. ( aosp/1012812 , aosp/1014730 )

এপিআই পরিবর্তন

  • Introduces FragmentContainerView as the strongly recommended container for dynamically added Fragments, replacing usage of FrameLayout , 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 in fragment-ktx . ( aosp/1090757 )
  • Added new overloads of add() and replace() on FragmentTransaction that take a Class<? extends Fragment> and optional Bundle of arguments. These methods use your FragmentFactory to 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 to fragment-ktx . ( b/126124987 )
  • @MainThread annotations have been added to Fragment lifecycle callbacks. ( b/127272564 )
  • The breadcrumb title related APIs on FragmentTransaction and FragmentManager.BackStackEntry have been deprecated. ( b/138252944 )
  • The setTransitionStyle method on FragmentTransaction has been deprecated. ( aosp/1011537 )
  • Many of the methods in FragmentManager are no longer abstract . FragmentManager itself remains abstract and should not be directly instantiated or extended; you should continue to only get an existing instance from getSupportFragmentManager() , 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 calling postponeEnterTransition() with a timeout more than once would not cancel previous timeouts. ( b/137797118 )
  • From Fragment 1.1.0-rc02 : Fixed a crash in FragmentPagerAdapter and FragmentStatePagerAdapter when 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 NullPointerException when using shared element transitions and combining a pop and add operation. ( b/120507394 )
  • Added a workaround to IllegalStateException s when using FragmentPagerAdapter and FragmentStatePagerAdapter in Robolectric tests. ( b/137201343 )

সংস্করণ 1.2.0-alpha01

জুলাই 2, 2019

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 calling onViewCreated() , ensuring that your view always has the correct insets. ( b/135945162 )

বাগ ফিক্স

  • Fixed a NullPointerException when popping a FragmentTransaction that used setPrimaryNavigationFragment() before replace() . ( b/134673465 )

সংস্করণ 1.1.0

সংস্করণ 1.1.0

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-testing artifact provides a FragmentScenario class for testing a fragment in isolation. See Test your app's fragments documentation for more details.
  • FragmentFactory : You can now set a FragmentFactory on a FragmentManager to manage the creation of fragment instances, removing the strict requirement to have a no-argument constructor.
  • Kotlin Property Delegates for ViewModels : The fragment-ktx artifact now contains two Kotlin property delegates: by viewModels() for accessing ViewModels associated with the individual fragment and by 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 a FragmentTransaction . This replaces the now deprecated setUserVisibleHint() . FragmentPagerAdapter and FragmentStatePagerAdapter have a new constructor that allows you to switch to the new behavior.
  • FragmentActivity LayoutId constructor : Subclasses of FragmentActivity can now optionally call into a constructor on FragmentActivity that takes an R.layout ID, indicating the layout that should be set as the content view as an alternative to calling setContentView() in onCreate() . This does not change the requirement that your subclass have a no-argument constructor.
  • Fragment LayoutId constructor : Subclasses of Fragment can now optionally call into a constructor on Fragment that takes an R.layout ID, indicating the layout that should be used for this fragment as an alternative to overriding onCreateView() . The inflated layout can be configured in onViewCreated() .
  • Postpone with a timeout : A new overload of postponeEnterTransition() has been added that takes a timeout.

Version 1.1.0-rc04

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

জুলাই 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

জুলাই 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 FragmentPagerAdapter and FragmentStatePagerAdapter when removing the current item. ( b/137209870 )

Version 1.1.0-rc01

জুলাই 2, 2019

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() or hide() operations while the transition is running. ( b/133385058 )
  • Fixed a NullPointerException when popping a FragmentTransaction that used setPrimaryNavigationFragment() before replace() . ( b/134673465 )

Version 1.1.0-beta01

জুন 5, 2019

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.Lifecycle callbacks (specifically related to STARTED , RESUMED , PAUSED , STOPPED , and DESTROYED ) for nested Fragments are now properly nested. ( b/133497591 )
  • OnBackPressedCallback instances registered in a Fragment's onCreate() 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

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 .

এপিআই পরিবর্তন

  • 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

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 call startPostponedEnterTransition() b/120803208

এপিআই পরিবর্তন

  • Breaking change: the previously deprecated FragmentFactory instantiate method that took a Bundle has been removed. aosp/953856
  • Breaking change: The RESUME_ONLY_CURRENT_FRAGMENT and USE_SET_USER_VISIBLE_HINT constants in FragmentPagerAdapter and FragmentStatePagerAdapter have been renamed to BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT and BEHAVIOR_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

সংস্করণ 1.1.0-alpha07

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 a FragmentTransaction . This replaces the now deprecated setUserVisibleHint() . FragmentPagerAdapter and FragmentStatePagerAdapter have a new constructor that allows you to switch to the new behavior. ( b/129780800 )

এপিআই পরিবর্তন

  • moveToState(STARTED) on FragmentScenario can 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 the contentLayoutId constructor of FragmentActivity or AppCompatActivity . ( b/129907905 )
  • Corrected an issue where fragments on the back stack would not be moved to at least CREATED after a configuration change, causing ViewModels and child retained fragments to not be properly disposed. ( b/129593351 )
  • Fixed a crash in restoreSaveState caused by a desync of the retained fragments after the instance state is saved. ( b/130433793 ) ( aosp/947824 )
  • Fixed issues where an OnBackPressedCallback added with a fragment lifecycle would not be called if the FragmentManager had a back stack. See androidx.activity 1.0.0-alpha07 for more details. ( aosp/948209 )
  • Fragments no longer enforce LAYER_TYPE_HARDWARE for animations. If you specifically need a hardware layer animation, please set it as part of your animation. ( b/129486478 )

সংস্করণ 1.1.0-alpha06

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 )

এপিআই পরিবর্তন

  • Fragment and FragmentActivity now 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 instantiate method that takes an argument Bundle has been deprecated and apps should use the new instantiate overload that does not take a Bundle. ( b/128836103 )
  • FragmentScenario methods are now properly annotated with @StyleRes . ( aosp/924193 )
  • FragmentTabHost has 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 @ContentView constructors 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 )

সংস্করণ 1.1.0-alpha05

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. এই সংস্করণে অন্তর্ভুক্ত প্রতিশ্রুতির সম্পূর্ণ তালিকা এখানে পাওয়া যাবে।

নতুন বৈশিষ্ট

  • @ContentView annotation lookups are now cached ( b/123709449 )

আচরণ পরিবর্তন

  • Calling remove() , hide() , show() , detach() , and setPrimaryNavigationFragment() with a Fragment attached to a different FragmentManager now throws an IllegalStateException rather than silently failing ( aosp/904301 )

বাগ ফিক্স

  • onNewIntent for FragmentActivity is now correctly marked with @CallSuper ( b/124120586 )
  • Fixed an issue where DialogFragment 's onDismiss() could be called twice when using getDialog().dismiss() or getDialog().cancel() ( b/126563750 )

সংস্করণ 1.1.0-alpha04

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 @ContentView class annotation that allows you to indicate which layout XML file should be inflated as an alternative to overriding onCreateView() . It is recommended to do view related work in onViewCreated() . ( aosp/837619 )
  • fragment-testing now depends on androidx.test:core-ktx 1.1.0 stable ( b/121209673 )
  • You can now use openActionBarOverflowOrOptionsMenu with FragmentScenario to test Fragment hosted options menus ( b/121126668 )

এপিআই পরিবর্তন

  • Added a requireArguments() method which returns a @NonNull Bundle or throws an IllegalStateException ( b/121196360 )
  • Added a note that getLifecycle() , getViewLifecycleOwner() , and getViewLifecycleOwnerLiveData() 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 null to setTargetFragment() . ( 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 )

সংস্করণ 1.1.0-alpha03

ডিসেম্বর 17, 2018

নতুন বৈশিষ্ট

  • Fragment now implements BundleSavedStateRegistryOwner and depends on the newly released SavedState library [ aosp/824380 ]
  • A by activityViewModels Kotlin property delegate has been added to retrieve ViewModels associated with the containing Activity [ b/119050253 ]
  • The by viewModels Kotlin property delegate has been expanded to take an optional lambda method for getting the ViewModelStoreOwner , allowing you to pass in the parent Fragment or other custom ViewModelStoreOwner with code such as val viewModel: MyViewModel by viewModels(::requireParentFragment) [ b/119050253 ]

এপিআই পরিবর্তন

  • FragmentScenario now allows you to specify a theme such as Theme.AppCompat [ b/119054431 ]. এটি একটি ব্রেকিং পরিবর্তন.
  • Added a requireView() method which returns a @NonNull View or throws an IllegalStateException [ b/120241368 ]
  • Added a requireParentFragment() method which returns a @NonNull Fragment or throws an IllegalStateException [ 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 Lifecycle object if re-added [ b/118880674 ]

সংস্করণ 1.1.0-alpha02

ডিসেম্বর 3, 2018

নতুন বৈশিষ্ট

  • FragmentScenario's Kotlin extensions now let you use a lambda for Fragment construction as an alternative to passing in a FragmentFactory instance. ( aosp/812913 )

বাগ ফিক্স

  • Fixed an IllegalStateException when using nested Fragments on the back stack ( b/119256498 )
  • Fixed crash when using FragmentScenario.recreate() with a FragmentFactory ( aosp/820540 )
  • Fixed an issue where target Fragments were not accessible after the Fragment was removed ( aosp/807634 )

সংস্করণ 1.1.0-alpha01

নভেম্বর 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 FragmentFactory on any FragmentManager to 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() .

এপিআই পরিবর্তন

  • 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-testing depends on androidx.test:core:1.0.0-beta01 instead of the correct androidx.test:core:1.0.0 .