PixelDroid-App-Android/app/src/main/java/com/h/pixeldroid/MainActivity.kt

313 lines
11 KiB
Kotlin
Raw Normal View History

2020-02-28 17:08:54 +01:00
package com.h.pixeldroid
import android.content.Context
import android.content.Intent
import android.graphics.drawable.Drawable
import android.net.Uri
2020-02-28 17:08:54 +01:00
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.ImageView
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.GravityCompat
import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.bumptech.glide.Glide
import com.google.android.material.tabs.TabLayoutMediator
import com.h.pixeldroid.db.AppDatabase
import com.h.pixeldroid.db.UserDatabaseEntity
import com.h.pixeldroid.di.PixelfedAPIHolder
import com.h.pixeldroid.fragments.CameraFragment
import com.h.pixeldroid.fragments.SearchDiscoverFragment
import com.h.pixeldroid.fragments.feeds.NotificationsFragment
import com.h.pixeldroid.fragments.feeds.OfflineFeedFragment
import com.h.pixeldroid.fragments.feeds.postFeeds.HomeTimelineFragment
import com.h.pixeldroid.fragments.feeds.postFeeds.PublicTimelineFragment
import com.h.pixeldroid.objects.Account
import com.h.pixeldroid.utils.DBUtils
import com.h.pixeldroid.utils.Utils.Companion.hasInternet
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.materialdrawer.iconics.iconicsIcon
import com.mikepenz.materialdrawer.model.PrimaryDrawerItem
import com.mikepenz.materialdrawer.model.ProfileDrawerItem
import com.mikepenz.materialdrawer.model.ProfileSettingDrawerItem
import com.mikepenz.materialdrawer.model.interfaces.*
import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader
import com.mikepenz.materialdrawer.util.DrawerImageLoader
import com.mikepenz.materialdrawer.widget.AccountHeaderView
import kotlinx.android.synthetic.main.activity_main.*
2020-09-10 22:47:04 +02:00
import org.ligi.tracedroid.sending.TraceDroidEmailSender
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import javax.inject.Inject
class MainActivity : AppCompatActivity() {
private val searchDiscoverFragment: SearchDiscoverFragment = SearchDiscoverFragment()
@Inject
lateinit var db: AppDatabase
@Inject
lateinit var apiHolder: PixelfedAPIHolder
private lateinit var header: AccountHeaderView
private var user: UserDatabaseEntity? = null
companion object {
const val ADD_ACCOUNT_IDENTIFIER: Long = -13
}
2020-02-28 17:08:54 +01:00
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme_NoActionBar)
2020-02-28 17:08:54 +01:00
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
2020-09-10 22:47:04 +02:00
TraceDroidEmailSender.sendStackTraces("contact@pixeldroid.org", this)
(this.application as Pixeldroid).getAppComponent().inject(this)
//get the currently active user
user = db.userDao().getActiveUser()
//Check if we have logged in and gotten an access token
if (user == null) {
launchActivity(LoginActivity(), firstTime = true)
As a user I want to be able to see posts in a feed (#28) * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * 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 * rebased from master * 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 * rebased from master * 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 * fixed another merge problem * trying my best to merge * removed drawable definition in activity_post.xml * implements swipe motion add a new class to implement swipe motion add the swipe right from home page to display settings passed the homepage in a fragment * transform profile activity into fragment transformed profile activity and layout into fragment linked it with a swipe motion * Implement swipeable tabs * Ask for login on first start, add API endpoints, change profile to show the user's profile * Started converting Post to a fragment * got a working feed * WI * removed non-valid 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 * 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) Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: Ulysse Widmer <ulysse.widmer@epfl.ch>
2020-03-16 09:38:35 +01:00
} else {
setupDrawer()
val tabs = arrayOf(
if (hasInternet(applicationContext)) HomeTimelineFragment()
else OfflineFeedFragment(),
searchDiscoverFragment,
Camera tab (#149) * added CameraX depedencies * added basis of camera activity layout * basis of camera layout * declare activity and request camera permissions * request camera permissions * implemented basic viewFinder aka stream preview * added drawing of layout * linked camera activity to new post fragment * texture view now fills the entire screen * added button, call to camera activity FOR RESULT and return to New Post Fragment * can now take a photo a upload it * locked camera activity in portrait orientation * added basic test to CameraActivity * added test with device orientation * deleted orientation test as it broke the whole app * deleted occurence of orientation tool for tests * added buttons for flipping cameras and picture upload * replaced NewPostFragment and took its job * deleted cameraActivity * replaced newPostFragment by Camera Activity * revamped NewPostFragment * perform basic test on buttons * corrected retrieval of buttons * robust camera fragment * fix thumbnail permission requests * refactor, finish fragment * try to fix build not working on CI * Add dependency * Fix camera test * update tests, delete obsolete xml * Try to fix test * Stop nullpointer that happens sometimes, when it shouldn't * remove unused strings * edit the photo instead of posting directly * fix test after changing putextra name * remove useless analyzer * add test? * better tests? * add dependencies * update dependencies * try to fix build * undo change to build.gradle * try to fix tests * try to fix tests * remove useless listener * save image so that ci can go through gallery * remove extraneous permission * Any app that declares the WRITE_EXTERNAL_STORAGE permission is implicitly granted this permission. Co-authored-by: Andrea Clement <samuel.dietz@epfl.ch>
2020-05-15 12:10:28 +02:00
CameraFragment(),
NotificationsFragment(),
PublicTimelineFragment()
)
As a user I want to be able to see posts in a feed (#28) * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * 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 * rebased from master * 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 * rebased from master * 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 * fixed another merge problem * trying my best to merge * removed drawable definition in activity_post.xml * implements swipe motion add a new class to implement swipe motion add the swipe right from home page to display settings passed the homepage in a fragment * transform profile activity into fragment transformed profile activity and layout into fragment linked it with a swipe motion * Implement swipeable tabs * Ask for login on first start, add API endpoints, change profile to show the user's profile * Started converting Post to a fragment * got a working feed * WI * removed non-valid 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 * 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) Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: Ulysse Widmer <ulysse.widmer@epfl.ch>
2020-03-16 09:38:35 +01:00
setupTabs(tabs)
}
}
private fun setupDrawer() {
main_drawer_button.setOnClickListener{
2020-09-13 23:35:09 +02:00
drawer_layout.open()
}
header = AccountHeaderView(this).apply {
headerBackgroundScaleType = ImageView.ScaleType.CENTER_CROP
currentHiddenInList = true
onAccountHeaderListener = { _: View?, profile: IProfile, current: Boolean ->
clickProfile(profile, current)
}
addProfile(ProfileSettingDrawerItem().apply {
identifier = ADD_ACCOUNT_IDENTIFIER
nameRes = R.string.add_account_name
descriptionRes = R.string.add_account_description
iconicsIcon = GoogleMaterial.Icon.gmd_add
}, 0)
attachToSliderView(drawer)
dividerBelowHeader = false
closeDrawerOnProfileListClick = true
}
DrawerImageLoader.init(object : AbstractDrawerImageLoader() {
override fun set(imageView: ImageView, uri: Uri, placeholder: Drawable, tag: String?) {
Glide.with(imageView.context)
.load(uri)
.placeholder(placeholder)
.into(imageView)
}
override fun cancel(imageView: ImageView) {
Glide.with(imageView.context).clear(imageView)
}
override fun placeholder(ctx: Context, tag: String?): Drawable {
if (tag == DrawerImageLoader.Tags.PROFILE.name || tag == DrawerImageLoader.Tags.PROFILE_DRAWER_ITEM.name) {
return ctx.getDrawable(R.drawable.ic_default_user)!!
}
return super.placeholder(ctx, tag)
}
})
fillDrawerAccountInfo(user!!.user_id)
//after setting with the values in the db, we make sure to update the database and apply
//with the received one. This happens asynchronously.
getUpdatedAccount()
drawer.itemAdapter.add(
primaryDrawerItem {
nameRes = R.string.menu_account
iconicsIcon = GoogleMaterial.Icon.gmd_person
},
primaryDrawerItem {
nameRes = R.string.menu_settings
iconicsIcon = GoogleMaterial.Icon.gmd_settings
},
primaryDrawerItem {
nameRes = R.string.logout
iconicsIcon = GoogleMaterial.Icon.gmd_close
})
drawer.onDrawerItemClickListener = { v, drawerItem, position ->
when (position){
1 -> launchActivity(ProfileActivity())
2 -> launchActivity(SettingsActivity())
3 -> logOut()
}
false
}
}
private fun logOut(){
db.userDao().deleteActiveUsers()
val remainingUsers = db.userDao().getAll()
if (remainingUsers.isEmpty()){
//no more users, start first-time login flow
launchActivity(LoginActivity(), firstTime = true)
} else {
val newActive = remainingUsers.first()
db.userDao().activateUser(newActive.user_id)
//relaunch the app
launchActivity(MainActivity(), firstTime = true)
}
}
private fun getUpdatedAccount() {
if (hasInternet(applicationContext)) {
val domain = user?.instance_uri.orEmpty()
val accessToken = user?.accessToken.orEmpty()
val api = apiHolder.api ?: apiHolder.setDomainToCurrentUser(db)
api.verifyCredentials("Bearer $accessToken")
.enqueue(object : Callback<Account> {
override fun onResponse(
call: Call<Account>,
response: Response<Account>
) {
if (response.body() != null && response.isSuccessful) {
val account = response.body() as Account
DBUtils.addUser(db, account, domain, accessToken = accessToken)
fillDrawerAccountInfo(account.id!!)
}
}
override fun onFailure(call: Call<Account>, t: Throwable) {
Log.e("DRAWER ACCOUNT:", t.toString())
}
})
}
}
//called when switching profiles, or when clicking on current profile
private fun clickProfile(profile: IProfile, current: Boolean): Boolean {
if(current){
launchActivity(ProfileActivity())
return false
}
//Clicked on add new account
if(profile.identifier == ADD_ACCOUNT_IDENTIFIER){
launchActivity(LoginActivity())
return false
}
db.userDao().deActivateActiveUsers()
db.userDao().activateUser(profile.identifier.toString())
apiHolder.setDomainToCurrentUser(db)
val intent = Intent(this, MainActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
startActivity(intent)
return false
}
private inline fun primaryDrawerItem(block: PrimaryDrawerItem.() -> Unit): PrimaryDrawerItem {
return PrimaryDrawerItem()
.apply {
isSelectable = false
isIconTinted = true
}
.apply(block)
}
private fun fillDrawerAccountInfo(account: String) {
val users = db.userDao().getAll().toMutableList()
users.sortWith(Comparator { l, r ->
when {
l.isActive && !r.isActive -> -1
r.isActive && !l.isActive -> 1
else -> 0
}
})
val profiles: MutableList<IProfile> = users.map { user ->
ProfileDrawerItem().apply {
isSelected = user.isActive
nameText = user.display_name
iconUrl = user.avatar_static
isNameShown = true
identifier = user.user_id.toLong()
descriptionText = "@${user.username}@${user.instance_uri.removePrefix("https://")}"
}
}.toMutableList()
// reuse the already existing "add account" item
header.profiles.orEmpty()
.filter { it.identifier == ADD_ACCOUNT_IDENTIFIER }
.take(1)
.map { profiles.add(it) }
header.clear()
header.profiles = profiles
header.setActiveProfile(account.toLong())
}
private fun setupTabs(tab_array: Array<Fragment>){
view_pager.adapter = object : FragmentStateAdapter(this) {
override fun createFragment(position: Int): Fragment {
return tab_array[position]
}
override fun getItemCount(): Int {
return 5
}
}
TabLayoutMediator(tabs, view_pager) { tab, position ->
when(position){
0 -> tab.icon = getDrawable(R.drawable.ic_home_white_24dp)
1 -> tab.icon = getDrawable(R.drawable.ic_search_white_24dp)
2 -> tab.icon = getDrawable(R.drawable.ic_photo_camera_white_24dp)
3 -> tab.icon = getDrawable(R.drawable.ic_heart)
4 -> tab.icon = getDrawable(R.drawable.ic_filter_black_24dp)
}
}.attach()
}
/**
* Launches the given activity and put it as the current one
* @param firstTime to true means the task history will be reset (as if the app were
* launched anew into this activity)
*/
private fun launchActivity(activity: AppCompatActivity, firstTime: Boolean = false) {
val intent = Intent(this, activity::class.java)
if(firstTime){
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK
}
startActivity(intent)
}
/**
* Closes the drawer if it is open, when we press the back button
*/
override fun onBackPressed() {
if(drawer_layout.isDrawerOpen(GravityCompat.START)){
drawer_layout.closeDrawer(GravityCompat.START)
} else {
super.onBackPressed()
}
2020-02-28 17:08:54 +01:00
}
As a user I want to be able to see posts in a feed (#28) * Got posts working and linked them to the profile * added tests for Post * layout changes * moved a test file * refactoring * refactoring * 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 * rebased from master * 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 * rebased from master * 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 * fixed another merge problem * trying my best to merge * removed drawable definition in activity_post.xml * implements swipe motion add a new class to implement swipe motion add the swipe right from home page to display settings passed the homepage in a fragment * transform profile activity into fragment transformed profile activity and layout into fragment linked it with a swipe motion * Implement swipeable tabs * Ask for login on first start, add API endpoints, change profile to show the user's profile * Started converting Post to a fragment * got a working feed * WI * removed non-valid 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 * 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) Co-authored-by: Matthieu <61561059+Wv5twkFEKh54vo4tta9yu7dHa3@users.noreply.github.com> Co-authored-by: Ulysse Widmer <ulysse.widmer@epfl.ch>
2020-03-16 09:38:35 +01:00
}