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


Java SlidingUpPanelLayout類代碼示例

本文整理匯總了Java中com.sothree.slidinguppanel.SlidingUpPanelLayout的典型用法代碼示例。如果您正苦於以下問題:Java SlidingUpPanelLayout類的具體用法?Java SlidingUpPanelLayout怎麽用?Java SlidingUpPanelLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: onCreate

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);

        navigationView = (NavigationView) findViewById(R.id.nav_view);
        navigationView.setNavigationItemSelectedListener(this);

        drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);

        ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
        drawerLayout.setDrawerListener(toggle);
        toggle.syncState();

        slidingUpPanelLayout = (SlidingUpPanelLayout) findViewById(R.id.sliding_layout);

//        logAdapter = new LogAdapter(this);
//        mLogger = (RecyclerView) findViewById(R.id.rc_logger);
//        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
//        linearLayoutManager.setStackFromEnd(true);
//        mLogger.setHasFixedSize(true);
//        mLogger.setAdapter(logAdapter);
    }
 
開發者ID:tranleduy2000,項目名稱:sortalgorithm,代碼行數:27,代碼來源:MainActivity.java

示例2: replaceFragment

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void replaceFragment(SubsonicFragment fragment, int tag, boolean replaceCurrent) {
	if(slideUpPanel != null && slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED && !isPanelClosing) {
		secondaryFragment = fragment;
		nowPlayingFragment.setPrimaryFragment(false);
		secondaryFragment.setPrimaryFragment(true);
		supportInvalidateOptionsMenu();

		FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
		trans.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left, R.anim.enter_from_left, R.anim.exit_to_right);
		trans.hide(nowPlayingFragment);
		trans.add(R.id.now_playing_fragment_container, secondaryFragment, tag + "");
		trans.commit();
	} else {
		super.replaceFragment(fragment, tag, replaceCurrent);
	}
}
 
開發者ID:popeen,項目名稱:Popeens-DSub,代碼行數:18,代碼來源:SubsonicFragmentActivity.java

示例3: removeCurrent

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void removeCurrent() {
	if(slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED && secondaryFragment != null) {
		FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
		trans.setCustomAnimations(R.anim.enter_from_left, R.anim.exit_to_right, R.anim.enter_from_right, R.anim.exit_to_left);
		trans.remove(secondaryFragment);
		trans.show(nowPlayingFragment);
		trans.commit();

		secondaryFragment = null;
		nowPlayingFragment.setPrimaryFragment(true);
		supportInvalidateOptionsMenu();
	} else {
		super.removeCurrent();
	}
}
 
開發者ID:popeen,項目名稱:Popeens-DSub,代碼行數:17,代碼來源:SubsonicFragmentActivity.java

示例4: onRetrieveDeadlineDays

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void onRetrieveDeadlineDays(final ScheduleDeadlineDaysModel model) {
    swipeRefreshLayout.setRefreshing(false);
    if (slidingUpPanelLayout.getPanelState() != SlidingUpPanelLayout.PanelState.EXPANDED) {
        titleSlidingUpPanel.setText(new SimpleDateFormat("MMMM yyyy").format(date.getTime()));
    }
    materialCalendarView.addDecorator(new DayViewDecorator() {
        @Override
        public boolean shouldDecorate(CalendarDay day) {
            return day.getMonth() == model.month && model.getDays().contains(day.getDay());
        }

        @Override
        public void decorate(DayViewFacade view) {
            view.addSpan(new ForegroundColorSpan(ContextCompat.getColor(getContext(), android.R.color.white)));
            view.setSelectionDrawable(ContextCompat.getDrawable(getContext(), R.drawable.round));
        }
    });
}
 
開發者ID:mgilangjanuar,項目名稱:GoSCELE,代碼行數:20,代碼來源:ScheduleDeadlineFragment.java

示例5: onBackPressed

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public boolean onBackPressed() {
    boolean wasExpanded = false;
    if (slidingUpPanelLayout != null) {
        wasExpanded = slidingUpPanelLayout.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED;
        slidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
    }

    return wasExpanded;
}
 
開發者ID:aliumujib,項目名稱:Orin,代碼行數:11,代碼來源:FlatPlayerFragment.java

示例6: onBackPressed

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void onBackPressed() {
    if (mBottomSheetBehavior.getState() != BottomSheetBehaviorV2.STATE_COLLAPSED) {
        mBottomSheetBehavior.setState(BottomSheetBehaviorV2.STATE_COLLAPSED);
        return;
    }

    if (mDockViewPagerAdapter.getHomeScreenDockFragment().isEditing()) {
        mDockViewPagerAdapter.getHomeScreenDockFragment().stopEditAnimation();
        return;
    }

    if (isAppDrawerOpened()) {
        mSlidingUpPanelLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
    }
}
 
開發者ID:OhMyLob,項目名稱:Paper-Launcher,代碼行數:17,代碼來源:LauncherActivity.java

示例7: updateUiStartCompile

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
private void updateUiStartCompile() {
    if (mActionRun != null) mActionRun.setEnabled(false);
    if (mCompileProgress != null) mCompileProgress.setVisibility(View.VISIBLE);
    hideKeyboard();
    openDrawer(GravityCompat.START);

    mMessagePresenter.resume((JavaApplication) getApplication());
    mMessagePresenter.clear();
    mMessagePresenter.append("Compiling...\n");

    mContainerOutput.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
    mDiagnosticPresenter.clear();

    mBottomPage.setCurrentItem(0);

}
 
開發者ID:tranleduy2000,項目名稱:javaide,代碼行數:17,代碼來源:MainActivity.java

示例8: onCreateView

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View root = super
            .onCreateView(inflater, container, savedInstanceState, R.layout.map_info_bottom);
    mLayout = (SlidingUpPanelLayout) root.findViewById(R.id.map_bottomsheet);
    mSlideableView = mLayout.findViewById(R.id.map_bottomsheet_slideable);

    mLayout.setPanelSlideListener(mPanelSlideListener);
    mLayout.setPanelState(SlidingUpPanelLayout.PanelState.HIDDEN);
    mLayout.setEnableDragViewTouchEvents(false);

    // Collapse the panel when the dummy content view is touched
    mPanelContent = root.findViewById(R.id.map_bottomsheet_dummycontent);
    mPanelContent.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            mLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
        }
    });
    mPanelContent.setClickable(false);

    return root;
}
 
開發者ID:dreaminglion,項目名稱:iosched-reader,代碼行數:26,代碼來源:SlideableInfoFragment.java

示例9: onNewIntent

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    if (intent != null && intent.getExtras() != null) {
        this.setIntent(intent);
        String url = "";
        Bundle bundle = getIntent().getExtras();
        if (bundle != null) {
            url = bundle.getString(Extras.EXTRA_URL);
        }

        Wallpaper wallpaper = Database.get(this).getWallpaper(url);
        if (wallpaper == null) {
            return;
        }

        mWallpaper = wallpaper;
        loadWallpaper(mWallpaper.getThumbUrl());
        mSlidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
    }
}
 
開發者ID:danimahardhika,項目名稱:wallpaperboard,代碼行數:22,代碼來源:WallpaperBoardPreviewActivity.java

示例10: onBackPressed

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void onBackPressed() {
    if (mSlidingLayout.getPanelState() == SlidingUpPanelLayout.PanelState.EXPANDED) {
        mSlidingLayout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
        return;
    }

    if (mTooltip != null) {
        mTooltip.dismiss();
        mTooltip = null;
    }

    if (mHandler != null && mRunnable != null)
        mHandler.removeCallbacks(mRunnable);

    if (mExitTransition != null) {
        mExitTransition.exit(this);
        return;
    }
    super.onBackPressed();
}
 
開發者ID:danimahardhika,項目名稱:wallpaperboard,代碼行數:22,代碼來源:WallpaperBoardPreviewActivity.java

示例11: onPanelStateChanged

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void onPanelStateChanged(View panel, SlidingUpPanelLayout.PanelState previousState,
                                SlidingUpPanelLayout.PanelState newState) {
    File file = ImageLoader.getInstance().getDiskCache().get(mWallpaper.getUrl());
    if (newState == SlidingUpPanelLayout.PanelState.COLLAPSED &&
            mTooltip == null
            && Preferences.get(this).isShowWallpaperTooltip() &&
            !file.exists() &&
            !Preferences.get(this).isTimeToShowWallpaperPreviewIntro() &&
            !Preferences.get(this).isHighQualityPreviewEnabled()) {
        mTooltip = Tooltip.Builder(this)
                .to(mMenuPreview)
                .content(R.string.wallpaper_tooltip_preview)
                .desc(R.string.wallpaper_tooltip_preview_icon_tap)
                .descIcon(R.drawable.ic_toolbar_preview_full)
                .visibleDontShowAgain(true)
                .cancelable(false)
                .buttonCallback(tooltip -> {
                    Preferences.get(this).setShowWallpaperTooltip(!tooltip.getCheckboxState());
                    tooltip.dismiss();
                })
                .build();
        mTooltip.show();
    }
}
 
