رفتن به مطلب
انجمن اندروید ایران | آموزش برنامه نویسی اندروید و موبایل
  • android.png.1fab383bc8500cd93127cebc65b1dcab.png

پست های پیشنهاد شده

با استفاده از این کتابخانه شما میتوانید  ckeckBox هایی دارای حالت انیمیشن را به برنامه خود اضافه کنید

 

animcheckbox.gif.9d370fb467cf0c6cbfe53f425fc8364a.gif

 

 

build.gradle

repositories {
    // ...
    maven { url "https://jitpack.io" }
}

 

dependency 

dependencies {
    compile 'com.github.lguipeng:AnimCheckBox:1.0.1'
}

 

 

 

**Maven**

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.lguipeng</groupId>
    <artifactId>AnimCheckBox</artifactId>
    <version>1.0.1</version>
</dependency>

 

 

Layout File

  <com.github.lguipeng.library.animcheckbox.AnimCheckBox
        android:layout_gravity="center_horizontal"
        android:layout_width="80dp"
        android:padding="4dp"
        android:layout_height="wrap_content"
        app:stroke_width="4dp"
        app:stroke_color="#2196F3"
        app:circle_color="#1976D2"
        app:checked="true"/>

 

 

 

Java File

AnimCheckBox checkbox = (AnimCheckBox)findViewById(R.id.checkbox)
checkbox.setChecked(true);
boolean animation = true;
checkbox.setChecked(false, animation);

 

 

 

support AnimCheckBox

AnimCheckBox-master.zip

لینک ارسال
به اشتراک گذاری در سایت های دیگر

به گفتگو بپیوندید

هم اکنون می توانید مطلب خود را ارسال نمایید و بعداً ثبت نام کنید. اگر حساب کاربری دارید، برای ارسال با حساب کاربری خود اکنون وارد شوید .

مهمان
ارسال پاسخ به این موضوع...

×   شما در حال چسباندن محتوایی با قالب بندی هستید.   حذف قالب بندی

  تنها استفاده از 75 اموجی مجاز می باشد.

×   لینک شما به صورت اتوماتیک جای گذاری شد.   نمایش به صورت لینک

×   محتوای قبلی شما بازگردانی شد.   پاک کردن محتوای ویرایشگر

