Search in sources :

Example 56 with LayoutParams

use of android.support.v7.widget.RecyclerView.LayoutParams in project ToolBarLib by jjhesk.

the class TopBarManager method triggerForCustomExternalCustomView.

public void triggerForCustomExternalCustomView() {
    if (toolbar_resid == 0)
        return;
    Toolbar.LayoutParams layoutParams = new Toolbar.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    layoutParams.gravity = Gravity.TOP;
    final View h = ToolbarHelper.generateView(toolbar_resid, ctx);
    toolbar.addView(h, layoutParams);
    actionbar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
//   h.bringToFront();
}
Also used : View(android.view.View) TextView(android.widget.TextView) Toolbar(android.support.v7.widget.Toolbar)

Example 57 with LayoutParams

use of android.support.v7.widget.RecyclerView.LayoutParams in project InstaMaterial by frogermcs.

the class UserProfileAdapter method onCreateViewHolder.

@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    final View view = LayoutInflater.from(context).inflate(R.layout.item_photo, parent, false);
    StaggeredGridLayoutManager.LayoutParams layoutParams = (StaggeredGridLayoutManager.LayoutParams) view.getLayoutParams();
    layoutParams.height = cellSize;
    layoutParams.width = cellSize;
    layoutParams.setFullSpan(false);
    view.setLayoutParams(layoutParams);
    return new PhotoViewHolder(view);
}
Also used : StaggeredGridLayoutManager(android.support.v7.widget.StaggeredGridLayoutManager) ImageView(android.widget.ImageView) BindView(butterknife.BindView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 58 with LayoutParams

use of android.support.v7.widget.RecyclerView.LayoutParams in project ListenerMusicPlayer by hefuyicoder.

the class ArtistDetailFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_artist_detail, container, false);
    if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) {
        root.findViewById(R.id.app_bar).setFitsSystemWindows(false);
        root.findViewById(R.id.artist_art).setFitsSystemWindows(false);
        root.findViewById(R.id.gradient).setFitsSystemWindows(false);
        Toolbar toolbar = (Toolbar) root.findViewById(R.id.toolbar);
        CollapsingToolbarLayout.LayoutParams layoutParams = (CollapsingToolbarLayout.LayoutParams) toolbar.getLayoutParams();
        layoutParams.height += DensityUtil.getStatusBarHeight(getContext());
        toolbar.setLayoutParams(layoutParams);
        toolbar.setPadding(0, DensityUtil.getStatusBarHeight(getContext()), 0, 0);
    }
    return root;
}
Also used : CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) Toolbar(android.support.v7.widget.Toolbar)

Example 59 with LayoutParams

use of android.support.v7.widget.RecyclerView.LayoutParams in project ListenerMusicPlayer by hefuyicoder.

the class AlbumDetailFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_album_detail, container, false);
    if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) {
        root.findViewById(R.id.app_bar).setFitsSystemWindows(false);
        root.findViewById(R.id.album_art).setFitsSystemWindows(false);
        root.findViewById(R.id.gradient).setFitsSystemWindows(false);
        Toolbar toolbar = (Toolbar) root.findViewById(R.id.toolbar);
        CollapsingToolbarLayout.LayoutParams layoutParams = (CollapsingToolbarLayout.LayoutParams) toolbar.getLayoutParams();
        layoutParams.height += DensityUtil.getStatusBarHeight(getContext());
        toolbar.setLayoutParams(layoutParams);
        toolbar.setPadding(0, DensityUtil.getStatusBarHeight(getContext()), 0, 0);
    }
    return root;
}
Also used : CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) Toolbar(android.support.v7.widget.Toolbar)

Example 60 with LayoutParams

use of android.support.v7.widget.RecyclerView.LayoutParams in project ListenerMusicPlayer by hefuyicoder.

the class PlaylistDetailFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View root = inflater.inflate(R.layout.fragment_album_detail, container, false);
    if (Build.VERSION.SDK_INT >= 19 && Build.VERSION.SDK_INT < 21) {
        root.findViewById(R.id.app_bar).setFitsSystemWindows(false);
        root.findViewById(R.id.album_art).setFitsSystemWindows(false);
        root.findViewById(R.id.gradient).setFitsSystemWindows(false);
        Toolbar toolbar = (Toolbar) root.findViewById(R.id.toolbar);
        CollapsingToolbarLayout.LayoutParams layoutParams = (CollapsingToolbarLayout.LayoutParams) toolbar.getLayoutParams();
        layoutParams.height += DensityUtil.getStatusBarHeight(getContext());
        toolbar.setLayoutParams(layoutParams);
        toolbar.setPadding(0, DensityUtil.getStatusBarHeight(getContext()), 0, 0);
    }
    return root;
}
Also used : CollapsingToolbarLayout(android.support.design.widget.CollapsingToolbarLayout) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

View (android.view.View)86 RecyclerView (android.support.v7.widget.RecyclerView)78 TextView (android.widget.TextView)24 ViewGroup (android.view.ViewGroup)23 ImageView (android.widget.ImageView)20 LayoutParams (android.support.v7.widget.RecyclerView.LayoutParams)13 FrameLayout (android.widget.FrameLayout)10 Toolbar (android.support.v7.widget.Toolbar)9 Rect (android.graphics.Rect)8 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)8 LinearLayout (android.widget.LinearLayout)8 BindView (butterknife.BindView)8 ActionMenuView (android.support.v7.widget.ActionMenuView)7 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)7 MarginLayoutParams (android.view.ViewGroup.MarginLayoutParams)6 EditText (android.widget.EditText)6 CollapsibleActionView (android.support.v7.view.CollapsibleActionView)5 MenuView (android.support.v7.view.menu.MenuView)5 ImageView (carbon.widget.ImageView)5 TextView (carbon.widget.TextView)5