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


Java BottomBar類代碼示例

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


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

示例1: initView

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
private void initView() {
    mToolBar= (Toolbar) findViewById(R.id.common_toolbar);
    mBottomBar= (BottomBar) findViewById(R.id.bottomBar );
    mVpContent = (ViewPager) findViewById(R.id.vp_main_content);
    mBottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab_home:
                    mToolBar.setTitle("飛鴿");
                    mVpContent.setCurrentItem(0);
                    break;
                case R.id.tab_tools:
                    mToolBar.setTitle("發現");
                    mVpContent.setCurrentItem(1);
                    break;
                case R.id.tab_person:
                    mToolBar.setTitle("我");
                    mVpContent.setCurrentItem(2);
                    break;

            }
        }
    });
}
 
開發者ID:monsterLin,項目名稱:Pigeon,代碼行數:26,代碼來源:MainActivity.java

示例2: onCreate

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_three_tabs_quick_return);

    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);

    // We're doing nothing with this listener here this time. Check example usage
    // from ThreeTabsActivity on how to use it.
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {

        }
    });
}
 
開發者ID:roughike,項目名稱:BottomBar,代碼行數:17,代碼來源:ThreeTabsQRActivity.java

示例3: onBackPressed

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
public void onBackPressed() {
    if (webViewContent.getVisibility() == View.VISIBLE) {
        setMusicViewShown(false, true);
    } else {
        if (bottomBar.getCurrentTabPosition() != 0) {
            try {
                Method selectTabAtPosition = BottomBar.class
                        .getDeclaredMethod("selectTabAtPosition", int.class, boolean.class);
                selectTabAtPosition.setAccessible(true);
                selectTabAtPosition.invoke(bottomBar, 0, true);
            } catch (NoSuchMethodException |
                    InvocationTargetException | IllegalAccessException e) {
                e.printStackTrace();
            }
        } else
            finish();
    }
}
 
開發者ID:oxoooo,項目名稱:excited-android,代碼行數:20,代碼來源:MainActivity.java

示例4: onCreate

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

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    toolbarColorAnimator = new ToolbarColorAnimator(toolbar, Color.BLACK);

    topLevelTabs = new SparseArray<>();
    topLevelTabs.put(R.id.tab_dining, new DiningTab());
    topLevelTabs.put(R.id.tab_restaurants, new RestaurantsTab());
    topLevelTabs.put(R.id.tab_settings, new SettingsTab());

    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(this);
}
 
開發者ID:sargunv,項目名稱:purdue-dining-courts-android,代碼行數:18,代碼來源:MainActivity.java

示例5: initListener

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
public void initListener() {
    bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab1:
                    replaceFragment(new MusicFragment());
                    break;
                case R.id.tab2:
                    replaceFragment(new VideoHomeFragment());
                    break;
                case R.id.tab3:
                    replaceFragment(new HomeFragment());
                    break;
                case R.id.tab4:
                    replaceFragment(new MeFragment());

            }
        }
    });

    mFabMusic.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            LogUtils.d("MainActivity", "mFabMusic to startActivity");
            startActivity(new Intent(MainActivty.this, PlayMusicActivity.class));
        }
    });
    mFabMusic.setVisibility(View.GONE);

}
 
開發者ID:popo1379,項目名稱:popomusic,代碼行數:34,代碼來源:MainActivty.java

示例6: initializeBottomBar

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
/**
 * set up the navigation tabs at the bottom of the screen
 * navigation items:
 *      dashboard
 *      search
 *      add new habit
 *      follow requests
 *      profile
 */
private void initializeBottomBar() {
    bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int tabId) {
            switch (tabId) {
                case R.id.tab_dashboard:
                    onDashboardClicked();
                    break;
                case R.id.tab_search:
                    onSearchClicked();
                    break;
                case R.id.tab_addHabit:
                    break;
                case R.id.tab_followRequests:
                    onFollowRequestClicked();
                    break;
                case R.id.tab_profile:
                    onProfileClicked();
                    break;
            }
        }
    });

    bottomBar.setTabSelectionInterceptor(new TabSelectionInterceptor() {
        @Override
        public boolean shouldInterceptTabSelection(@IdRes int oldTabId, @IdRes int newTabId) {
            if (newTabId == R.id.tab_addHabit) {
                onAddHabitClicked();
                return true;
            }
            return false;
        }
    });
}
 
開發者ID:CMPUT301F17T15,項目名稱:CIA,代碼行數:45,代碼來源:HomeTabbedActivity.java

示例7: onCreate

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AppLog.d("trace===MainActivity onCreate");
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);
    mBottomBar = BottomBar.attach(this, savedInstanceState);

    initViews();

    AppLog.d("trace===MainActivity onCreate, end");
}
 
開發者ID:mingjunli,項目名稱:GithubApp,代碼行數:13,代碼來源:MainActivity.java

示例8: onCreateView

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this
    final View frescoView = inflater.inflate(R.layout.fresco_overlay, null);
    View rootView =  inflater.inflate(R.layout.fragment_view_manga, container, false);
    View mainView = getActivity().findViewById(R.id.MainLayout);
    BottomBar bottomBar = (BottomBar) mainView.findViewById(R.id.bottomBar);
    bottomBar.getShySettings().hideBar();
    coverImg =(ImageView) rootView.findViewById(R.id.cover_view_img);
    coverImg.setImageBitmap(coverImgBit);
    mangaName =(TextView) rootView.findViewById(R.id.manga_view_name);
    mangaName.setText(mName);
    TextView authorName = (TextView) rootView.findViewById(R.id.author_view_name);
    authorName.setText(mAuthor);
    TextView storyText = (TextView) rootView.findViewById(R.id.story_view);
    storyText.setText(mStory);
    mListView = (ListView) rootView.findViewById(R.id.chapter_list_view);
    final TextView chapterNumber = (TextView) frescoView.findViewById(R.id.chapNum);
    final TextView pageNumber = (TextView) frescoView.findViewById(R.id.pageNum);
    ArrayAdapter adapter = new ArrayAdapter(getActivity() , android.R.layout.simple_list_item_1, listItems);
    mListView.setAdapter(adapter);
    mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
            Log.d("Clicked", adapterView.getItemAtPosition(i) + " ");
            String pathCC = path + "/" + mName + "/" + adapterView.getItemAtPosition(i);
            try {
                File f = new File(pathCC);
                File file[] = f.listFiles();
                for (File aFile : file) {
                    chapterPaths.add("file://" + pathCC + "/" + aFile.getName());
                }
            }
            catch (NullPointerException e){
                Log.e("Warning", "No Chapter Images."+e);
            }
            chapterNumber.setText(adapterView.getItemAtPosition(i).toString());
            new ImageViewer.Builder(getActivity(), chapterPaths)
                    .setStartPosition(0)
                    .setOverlayView(frescoView)
                    .setImageChangeListener(getImageChangeListener(pageNumber, chapterPaths.size()))
                    .setOnDismissListener(getDismissListener(frescoView))
                    .show();
        }
    });
    return  rootView;
}
 
開發者ID:FR0ST1N,項目名稱:Mataku,代碼行數:49,代碼來源:ViewManga.java

