PixelDroid-App-Android/app/src/main/java/com/h/pixeldroid/fragments/feeds/postFeeds/PostsFeedFragment.kt

153 lines
6.1 KiB
Kotlin
Raw Normal View History

package com.h.pixeldroid.fragments.feeds.postFeeds
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.graphics.drawable.Drawable
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
import android.widget.*
2020-04-03 09:11:57 +02:00
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer
import androidx.paging.PagedList
import androidx.recyclerview.widget.RecyclerView
import androidx.viewpager2.widget.ViewPager2
import at.connyduck.sparkbutton.SparkButton
import com.bumptech.glide.Glide
import com.bumptech.glide.ListPreloader
import com.bumptech.glide.RequestBuilder
import com.bumptech.glide.integration.recyclerview.RecyclerViewPreloader
import com.bumptech.glide.util.ViewPreloadSizeProvider
import com.h.pixeldroid.R
import com.h.pixeldroid.fragments.feeds.FeedFragment
import com.h.pixeldroid.fragments.feeds.FeedsRecyclerViewAdapter
import com.h.pixeldroid.objects.Status
abstract class PostsFeedFragment : FeedFragment() {
lateinit var picRequest: RequestBuilder<Drawable>
lateinit var domain : String
protected lateinit var adapter : FeedsRecyclerViewAdapter<Status, PostViewHolder>
lateinit var factory: FeedDataSourceFactory<String, Status>
override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
val view = super.onCreateView(inflater, container, savedInstanceState)
domain = user?.instance_uri.orEmpty()
2020-04-02 22:16:03 +02:00
//RequestBuilder that is re-used for every image
picRequest = Glide.with(this)
.asDrawable().fitCenter()
.placeholder(ColorDrawable(Color.GRAY))
adapter = PostsFeedRecyclerViewAdapter()
list.adapter = adapter
2020-04-02 22:16:03 +02:00
//Make Glide be aware of the recyclerview and pre-load images
val sizeProvider: ListPreloader.PreloadSizeProvider<Status> = ViewPreloadSizeProvider()
val preloader: RecyclerViewPreloader<Status> = RecyclerViewPreloader(
Glide.with(this), adapter as PostsFeedRecyclerViewAdapter, sizeProvider, 4
)
list.addOnScrollListener(preloader)
return view
}
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
val content = makeContent()
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
content.observe(viewLifecycleOwner,
{ c ->
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
adapter.submitList(c)
//after a refresh is done we need to stop the pull to refresh spinner
swipeRefreshLayout.isRefreshing = false
})
swipeRefreshLayout.setOnRefreshListener {
2020-10-31 11:21:56 +01:00
showError(show = false)
//by invalidating data, loadInitial will be called again
factory.liveData.value!!.invalidate()
2020-04-03 09:11:57 +02:00
}
}
internal abstract fun makeContent(): LiveData<PagedList<Status>>
/**
* [RecyclerView.Adapter] that can display a list of Statuses
*/
inner class PostsFeedRecyclerViewAdapter
: FeedsRecyclerViewAdapter<Status, PostViewHolder>(),
ListPreloader.PreloadModelProvider<Status> {
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
private val api = pixelfedAPI
private val credential = "Bearer $accessToken"
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PostViewHolder {
val view = LayoutInflater.from(parent.context)
.inflate(R.layout.post_fragment, parent, false)
context = view.context
return PostViewHolder(
view,
context
)
}
/**
* Binds the different elements of the Post Model to the view holder
*/
override fun onBindViewHolder(holder: PostViewHolder, position: Int) {
val post = getItem(position) ?: return
val metrics = context.resources.displayMetrics
//Limit the height of the different images
holder.postPic.maxHeight = metrics.heightPixels * 3/4
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
//Setup the post layout
post.setupPost(holder.postView, picRequest, this@PostsFeedFragment, domain, false)
post.activateButtons(holder, api, credential)
}
override fun getPreloadItems(position: Int): MutableList<Status> {
val status = getItem(position) ?: return mutableListOf()
return mutableListOf(status)
}
override fun getPreloadRequestBuilder(item: Status): RequestBuilder<*>? {
return picRequest.load(item.getPostUrl())
}
}
}
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
/**
* Represents the posts that will be contained within the feed
*/
class PostViewHolder(val postView: View, val context: android.content.Context) : RecyclerView.ViewHolder(postView) {
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
val profilePic : ImageView = postView.findViewById(R.id.profilePic)
val postPic : ImageView = postView.findViewById(R.id.postPicture)
val username : TextView = postView.findViewById(R.id.username)
val usernameDesc: TextView = postView.findViewById(R.id.usernameDesc)
val description : TextView = postView.findViewById(R.id.description)
val nlikes : TextView = postView.findViewById(R.id.nlikes)
val nshares : TextView = postView.findViewById(R.id.nshares)
//Spark buttons
val liker : SparkButton = postView.findViewById(R.id.liker)
val reblogger : SparkButton = postView.findViewById(R.id.reblogger)
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
val submitCmnt : ImageButton = postView.findViewById(R.id.submitComment)
val commenter : ImageView = postView.findViewById(R.id.commenter)
val comment : EditText = postView.findViewById(R.id.editComment)
val commentCont : LinearLayout = postView.findViewById(R.id.commentContainer)
val commentIn : LinearLayout = postView.findViewById(R.id.commentIn)
val viewComment : TextView = postView.findViewById(R.id.ViewComments)
val postDate : TextView = postView.findViewById(R.id.postDate)
val postDomain : TextView = postView.findViewById(R.id.postDomain)
val sensitiveW : TextView = postView.findViewById(R.id.sensitiveWarning)
val postPager : ViewPager2 = postView.findViewById(R.id.postPager)
val more : ImageButton = postView.findViewById(R.id.status_more)
Commenting & seeing comments on a post ( issues: #37 #77 ) (#87) Comment and like buttons added + a few UI tweaks * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * layout changes * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * Add tests * delete test for now * Adapt test to changes (no more profile from drawer) * Add unit test for api * Add test for profile, refactor to allow testing, add exception to security policy to allow tests * Adapt test to new situation * Fix typo due to change * refactor somewhat * added a feed test * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * WIP posts * trying to add images * WIP posts * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * WIP posts * WIP posts * trying to add images * trying to add images * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * WIP posts * WIP posts * WIP posts * WIP posts * trying to add images * trying to add images * trying to add images * trying to add images * Got posts working and linked them to the profile * Got posts working and linked them to the profile * added tests for Post * layout changes * layout changes * moved a test file * refactoring * refactoring * refactoring * refactoring * removed wrong annotation in unit test * removed an import that was breaking the build * removed an import that was breaking the build * removed tests that broke from merge, will override with master * removed tests that broke from merge, will override with master * added UI test for the post activity * fixed merging errors * trying my best to merge * removed drawable definition in activity_post.xml * Started converting Post to a fragment * got a working feed * WI * removed non-valid test * rebase on other branch * moved the feed to the home page * added a feed test * added a working feed test * fixed broken test * merged with master * added a max height for images and made profile pictures round * Added a default image for the post * created a PostActivity to look a single posts * fixed buggy postActivity * Complete overhall of the feed UI * removed test that didn't please Travis * removed legacy test * changed feedAdapter init location (outside of network callback) * changed the feed from public timeline to home timeline * Refactored myProfile page * Converted profile picture to round image * restored feed test * I can like a post, but unlike is still a WIP * Liking kind of works now and added tests * fixed an error, now we can unlike as well * fixed travis constraint error * Display user's posts on profile page * moved test to Mock server tests * fixed test * last resort debugging * Changed fixed size of profile posts * last resort debugging * last resort debugging * last resort debugging * made post_activity profilepic round * Total refactor of profile posts * still have a weird bug with the comments: input is always null (WIP) * still trying to fix coments * removed annoying side margins in the home feed * trying to fix comments * fixed null comment * converted all posts back to statuses and got rid of post * Refactored recycler view * Merged with my-profile * Posts displayed on profile page * Added links to profile activity where needed * fixed comment posting * finished implementing comments, but api is buggy so none are visible * removed useless space in profile page * fixed ci config bug * trying to trigger ci hook (github was down last time) * updated tests with master tests * added tests for the comments * added tests for the comments * added first() matcher to fix comment test * still trying to fix comment tests' null progress bar * getting rid of that null progress bar * added comment test * fixed merge error * added like button test * added more post tests * took pr coments into account * added back an old test * added mockServer response for comment test and fixed comment null pointer bug * changed notification UI to better separate notifications * added mockserver response for likes and corrected like toggling error * added a test for posting comments * fixed typo in test * a gift for code climate * refactored stuff * fixed broken imports * comment refactored as xml Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: mjaillot <marie.jaillot@epfl.ch>
2020-04-11 12:55:06 +02:00
}