Fixed usernames and post scroll

This commit is contained in:
mjaillot 2020-04-26 17:56:46 +02:00
parent 4af74c7432
commit 9b628120d5
6 changed files with 14 additions and 8 deletions

View File

@ -99,7 +99,7 @@ class DrawerMenuTest {
onView(withText("ete2")).perform(ViewActions.click())
Thread.sleep(1000)
onView(withId(R.id.accountNameTextView)).check(matches(withText("ete2")))
onView(withId(R.id.accountNameTextView)).check(matches(withText("Christian")))
}
@Test
@ -114,6 +114,6 @@ class DrawerMenuTest {
onView(withText("Dobios")).perform(ViewActions.click())
Thread.sleep(1000)
onView(withId(R.id.accountNameTextView)).check(matches(withText("Dobios")))
onView(withId(R.id.accountNameTextView)).check(matches(withText("Andrew Dobis")))
}
}

View File

@ -90,7 +90,7 @@ class MockedServerTest {
onView(withText("ete2")).perform((ViewActions.click()))
Thread.sleep(1000)
onView(withId(R.id.accountNameTextView)).check(matches(withText("ete2")))
onView(withId(R.id.accountNameTextView)).check(matches(withText("Christian")))
}
@Test
@ -136,7 +136,7 @@ class MockedServerTest {
onView(withText("Dobios followed you")).perform(ViewActions.click())
Thread.sleep(1000)
onView(withText("Dobios")).check(matches(withId(R.id.accountNameTextView)))
onView(withText("Andrew Dobis")).check(matches(withId(R.id.accountNameTextView)))
}
@Test

View File

@ -81,7 +81,7 @@ class MainActivity : AppCompatActivity(), NavigationView.OnNavigationItemSelecte
// Set profile picture
val avatar = findViewById<ImageView>(R.id.drawer_avatar)
ImageConverter.setRoundImageFromURL(
View(applicationContext), account.avatar, avatar)
View(applicationContext), account.avatar_static, avatar)
avatar.setOnClickListener{ launchActivity(ProfileActivity()) }
// Set account name

View File

@ -103,7 +103,7 @@ class ProfileActivity : AppCompatActivity() {
description.text = account!!.note
val accountName = findViewById<TextView>(R.id.accountNameTextView)
accountName.text = account!!.username
accountName.text = account!!.display_name
accountName.setTypeface(null, Typeface.BOLD)
val nbPosts = findViewById<TextView>(R.id.nbPostsTextView)

View File

@ -99,9 +99,9 @@ data class Status(
}
fun getUsername() : CharSequence {
var name = account.display_name
var name = account.username
if (name.isEmpty()) {
name = account.username
name = account.display_name
}
return name
}

View File

@ -12,6 +12,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -219,6 +223,8 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>
</androidx.cardview.widget.CardView>