use of android.support.v7.app.ActionBar.LayoutParams in project vlayout by alibaba.
the class StaggeredGridLayoutHelper method recycleFromEnd.
private void recycleFromEnd(RecyclerView.Recycler recycler, int line, LayoutManagerHelper helper) {
final OrientationHelperEx orientationHelper = helper.getMainOrientationHelper();
final int childCount = helper.getChildCount();
int i;
for (i = childCount - 1; i >= 0; i--) {
View child = helper.getChildAt(i);
if (child != null && orientationHelper.getDecoratedStart(child) > line) {
LayoutParams lp = (LayoutParams) child.getLayoutParams();
int position = lp.getViewPosition();
Span span = findSpan(position, child, false);
if (span != null) {
span.popEnd(orientationHelper);
helper.removeChildView(child);
recycler.recycleView(child);
}
} else {
// done
return;
}
}
}
use of android.support.v7.app.ActionBar.LayoutParams in project PhotoNoter by yydcdut.
the class DetailActivity method initToolBar.
private void initToolBar() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
toolbar.setBackgroundColor(Color.TRANSPARENT);
toolbar.setTitle(" ");
toolbar.setNavigationIcon(R.drawable.ic_arrow_back_white_24dp);
if (AppCompat.AFTER_LOLLIPOP) {
int size = getStatusBarSize();
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) toolbar.getLayoutParams();
layoutParams.setMargins(0, size, 0, 0);
}
}
use of android.support.v7.app.ActionBar.LayoutParams in project EasyRecyclerView by Jude95.
the class RecyclerArrayAdapter method createSpViewByType.
private View createSpViewByType(ViewGroup parent, int viewType) {
for (ItemView headerView : headers) {
if (headerView.hashCode() == viewType) {
View view = headerView.onCreateView(parent);
StaggeredGridLayoutManager.LayoutParams layoutParams;
if (view.getLayoutParams() != null)
layoutParams = new StaggeredGridLayoutManager.LayoutParams(view.getLayoutParams());
else
layoutParams = new StaggeredGridLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.setFullSpan(true);
view.setLayoutParams(layoutParams);
return view;
}
}
for (ItemView footerview : footers) {
if (footerview.hashCode() == viewType) {
View view = footerview.onCreateView(parent);
StaggeredGridLayoutManager.LayoutParams layoutParams;
if (view.getLayoutParams() != null)
layoutParams = new StaggeredGridLayoutManager.LayoutParams(view.getLayoutParams());
else
layoutParams = new StaggeredGridLayoutManager.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.setFullSpan(true);
view.setLayoutParams(layoutParams);
return view;
}
}
return null;
}
use of android.support.v7.app.ActionBar.LayoutParams in project LeafPic by HoraApps.
the class AlertDialogsHelper method getInsertTextDialog.
public static AlertDialog getInsertTextDialog(final ThemedActivity activity, AlertDialog.Builder dialogBuilder, EditText editText, @StringRes int title) {
View dialogLayout = activity.getLayoutInflater().inflate(org.horaapps.leafpic.R.layout.dialog_insert_text, null);
TextView textViewTitle = (TextView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.rename_title);
((CardView) dialogLayout.findViewById(org.horaapps.leafpic.R.id.dialog_chose_provider_title)).setCardBackgroundColor(activity.getCardBackgroundColor());
textViewTitle.setBackgroundColor(activity.getPrimaryColor());
textViewTitle.setText(title);
ThemeHelper.setCursorDrawableColor(editText, activity.getTextColor());
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
editText.setLayoutParams(layoutParams);
editText.setSingleLine(true);
editText.getBackground().mutate().setColorFilter(activity.getTextColor(), PorterDuff.Mode.SRC_IN);
editText.setTextColor(activity.getTextColor());
try {
Field f = TextView.class.getDeclaredField("mCursorDrawableRes");
f.setAccessible(true);
f.set(editText, null);
} catch (Exception ignored) {
}
((RelativeLayout) dialogLayout.findViewById(org.horaapps.leafpic.R.id.container_edit_text)).addView(editText);
dialogBuilder.setView(dialogLayout);
return dialogBuilder.create();
}
use of android.support.v7.app.ActionBar.LayoutParams in project LeafPic by HoraApps.
the class SelectAlbumBottomSheet method setupDialog.
@Override
public void setupDialog(Dialog dialog, int style) {
super.setupDialog(dialog, style);
View contentView = View.inflate(getContext(), R.layout.select_folder_bottom_sheet, null);
theme = new ThemeHelper(getContext());
RecyclerView mRecyclerView = (RecyclerView) contentView.findViewById(R.id.folders);
mRecyclerView.setLayoutManager(new GridLayoutManager(getContext(), 1));
adapter = new BottomSheetAlbumsAdapter();
mRecyclerView.setAdapter(adapter);
exploreModePanel = (LinearLayout) contentView.findViewById(R.id.explore_mode_panel);
currentFolderPath = (TextView) contentView.findViewById(R.id.bottom_sheet_sub_title);
imgExploreMode = (IconicsImageView) contentView.findViewById(R.id.toggle_hidden_icon);
imgExploreMode.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
toggleExplorerMode(!exploreMode);
}
});
toggleExplorerMode(false);
/**
*SET UP THEME*
*/
theme.setColorScrollBarDrawable(ContextCompat.getDrawable(dialog.getContext(), R.drawable.ic_scrollbar));
contentView.findViewById(R.id.ll_bottom_sheet_title).setBackgroundColor(theme.getPrimaryColor());
contentView.findViewById(R.id.ll_select_folder).setBackgroundColor(theme.getCardBackgroundColor());
((TextView) contentView.findViewById(R.id.bottom_sheet_title)).setText(title);
((IconicsImageView) contentView.findViewById(R.id.create_new_folder)).setColor(theme.getIconColor());
((TextView) contentView.findViewById(R.id.create_new_folder_text)).setTextColor(theme.getSubTextColor());
((IconicsImageView) contentView.findViewById(R.id.done)).setColor(theme.getIconColor());
contentView.findViewById(R.id.done).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
selectAlbumInterface.folderSelected(currentFolderPath.getText().toString());
}
});
contentView.findViewById(R.id.ll_create_new_folder).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final EditText editText = new EditText(getContext());
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), theme.getDialogStyle());
AlertDialogsHelper.getInsertTextDialog(((ThemedActivity) getActivity()), builder, editText, R.string.new_folder);
builder.setPositiveButton(R.string.ok_action, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
File folderPath = new File(currentFolderPath.getText().toString() + File.separator + editText.getText().toString());
if (folderPath.mkdir())
displayContentFolder(folderPath);
}
});
builder.show();
}
});
dialog.setContentView(contentView);
CoordinatorLayout.LayoutParams layoutParams = (CoordinatorLayout.LayoutParams) ((View) contentView.getParent()).getLayoutParams();
CoordinatorLayout.Behavior behavior = layoutParams.getBehavior();
if (behavior != null && behavior instanceof BottomSheetBehavior) {
((BottomSheetBehavior) behavior).setBottomSheetCallback(mBottomSheetBehaviorCallback);
}
adapter.notifyDataSetChanged();
}
Aggregations