use of android.support.v7.app.ActionBar.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;
}
use of android.support.v7.app.ActionBar.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;
}
use of android.support.v7.app.ActionBar.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;
}
use of android.support.v7.app.ActionBar.LayoutParams in project TwinklingRefreshLayout by lcodecorex.
the class ScrollingUtil method getRecyclerViewItemTopInset.
/**
* 通过反射获取RecyclerView的item的topInset
*
* @param layoutParams
* @return
*/
private static int getRecyclerViewItemTopInset(RecyclerView.LayoutParams layoutParams) {
try {
Field field = RecyclerView.LayoutParams.class.getDeclaredField("mDecorInsets");
field.setAccessible(true);
// 开发者自定义的滚动监听器
Rect decorInsets = (Rect) field.get(layoutParams);
return decorInsets.top;
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
use of android.support.v7.app.ActionBar.LayoutParams in project UltimateAndroid by cymcsg.
the class TwoWayLayoutManager method makeAndAddView.
private View makeAndAddView(int position, Direction direction, Recycler recycler) {
final View child = recycler.getViewForPosition(position);
final boolean isItemRemoved = ((LayoutParams) child.getLayoutParams()).isItemRemoved();
if (!isItemRemoved) {
addView(child, (direction == Direction.END ? -1 : 0));
}
setupChild(child, direction);
if (!isItemRemoved) {
updateLayoutEdgesFromNewChild(child);
}
return child;
}
Aggregations