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

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

یک کتابخانه بسیار زیبا برای ایجاد Toast های متفاوت

https://github.com/GrenderG/Toasty

آدرس Dependency :

Build.Gradle Module

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

 

Build.Gradle app

dependencies {
	...
	compile 'com.github.GrenderG:Toasty:1.2.8'
}

 

 

To display an error Toast

Toasty.error(yourContext, "This is an error toast.", Toast.LENGTH_SHORT, true).show();

 

 

To display a success Toast

Toasty.success(yourContext, "Success!", Toast.LENGTH_SHORT, true).show();

 

To display an info Toast

Toasty.info(yourContext, "Here is some info for you.", Toast.LENGTH_SHORT, true).show();

 

To display a warning Toast

Toasty.warning(yourContext, "Beware of the dog.", Toast.LENGTH_SHORT, true).show();

 

 

To display the usual Toast

Toasty.normal(yourContext, "Normal toast w/o icon").show();

 

 

To display the usual Toast with icon

Toasty.normal(yourContext, "Normal toast w/ icon", yourIconDrawable).show();

 

 

 

collage.thumb.png.0f32f6b5a6d7ddd07ae44a2e2ba75a8a.png

Toasty-master.zip

لینک ارسال
به اشتراک گذاری در سایت های دیگر
در 5 ساعت قبل، evill گفته است :

سلام

اسم کتابخونه چی هست؟

اون کدی که باید build.gradle

اضافه کنیم رو میخواستم

مقاله آپدیت شد

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

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

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

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

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

  تنها استفاده از 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
      با استفاده از این کتابخانه شما میتوانید  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);  
       
       
      support AnimCheckBox
      AnimCheckBox-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
      این کتابخانه به منظور ارائه انیمیشن های جدید برای اکتیویتی ها در 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
  • فایل

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