×   شما مستقیما نمی توانید تصویر خود را قرار دهید. یا آن را اینجا بارگذاری کنید یا از یک URL قرار دهید.

  • مطالب مشابه

    • توسط Omid Zakeri
      این کتابخانه شامل یک Floating Action Button است برای نمایش قسمت Navigation View یک منوی بسیار زیبا استفاده شده است.

       
       
       در ابتدا مورد زیر را در قسمت  build.gradle اضافه کنید:
      dependencies{ compile 'com.github.andremion:floatingnavigationview:1.1.1' }  
      قسمت layout.xml مورد زیر را اضافه کنید:
      <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true"> ... <com.andremion.floatingnavigationview.FloatingNavigationView android:id="@+id/floating_navigation_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="@dimen/fab_margin" app:layout_anchor="@id/toolbar" app:layout_anchorGravity="bottom|end" app:drawMenuBelowFab="true" app:headerLayout="@layout/navigation_view_header" app:menu="@menu/menu_navigation_view" /> </android.support.design.widget.CoordinatorLayout>  
      قسمت کلاس مربوط به Activity  :
      public class MainActivity extends AppCompatActivity { private FloatingNavigationView mFloatingNavigationView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mFloatingNavigationView = (FloatingNavigationView) findViewById(R.id.floating_navigation_view); mFloatingNavigationView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { mFloatingNavigationView.open(); } }); mFloatingNavigationView.setNavigationItemSelectedListener(new NavigationView.OnNavigationItemSelectedListener() { @Override public boolean onNavigationItemSelected(MenuItem item) { Snackbar.make((View) mFloatingNavigationView.getParent(), item.getTitle() + " Selected!", Snackbar.LENGTH_SHORT).show(); mFloatingNavigationView.close(); return true; } }); } @Override public void onBackPressed() { if (mFloatingNavigationView.isOpened()) { mFloatingNavigationView.close(); } else { super.onBackPressed(); } }  
       
       
       
      پشتیبانی : Floating-Navigation-View
      Floating-Navigation-View-master.zip
    • توسط Omid Zakeri
      یک کتابخانه بسیار جذاب و زیبا برای طراحی صفحات با فرگمنت های متفاوت.
       
      هدف استفاده از Fragment ها ساده تر می شود.
      مدیریت بهتر فرگمنت ها
       
      ویژگی   API قدرتمند
        یادداشت های انگلیسی به اندازه کافی
        سخت ترین استثنائات
        استثناها و اشکالات معمول در جداول را حل کنید
        انیمیشن انتقال فرگمنت
        گزینه پیکربندی تگ fragment
        اضافه کردن روش onBackPressed برای فرگمنت ها
        گزینه ای برای پیکربندی پراکنده حالت پیکربندی
        پشتیبانی از DialogFragment
        و ...
       

       
       

       
       
       
       
      راهنما و پشتیبانی: FragmentRigger
       
      FragmentRigger-master.zip
       

    • توسط Omid Zakeri
      شما با استفاده از این کتابخانه زیبا و جذاب میتوانید لیست contact یا هر لیست دیگر را به صورت نمایه زیر نمایش دهید:
       

       
       
      حالا برای دانلود این کتابخانه قسمت زیر را در gradle اضافه کنید:
      dependencies { compile 'com.gjiazhe:wavesidebar:1.3' }  
       
      و در قسمت Layout میتوانید از این کتابخانه به صورت زیر استفاده کنید:
      <com.gjiazhe.wavesidebar.WaveSideBar android:id="@+id/side_bar" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingRight="8dp" app:sidebar_position="right" app:sidebar_max_offset="80dp" app:sidebar_lazy_respond="false" app:sidebar_text_color="#8D6E63" app:sidebar_text_size="14sp" app:sidebar_text_alignment="center"/>  
       
      سری ویژگی های این کتابخانه شامل موارد زیر است :
       

       
       
      شما می توانید از این ویژگی ها در قسمت layout یا در قسمت اکتیویتی استفاده کنید :
      WaveSideBar sideBar = (WaveSideBar) findViewById(R.id.side_bar); sideBar.setTextColor(Color.BLACK); sideBar.setMaxOffset(100); sideBar.setPosition(WaveSideBar.POSITION_LEFT); sideBar.setTextAlign(WaveSideBar.TEXT_ALIGN_CENTER); sideBar.setLazyRespond(true);  
       
      WaveSideBar sideBar = (WaveSideBar) findViewById(R.id.side_bar); sideBar.setOnSelectIndexItemListener(new WaveSideBar.OnSelectIndexItemListener() { @Override public void onSelectIndexItem(String index) { Log.d("WaveSideBar", index); // Do something here .... } });  
      شما با استفاده از متد setIndexItems می توانید برای Customize استفاده کنید.
       
      با استفاده از متد setPosition شما می توانید موقعیت قرار گیری آیتم هارا انتخاب کنید:
      sideBar.setPosition(WaveSideBar.POSITION_LEFT);
       
       
       
      پشتیبانی WaveSideBar
       
      WaveSideBar-master.zip
    • توسط Omid Zakeri
      کتابخانه ای که شما می توانید هر کدام از ایتم های موجود در لیست خود را بین دیگر آیتم ها جابجا کنید یا به عبارتی با درگ کردن آیتم مکان و position آنها را تغییر دهید
       

       
      موارد زیر را در بخش dependency به پروژه خو اضافه کنید : 
      // Required implementation "com.android.support:appcompat-v7:{latest version}' implementation "com.android.support:recyclerview-v7:{latest version}' // RecyclerViewHelper implementation 'com.github.nisrulz:recyclerviewhelper:{latest version}'  
      build.gradle
      allprojects { repositories { google() jcenter() } }  
       
      آداپتر مورد نظر برای لیست به صورت زیر ی باید:
      public class MyAdapter extends RecyclerView.Adapter<MyAdapter.ItemViewHolder> implements RVHAdapter { ... @Override public boolean onItemMove(int fromPosition, int toPosition) { swap(fromPosition, toPosition); return false; } @Override public void onItemDismiss(int position, int direction) { remove(position); } public class ItemViewHolder extends RecyclerView.ViewHolder implements RVHViewHolder { ... @Override public void onItemSelected(int actionstate) { System.out.println("Item is selected"); } @Override public void onItemClear() { System.out.println("Item is unselected"); } } // Helper functions you might want to implement to make changes in the list as an event is fired private void remove(int position) { dataList.remove(position); notifyItemRemoved(position); } private void swap(int firstPosition, int secondPosition) { Collections.swap(dataList, firstPosition, secondPosition); notifyItemMoved(firstPosition, secondPosition); } }  
       
      public class MainActivity extends AppCompatActivity { RecyclerView myrecyclerview; ArrayList<String> data; MyAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); myrecyclerview = (RecyclerView) findViewById(R.id.rv_fruits); data = new ArrayList<>(); data.add("Apple"); ... data.add("Fig"); // Setup your adapter adapter = new MyAdapter(data); // Setup myrecyclerview.hasFixedSize(); myrecyclerview.setLayoutManager(new LinearLayoutManager(this)); myrecyclerview.setAdapter(adapter); // Setup onItemTouchHandler to enable drag and drop , swipe left or right ItemTouchHelper.Callback callback = new RVHItemTouchHelperCallback(adapter, true, true, true); ItemTouchHelper helper = new ItemTouchHelper(callback); helper.attachToRecyclerView(myrecyclerview); // Set the divider in the recyclerview myrecyclerview.addItemDecoration(new RVHItemDividerDecoration(this, LinearLayoutManager.VERTICAL)); // Set On Click Listener myrecyclerview.addOnItemTouchListener(new RVHItemClickListener(this, new RVHItemClickListener.OnItemClickListener() { @Override public void onItemClick(View view, int position) { String value = "Clicked Item " + data.get(position) + " at " + position; Log.d("TAG", value); Toast.makeText(MainActivity.this, value, Toast.LENGTH_SHORT).show(); } })); } }  
       
       
      پشتیبانی recyclerviewhelper
      recyclerviewhelper-develop.zip
    • توسط Omid Zakeri
      این کتابخانه به منظور ارائه انیمیشن های جدید برای اکتیویتی ها در Android ایجاد شده است. با استفاده از کلاس ViewDragHelper، می توانید انیمیشن هایی  ایجاد کنید که امکان کنترل کامل نمایش را توسط کاربر فراهم می کند.
      Dragger در حال حاضر با استفاده از Rebound (کوچک، 41.7kb) از فیس بوک برای ارائه انیمیشن های واقع گرایانه و بهبود عملکرد دستگاه های قدیمی است.
      این کتابخانه باید بر روی API 10 کار کند.
       

       
       
      برای استفاده از این کتابخانه شما ابتدا موارد زیر را به build.gradle اضافه کنید:
      repositories { maven { url "https://jitpack.io" } } dependencies { compile 'com.github.ppamorim:dragger:1.2' }  
      سپس می توانید از این کتابخانه به صورت زیر استفاده کنید :
      <com.github.ppamorim.library.DraggerView android:layout_width="match_parent" android:layout_height="match_parent" dragger_layout:drag_view_id="@+id/drag_view" dragger_layout:shadow_view_id="@+id/shadow_view" dragger_layout:drag_position="top"> <FrameLayout android:id="@+id/shadow_view" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/transparent" android:visibility="invisible"/> <LinearLayout android:id="@+id/drag_view" android:layout_width="match_parent" android:layout_height="match_parent"/> </com.github.ppamorim.library.DraggerView>  
       
      قسمت styles:
      <style name="YourTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="android:windowAnimationStyle">@null</item> </style>  
       
      شما میتوانید در قسمت manifest اکتیویتی مربوطه را اضافه کنید :
      <activity android:name="com.github.dragger.BaseActivity" android:theme="@style/YourTheme"/>  
       
      یا از روش زیر میتوانید استفاده کنید:
      public class YourActivity extends DraggerActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setShadowView(R.layout.custom_shadow); // It is not necessary, use if you want. setContentView(R.layout.layout_content); } }  سری متد هایی که شما می توانید در این کاتبخانه استفاده کنید و به صورت Custom نمایش دهید:
      setDraggerCallback(DraggerCallback) //Interface that's provides some infos of the animation. setSlideEnabled(boolean) //Enable or disable the drag, useful to use with ScrollViews. setHorizontalDragRange(float) //Draggable distance that the draggableView can use, horizontally. setVerticalDragRange(float) //Draggable distance that the draggableView can use, vertically. setRunAnimationOnFinishInflate(boolean) //Run the initial animation, useful if you only want the drag function. setDraggerLimit(float) //Set the max limit drag, default is 0.5 (center of the screen). setDraggerPosition(DraggerPosition) //Set the position of archor. setTension(float) //Tension of the animation. This represent with the friction, how much time the animation will be executed. setFriction(float) //Friction of the animation. This represent with the tension, how much friction is applied at the tension animation. show() //Show the drag view with Rebound animation. closeActivity() //Simply close the activity with Rebound animation, based of the DraggerPosition choosen.  
       
       
       
      پشتیبانی:Dragger
       
      Dragger-master.zip
  • فایل

×
×
  • اضافه کردن...