當前位置: 首頁>>代碼示例>>Java>>正文


Java DrawerLayout.setDrawerShadow方法代碼示例

本文整理匯總了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

}
 
開發者ID:ceji-longquan,項目名稱:ceji_android,代碼行數:11,代碼來源:ReadingActivity.java

示例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);
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:36,代碼來源:FeaturesActivity.java

示例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);
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:10,代碼來源:VideoLibraryFilteredFragment.java

示例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);
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:75,代碼來源:ExploreSessionsActivity.java


注:本文中的android.support.v4.widget.DrawerLayout.setDrawerShadow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。