Java Code Examples for android.support.v4.widget.DrawerLayout#setScrimColor()
The following examples show how to use
android.support.v4.widget.DrawerLayout#setScrimColor() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MainActivity.java From FantasySlide with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getSupportActionBar().setDisplayHomeAsUpEnabled(true); final DrawerArrowDrawable indicator = new DrawerArrowDrawable(this); indicator.setColor(Color.WHITE); getSupportActionBar().setHomeAsUpIndicator(indicator); setTransformer(); // setListener(); drawerLayout = (DrawerLayout) findViewById(R.id.drawerLayout); drawerLayout.setScrimColor(Color.TRANSPARENT); drawerLayout.addDrawerListener(new DrawerLayout.SimpleDrawerListener() { @Override public void onDrawerSlide(View drawerView, float slideOffset) { if (((ViewGroup) drawerView).getChildAt(1).getId() == R.id.leftSideBar) { indicator.setProgress(slideOffset); } } }); }
Example 2
Source File: MainActivity.java From Jide-Note with MIT License | 6 votes |
/** * 初始化页面 */ private void CreateActivity() { recordFragment = ContentFragment.newInstance(ContentFragment.RECORD); getSupportFragmentManager().beginTransaction() .replace(R.id.content_frame,recordFragment) .commit(); drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); drawerLayout.setScrimColor(Color.TRANSPARENT); leftlayout = (LinearLayout) findViewById(R.id.left_drawer); leftlayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { drawerLayout.closeDrawers(); } }); setToolBar(); setTitle(RECORD); createMenuList(); viewAnimator = new ViewAnimator<>(MainActivity.this, menuItemList, recordFragment, drawerLayout, this); }
Example 3
Source File: MainActivity.java From TidyDemo with Apache License 2.0 | 6 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); overlayLayout = this.findViewById(R.id.overlayLayout); menuFrame = this.findViewById(R.id.menu_frame); int[] attrs = { android.R.attr.windowBackground }; TypedValue outValue = new TypedValue(); this.getTheme().resolveAttribute(android.R.attr.windowBackground, outValue, true); TypedArray style = this.getTheme().obtainStyledAttributes(outValue.resourceId, attrs); overlayBackground = style.getDrawable(0); contentFrame = findViewById(R.id.content_frame); drawLayout = (DrawerLayout) this.findViewById(R.id.drawer_layout); drawLayout.setDrawerListener(drawerListner); drawLayout.setScrimColor(Color.TRANSPARENT); }
Example 4
Source File: MainActivity.java From cidrawing with Apache License 2.0 | 5 votes |
private void setupView() { Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setScrimColor(Color.TRANSPARENT); drawer.setDrawerListener(toggle); toggle.syncState(); }
Example 5
Source File: MainActivity.java From CoolWeather with Apache License 2.0 | 5 votes |
private void initview() { mainDrawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout_main); initBgPic(); leftDrawer = findViewById(R.id.left_drawer); mainDrawerLayout.setScrimColor(0x00000000);// 设置底部页面背景透明度 FragmentManager fm = getSupportFragmentManager(); FragmentTransaction ft = fm.beginTransaction(); ft.replace(R.id.fragmentlayout, homecontent, HomePageFragment.TAG); ft.commit(); }
Example 6
Source File: FullScreenVideoActivity.java From AndroidTvDemo with Apache License 2.0 | 4 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_player); mSettings = new Settings(this); // handle arguments mVideoPath = getIntent().getStringExtra("videoPath"); Intent intent = getIntent(); String intentAction = intent.getAction(); if (!TextUtils.isEmpty(intentAction)) { if (intentAction.equals(Intent.ACTION_VIEW)) { mVideoPath = intent.getDataString(); } else if (intentAction.equals(Intent.ACTION_SEND)) { mVideoUri = intent.getParcelableExtra(Intent.EXTRA_STREAM); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { String scheme = mVideoUri.getScheme(); if (TextUtils.isEmpty(scheme)) { Log.e(TAG, "Null unknown ccheme\n"); finish(); return; } if (scheme.equals(ContentResolver.SCHEME_ANDROID_RESOURCE)) { mVideoPath = mVideoUri.getPath(); } else if (scheme.equals(ContentResolver.SCHEME_CONTENT)) { Log.e(TAG, "Can not resolve content below Android-ICS\n"); finish(); return; } else { Log.e(TAG, "Unknown scheme " + scheme + "\n"); finish(); return; } } } } if (!TextUtils.isEmpty(mVideoPath)) { new RecentMediaStorage(this).saveUrlAsync(mVideoPath); } // init UI Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar); setSupportActionBar(toolbar); ActionBar actionBar = getSupportActionBar(); customMediaController = new CustomMediaController(this, false); customMediaController.setSupportActionBar(actionBar); actionBar.setDisplayHomeAsUpEnabled(true); mToastTextView = (TextView)findViewById(R.id.toast_text_view); mHudView = (TableLayout)findViewById(R.id.hud_view); mDrawerLayout = (DrawerLayout)findViewById(R.id.drawer_layout); mRightDrawer = (ViewGroup)findViewById(R.id.right_drawer); mDrawerLayout.setScrimColor(Color.TRANSPARENT); // init player IjkMediaPlayer.loadLibrariesOnce(null); IjkMediaPlayer.native_profileBegin("libijkplayer.so"); mVideoView = (IjkVideoView)findViewById(R.id.video_view); mVideoView.setMediaController(customMediaController); mVideoView.setHudView(mHudView); // prefer mVideoPath if (mVideoPath != null) mVideoView.setVideoPath(mVideoPath); else if (mVideoUri != null) mVideoView.setVideoURI(mVideoUri); else { Log.e(TAG, "Null Data Source\n"); finish(); return; } mVideoView.start(); }