1
0
Fork 0
mirror of https://github.com/anyproto/anytype-kotlin.git synced 2025-06-08 05:47:05 +09:00

Fix/dashboard positioning (#913)

This commit is contained in:
Evgenii Kozlov 2020-09-23 21:00:25 +02:00 committed by GitHub
parent 9e29d53b44
commit 0b5e3a717b
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View file

@ -3,6 +3,7 @@ package com.agileburo.anytype.ui.desktop
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.agileburo.anytype.R
@ -12,9 +13,13 @@ class LinearConcatAdapter(val adapter: DashboardProfileAdapter) :
RecyclerView.Adapter<LinearConcatAdapter.LinearConcatHolder>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LinearConcatHolder {
val view =
LayoutInflater.from(parent.context).inflate(R.layout.item_profile_container, parent, false)
view.recyclerView.layoutManager = LinearLayoutManager(parent.context)
val inflater = LayoutInflater.from(parent.context)
val view = inflater.inflate(R.layout.item_profile_container, parent, false)
view.recyclerView.apply {
layoutManager = LinearLayoutManager(parent.context)
val lp = (layoutParams as FrameLayout.LayoutParams)
lp.height = (parent.height / 2) - lp.topMargin - lp.bottomMargin
}
return LinearConcatHolder(view)
}

View file

@ -17,9 +17,8 @@
style="@style/HomeDashboardGreetingStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginTop="43dp"
android:layout_marginEnd="20dp"
android:layout_marginEnd="10dp"
android:lineSpacingExtra="2sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
@ -30,7 +29,6 @@
android:id="@+id/avatar"
android:layout_width="@dimen/width_avatar_on_dashboard"
android:layout_height="@dimen/height_avatar_on_dashboard"
android:layout_marginStart="20dp"
android:layout_marginTop="24dp"
android:background="@drawable/circle_solid_default"
app:layout_constraintStart_toStartOf="parent"

View file

@ -2,9 +2,8 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="300dp"/>
android:layout_height="match_parent" />
</FrameLayout>