Kevin Wu
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # Bamtech(new) > [By吳岳, time=Fri, Jul 23, 2021 2:45 PM] ## Main Flow * All Files are under package "poorni.bamboo"(Seperate folders for Login and Navigation) * ![](https://i.imgur.com/O40vqAU.png) * The flow is Login -> Auth -> Homepage + Navigation Bar (Corresponding Activities : FirstActivity -> Login -> MainActivity) * FirstActivity is the first Page, uses activity_first.xml as layout * ![](https://i.imgur.com/CyWQVE8.png) * ![](https://i.imgur.com/vP1ibb7.png) * ![](https://i.imgur.com/bIaKQew.png) * ![](https://i.imgur.com/WsSdJ6T.png) * Sign in and enter Homepage + Navigation * ![](https://i.imgur.com/2sQOyi6.png) ## Loginpage ### Login.java(java/poorni.bamboo/Login * for login function,use Firebase UI * Now provide Email, google, Facebook(will show GraphMethodException , but still work) ,Twitter account login * build.gradle(bamtech.app): added dependencies for Firebase, fb login * strings.xml: add fb_id for fb login * manifest: meta-data and others for fb login ## Homepage + Navigation Bar ### MainActivity.java (java/poorni.bamboo * used to show content when uses changes between pages * Constructs Bottom Navigation View & NavController<br> <font color="#f00">2021/8/26: This method will have problem if you want to use bundle when intent to MainActivity <br> 8/27: putInt(destination_id) can avoid app crash, but the imagebutton in category and DIY will be no response while clicking</font> * have several popupwindows (profile,selection bar menu item) ### Layout *.xml files(res) * activity_main.xml 1.Uses navHostFragmentto show different contents for each page 2.bottomNav_view shows the for the navigation bar * fragment_*.xmls: are just for page creation * pop_*.xmls: popupwindows in MainActivity ### Menu & Navigation(res) * bottom_nav_menu.xml: used for building the bottom navigation bar * nav_graph.xml: 1.contructs the navigation graph 2.when you add a new destination, creates java class in java/poorni.bamboo/Navigation ### Other files(res) * Added colors to colors.xml, text to strings.xml * add theme.xml -> *may need to remove v24, night* * build.gradle(bamtech.app): added dependencies for navigation ## Profile ### user now * show username and photo(if any) ### Account * user data is in Firebase ,child("user") <br> data will be update by *user* class in Login file * The Attribute "advanced" is used for judging if user has permissions to reply others' question * Edit profile: let user change their info on firebase * Reset password: send an email to user for reseting password * Delete account: delete user's account, and turn back to Login Page ### Calendar * try to use Material-Calendar-View​ at first ,but can't figure out how object "EventDay" works * The original Calendar-View in android can't show event in the calendar ,so I just used the same way as I do in Bookmark ;( ### Bookmark * https://www.youtube.com/playlist?list=PLHQRWugvckFr9H2Mo4hyre1wQHglSRake this is how I update/delete data in firebase ### Reading List ### Q&A * for changing FloatActionButton's position , you need an FrameLayout (FAB in post by me,world forum) ### Watch later ### Logout ### DIY * firebase data: videos title, videos url, videos category(ID) * RecyclerView: WebView (play videos) + TextView (show videos title) * Search: SearchView * Filter: filtered by category # 8/2 BAMTECH會議報告(吳岳) ### Carousel * 嘗試網路套件 [https://github.com/denzcoskun/ImageSlideshow](https://) * 遇到的問題:與網路連線相關的問題,好像抓不到網路上的原件(非官方) ![](https://i.imgur.com/P1JfYmM.png) * 嘗試另一個套件 https://github.com/sayyam/carouselview * 遇到問題:當layout xml view 改成 Carousel時,APP Crash ![](https://i.imgur.com/adWoxxJ.png) ### Notification * Action Bar 在建立Bottom Navigation 的時候做自動建立 ![](https://i.imgur.com/avxpYKQ.png) * 重新讀Navigation Documentation * 實作Navigation及Action Bar設置(官方Codelab) * 有實做出功能(但是是Kotlin寫的) * 發現也可以用Navigation Library來做Selection ### 預計要做的 * Carousel: 1.熟悉Fragment的使用(Navigation建立的Fragment好像不太一樣) 2.仍Debug不出來改用ViewPager2試試看(?) * Notification: 1.把Kotlin轉成Java,整合至Project ### 問題 * 推薦使用Viewpager2實作嗎 * 目前是一個Activity上跑多個Fragment,有要改成多個不同的Activity嗎 * 要自訂Action Bar或是用NavigationUI內建的(我跟家佑有挑論兩種不同的做法) # 8/9會議報告(吳岳) ### Notification Bell * 加入Toolbar當中並且按下時會顯現Toast * ![](https://i.imgur.com/GwEUNwW.png) ![](https://i.imgur.com/a539HDG.png) ### Carousel * 新增item_home_carousel.xml * 新增Navigation -> ViewPagerAdapter.java * 更新home.java ![](https://i.imgur.com/9q9Mbyq.png) ### 問題 * 去背會吃到照片本身(線上、PowerPoint) ![](https://i.imgur.com/1UjukOB.png) * fragment_home.xml變得很奇怪 ![](https://i.imgur.com/IECFiVK.png) # 8/23會議報告(吳岳) ### Notification Bell * 把Toast改成顯示Unread, read ![](https://i.imgur.com/jByBgIP.png) ### 未來進度 * 匯入Firebase資料 * 顯示Badge Count * Treatment and preservation # 改變文字選取選單 ## 請複製以下程式碼到Categories的頁面<br>(參考Construction Sequence底下的頁面) Boolean bk_isrepeated = false; public void customselectionmenu(TextView t){ t.setCustomSelectionActionModeCallback(new ActionMode.Callback() { @Override public boolean onCreateActionMode(ActionMode mode, Menu menu) { MenuInflater menuInflater = mode.getMenuInflater(); menu.clear(); menuInflater.inflate(R.menu.custom_select_action_menu,menu); return true; } @Override public boolean onPrepareActionMode(ActionMode mode, Menu menu) { return false; } @Override public boolean onActionItemClicked(ActionMode mode, MenuItem item) { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); switch (item.getItemId()){ case R.id.bookmark: DatabaseReference DbRef_bk = FirebaseDatabase.getInstance().getReference().child("bookmark"); DbRef_bk.addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(@NonNull @NotNull DataSnapshot snapshot) { for(DataSnapshot testDatasnap : snapshot.getChildren()){ Bookmark bk_add = testDatasnap.getValue(Bookmark.class); if(bk_add.getPagename().equals(getLocalClassName())&& bk_add.getUserid().equals(user.getUid())){ bk_isrepeated = true; } } if(bk_isrepeated == true){ Toast.makeText(getApplicationContext(), "Bookmark already exist", Toast.LENGTH_SHORT).show(); }else{ Bookmark bk = new Bookmark(getLocalClassName(), user.getUid()); Task<Void> mTask = DbRef_bk.push().setValue(bk); mTask.addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(@NonNull @NotNull Void unused) { Toast.makeText(getApplicationContext(), "Bookmark added!", Toast.LENGTH_SHORT).show(); DatabaseReference DbRef_n = FirebaseDatabase.getInstance().getReference().child("notification"); String bk_name = getLocalClassName().substring(getLocalClassName().lastIndexOf(".")+1); Notification n = new Notification(bk_name+" "+getString(R.string.notification_bk_add),user.getUid() ,"0"); DbRef_n.push().setValue(n); } }); } } @Override public void onCancelled(@NonNull @NotNull DatabaseError error) { } }); mode.finish(); break; case R.id.readinglist: int content_start = t.getSelectionStart(); int content_end = t.getSelectionEnd(); String content = t.getText().toString().substring(content_start, content_end); DatabaseReference DbRef_rd = FirebaseDatabase.getInstance().getReference().child("readinglist"); ReadingList_item rd = new ReadingList_item(getLocalClassName(), content , user.getUid()); Task<Void> mTask = DbRef_rd.push().setValue(rd); mTask.addOnSuccessListener(new OnSuccessListener<Void>() { @Override public void onSuccess(@NonNull @NotNull Void unused) { Toast.makeText(getApplicationContext(), "Reading List added!", Toast.LENGTH_SHORT).show(); DatabaseReference DbRef_n = FirebaseDatabase.getInstance().getReference().child("notification"); String rd_name = getLocalClassName().substring(getLocalClassName().lastIndexOf(".")+1); Notification n = new Notification(rd_name+" "+getString(R.string.notification_rd_add),user.getUid() ,"0"); DbRef_n.push().setValue(n); } }); mode.finish(); break; case R.id.QA: int quote_start = t.getSelectionStart(); int quote_end = t.getSelectionEnd(); String quote = t.getText().toString().substring(quote_start, quote_end); PopupWindow pop_ask_question = new PopupWindow(); View layout = getLayoutInflater().inflate(R.layout.pop_qa_ask_question, null); pop_ask_question.setContentView(layout); pop_ask_question.setBackgroundDrawable(null); pop_ask_question.setWidth(RelativeLayout.LayoutParams.MATCH_PARENT); pop_ask_question.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT); pop_ask_question.setFocusable(true); pop_ask_question.update(); pop_ask_question.showAtLocation(layout, Gravity.CENTER, 0, 2); ImageButton exit_btn = layout.findViewById(R.id.exit_btn); TextView quote_tv = layout.findViewById(R.id.quote); if(quote.equals("")){ quote_tv.setVisibility(View.GONE); }else{ quote_tv.setText(quote); } TextInputEditText questionInput = layout.findViewById(R.id.question_input); Button post_btn = layout.findViewById(R.id.post); post_btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { DatabaseReference DbRef_QA = FirebaseDatabase.getInstance().getReference().child("Q&A"); QA qa = new QA(quote_tv.getText().toString(),questionInput.getText().toString(), user.getUid(),user.getDisplayName(),"","",""); DbRef_QA.push().setValue(qa); Toast.makeText(getApplicationContext(), "Question upload!", Toast.LENGTH_SHORT).show(); pop_ask_question.dismiss(); Intent i = new Intent(getApplicationContext(),MainActivity.class); startActivity(i); finish(); } }); exit_btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { pop_ask_question.dismiss(); } }); mode.finish(); break; } return false; } @Override public void onDestroyActionMode(ActionMode mode) { } }); } ### 輸入完後,將該頁面的文字套用該方法 舉例: tv1 = findViewById(R.id.plantv_1); **tv1.setTextIsSelectable(true);// 如果在xml檔裡已經有設置 則不需要此行 customselectionmenu(tv1);** # 8/30會議報告(吳岳) ### Notification Bell * 跟Hank一起完成notification bell 的功能 * 預設是0,選取bookmark或是reading list就會變1 ![](https://i.imgur.com/8pBSxrL.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully