Commit f5a8513b authored by Mygod's avatar Mygod

Refine padding in profile item

parent 97e93552
...@@ -174,10 +174,13 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener { ...@@ -174,10 +174,13 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener {
val params = val params =
LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
params.gravity = Gravity.CENTER_HORIZONTAL params.gravity = Gravity.CENTER_HORIZONTAL
adView = AdView(activity) val context = context!!
adView = AdView(context)
adView.layoutParams = params adView.layoutParams = params
adView.adUnitId = "ca-app-pub-9097031975646651/7760346322" adView.adUnitId = "ca-app-pub-9097031975646651/7760346322"
adView.adSize = AdSize.FLUID adView.adSize = AdSize.FLUID
val padding = context.resources.getDimensionPixelOffset(R.dimen.profile_padding)
adView.setPadding(padding, 0, 0, padding)
itemView.findViewById<LinearLayout>(R.id.content).addView(adView) itemView.findViewById<LinearLayout>(R.id.content).addView(adView)
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</item> </item>
</selector> </selector>
</item> </item>
<item android:left="8dp"> <item android:left="@dimen/profile_padding">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@android:color/white" /> <solid android:color="@android:color/white" />
</shape> </shape>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
android:orientation="vertical"> android:orientation="vertical">
<include layout="@layout/toolbar_light_dark"/> <include layout="@layout/toolbar_light_dark"/>
<android.support.v7.widget.RecyclerView android:id="@+id/list" <android.support.v7.widget.RecyclerView android:id="@+id/list"
tools:listitem="@android:layout/simple_list_item_1" tools:listitem="@layout/layout_profile"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
......
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
android:nextFocusRight="@+id/edit" android:nextFocusRight="@+id/edit"
android:orientation="vertical"> android:orientation="vertical">
<Space
android:layout_width="match_parent"
android:layout_height="8dp"/>
<LinearLayout <LinearLayout
android:id="@+id/container" android:id="@+id/container"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -46,7 +42,7 @@ ...@@ -46,7 +42,7 @@
android:contentDescription="@string/share" android:contentDescription="@string/share"
android:focusable="true" android:focusable="true"
android:nextFocusLeft="@+id/container" android:nextFocusLeft="@+id/container"
android:padding="8dp" android:padding="12dp"
app:srcCompat="@drawable/ic_social_share"/> app:srcCompat="@drawable/ic_social_share"/>
<android.support.v7.widget.AppCompatImageView <android.support.v7.widget.AppCompatImageView
...@@ -57,7 +53,7 @@ ...@@ -57,7 +53,7 @@
android:background="?attr/selectableItemBackgroundBorderless" android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/edit" android:contentDescription="@string/edit"
android:focusable="true" android:focusable="true"
android:padding="8dp" android:padding="12dp"
app:srcCompat="@drawable/ic_image_edit"/> app:srcCompat="@drawable/ic_image_edit"/>
</LinearLayout> </LinearLayout>
...@@ -72,13 +68,14 @@ ...@@ -72,13 +68,14 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentStart="true" android:layout_alignParentStart="true"
android:layout_marginEnd="8dp" android:layout_marginBottom="@dimen/profile_padding"
android:layout_marginEnd="12dp"
android:layout_toStartOf="@+id/traffic" android:layout_toStartOf="@+id/traffic"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
tools:text="@string/profile_plugin"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/> android:textColor="?android:attr/textColorSecondary"
tools:text="@string/profile_plugin"/>
<TextView <TextView
android:id="@+id/traffic" android:id="@+id/traffic"
...@@ -86,13 +83,11 @@ ...@@ -86,13 +83,11 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginEnd="8dp" android:layout_marginBottom="@dimen/profile_padding"
android:layout_marginEnd="12dp"
android:ellipsize="end" android:ellipsize="end"
tools:text="@string/traffic"
android:textAppearance="?android:attr/textAppearanceSmall" android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"/> android:textColor="?android:attr/textColorSecondary"
tools:text="@string/traffic"/>
</RelativeLayout> </RelativeLayout>
<Space
android:layout_width="match_parent"
android:layout_height="8dp"/>
</LinearLayout> </LinearLayout>
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
<resources> <resources>
<dimen name="profile_item_max_width">480dp</dimen> <dimen name="profile_item_max_width">480dp</dimen>
<dimen name="qr_code_size">250dp</dimen> <dimen name="qr_code_size">250dp</dimen>
<dimen name="profile_padding">8dp</dimen>
<!-- TODO: Remove when this issue is fixed: https://github.com/JorgeCastilloPrz/FABProgressCircle/issues/19 --> <!-- TODO: Remove when this issue is fixed: https://github.com/JorgeCastilloPrz/FABProgressCircle/issues/19 -->
<dimen name="fab_margin_top">-44dp</dimen> <dimen name="fab_margin_top">-44dp</dimen>
</resources> </resources>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment