use of android.support.v7.widget.helper.ItemTouchHelper.RIGHT in project mongol-library by suragch.
the class MongolTextViewActivity method onPaddingClick.
public void onPaddingClick(View view) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Padding");
final String[] paddings = { "0dp", "10dp", "10dp, 0dp, 20dp, 30dp" };
builder.setSingleChoiceItems(paddings, mCheckedPaddingItem, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
float density = getResources().getDisplayMetrics().density;
switch(which) {
case 0:
mtvExample.setPadding(0, 0, 0, 0);
break;
case 1:
int px = (int) (10 * density);
mtvExample.setPadding(px, px, px, px);
break;
case 2:
int left = (int) (10 * density);
int top = (int) (0 * density);
int right = (int) (20 * density);
int bottom = (int) (30 * density);
mtvExample.setPadding(left, top, right, bottom);
break;
}
mCheckedPaddingItem = which;
dialog.dismiss();
}
});
AlertDialog dialog = builder.create();
dialog.show();
}
use of android.support.v7.widget.helper.ItemTouchHelper.RIGHT in project android_packages_apps_Settings by omnirom.
the class InputMethodAndSubtypeEnabler method onCreate.
@Override
public void onCreate(final Bundle icicle) {
super.onCreate(icicle);
// Input method id should be available from an Intent when this preference is launched as a
// single Activity (see InputMethodAndSubtypeEnablerActivity). It should be available
// from a preference argument when the preference is launched as a part of the other
// Activity (like a right pane of 2-pane Settings app)
final String targetImi = getStringExtraFromIntentOrArguments(android.provider.Settings.EXTRA_INPUT_METHOD_ID);
final PreferenceScreen root = getPreferenceManager().createPreferenceScreen(getPrefContext());
mManager = new InputMethodAndSubtypeEnablerManager(this);
mManager.init(this, targetImi, root);
setPreferenceScreen(root);
}
use of android.support.v7.widget.helper.ItemTouchHelper.RIGHT in project openhab-android by openhab.
the class DividerItemDecoration method onDraw.
@Override
public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
if (mDivider == null) {
return;
}
int left = parent.getPaddingLeft();
int right = parent.getWidth() - parent.getPaddingRight();
int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = parent.getChildAt(i);
if (suppressDividerForChild(child, parent)) {
continue;
}
RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
int top = child.getBottom() + params.bottomMargin;
int bottom = top + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
use of android.support.v7.widget.helper.ItemTouchHelper.RIGHT in project RecyclerViewItemAnimators by gabrielemariotti.
the class DividerItemDecoration method drawHorizontal.
public void drawHorizontal(Canvas c, RecyclerView parent) {
final int top = parent.getPaddingTop();
final int bottom = parent.getHeight() - parent.getPaddingBottom();
final int childCount = parent.getChildCount();
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
final int left = child.getRight() + params.rightMargin;
final int right = left + mDivider.getIntrinsicHeight();
mDivider.setBounds(left, top, right, bottom);
mDivider.draw(c);
}
}
use of android.support.v7.widget.helper.ItemTouchHelper.RIGHT in project AndroidUtilLib by SiberiaDante.
the class SDGridItemDecoration method drawHorizontal.
private void drawHorizontal(Canvas c, RecyclerView parent, int childCount, int itemCount, int spanCount) {
for (int i = 0; i < childCount; i++) {
View child = parent.getChildAt(i);
int position = parent.getChildAdapterPosition(child);
if (isLastRow(position, spanCount, itemCount))
continue;
final int left = child.getLeft();
final int top = child.getBottom();
final int right = isLastColumn(position, spanCount, childCount) ? child.getRight() : child.getRight() + mBuilder.dividerVerSize;
final int bottom = child.getBottom() + mBuilder.dividerHorSize;
c.drawRect(left, top, right, bottom, mHorPaint);
}
}
Aggregations