開發者ID:danimahardhika,項目名稱:wallpaperboard,代碼行數:26,代碼來源:WallpaperBoardPreviewActivity.java

示例12: onServiceConnected

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
    Log.d("ServiceConnection", "connected");
    StreamService.LocalBinder binder = (StreamService.LocalBinder) service;
    mService = binder.getService();
    mBound = true;

    // when the service is bound there is no need to display a notification (foreground)
    mService.foregroundStop();

    if (mService.isPlaying()) {
        fab.hide();
        sup.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
        panelSlider.post(new Runnable() {
            @Override
            public void run() {
                panelMain.setPadding(0, 0, 0, panelSlider.getHeight());
                playerSetConnectionType();
                startPlayerUpdater();
            }
        });
    } else
        sup.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
}
 
開發者ID:indywidualny,項目名稱:Centrum.fm,代碼行數:25,代碼來源:MainActivity.java

示例13: playEnclosure

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void playEnclosure(String url) {
    if (url == null)
        return;

    tracker.send(new HitBuilders.EventBuilder()
            .setCategory("Play Enclosure")
            .setAction(url)
            .build());

    if (Connectivity.isConnected(this)) {
        if (mBound)
            mService.playUrl(url);
        sup.setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
    } else {
        Snackbar.make(panelMain, getString(R.string.no_network),
                Snackbar.LENGTH_LONG).show();
    }
}
 
開發者ID:indywidualny,項目名稱:Centrum.fm,代碼行數:20,代碼來源:MainActivity.java

示例14: openPoiDetailDrawer

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void openPoiDetailDrawer(PointOfInterest poi) {
    POIDrawerFragment fragment = new POIDrawerFragment();
    Bundle bundle = new Bundle();
    bundle.putParcelable("poi", poi);
    bundle.putBoolean("close", isCloseTo(poi));
    bundle.putBoolean("journey", true);
    bundle.putBoolean("hasNext", currentPoi != getPois().get(getPois().size() - 1));
    bundle.putString("nextTitle", currentPoi != getPois().get(getPois().size() - 1) ? getPois().get(getPois().indexOf(currentPoi) + 1).getTitle(getLocale()) : "");
    fragment.setDrawerFragmentListener(this);
    fragment.setArguments(bundle);
    FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
    transaction.replace(R.id.drawer_container, fragment);
    transaction.commit();
    getDrawerLayout().setPanelState(SlidingUpPanelLayout.PanelState.EXPANDED);
}
 
開發者ID:rasmussaks,項目名稱:aken-ajalukku,代碼行數:17,代碼來源:JourneyActivity.java

示例15: onMetadataUpdate

import com.sothree.slidinguppanel.SlidingUpPanelLayout; //導入依賴的package包/類
@Override
public void onMetadataUpdate(MusicDirectory.Entry song, int fieldChange) {
	if(song != null && coverArtView != null && fieldChange == DownloadService.METADATA_UPDATED_COVER_ART) {
		int height = coverArtView.getHeight();
		if (height <= 0) {
			int[] attrs = new int[]{R.attr.actionBarSize};
			TypedArray typedArray = this.obtainStyledAttributes(attrs);
			height = typedArray.getDimensionPixelSize(0, 0);
			typedArray.recycle();
		}
		getImageLoader().loadImage(coverArtView, song, false, height, false);

		// We need to update it immediately since it won't update if updater is not running for it
		if(nowPlayingFragment != null && slideUpPanel.getPanelState() == SlidingUpPanelLayout.PanelState.COLLAPSED) {
			nowPlayingFragment.onMetadataUpdate(song, fieldChange);
		}
	}
}
 
開發者ID:nvllsvm,項目名稱:Audinaut,代碼行數:19,代碼來源:SubsonicFragmentActivity.java


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