Search in sources :

Example 26 with InsetDrawable

use of android.graphics.drawable.InsetDrawable in project android_packages_apps_Settings by LineageOS.

the class PhotosViewHolderController method setupView.

@Override
public void setupView(AppViewHolder holder) {
    holder.appIcon.setImageDrawable(new InsetDrawable(mContext.getDrawable(R.drawable.ic_photo_library), INSET_SIZE));
    holder.appName.setText(mContext.getText(R.string.storage_detail_images));
    holder.summary.setText(Formatter.formatFileSize(mContext, mFilesSize));
}
Also used : InsetDrawable(android.graphics.drawable.InsetDrawable)

Example 27 with InsetDrawable

use of android.graphics.drawable.InsetDrawable in project android_packages_apps_Settings by omnirom.

the class PhotosViewHolderController method setupView.

@Override
public void setupView(AppViewHolder holder) {
    holder.appIcon.setImageDrawable(new InsetDrawable(mContext.getDrawable(R.drawable.ic_photo_library), INSET_SIZE));
    holder.appName.setText(mContext.getText(R.string.storage_detail_images));
    holder.summary.setText(Formatter.formatFileSize(mContext, mFilesSize));
}
Also used : InsetDrawable(android.graphics.drawable.InsetDrawable)

Example 28 with InsetDrawable

use of android.graphics.drawable.InsetDrawable in project AnExplorer by 1hakr.

the class DirectoryFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    final Context context = inflater.getContext();
    final Resources res = context.getResources();
    final View view = inflater.inflate(R.layout.fragment_directory, container, false);
    mProgressBar = (MaterialProgressBar) view.findViewById(R.id.progressBar);
    mEmptyView = (CompatTextView) view.findViewById(android.R.id.empty);
    mListView = (ListView) view.findViewById(R.id.list);
    mListView.setOnItemClickListener(mItemListener);
    mListView.setMultiChoiceModeListener(mMultiListener);
    mListView.setRecyclerListener(mRecycleListener);
    // Indent our list divider to align with text
    final Drawable divider = mListView.getDivider();
    final boolean insetLeft = res.getBoolean(R.bool.list_divider_inset_left);
    final int insetSize = res.getDimensionPixelSize(R.dimen.list_divider_inset);
    if (insetLeft) {
        mListView.setDivider(new InsetDrawable(divider, insetSize, 0, 0, 0));
    } else {
        mListView.setDivider(new InsetDrawable(divider, 0, 0, insetSize, 0));
    }
    mGridView = (GridView) view.findViewById(R.id.grid);
    mGridView.setOnItemClickListener(mItemListener);
    mGridView.setMultiChoiceModeListener(mMultiListener);
    mGridView.setRecyclerListener(mRecycleListener);
    return view;
}
Also used : Context(android.content.Context) Drawable(android.graphics.drawable.Drawable) BitmapDrawable(android.graphics.drawable.BitmapDrawable) InsetDrawable(android.graphics.drawable.InsetDrawable) InsetDrawable(android.graphics.drawable.InsetDrawable) Resources(android.content.res.Resources) ImageView(android.widget.ImageView) GridView(android.widget.GridView) View(android.view.View) AdapterView(android.widget.AdapterView) TextView(android.widget.TextView) ListView(android.widget.ListView) AbsListView(android.widget.AbsListView) CompatTextView(dev.dworks.apps.anexplorer.ui.CompatTextView) Point(android.graphics.Point)

Example 29 with InsetDrawable

use of android.graphics.drawable.InsetDrawable in project android_packages_apps_Settings by crdroidandroid.

the class PhotosViewHolderController method setupView.

@Override
public void setupView(AppViewHolder holder) {
    holder.appIcon.setImageDrawable(new InsetDrawable(mContext.getDrawable(R.drawable.ic_photo_library), INSET_SIZE));
    holder.appName.setText(mContext.getText(R.string.storage_detail_images));
    holder.summary.setText(Formatter.formatFileSize(mContext, mFilesSize));
}
Also used : InsetDrawable(android.graphics.drawable.InsetDrawable)

Example 30 with InsetDrawable

use of android.graphics.drawable.InsetDrawable in project SublimePicker by vikramkakkar.

the class SUtils method createButtonShape.

// Base button shape
private static Drawable createButtonShape(Context context, int color) {
    // Translation of Lollipop's xml button-bg definition to Java
    int paddingH = context.getResources().getDimensionPixelSize(R.dimen.button_padding_horizontal_material);
    int paddingV = context.getResources().getDimensionPixelSize(R.dimen.button_padding_vertical_material);
    int insetH = context.getResources().getDimensionPixelSize(R.dimen.button_inset_horizontal_material);
    int insetV = context.getResources().getDimensionPixelSize(R.dimen.button_inset_vertical_material);
    float[] outerRadii = new float[8];
    Arrays.fill(outerRadii, CORNER_RADIUS);
    RoundRectShape r = new RoundRectShape(outerRadii, null, null);
    ShapeDrawable shapeDrawable = new ShapeDrawable(r);
    shapeDrawable.getPaint().setColor(color);
    shapeDrawable.setPadding(paddingH, paddingV, paddingH, paddingV);
    return new InsetDrawable(shapeDrawable, insetH, insetV, insetH, insetV);
}
Also used : RoundRectShape(android.graphics.drawable.shapes.RoundRectShape) ShapeDrawable(android.graphics.drawable.ShapeDrawable) InsetDrawable(android.graphics.drawable.InsetDrawable)

Aggregations

InsetDrawable (android.graphics.drawable.InsetDrawable)37 Drawable (android.graphics.drawable.Drawable)15 LayerDrawable (android.graphics.drawable.LayerDrawable)6 StateListDrawable (android.graphics.drawable.StateListDrawable)5 ImageView (android.widget.ImageView)5 TextView (android.widget.TextView)5 Resources (android.content.res.Resources)4 ColorDrawable (android.graphics.drawable.ColorDrawable)4 GradientDrawable (android.graphics.drawable.GradientDrawable)4 NonNull (androidx.annotation.NonNull)4 Context (android.content.Context)3 TypedArray (android.content.res.TypedArray)3 Bitmap (android.graphics.Bitmap)3 ShapeDrawable (android.graphics.drawable.ShapeDrawable)3 RoundRectShape (android.graphics.drawable.shapes.RoundRectShape)3 View (android.view.View)3 Attributes (com.cengalabs.flatui.Attributes)3 Activity (android.app.Activity)2 Intent (android.content.Intent)2 Typeface (android.graphics.Typeface)2