diff --git a/mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt b/mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt index aeb3a04c..0c86f1cb 100644 --- a/mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt +++ b/mobile/src/main/java/com/github/shadowsocks/ProfilesFragment.kt @@ -174,10 +174,13 @@ class ProfilesFragment : ToolbarFragment(), Toolbar.OnMenuItemClickListener { val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) params.gravity = Gravity.CENTER_HORIZONTAL - adView = AdView(activity) + val context = context!! + adView = AdView(context) adView.layoutParams = params adView.adUnitId = "ca-app-pub-9097031975646651/7760346322" adView.adSize = AdSize.FLUID + val padding = context.resources.getDimensionPixelOffset(R.dimen.profile_padding) + adView.setPadding(padding, 0, 0, padding) itemView.findViewById(R.id.content).addView(adView) diff --git a/mobile/src/main/res/drawable/background_profile.xml b/mobile/src/main/res/drawable/background_profile.xml index b007a6c9..28592514 100644 --- a/mobile/src/main/res/drawable/background_profile.xml +++ b/mobile/src/main/res/drawable/background_profile.xml @@ -15,7 +15,7 @@ - + diff --git a/mobile/src/main/res/layout/layout_list.xml b/mobile/src/main/res/layout/layout_list.xml index abd9a790..879e6310 100644 --- a/mobile/src/main/res/layout/layout_list.xml +++ b/mobile/src/main/res/layout/layout_list.xml @@ -6,7 +6,7 @@ android:orientation="vertical"> - - @@ -72,13 +68,14 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentStart="true" - android:layout_marginEnd="8dp" + android:layout_marginBottom="@dimen/profile_padding" + android:layout_marginEnd="12dp" android:layout_toStartOf="@+id/traffic" android:ellipsize="end" android:maxLines="2" - tools:text="@string/profile_plugin" android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="?android:attr/textColorSecondary"/> + android:textColor="?android:attr/textColorSecondary" + tools:text="@string/profile_plugin"/> + android:textColor="?android:attr/textColorSecondary" + tools:text="@string/traffic"/> - diff --git a/mobile/src/main/res/values/dimen.xml b/mobile/src/main/res/values/dimen.xml index bf8b97cd..9bdfae6e 100644 --- a/mobile/src/main/res/values/dimen.xml +++ b/mobile/src/main/res/values/dimen.xml @@ -2,6 +2,7 @@ 480dp 250dp + 8dp -44dp