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));
}
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));
}
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;
}
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));
}
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);
}
Aggregations