示例9: onDetach

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
public void onDetach() {
    super.onDetach();
    mListener = null;
    View mainView = getActivity().findViewById(R.id.MainLayout);
    BottomBar bottomBar = (BottomBar) mainView.findViewById(R.id.bottomBar);
    bottomBar.getShySettings().showBar();
    ((AppCompatActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(false);
    ((MainActivity) getActivity()).setActionBarTitle("Mataku");
}
 
開發者ID:FR0ST1N,項目名稱:Mataku,代碼行數:11,代碼來源:ViewManga.java

示例10: setupBottomBar

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
private void setupBottomBar(BottomBar bottomBar) {
    bottomBar.setOnTabSelectListener(id -> {
        Fragment frag = null;

        switch (id) {
            case R.id.tab_map:
                if (awaitingLocationPermission) {
                    frag = new MapPlaceHolderFragment();
                } else {
                    frag = new MapboxMapFragment();
                }
                break;

            case R.id.tab_now:
                frag = new ExploreListViewFragment();
                break;

            case R.id.tab_browse:
                frag = new BrowseListViewFragment();
                break;

            case R.id.tab_favorites:
                frag = new FavoritesListViewFragment();
                break;
        }

        if (frag != null) {
            setCurrentFragment(frag);
        }
    });
}
 
開發者ID:Burning-Man-Earth,項目名稱:iBurn-Android,代碼行數:32,代碼來源:MainActivity.java

示例11: layoutDependsOn

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
public boolean layoutDependsOn(CoordinatorLayout parent, FloatingActionButton child, View dependency) {
    return dependency instanceof BottomBar;
}
 
開發者ID:HStanN,項目名稱:TakeRest,代碼行數:5,代碼來源:FABBehavior.java

示例12: onViewCreated

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
protected void onViewCreated(@Nullable Bundle savedInstanceState) {
    mBottomBar = BottomBar.attach(this, savedInstanceState);
    initViews();
}
 
開發者ID:Jusenr,項目名稱:androidgithub,代碼行數:6,代碼來源:MainActivity.java

示例13: getBottomBar

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
public BottomBar getBottomBar() {
    return this.bottomBar;
}
 
開發者ID:freespanish,項目名稱:Diccionario,代碼行數:5,代碼來源:MainActivity.java

示例14: onCreate

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MiuiStatusBarCompat.enableLightStatusBar(getWindow());
    setContentView(R.layout.main_activity);
    getWindow().setStatusBarColor(Color.TRANSPARENT);
    container = (InsetsFrameLayout) findViewById(R.id.container);
    bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    setBarBackground();

    webViewContent = (ViewGroup) findViewById(R.id.webView_content);
    webView = (MusicView) findViewById(R.id.webView);
    progressImage = (ImageView) findViewById(R.id.progress_image);
    playContent = (FrameLayout) findViewById(R.id.play_content);
    play = (ImageView) findViewById(R.id.image_play);
    appBarLayout = (AppBarLayout) findViewById(R.id.appbar);
    toolbarLayout = (CollapsingToolbarLayout) findViewById(R.id.toolbar_layout);

    container.setPrevent(InsetsFrameLayout.PREVENT_TOP);

    ImageButton down = (ImageButton) findViewById(R.id.down);
    ImageButton cancel = (ImageButton) findViewById(R.id.cancel);
    down.setOnClickListener(this);
    cancel.setOnClickListener(this);
    playContent.setOnClickListener(this);

    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    setSupportActionBar(toolbar);
    if (getSupportActionBar() != null)
        getSupportActionBar().setTitle(null);

    userId = PreferenceManager.getValue(this, LoginActivity.ID);

    setupFragments();
    addHomeFrame();

    setNavigationListener();

    String targetFragment = getIntent().getStringExtra("fragment");
    switchFragment(targetFragment);

    checkLoginStatus();
}
 
開發者ID:oxoooo,項目名稱:excited-android,代碼行數:44,代碼來源:MainActivity.java

示例15: onCreate

import com.roughike.bottombar.BottomBar; //導入依賴的package包/類
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Fresco.initialize(this);
    setContentView(R.layout.activity_main);
    LibF = new LibraryFragment();
    PopF = new PopularFragment();
    BroF = new BrowseFragment();
    BottomBar bottomBar = (BottomBar) findViewById(R.id.bottomBar);
    bottomBar.setOnTabSelectListener(new OnTabSelectListener() {
        @Override
        public void onTabSelected(@IdRes int menuItemId) {
            // The user selected a tab at the specified position
            FragmentTransaction FragTrans = FragMan.beginTransaction();
            if (menuItemId == R.id.menu_library) {

                FragTrans.replace(R.id.MainLayout, LibF);
            } else if (menuItemId == R.id.menu_popular) {

                FragTrans.replace(R.id.MainLayout, PopF);
            } else if (menuItemId == R.id.menu_browse) {

                FragTrans.replace(R.id.MainLayout, BroF);
            }
            FragTrans.commit();
        }

    });
    RequestQueue queue = MySingleton.getInstance(this.getApplicationContext()).
            getRequestQueue();
    popularMangaList = new ArrayList<>();
    newMangaList = new ArrayList<>();

    //TODO : Caching Popular mangalist
    //TODO : Implementing ThreadPool for concurrent mangalist fetch
    Intent mangaFetch = new Intent(this,MangaFetchService.class);
    mangaFetch.putExtra("mangaURL",mangaFox);
    mangaFetch.putExtra("receiver",new PopularProgress(new Handler()));
    this.startService(mangaFetch);

}
 
開發者ID:FR0ST1N,項目名稱:Mataku,代碼行數:42,代碼來源:MainActivity.java


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