-
تعداد ارسال ها
150 -
تاریخ عضویت
-
آخرین بازدید
-
روز های برد
37
نوع محتوا
نمایه ها
تالارهای گفتگو
فروشگاه
بخش دریافت
تقویم
وبلاگها
Articles
پست ها ارسال شده توسط 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
- 1
-
کتابخانه WindowImageView صفحه نمایش را به صورت یک background خاص نمایش می دهد همان طور که می بینید جلوه زیبا و حرفه ای به اپلیکیشن شما می دهد.
ابتدا در قسمت build.gradle موارد زیر را اضافه کنید:
repositories { maven { url "https://jitpack.io" } } dependencies { compile 'com.github.Bleoo:WindowImageView:1.0.2' }
در قسمت xml.
<io.github.bleoo.windowimageview.WindowImageView android:id="@+id/window_image_view" android:layout_width="match_parent" android:layout_height="180dp" app:frescoEnable="false" app:src="@drawable/timg" />
و در قسمت کلاس مربوط اکتیویتی قسمت زیر را اضافه کنید:
window_image_view.setFrescoEnable(true); window_image_view.setImageResource(R.drawable.timg); window_image_view.bindRecyclerView(recyclerView);
راهنمایی و پشتیبانی : WindowImageView
-
MultiSnapRecyclerView کتابخانه ای با طراحی زیبا که به شما این امکان را می دهد لیست خود را به بهترین شکل و با طراحی فوق العاده طراحی کنید.
ابتدا در قسمت Gradle مورد زیر را اضافه کنید:
dependencies { implementation 'com.github.takusemba:multisnaprecyclerview:1.3.3' }
قسمت xml
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" app:msrv_gravity="start" or center, end app:msrv_ms_per_inch="@dimen/normal_speed" // speed of scrolling through. app:msrv_snap_count="2" /> items to scroll over
set layout manager
LinearLayoutManager layoutManager = new LinearLayoutManager(this); multiSnapRecyclerView.setLayoutManager(layoutManager); multiSnapRecyclerView.setAdapter(adapter); multiSnapRecyclerView.setOnSnapListener(new OnSnapListener() { @Override public void snapped(int position) { // do something with the position of the snapped view } });
راهنما و پشتیبانی : MultiSnapRecyclerView
- 1
-
یک کتابخانه بسیار جذاب و زیبا برای طراحی صفحات با فرگمنت های متفاوت.
- هدف
استفاده از Fragment ها ساده تر می شود.
مدیریت بهتر فرگمنت ها- ویژگی
API قدرتمند
یادداشت های انگلیسی به اندازه کافی
سخت ترین استثنائات
استثناها و اشکالات معمول در جداول را حل کنید
انیمیشن انتقال فرگمنت
گزینه پیکربندی تگ fragment
اضافه کردن روش onBackPressed برای فرگمنت ها
گزینه ای برای پیکربندی پراکنده حالت پیکربندی
پشتیبانی از DialogFragmentو ...
راهنما و پشتیبانی: FragmentRigger
-
با استفاده از این کتابخانه شما میتوانید ckeckBox هایی دارای حالت انیمیشن را به برنامه خود اضافه کنید
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);
-
شما با استفاده از این کتابخانه زیبا و جذاب میتوانید لیست 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);
-
کتابخانه ای که شما می توانید هر کدام از ایتم های موجود در لیست خود را بین دیگر آیتم ها جابجا کنید یا به عبارتی با درگ کردن آیتم مکان و 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(); } })); } }
-
این کتابخانه به منظور ارائه انیمیشن های جدید برای اکتیویتی ها در 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.
-
یک کتابخانه بسیار زیبا که جابجایی بین تب ها در فرگمنت ها را بصورت حبابی نمایش می دهد
دانلود :
compile 'com.github.florent37:bubbletab:1.0.2'
BubbleTab را به صورت زیر به layout.xml خود اضافه کنید
شما میتوانید دو پارامتر زیر را اضافه کنید
- circleColor
- circleRatio
<com.github.florent37.bubbletab.BubbleTab android:id="@+id/bubbleTab" android:layout_width="match_parent" android:layout_height="wrap_content" android:clipToPadding="false" android:background="@android:color/white" android:elevation="10dp" app:bubbleTab_circleColor="@color/colorAccent" app:bubbleTab_circleRatio="1.25" > <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:padding="16dp" android:src="@drawable/bubbletab_ic_hourglass_selector" /> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:padding="16dp" android:src="@drawable/bubbletab_ic_event_selector" /> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:padding="16dp" android:src="@drawable/bubbletab_ic_query_selector" /> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:padding="16dp" android:src="@drawable/bubbletab_ic_search_selector" /> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:padding="16dp" android:src="@drawable/bubbletab_ic_home_selector" /> </com.github.florent37.bubbletab.BubbleTab> <android.support.v4.view.ViewPager android:id="@+id/viewPager" android:layout_width="match_parent" android:layout_height="match_parent"/>
سپس برای set کردن viewPager از روش زیر استفاده کنید
bubbleTab.setupWithViewPager(viewPager);
-
کتابخانه Material Bottom Navigation یک کتابخانه بسیار جذاب و زیبا می باشد که دارای متریال دیزاینی منحصر به فرد است که باعث می شود که شما در طراحی و بازدهی اپلیکیشن های خود یک قدم جلوتر باشید
برای دانلود این کتابخانه در قسمت Gradle مورد زیر را اضافه کنید
compile 'com.github.armcha:LuseenBottomNavigation:1.8.2'
Maven
<dependency> <groupId>com.github.armcha</groupId> <artifactId>LuseenBottomNavigation</artifactId> <version>1.8.2</version> <type>pom</type> </dependency>
برای اضافه کردن BottomNavigationView به قسمت layout مورد زیر را اضافه کنید
<com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView android:id="@+id/bottomNavigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" />
سپس آیتم های BottomNavigation را اضافه کنید
BottomNavigationView bottomNavigationView = (BottomNavigationView) findViewById(R.id.bottomNavigation); BottomNavigationItem bottomNavigationItem = new BottomNavigationItem ("Record", ContextCompat.getColor(this, R.color.firstColor), R.drawable.ic_mic_black_24dp); BottomNavigationItem bottomNavigationItem1 = new BottomNavigationItem ("Like", ContextCompat.getColor(this, R.color.secondColor), R.drawable.ic_favorite_black_24dp); bottomNavigationView.addTab(bottomNavigationItem); bottomNavigationView.addTab(bottomNavigationItem1);
متد OnBottomNavigationItemClickListener
bottomNavigationView.setOnBottomNavigationItemClickListener(new OnBottomNavigationItemClickListener() { @Override public void onNavigationItemClick(int index) { Toast.makeText(MainActivity.this, "Item " +index +" clicked", Toast.LENGTH_SHORT).show(); } });
اگر شما از ViewPager استفاده می کنید شما میتوانید از BottomNavigationView برای تغییر color مورد زیر را set کنید
ContextCompat.getColor(context, R.color.firstColor) bottomNavigationView.setUpWithViewPager(yourPager , colorResources , imageResources);
شما می توانید انیمیشن اسلاید را هنگام استفاده از viewPager غیرفعال کنید
bottomNavigationView.disableViewPagerSlide();
شما می توانید از Bottom Navigation به صورت custom استفاده کنید:
<com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView android:id="@+id/bottomNavigation" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" app:bnv_colored_background="true" app:bnv_with_text="false" app:bnv_shadow="true" app:bnv_tablet="false" app:bnv_viewpager_slide="true" app:bnv_active_color="@color/colorPrimary" app:bnv_active_text_size="@dimen/bottom_navigation_text_size_active" app:bnv_inactive_text_size="@dimen/bottom_navigation_text_size_inactive"/>
همچنین شما میتوانید با set کردن متد زیر برای حالت های تبلت استفاده کنید
bottomNavigationView.activateTabletMode();
پشتیبانی LuseenBottomNavigation
- 1
-
گاهی اوقات لازم است که در بالای ViewPager یا ListView یک نمایه را اضافه کنیم.
DragTopLayout یک ViewGroup است که حاوی یک نمایه است یا View می باشد که به صورت زیر عمل می کند و شما می توانید این امکانات جذاب و زیبا رو به اپلیکیشن خود اضافه کنید.
build.gradle
dependencies { compile 'com.github.chenupt.android:dragtoplayout:1.2.1@aar' }
و کد زیر را به قسمت Layout o,n خود اضافه کنید:
<github.chenupt.dragtoplayout.DragTopLayout android:layout_width="match_parent" android:layout_height="match_parent"> <!--top view--> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:orientation="vertical"> ... </LinearLayout> <!--content view--> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> ... </LinearLayout> </github.chenupt.dragtoplayout.DragTopLayout>
https://github.com/chenupt/DragTopLayout
-
منوی کشویی یا همان navigation drawer یکی از امکاناتی است که اکثر توسعه دهندگان اندروید آنرا در پروژه های خود پیاده سازی می کنند.هرچند روش های مختلفی برای پیاده سازی navigation drawer وجود دارد ولی در این روش یکی از آسان ترین و سریع ترین روش پیاده سازی منوی کشویی می باشد.
Gradle dependency
repositories { // ... maven { url 'https://jitpack.io' } } dependencies { compile 'com.heinrichreimersoftware:material-drawer:2.3.3' }
در مرحله اول باید اکتیویتی مورد نظر extend بشه از DrawerActivity بصورت زیر :
public class MainActivity extends DrawerActivity {}
تنظیمات قسمت profile
addProfile( new DrawerProfile() .setRoundedAvatar((BitmapDrawable)getResources().getDrawable(R.drawable.profile_avatar)) .setBackground(getResources().getDrawable(R.drawable.profile_cover)) .setName(getString(R.string.profile_name)) .setDescription(getString(R.string.profile_description)) .setOnProfileClickListener(new DrawerProfile.OnProfileClickListener() { @Override public void onClick(DrawerProfile drawerProfile, long id) { Toast.makeText(MainActivity.this, "Clicked profile #" + id, Toast.LENGTH_SHORT).show(); } }) );
گروهبندی drawer list
addItem( new DrawerItem() .setImage(getResources().getDrawable(R.drawable.ic_first_item)) .setTextPrimary(getString(R.string.title_first_item)) .setTextSecondary(getString(R.string.description_first_item)) .setOnItemClickListener(new DrawerItem.OnItemClickListener() { @Override public void onClick(DrawerItem drawerItem, long id, int position) { Toast.makeText(MainActivity.this, "Clicked first item #" + id, Toast.LENGTH_SHORT).show(); } }) ); addDivider(); addItem( new DrawerItem() .setImage(getResources().getDrawable(R.drawable.ic_second_item)) .setTextPrimary(getString(R.string.title_second_item)) .setOnItemClickListener(new DrawerItem.OnItemClickListener() { @Override public void onClick(DrawerItem drawerItem, long id, int position) { Toast.makeText(MainActivity.this, "Clicked second item #" + id, Toast.LENGTH_SHORT).show(); } }) );
قسمت زیر را به style برنامه اضافه کنید (theme)
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <item name="colorPrimary">@color/color_primary</item> <item name="colorPrimaryDark">@color/color_primary_dark</item> <item name="colorAccent">@color/color_accent</item> <item name="actionBarStyle">@style/ThemeOverlay.AppCompat.Dark.ActionBar</item> </style>
برای افزودن یا تغییر theme منوی کشویی از روش زیر استفاده کنید:
setDrawerTheme( new DrawerTheme(this) .setBackgroundColorRes(R.color.background) .setTextColorPrimaryRes(R.color.primary_text) .setTextColorSecondaryRes(R.color.secondary_text) .setTextColorPrimaryInverseRes(R.color.primary_text_inverse) .setTextColorSecondaryInverseRes(R.color.secondary_text_inverse) .setHighlightColorRes(R.color.highlight) );
-
کتابخانه FlowingDrawer یک کتابخانه بسیار عالی و زیبا دارای متریال منحصر به فرد می باشد که شما میتوانید یک منوی بسیار برای اپلیکیشن خود قرار دهید
موارد زیر را به Gradle پروژه خود اضافه کنید:
repositories { jcenter() } dependencies { compile 'com.mxn.soul:flowingdrawer-core:2.0.0' compile 'com.nineoldandroids:library:2.4.0' }
activity_main.xml
<com.mxn.soul.flowingdrawer_core.FlowingDrawer xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawerlayout" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false" android:clipToPadding="false" app:edPosition="1" app:edMenuSize="260dp" app:edMenuBackground="#dddddd"> <!--content--> <RelativeLayout android:id="@+id/content" android:layout_width="match_parent" android:layout_height="match_parent"/> <!--menu--> <com.mxn.soul.flowingdrawer_core.FlowingMenuLayout android:id="@+id/menulayout" android:layout_width="match_parent" android:layout_height="match_parent"> <FrameLayout android:id="@+id/id_container_menu" android:layout_width="match_parent" android:layout_height="match_parent"/> </com.mxn.soul.flowingdrawer_core.FlowingMenuLayout> </com.mxn.soul.flowingdrawer_core.FlowingDrawer>
MainActivity
mDrawer = (FlowingDrawer) findViewById(R.id.drawerlayout); mDrawer.setTouchMode(ElasticDrawer.TOUCH_MODE_BEZEL); mDrawer.setOnDrawerStateChangeListener(new ElasticDrawer.OnDrawerStateChangeListener() { @Override public void onDrawerStateChange(int oldState, int newState) { if (newState == ElasticDrawer.STATE_CLOSED) { Log.i("MainActivity", "Drawer STATE_CLOSED"); } } @Override public void onDrawerSlide(float openRatio, int offsetPixels) { Log.i("MainActivity", "openRatio=" + openRatio + " ,offsetPixels=" + offsetPixels); } });
https://github.com/mxn21/FlowingDrawer
-
ChatKit یک کتابخانه طراحی شده برای ساده سازی توسعه ی رابط کاربری اپلیکیشن هایی که به عنوان چت می باشند استفاده می شود. این امکانات انعطاف پذیر برای ظاهر طراحی، سفارشی سازی و مدیریت داده ها است.
امکانات:
- پیام های رسانه ای پیش فرض و سفارشی
- طرح بندی کاملا قابل تنظیم(با استفاده از رنگ های خود، ظاهر متن، drawable، selectors و اندازه) و یا حتی ایجاد نشانه های سفارشی خود و / یا خود را برای رفتار منحصر به فرد؛
- لیستی از گفتگوها، از جمله چتهای گروهی و گروهی، نشانگرهای پیامهای خوانده نشده و آخرین پیام های کاربر؛
- لیست پیام ها (ورودی و خروجی) با صفحه بندی تاریخ و هدر های محاسبه شده در حال حاضر؛
- آواتار های مختلف بدون تحقق خاصی از بارگذاری تصویر - شما می توانید از هر کتابخانه ای که می خواهید استفاده کنید؛
- حالت انتخاب برای تعامل با پیام؛
- برجسته کردن لینک ها
- قالب بندی آسان تاریخ
- مدل های خود را برای گفتگو و پیام ها - هیچ تبدیل مورد نیاز وجود دارد؛
- آماده استفاده از نمایش ورودی؛
- انیمیشن های سفارشی (با توجه به استفاده از RecyclerView).دانلود از طریق Gradle
compile 'com.github.stfalcon:chatkit:0.2.2'
یا Maven
<dependency> <groupId>com.github.stfalcon</groupId> <artifactId>chatkit</artifactId> <version>0.2.2</version> <type>pom</type> </dependency>
https://github.com/stfalcon-studio/ChatKit
- 1
-
کتابخانه ای بسیار عالی برای ایجاد و پیاده سازی انیمیشن بر روی TextView در اندروید که شما میتوانید برای متن های مورد نظر خود انیمیشن ایجاد کنید همانند چیزی که در زیر می بینید:
repositories { maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } } dependencies { implementation 'com.shazam:android-reflow-animator:1.0.0-SNAPSHOT' }
برای حرکت از fromView به toView:
new ReflowTextAnimatorHelper.Builder(fromView, toView) .buildAnimator() .start();
https://github.com/shazam/reflow-animator
-
یک کتابخانه بسیار جذاب و زیبا برای نمایش Progress به صورت Horizontal که شما با استفاده از این کتابخانه می توانید تصاویر و عکس های خود را همانند صفحه استوری اینستاگرام پیمایش کنید.
build.gradle
allprojects { repositories { ... maven { url "https://jitpack.io" } } }
dependency
dependencies { compile 'com.github.shts:StoriesProgressView:2.0.0' }
xml layouts
<jp.shts.android.storiesprogressview.StoriesProgressView android:id="@+id/stories" android:layout_width="match_parent" android:layout_height="3dp" android:layout_gravity="top" android:layout_marginTop="8dp" />
yourActivity
public class YourActivity extends AppCompatActivity implements StoriesProgressView.StoriesListener { private StoriesProgressView storiesProgressView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); storiesProgressView = (StoriesProgressView) findViewById(R.id.stories); storiesProgressView.setStoriesCount(PROGRESS_COUNT); // <- set stories storiesProgressView.setStoryDuration(1200L); // <- set a story duration storiesProgressView.setStoriesListener(this); // <- set listener storiesProgressView.startStories(); // <- start progress } @Override public void onNext() { Toast.makeText(this, "onNext", Toast.LENGTH_SHORT).show(); } @Override public void onPrev() { // Call when finished revserse animation. Toast.makeText(this, "onPrev", Toast.LENGTH_SHORT).show(); } @Override public void onComplete() { Toast.makeText(this, "onComplete", Toast.LENGTH_SHORT).show(); } @Override protected void onDestroy() { // Very important ! storiesProgressView.destroy(); super.onDestroy(); } }
https://github.com/shts/StoriesProgressView
-
این کتابخانه برای برداشت و برش تصویر به صورت هوشمند است که می تواند مرزهای یک تصویر را شناسایی و به صورت صحیح تصویر بریده شود که میتوانید انواع تصاوی هم از طریق camera و هم از طریق گالری را برش دهید.
امکانات:
تصویر را به شیوه ای هوشمند می توانید برش دهید
حمایت از درگ یا کشیدن، اثر ذره بین برای بهبود موقعیت یابی،
پشتیبانی از تنظیمات UI مانند خطوط کمکی، ماسک، درگ، ذره بین و غیره.build.gradle
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
dependencies { compile 'com.github.pqpo:SmartCropper:v1.1.3@aar' }
Layout.xml
<me.pqpo.smartcropperlib.view.CropImageView android:id="@+id/iv_crop" android:layout_width="match_parent" android:layout_height="match_parent" />
activity Code
ivCrop.setImageToCrop(selectedBitmap);
Bitmap crop = ivCrop.crop();
https://github.com/pqpo/SmartCropper
-
SwipeBack یک کتابخانه اندروید است که می تواند با استفاده از ان حرکات و رفتن به یک اکتیویتی را به طور خاص و جالب نمایش داد.
شما می توانید جهت کشویی یا حرکت به سمت چپ یا راست را تعیین کنید مانند FROM_LEFT، FROM_TOP، FROM_RIGHT و FROM_BOTTOM .
برای استفاده از این کتابخانه در قسمت Gradle مورد زیر را اضافه کنید:
dependencies { compile 'com.gongwen:swipeback:1.0.2' }
کد xml مربوط به بخش Layout
<com.gw.swipeback.SwipeBackLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/swipeBackLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:directionMode="left" app:isSwipeFromEdge="true" app:maskAlpha="125" app:swipeBackFactor="0.5"> <!-- SwipeBackLayout must contains only one direct child --> </com.gw.swipeback.SwipeBackLayout>
<com.gw.swipeback.WxSwipeBackLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/swipeBackLayout" android:layout_width="match_parent" android:layout_height="match_parent" app:directionMode="left" app:isSwipeFromEdge="true" app:maskAlpha="125" app:swipeBackFactor="0.5"> <!-- WxSwipeBackLayout must contains only one direct child --> </com.gw.swipeback.WxSwipeBackLayout>
نکته: اگر شما از WxSwipeBackLayout استفاده می کنید، باید آنرا در کلاس
Application
خود به صورت زیر وارد کنید:public class MainApplication extends Application { @Override public void onCreate() { super.onCreate(); WxSwipeBackActivityManager.getInstance().init(this); } }
در قسمت onCreate مربوط به اکتیویتی کد زیر را وارد کنید:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); //SwipeBackLayout is included in the layout setContentView(layoutId); SwipeBackLayout mSwipeBackLayout = (SwipeBackLayout) findViewById(R.id.swipeBackLayout); mSwipeBackLayout.setDirectionMode(SwipeBackLayout.FROM_LEFT); mSwipeBackLayout.setMaskAlpha(125); mSwipeBackLayout.setSwipeBackFactor(0.5f); mSwipeBackLayout.setSwipeBackListener(new SwipeBackLayout.OnSwipeBackListener() { @Override public void onViewPositionChanged(View mView, float swipeBackFraction, float SWIPE_BACK_FACTOR) { } @Override public void onViewSwipeFinished(View mView, boolean isEnd) { } }); }
یا
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); SwipeBackLayout mSwipeBackLayout = new SwipeBackLayout(this); mSwipeBackLayout.addView(contentView); setContentView(mSwipeBackLayout); }
یا
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); //SwipeBackLayout is not included in the layout setContentView(layoutId); mSwipeBackLayout = new SwipeBackLayout(this); mSwipeBackLayout.attachToActivity(this); }
و حالا در قسمت them برای Style کد زیر را اضافه کنید
<style name="Theme.Swipe.Back.NoActionBar" parent="AppTheme"> <item name="android:windowIsTranslucent">true</item> <item name="android:windowBackground">@android:color/transparent</item> </style>
https://github.com/gongwen/SwipeBackLayout
- 1
-
کتابخانه Expandable LinearLayout یک کتابخانه جذاب و جالب می باشد که هر سطر به صورت Expandable دارای یک منوی باز شونده می باشد.همانطور که در زیر مشاهده می کنید:
قطعه کد زیر را در قسمت Dependency وارد کنید:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } } dependencies { compile 'com.github.iammert:ExpandableLayout:1.4.1' }
قطعه کد زیر را در Layout خود وارد کنید:
<iammert.com.expandablelib.ExpandableLayout android:id="@+id/el" android:layout_width="match_parent" android:layout_height="match_parent" app:parentLayout="@layout/layout_parent" app:childLayout="@layout/layout_child"/>
Set renderer
expandableLayout.setRenderer(new ExpandableLayout.Renderer<FruitCategory, Fruit>() { @Override public void renderParent(View view, FruitCategory model, boolean isExpanded, int parentPosition) { ((TextView) view.findViewById(R.id.tvParent)).setText(model.name); } @Override public void renderChild(View view, Fruit model, int parentPosition, int childPosition) { ((TextView) view.findViewById(R.id.tvChild)).setText(model.name); } });
Set listeners
expandableLayout.setExpandListener(new ExpandCollapseListener.ExpandListener<FruitCategory>() { @Override public void onExpanded(int parentIndex, FruitCategory parent, View view) { //Layout expanded } }); expandableLayout.setCollapseListener(new ExpandCollapseListener.CollapseListener<FruitCategory>() { @Override public void onCollapsed(int parentIndex, FruitCategory parent, View view) { //Layout collapsed } });
Add section or children
Section<FruitCategory, Fruit> section = new Section<>(); //defaut is false section.expanded = true; FruitCategory fruitCategory = new FruitCategory("Fruits"); Fruit fruit1 = new Fruit("Apple"); Fruit fruit2 = new Fruit("Orange"); section.parent = fruitCategory; section.children.add(fruit1); section.children.add(fruit2); expandableLayout.addSection(section); expandableLayout.addChild(fruitCategory, new Fruit("Grape"));
Filter parent and children
//make your parent class filterable class FruitCatefory implements Filterable{} //make your child class filterable class FruitCatefory implements Filterable{} Now, you can search in parents or children. Layout will be updated automatically. expendableLayout.filterParent("SEARCH PARAM") //or expendableLayout.filterChildren("SEARCH PARAM")
https://github.com/iammert/ExpandableLayout
- 2
-
چیدمان Vega Scroll کتابخانه ای جذاب برای پیمایش RecyclerView می باشد که یک فریم جریان انیمیشن بسیار سبک زیبا است که در هنگام پیمایش محو می شود و head itemView را کاهش می دهد.
قسمت زیر را به gradle اضافه کنید:
compile 'com.stone.vega.library:VegaLayoutManager:1.0.1'
xml file
<android.support.v7.widget.RecyclerView android:id="@+id/main_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" />
LayoutManager
RecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_recycler_view); recyclerView.setLayoutManager(new VegaLayoutManager()); RecyclerView.Adapter adapter = getAdapter(); recyclerView.setAdapter(adapter);
https://github.com/xmuSistone/VegaLayoutManager
- 2
-
از این کتابخانه برای ایجاد امکاناتی از قبیل پیمایش برای RecyclerView در اندروید استفاده می شود. MultiSnapRecyclerView به راحتی یک ویژگی snapping را فراهم می کند. این کتابخانه بسیار زیبا جذاب و قدرتمند است.
dependencies { compile 'com.github.takusemba:multisnaprecyclerview:1.1.1' }
xml file
<com.takusemba.multisnaprecyclerview.MultiSnapRecyclerView android:layout_width="match_parent" android:layout_height="wrap_content" app:msrv_gravity="start" or center, end app:msrv_snap_count="2" /> items to scroll over
layout manager
LinearLayoutManager layoutManager = new LinearLayoutManager(this); multiSnapRecyclerView.setLayoutManager(layoutManager); multiSnapRecyclerView.setAdapter(adapter); multiSnapRecyclerView.setOnSnapListener(new OnSnapListener() { @Override public void snapped(int position) { // do something with the position of the snapped view } });
https://github.com/TakuSemba/MultiSnapRecyclerView
-
این کتابخانه بسیار عالی و حرفه ای شامل یک کامپوننت برای Material Design اندروید می باشد همانطور که در زیر مشاهده می کنید:
build.gradle
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
dependency
dependencies { compile 'moe.feng:MaterialStepperView:latest-version' }
اگر شما مستقیما از StepperItemView استفاده کنید، باید آیتم ها را به صورت دستی در XML، تنظیم کنید.
چطونگی تنظیم آیتم های StepperItemView در این لینک در دسترس می باشد.
لینک دانلود کتابخانه:
https://github.com/fython/MaterialStepperView
دانلود مستقیم فایل:
-
یک کتابخانه جذاب و ساده که با استفاده از این کتابخانه شما میتوانید یک مرور متن ایجاد کنید که محتوای آن هر چند ثانیه چند بار تغییر می کند.
project build.gradle
allprojects { repositories { jcenter() } }
module build.gradle
dependencies { compile 'com.tomer:fadingtextview:2.5' }
ابتدا باید یک آرایه رشته ای در پوشه string-array خود ایجاد کنید مانند:
<string-array name="examples"> <item>Hello</item> <item>Fading TextView</item> </string-array>
و در قسمت layout کد زیر را وارد کنید
<com.tomer.fadingtextview.FadingTextView android:layout_width="match_parent" android:layout_height="wrap_content" app:texts="@array/examples" />
شما می توانید مقدار زمانی که هر متن با استفاده از ویژگی زمان بندی و با تعیین طول زمان در میلی ثانیه مشخص شده است را تنظیم کنید. مثل این:
app:timeout="500"
<com.tomer.fadingtextview.FadingTextView android:id="@+id/fadingTextView" android:layout_width="match_parent" android:layout_height="wrap_content" app:timeout="500" app:texts="@array/examples" />
و برای تنظیم متن به صورت پویا، می توانید از کد زیر استفاده کنید
String[] texts = {"text1","text2","text3"}; FadingTextView FTV = (FadingTextView) findViewById(R.id.fadingTextView); FTV.setTexts(texts); //You can use an array resource or a string array as the parameter
برای تنظیم زمان بین تغییرات متن، می توانید از موارد زیر استفاده کنید:
//For text change once every hour FTV.setTimeout(60, MINUTES); //For text change once every half a minute FTV.setTimeout(0.5, MINUTES); //For text change every 10 seconds FTV.setTimeout(10, SECONDS); //For text change every 500 milliseconds (0.5 seconds) FTV.setTimeout(500, MILLISECONDS);
https://github.com/rosenpin/FadingTextView
- 1
-
یک زیرمجموعه FloatingActionButton که شما با استفاده از این امکان همانطور که در زیر می بینید میتوانید برای FloatingActionButton شمارنده قرار دهید.
build.gradle
dependencies{ compile 'com.github.andremion:counterfab:1.0.1' }
<dependency> <groupId>com.github.andremion</groupId> <artifactId>counterfab</artifactId> <version>1.0.1</version> <type>pom</type> </dependency>
برای اضافه کردن FloatingActionButton به فایل xml.
<com.andremion.counterfab.CounterFab android:id="@+id/counter_fab" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_add_white_24dp" />
CounterFab counterFab = (CounterFab) findViewById(R.id.counter_fab); counterFab.setCount(10); // Set the count value to show on badge counterFab.increase(); // Increase the current count value by 1 counterFab.decrease(); // Decrease the current count value by 1
روش توصیه شده برای سفارشی کردن رنگ پس زمینه با استفاده از app:backgroundTint می باشد.
<com.andremion.counterfab.CounterFab android:id="@+id/counter_fab" android:layout_width="wrap_content" android:layout_height="wrap_content" app:backgroundTint="#009688" android:src="@drawable/ic_add_white_24dp" />
https://github.com/andremion/CounterFab
معرفی کتابخانه PRDownloader
در کتابخانه های اندروید
ارسال شده در
PRDownloader را می توان برای دانلود هر نوع فایل مانند تصویر، ویدئو، پی دی اف، APK و غیره استفاده می شود.
پشتیبانی از دانلود فایل بزرگ.
ما می توانیم وضعیت دانلود با شناسه دانلود داده شده را بررسی کنیم.
PRDownloader برای همه چیزهایی مانند onProgress، onCancel، onStart، onError و غیره هنگام فراخوانی فایل، callbacks می دهد.
پشتیبانی از لغو درخواست مناسب
بسیاری از درخواست ها می توانند به صورت موازی انجام شوند.
همه انواع سفارشی سازی ممکن است.
ابتدا قسمت زیر را به build.gradle اضافه کنید
permission in manifest
onCreate() Method of application class
PRDownloader.initialize(getApplicationContext());
تنظیماتی که شما می توانید به صورت customiz انجام دهید:
// Enabling database for resume support even after the application is killed: PRDownloaderConfig config = PRDownloaderConfig.newBuilder() .setDatabaseEnabled(true) .build(); PRDownloader.initialize(getApplicationContext(), config); // Setting timeout globally for the download network requests: PRDownloaderConfig config = PRDownloaderConfig.newBuilder() .setReadTimeout(30_000) .setConnectTimeout(30_000) .build(); PRDownloader.initialize(getApplicationContext(), config);
Make a download request
Pause a download request
PRDownloader.pause(downloadId);
Resume a download request
PRDownloader.resume(downloadId);
Cancel a download request
پشتیبانی : PRDownloader
PRDownloader-master.zip