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


Java SlidingPaneLayout.setSliderFadeColor方法代碼示例

本文整理匯總了Java中android.support.v4.widget.SlidingPaneLayout.setSliderFadeColor方法的典型用法代碼示例。如果您正苦於以下問題:Java SlidingPaneLayout.setSliderFadeColor方法的具體用法?Java SlidingPaneLayout.setSliderFadeColor怎麽用?Java SlidingPaneLayout.setSliderFadeColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.support.v4.widget.SlidingPaneLayout的用法示例。


在下文中一共展示了SlidingPaneLayout.setSliderFadeColor方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateView

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
@Override
protected void onCreateView(final Bundle savedInstanceState) {
	setContentView(R.layout.activity_feature_uart);

	// Setup the sliding pane if it exists
	final SlidingPaneLayout slidingPane = mSlider = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
	if (slidingPane != null) {
		slidingPane.setSliderFadeColor(Color.TRANSPARENT);
		slidingPane.setShadowResourceLeft(R.drawable.shadow_r);
		slidingPane.setPanelSlideListener(new SlidingPaneLayout.SimplePanelSlideListener() {
			@Override
			public void onPanelClosed(final View panel) {
				// Close the keyboard
				final UARTLogFragment logFragment = (UARTLogFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_log);
				logFragment.onFragmentHidden();
			}
		});
	}
}
 
開發者ID:runtimeco,項目名稱:Android-DFU-App,代碼行數:20,代碼來源:UARTActivity.java

示例2: onCreateView

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
@Override
protected void onCreateView(final Bundle savedInstanceState) {
	setContentView(R.layout.activity_feature_uart);

	mContainer = findViewById(R.id.container);
	// Setup the sliding pane if it exists
	final SlidingPaneLayout slidingPane = mSlider = findViewById(R.id.sliding_pane);
	if (slidingPane != null) {
		slidingPane.setSliderFadeColor(Color.TRANSPARENT);
		slidingPane.setShadowResourceLeft(R.drawable.shadow_r);
		slidingPane.setPanelSlideListener(new SlidingPaneLayout.SimplePanelSlideListener() {
			@Override
			public void onPanelClosed(final View panel) {
				// Close the keyboard
				final UARTLogFragment logFragment = (UARTLogFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_log);
				logFragment.onFragmentHidden();
			}
		});
	}
}
 
開發者ID:NordicSemiconductor,項目名稱:Android-nRF-Toolbox,代碼行數:21,代碼來源:UARTActivity.java

示例3: onCreateView

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
@Override
protected void onCreateView(final Bundle savedInstanceState) {
	setContentView(R.layout.activity_feature_uart);

	// Setup the sliding pane if it exists
	final SlidingPaneLayout slidingPane = mSlider = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
	if (slidingPane != null) {
		slidingPane.setSliderFadeColor(Color.TRANSPARENT);
		slidingPane.setShadowResourceLeft(R.drawable.shadow_r);
		slidingPane.setPanelSlideListener(new SlidingPaneLayout.SimplePanelSlideListener() {
			@Override
			public void onPanelClosed(final View panel) {
				// Close the keyboard
				final UARTLogFragment logFragment = (UARTLogFragment) getFragmentManager().findFragmentById(R.id.fragment_log);
				logFragment.onFragmentHidden();
			}
		});
	}
}
 
開發者ID:frostmournex,項目名稱:nRFToolbox,代碼行數:20,代碼來源:UARTActivity.java

示例4: initSwipeBackFinish

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
/**
 * 初始化滑動返回
 */
