কার্ডস্ক্রোল ভিউ

API স্তর XE12 এ যোগ করা হয়েছে

একটি View যা অনুভূমিকভাবে স্ক্রোল করা শিশুদের দৃশ্য দেখায়, কার্ড হিসাবে উল্লেখ করা হয়।

কার্ডগুলি CardScrollAdapter থেকে আসে যা CardScrollView এর সাথে যুক্ত। প্রতিটি কার্ড দৃশ্যত একটি নির্দিষ্ট Object আইটেম প্রতিনিধিত্ব করে।

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

সাধারণ ব্যবহার

  1. একটি স্ট্যান্ডার্ড ভিউ হায়ারার্কি বা CardBuilder ক্লাস ব্যবহার করে কার্ডের একটি সেট তৈরি করুন।
  2. CardScrollView এ কার্ডের সেট সরবরাহ করতে একটি CardScrollAdapter প্রয়োগ করুন। প্রতিটি কার্ডের একটি অনন্য Object শনাক্তকারী থাকে এবং এটি একটি নির্দিষ্ট Object প্রতিনিধিত্ব করে।
  3. আপনার কার্যকলাপের বিষয়বস্তু দৃশ্যটিকে CardScrollView হিসাবে সেট করুন বা একটি লেআউটে CardScrollView ব্যবহার করুন৷

স্ক্রলিং এবং মিথস্ক্রিয়া পরিচালনা করা

CardScrollView আপনাকে নিম্নলিখিত শ্রোতা ইন্টারফেসগুলির সাথে সূচিত করে যা AdapterView থেকে উত্তরাধিকারসূত্রে পাওয়া যায়:

  • AdapterView.OnItemSelectedListener - ব্যবহারকারী তালিকার মধ্য দিয়ে স্ক্রোল করা শেষ করে এবং একটি আইটেমে স্থির হওয়ার পরে একটি আইটেম নির্বাচন করা হয়।
  • AdapterView.OnItemClickListener - একটি আইটেম ক্লিক করা হয় যখন ব্যবহারকারী ট্যাপ করে এবং নির্বাচিত একটি আইটেম ছেড়ে দেয়।
  • AdapterView.OnItemLongClickListener ) - একটি আইটেম দীর্ঘ-ক্লিক করা হয় যখন ব্যবহারকারী একটি আইটেমকে ট্যাপ করে, ধরে রাখে এবং ছেড়ে দেয় যা নির্বাচিত হয়।

নেস্টেড ক্লাস
enum CardScrollView.Animation একটি কার্ডে নেভিগেট করতে, সন্নিবেশ করতে বা মুছতে ব্যবহৃত অ্যানিমেশনের ধরনকে সংজ্ঞায়িত করে।
উত্তরাধিকার সূত্রে প্রাপ্ত ধ্রুবক
উত্তরাধিকারসূত্রে প্রাপ্ত ক্ষেত্র
পাবলিক কনস্ট্রাক্টর
কার্ডস্ক্রোলভিউ ( প্রসঙ্গ প্রসঙ্গ, অ্যাট্রিবিউটসেট অ্যাটিআরস, int ডিফস্টাইল)
পাবলিক পদ্ধতি
অকার্যকর
বুলিয়ান
অ্যানিমেট (int অবস্থান, CardScrollView. অ্যানিমেশন অ্যানিমেশন টাইপ)
অকার্যকর
কার্ডস্ক্রোল অ্যাডাপ্টার
দীর্ঘ
int
দেখুন
বুলিয়ান
বুলিয়ান
বুলিয়ান
onKeyDown (int keyCode, KeyEvent ইভেন্ট)
অকার্যকর
onWindowFocusপরিবর্তিত (বুলিয়ান আছে উইন্ডোফোকাস)
অকার্যকর
অকার্যকর
সেটEmptyView ( খালি ভিউ দেখুন )
অকার্যকর
সেটHorizontalScrollBarEnabled (বুলিয়ান সক্ষম)
অকার্যকর
সেট নির্বাচন (int অবস্থান)
সুরক্ষিত পদ্ধতি
বুলিয়ান
বুলিয়ান
অকার্যকর
অকার্যকর
অনলেআউট (বুলিয়ান পরিবর্তিত, int বাম, int শীর্ষ, int ডান, int নীচে)
অকার্যকর
অনভিসিবিলিটি চেঞ্জড ( দেখুন পরিবর্তিত ভিউ, int ভিজিবিলিটি)
উত্তরাধিকারসূত্রে প্রাপ্ত পদ্ধতি

Public Constructors

API স্তর XE12 এ যোগ করা হয়েছে

public CardScrollView ( Context context)

API স্তর XE12 এ যোগ করা হয়েছে

public CardScrollView ( Context context, AttributeSet attrs)

API স্তর XE12 এ যোগ করা হয়েছে

public CardScrollView ( Context context, AttributeSet attrs, int defStyle)

পাবলিক পদ্ধতি

API স্তর XE12 এ যোগ করা হয়েছে

public void activate ()

Tells the CardScrollView to activate and be ready for display. TODO(ajcbik): investigate if we can replace [de]activate with focus events, see b/17574566 request.

Added in API level XE21

public boolean animate (int position, CardScrollView.Animation animationType)

Animates for card at given position, where animationType should be one of:

  • NAVIGATION : moves to given card from any position, regular navigation,
  • INSERTION : moves to given card, which appears into view, after insertion,
  • DELETION : given card disappears from view, if selected, after deletion.
The animation is skipped if the scroller is deactivated, if a prior autonomous animation is still ongoing, or if the position is invalid. A deletion animation only occurs if the deleted card is currently selected.

The insertion and deletion animation should be used after doing the corresponding mutation in CardScrollAdapter . The animation will call the notifyDataSetChanged() on the adapter at the proper moment in the animation, even when skipped or terminated early.

Sample usage:

 .... insert card at p-th position in adapter ....
 animate(p, INSERTION);    // calls notifyDataSetChanged() on adapter
 

পরামিতি
position of the card involved in the animation
animationType controls the type of animation to use
রিটার্নস
  • whether animation was started
API স্তর XE12 এ যোগ করা হয়েছে

public void deactivate ()

Tells the CardScrollView to deactivate; it will not be displayed until after activate() is called again.

API স্তর XE12 এ যোগ করা হয়েছে

public CardScrollAdapter getAdapter ()

public long getSelectedItemId ()

API স্তর XE12 এ যোগ করা হয়েছে

public int getSelectedItemPosition ()

API স্তর XE12 এ যোগ করা হয়েছে

public View getSelectedView ()

API স্তর XE12 এ যোগ করা হয়েছে

public boolean isActivated ()

public boolean isHorizontalScrollBarEnabled ()

public boolean onKeyDown (int keyCode, KeyEvent event)

public void onWindowFocusChanged (boolean hasWindowFocus)

API স্তর XE12 এ যোগ করা হয়েছে

public void setAdapter ( CardScrollAdapter adapter)

public void setEmptyView ( View emptyView)

The setEmptyView(View) is unsupported by the CardScrollView .

To get proper animation and tuggable behavior, use an adapter with a single empty view for empty data sets instead.

public void setHorizontalScrollBarEnabled (boolean enable)

API স্তর XE12 এ যোগ করা হয়েছে

public void setSelection (int position)

Protected Methods

protected boolean awakenScrollBars ()

Awakens the horizontal scrollbar, if any.

protected boolean dispatchGenericFocusedEvent ( MotionEvent event)

protected void initializeScrollbars ( TypedArray a)

API স্তর XE12 এ যোগ করা হয়েছে

protected void onLayout (boolean changed, int left, int top, int right, int bottom)

protected void onVisibilityChanged ( View changedView, int visibility)