<অনসোয়াইপ>
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ব্যবহারকারী যখন লেআউটে সোয়াইপ করে তখন সঞ্চালনের জন্য ক্রিয়া নির্দিষ্ট করে। মোশন সিকোয়েন্সের গতি এবং লক্ষ্যযুক্ত দৃশ্যের গতি সোয়াইপের গতি এবং দিক দ্বারা প্রভাবিত হয়, আপনি ঐচ্ছিক পরামিতিগুলির সাথে সেট করা সীমা সাপেক্ষে।
একটি একক <Transition>
এর জন্য একাধিক <OnSwipe>
নোড থাকতে পারে, প্রতিটি <OnSwipe>
একটি ভিন্ন সোয়াইপ দিক নির্দেশ করে এবং ব্যবহারকারী যখন সেই সোয়াইপটি করে তখন সঞ্চালনের জন্য একটি ভিন্ন ক্রিয়া থাকে।
সিনট্যাক্স
<OnSwipe
motion:touchAnchorId="@id/target_view"
motion:touchAnchorSide="side"
[ motion:dragDirection="direction" ]
[ motion:dragScale="scale" ]
[ motion:maxVelocity="maxVelocity" ]
[ motion:maxAcceleration="maxAcceleration" ]
/>
গুণাবলী
-
motion:touchAnchorId
- সোয়াইপ দ্বারা সরানো হচ্ছে যে দেখুন.
-
motion:touchAnchorSide
- টার্গেট ভিউ এর সাইডে যে সোয়াইপ নোঙর করা হয়।
MotionLayout
অ্যাঙ্কর এবং ব্যবহারকারীর আঙুলের মধ্যে একটি ধ্রুবক দূরত্ব রাখে। গ্রহণযোগ্য মানগুলি হল "left"
, "right"
, "top"
এবং "bottom"
। -
motion:dragDirection
- ব্যবহারকারীর সোয়াইপ গতির দিকনির্দেশ। এই বৈশিষ্ট্যটি সেট করা থাকলে, এই
<OnSwipe>
শুধুমাত্র নির্দিষ্ট দিক থেকে সোয়াইপের ক্ষেত্রে প্রযোজ্য। গ্রহণযোগ্য মান হল "dragLeft"
, "dragRight"
, "dragUp"
, এবং "dragDown"
। -
motion:dragScale
সোয়াইপের দৈর্ঘ্যের সাপেক্ষে দৃশ্যটি সরানো দূরত্ব নিয়ন্ত্রণ করে। ডিফল্ট মান হল 1, যা নির্দেশ করে যে ভিউ যতদূর সোয়াইপ করে ততদূর চলে যায়। dragScale
1 এর কম হলে, দৃশ্যটি সোয়াইপ দূরত্বের চেয়ে কম সরে যায়। উদাহরণস্বরূপ, 0.5 এর একটি dragScale
অর্থ হল যদি সোয়াইপ 4 সেমি সরে যায়, লক্ষ্য দৃশ্যটি 2 সেমি সরে যায়।
dragScale
1-এর বেশি হলে, দৃশ্যটি সোয়াইপ দূরত্বের চেয়ে অনেক দূরে চলে যায়। উদাহরণস্বরূপ, 1.5 এর একটি dragScale
মানে হল যদি সোয়াইপ 4 সেমি সরে যায়, টার্গেট ভিউ 6 সেমি সরে যায়।
-
motion:maxVelocity
লক্ষ্য দৃশ্যের সর্বোচ্চ বেগ।
-
motion:maxAcceleration
লক্ষ্য দৃশ্যের সর্বোচ্চ ত্বরণ।
এর মধ্যে রয়েছে
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-07-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# <OnSwipe>\n\nSpecifies the action to perform when the user swipes on the layout. The speed of\nthe motion sequence and the motion of the targeted view are affected by the\nspeed and direction of the swipe, subject to the limits you set with optional\nparameters.\n\nThere can be multiple `\u003cOnSwipe\u003e` nodes for a single `\u003cTransition\u003e`, with each\n`\u003cOnSwipe\u003e` specifying a different swipe direction and a different action to\nperform when the user performs that swipe.\n\nSyntax\n------\n\n```xml\n\u003cOnSwipe\n motion:touchAnchorId=\"@id/target_view\"\n motion:touchAnchorSide=\"side\"\n[ motion:dragDirection=\"direction\" ]\n[ motion:dragScale=\"scale\" ]\n[ motion:maxVelocity=\"maxVelocity\" ]\n[ motion:maxAcceleration=\"maxAcceleration\" ]\n /\u003e\n```\n\nAttributes\n----------\n\n`motion:touchAnchorId`\n: View that is being moved by the swipe.\n\n`motion:touchAnchorSide`\n: Side of the target view that the swipe is anchored to. `MotionLayout` keeps a\n constant distance between the anchor and the user's finger. Acceptable values\n are `\"left\"`, `\"right\"`, `\"top\"`, and `\"bottom\"`.\n\n`motion:dragDirection`\n: Direction of the user's swipe motion. If this attribute is set, this\n `\u003cOnSwipe\u003e` only applies to swipes in the specified direction. Acceptable values\n are `\"dragLeft\"`, `\"dragRight\"`, `\"dragUp\"`, and `\"dragDown\"`.\n\n`motion:dragScale`\n\n: Controls the distance the view moves relative to the length of the swipe. The\n default value is 1, indicating that the view moves as far as the swipe does.\n If `dragScale` is less than 1, the view moves less than the swipe distance.\n For example, a `dragScale` of 0.5 means that if the swipe moves 4 cm, the\n target view moves 2 cm.\n\n If `dragScale` is greater than 1, the view moves farther than the swipe\n distance. For example, a `dragScale` of 1.5 means that if the swipe moves 4\n cm, the target view moves 6 cm.\n\n`motion:maxVelocity`\n\n: Maximum velocity of the target view.\n\n`motion:maxAcceleration`\n\n: Maximum acceleration of the target view.\n\nContained in\n------------\n\n- [`\u003cTransition\u003e`](/training/constraint-layout/motionlayout/ref/transition)"]]