private void initSwipeBackFinish() {
    if (isSupportSwipeBack) {
        SlidingPaneLayout slidingPaneLayout = new SlidingPaneLayout(this);
        //通過反射改變mOverhangSize的值為0,這個mOverhangSize值為菜單到右邊屏幕的最短距離,默認
        //是32dp,現在給它改成0
        try {
            //屬性
            Field f_overHang = SlidingPaneLayout.class.getDeclaredField("mOverhangSize");
            f_overHang.setAccessible(true);
            f_overHang.set(slidingPaneLayout, 0);
        } catch (Exception e) {
            e.printStackTrace();
        }

        slidingPaneLayout.setPanelSlideListener(BaseActivityWithSlidingPaneLayout.this);
        slidingPaneLayout.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
        //slidingPaneLayout.setLayoutParams(new SlidingPaneLayout.LayoutParams(100,SlidingPaneLayout.LayoutParams.MATCH_PARENT));
        View leftView = new View(this);
        leftView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        slidingPaneLayout.addView(leftView, 0);

        ViewGroup decor = (ViewGroup) getWindow().getDecorView();
        ViewGroup decorChild = (ViewGroup) decor.getChildAt(0);
        //decorChild.setBackgroundColor(getResources().getColor(android.R.color.white));
        decor.removeView(decorChild);
        decor.addView(slidingPaneLayout);
        slidingPaneLayout.addView(decorChild, 1);
    }
}
 
開發者ID:hkq325800,項目名稱:YellowNote,代碼行數:33,代碼來源:BaseActivityWithSlidingPaneLayout.java

示例5: initSwipeBackFinish

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
/**
 * 初始化滑動返回
 */
private void initSwipeBackFinish() {
    if (isSupportSwipeBack()) {
        SlidingPaneLayout slidingPaneLayout =  new SlidingPaneLayout(this);
        //通過反射改變mOverhangSize的值為0,這個mOverhangSize值為菜單到右邊屏幕的最短距離,默認
        //是32dp,現在給它改成0
        try {
            //屬性
            Field f_overHang = SlidingPaneLayout.class.getDeclaredField("mOverhangSize");
            f_overHang.setAccessible(true);
            f_overHang.set(slidingPaneLayout, 0);
        } catch (Exception e) {
            e.printStackTrace();
        }
        slidingPaneLayout.setPanelSlideListener(this);
        slidingPaneLayout.setSliderFadeColor(getResources().getColor(android.R.color.transparent));

        View leftView = new View(this);
        leftView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
        slidingPaneLayout.addView(leftView, 0);

        ViewGroup decor = (ViewGroup) getWindow().getDecorView();
        ViewGroup decorChild = (ViewGroup) decor.getChildAt(0);
        decorChild.setBackgroundColor(getResources().getColor(android.R.color.white));
        decor.removeView(decorChild);
        decor.addView(slidingPaneLayout);
        slidingPaneLayout.addView(decorChild, 1);
    }
}
 
開發者ID:paradoxie,項目名稱:SwipBackDemo,代碼行數:32,代碼來源:BaseActivity.java

示例6: setUpForTablets

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
public void setUpForTablets(int fragmentId, SlidingPaneLayout drawerLayout) {
    drawerLayout.setShadowResourceLeft(R.drawable.drawer_shadow_right);
    drawerLayout.setShadowResourceRight(R.drawable.drawer_shadow_right);
    mFragmentContainerView = getActivity().findViewById(fragmentId);
    drawerLayout.setSliderFadeColor(Color.TRANSPARENT);

    ActionBar actionBar = getActionBar();
    actionBar.setDisplayHomeAsUpEnabled(true);
    actionBar.setHomeButtonEnabled(true);

    mDrawerToggle = new ActionBarSlidingPanelToggle(getActivity(), R.string.navigation_drawer_open,
            R.string.navigation_drawer_close){
        @Override
        public void onDrawerClosed(View drawerView) {

        }

        @Override
        public void onDrawerOpened(View drawerView) {

        }
    };

    ((ActionBarSlidingPanelToggle) mDrawerToggle).setDrawerLayout(drawerLayout);

    mDrawerToggle.syncState();
}
 
開發者ID:vicmns,項目名稱:GmailLikeDrawer,代碼行數:28,代碼來源:NavigationDrawerFragment.java

