本文整理汇总了Java中android.support.v4.widget.DrawerLayout.setDrawerShadow方法的典型用法代码示例。如果您正苦于以下问题:Java DrawerLayout.setDrawerShadow方法的具体用法?Java DrawerLayout.setDrawerShadow怎么用?Java DrawerLayout.setDrawerShadow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.widget.DrawerLayout
的用法示例。
在下文中一共展示了DrawerLayout.setDrawerShadow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initLayoutDrawer
import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
private void initLayoutDrawer() {
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
readingFragment = (ReadingFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_reading);
mDrawerList = (ListView) findViewById(R.id.left_drawer_list);
// set a custom shadow that overlays the main content when the drawer opens
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
// set up the drawer's list view with items and click listener
}
示例2: onCreate
import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
@Override
protected void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_features);
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar_actionbar);
setSupportActionBar(toolbar);
// ensure that Bluetooth exists
if (!ensureBLEExists())
finish();
final DrawerLayout drawer = mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
drawer.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);
// Set the drawer toggle as the DrawerListener
mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.drawer_open, R.string.drawer_close) {
@Override
public void onDrawerSlide(final View drawerView, final float slideOffset) {
// Disable the Hamburger icon animation
super.onDrawerSlide(drawerView, 0);
}
};
drawer.setDrawerListener(mDrawerToggle);
// setup plug-ins in the drawer
setupPluginsInDrawer((ViewGroup) drawer.findViewById(R.id.plugin_container));
// configure the app grid
final GridView grid = (GridView) findViewById(R.id.grid);
grid.setAdapter(new AppAdapter(this));
grid.setEmptyView(findViewById(android.R.id.empty));
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
示例3: onActivityCreated
import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
mImageLoader = new ImageLoader(getActivity(), android.R.color.transparent);
mYearsFilterRadioGroup = (RadioGroup) getActivity().findViewById(R.id.years_radio_group);
mTopicsFilterRadioGroup = (RadioGroup) getActivity().findViewById(R.id.topics_radio_group);
mDrawerLayout = (DrawerLayout) getActivity().findViewById(R.id.drawer_layout);
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow_flipped, GravityCompat.END);
}
示例4: onCreate
import android.support.v4.widget.DrawerLayout; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.explore_sessions_act);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mDrawerCollectionView = (CollectionView) findViewById(R.id.drawer_collection_view);
mTimeSlotLayout = findViewById(R.id.timeslot_view);
mTimeSlotDivider = findViewById(R.id.timeslot_divider);
TextView timeSlotTextView = (TextView) findViewById(R.id.timeslot);
ImageButton dismissTimeSlotButton = (ImageButton) findViewById(R.id.close_timeslot);
registerHideableHeaderView(findViewById(R.id.headerbar));
mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow_flipped, GravityCompat.END);
mFragment = (ExploreSessionsFragment) getFragmentManager()
.findFragmentById(R.id.explore_sessions_frag);
if (savedInstanceState != null) {
mTagFilterHolder = savedInstanceState.getParcelable(STATE_FILTER_TAGS);
mCurrentUri = savedInstanceState.getParcelable(STATE_CURRENT_URI);
} else if (getIntent() != null) {
mCurrentUri = getIntent().getData();
}
// Build the tag URI
long[] interval = ScheduleContract.Sessions.getInterval(mCurrentUri);
if (interval != null) {
mMode = MODE_TIME_FIT;
String title = getString(R.string.explore_sessions_time_slot_title,
getString(R.string.explore_sessions_show_day_n,
UIUtils.startTimeToDayIndex(interval[0])),
UIUtils.formatTime(interval[0], this));
setTitle(title);
mTimeSlotLayout.setVisibility(View.VISIBLE);
mTimeSlotDivider.setVisibility(View.VISIBLE);
timeSlotTextView.setText(title);
dismissTimeSlotButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
mTimeSlotLayout.setVisibility(View.GONE);
mTimeSlotDivider.setVisibility(View.GONE);
mMode = MODE_EXPLORE;
mCurrentUri = null;
reloadFragment();
}
});
} else {
mMode = MODE_EXPLORE;
}
// Add the back button to the toolbar.
Toolbar toolbar = getActionBarToolbar();
toolbar.setNavigationIcon(R.drawable.ic_up);
toolbar.setNavigationContentDescription(R.string.close_and_go_back);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
navigateUpOrBack(ExploreSessionsActivity.this, null);
}
});
// Start loading the tag metadata. This will in turn call the fragment with the
// correct arguments.
getLoaderManager().initLoader(TAG_METADATA_TOKEN, null, this);
// ANALYTICS SCREEN: View the Explore Sessions screen
// Contains: Nothing (Page name is a constant)
AnalyticsHelper.sendScreenView(SCREEN_LABEL);
}