برنامه نویسی موبایل اندروید

۳ مطلب در فروردين ۱۳۹۶ ثبت شده است

رنگ های متریال دیزاین (Material Design Color)

دانلود رنگ های متریال دیزاین در قالب یک فایل xml


۰ نظر موافقین ۰ مخالفین ۰
ُسینا رحیمی

Ripple Effect (ریپل افکت) در اندروید


تا به امروز برای اعمال Ripple Effect  بیشتر از کتابخانه هایی که اماده درست کرده بودند استفاده کردم و این موضوع که کتابخانه ها حجم برنامه رو زیاد می کنن من رو به این فکر انداخت که بتونم بدون استفاده از 

کتابخانه ای این افکت رو اضافه کنم به لایه ها، هنوز به صورت دقیق چیزی پیدا نکردم اما دنبالشم.

راه حل رو به رو بدون اضافه کردن کتابخانه ی خاصی به این موضوع پرداخته است :


Basic ripple setup

  • Ripples contained within the view.
    android:background="?attr/selectableItemBackground"
  • Ripples that extend beyond the view's bounds:
    android:background="?attr/selectableItemBackgroundBorderless"

    Have a look here for resolving ?attr xml references in Java code.

(This is how you do it:
// Create an array of the attributes we want to resolve
// using values from a theme
int[] attrs = new int[] { R.attr.listItemBackground /* index 0 */};

// Obtain the styled attributes. 'themedContext' is a context with a
// theme, typically the current Activity (i.e. 'this')
TypedArray ta = themedContext.obtainStyledAttributes(attrs);

// To get the value of the 'listItemBackground' attribute that was
// set in the theme used in 'themedContext'. The parameter is the index
// of the attribute in the 'attrs' array. The returned Drawable
// is what you are after
Drawable drawableFromTheme = ta.getDrawable(0 /* index */);

// Finally, free the resources used by TypedArray 
ta.recycle();

----------------------------------------------------------

Support Library

  • Using ?attr: instead of ?android:attr references the support library, so is available back to API 7.

Ripples with images/backgrounds

  • To have a image or background and overlaying ripple the easiest solution is to wrap the View in a FrameLayout with the ripple set with setForeground() or setBackground().

Honestly there is no clean way of doing this otherwise, though Nick Butcher did post this on the subject of ImageViews with ripples.


لیست کتابخانه هایی که ریپل افکت دارند :


۰ نظر موافقین ۰ مخالفین ۰
ُسینا رحیمی

تبدیل فایل اکسل به sqlite

با سلام امروز به یک سایت انلاین برخوردم که فایل اکسل رو بهش میدید و برای شما یک فایل sqlite بر میده ؛ خوبیش اینه که با زبان فارسی سازگاره و خیلی از نکاتی که شما توی جدول داخل اکسل گذاشتین رو براتون خیلی راحت تبدیل می کنه.

Convert CSV or Excel File To SQLite

http://converttosqlite.com/convert

۱ نظر موافقین ۰ مخالفین ۰
ُسینا رحیمی