示例7: onCreate

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
@Override protected void onCreate(Bundle state) {
    super.onCreate(state);

    setContentView(R.layout.activity_settings);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    if (toolbar != null) {
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    }

    slidingPane = (SlidingPaneLayout) findViewById(R.id.sliding_pane);
    slidingPane.setSliderFadeColor(getResources().getColor(R.color.preference_background));
    slidingPane.setShadowResourceLeft(R.drawable.pane_shadow);
    slidingPane.setPanelSlideListener(new SlidingPaneLayout.SimplePanelSlideListener() {
        @Override
        public void onPanelOpened(View panel) {
            if (isPreferencesOpen()) {
                resetPreferencePane();
            }
        }
    });

    slidingPane.openPane();

    profileAdapter = new ProfileAdapter(this);

    RecyclerView profileList = (RecyclerView) findViewById(R.id.profile_list);

    profileList.setLayoutManager(new LinearLayoutManager(this));
    profileList.setAdapter(profileAdapter);

    fillPreferences();

    getSupportLoaderManager().initLoader(G.PROFILES_LOADER_ID, null, profileLoaderCallbacks);

    boolean showNewProfile = getIntent().getBooleanExtra(G.ARG_NEW_PROFILE, false);

    if (state == null) {
        TransmissionProfile.cleanTemporaryPreferences();

        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
        prefs.registerOnSharedPreferenceChangeListener(defaultPrefListener);

        prefs = getSharedPreferences(TransmissionProfile.getPreferencesName(),
            Activity.MODE_PRIVATE);
        prefs.registerOnSharedPreferenceChangeListener(profilesPrefListener);
    } else {
        showNewProfile = false;
    }

    if (showNewProfile) {
        addFragment("new-profile", Type.PROFILE, null);

        slidingPane.closePane();
    }
}
 
開發者ID:urandom,項目名稱:gearshift,代碼行數:58,代碼來源:SettingsActivity.java

示例8: onCreate

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Crashlytics.start(this);
    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);
    setTheme(Themes.get(this).getCurrentTheme());
    sqlHelper = StacksDatabaseHelper.get(this);
    QuizletCommunicator.init(this);
    StudyStackCommunicator.init(this);

    setContentView(R.layout.main_activity);

    progressBar = (ProgressBar) findViewById(R.id.progressBar);
    adFrameLayout = (FrameLayout) findViewById(R.id.ad_frameLayout);
    slidingPane = (SlidingPaneLayout) findViewById(R.id.slidingPane);

    if (slidingPane == null) {
        isMultiPane = true;
    } else {
        isMultiPane = false;
        slidingPane.setCoveredFadeColor(getResources().getColor(android.R.color.transparent));
        slidingPane.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
        slidingPane.setPanelSlideListener(this);
    }
    progressBar.setVisibility(View.GONE);

    stackFragment = (StackFragment) getFragmentManager().findFragmentById(R.id.stackFragment);
    cardFragment = (CardFragment) getFragmentManager().findFragmentById(R.id.right_button);

    configureAdView();
    setupUncaughtExceptionHandler();

    if (savedInstanceState != null) {
        dataLoaded = savedInstanceState.getBoolean("dataLoaded", false);

        if (savedInstanceState.containsKey("stack") && StackManager.get().getStack(savedInstanceState.getString("stack")) != null) {
            cardFragment.setStack(StackManager.get().getStack(savedInstanceState.getString("stack")));
        }

        if (savedInstanceState.getBoolean("stacksOpened")) {
            showStacks();
            onPanelOpened(null);
        } else {
            showCards();
            onPanelClosed(null);
        }
    } else {
        showStacks();
        onPanelOpened(null);
    }

    if ((StackManager.get().getArchivedStackList().size() == 0 &&
            StackManager.get().getStackList().size() == 0)) {
        loadSQLData();
    }
    //new ReleaseNotes(this).showReleaseNotesWithoutRepeat();
    getSharedPreferences("properties", MODE_PRIVATE).edit().putInt("version", VERSION).apply();
}
 
開發者ID:PhaniGaddipati,項目名稱:Stacks-Flashcards,代碼行數:59,代碼來源:MainActivity.java

示例9: onCreate

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    //通過反射來改變SlidingPanelayout的值
    try {
        slidingPaneLayout = new SlidingPaneLayout(this);
        Field f_overHang = SlidingPaneLayout.class.getDeclaredField("mOverhangSize");
        f_overHang.setAccessible(true);
        f_overHang.set(slidingPaneLayout, 0);
        slidingPaneLayout.setPanelSlideListener(this);
        slidingPaneLayout.setSliderFadeColor(getResources().getColor(android.R.color.transparent));
    } catch (Exception e) {
        e.printStackTrace();
    }
    super.onCreate(savedInstanceState);
    mFileTemp = new File(getCacheDir(), WINDOWBITMAP);
    defaultTranslationX = dip2px(defaultTranslationX);
    shadowWidth = dip2px(shadowWidth);
    //behindframeLayout
    FrameLayout behindframeLayout = new FrameLayout(this);
    behindImageView = new ImageView(this);
    behindImageView.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
    behindframeLayout.addView(behindImageView, 0);

    //containerLayout
    LinearLayout containerLayout = new LinearLayout(this);
    containerLayout.setOrientation(LinearLayout.HORIZONTAL);
    containerLayout.setBackgroundColor(getResources().getColor(android.R.color.transparent));
    containerLayout.setLayoutParams(new ViewGroup.LayoutParams(getWindowManager().getDefaultDisplay().getWidth() + shadowWidth, ViewGroup.LayoutParams.MATCH_PARENT));
    //you view container
    frameLayout = new FrameLayout(this);
    frameLayout.setBackgroundColor(getResources().getColor(android.R.color.white));
    frameLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT));

    //add shadow
    shadowImageView = new ImageView(this);
    shadowImageView.setBackgroundResource(R.drawable.parallax_swipe_back_shadow);
    shadowImageView.setLayoutParams(new LinearLayout.LayoutParams(shadowWidth, LinearLayout.LayoutParams.MATCH_PARENT));
    containerLayout.addView(shadowImageView);
    containerLayout.addView(frameLayout);
    containerLayout.setTranslationX(-shadowWidth);
    //添加兩個view
    slidingPaneLayout.addView(behindframeLayout, 0);
    slidingPaneLayout.addView(containerLayout, 1);
}
 
開發者ID:cymcsg,項目名稱:UltimateAndroid,代碼行數:45,代碼來源:ParallaxSwipeBackActivity.java

示例10: onCreate

import android.support.v4.widget.SlidingPaneLayout; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    UIUtils.tryTranslateHttpIntent(this);
    BeamUtils.tryUpdateIntentFromBeam(this);

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_sessions_sandbox);

    final FragmentManager fm = getSupportFragmentManager();
    mTracksDropdownFragment = (TracksDropdownFragment) fm.findFragmentById(
            R.id.fragment_tracks_dropdown);

    mSlidingPaneLayout = (SlidingPaneLayout) findViewById(R.id.sliding_pane_layout);

    // Offset the left pane by its full width and left margin when collapsed
    // (ViewPager-like presentation)
    mSlidingPaneLayout.setParallaxDistance(
            getResources().getDimensionPixelSize(R.dimen.sliding_pane_width) +
                    getResources().getDimensionPixelSize(R.dimen.multipane_padding));
    mSlidingPaneLayout.setSliderFadeColor(getResources().getColor(
            R.color.sliding_pane_content_fade));

    routeIntent(getIntent(), savedInstanceState != null);

    if (savedInstanceState != null) {
        if (mFullUI) {
            int viewType = savedInstanceState.getInt(STATE_VIEW_TYPE);
            getSupportActionBar().setSelectedNavigationItem(viewType);
        }

        mDetailFragment = fm.findFragmentById(R.id.fragment_container_detail);
        updateDetailBackground();
    }

    // This flag prevents onTabSelected from triggering extra master pane reloads
    // unless it's actually being triggered by the user (and not automatically by
    // the system)
    mInitialTabSelect = false;

    mImageLoader = new ImageLoader(this, R.drawable.person_image_empty)
            .setMaxImageSize(getResources().getDimensionPixelSize(R.dimen.speaker_image_size))
            .setFadeInImage(UIUtils.hasHoneycombMR1());

    EasyTracker.getInstance().setContext(this);
}
 
開發者ID:TheDeltaProgram,項目名稱:iosched2013,代碼行數:47,代碼來源:SessionsSandboxMultiPaneActivity.java


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