Refrain from using SMART_BANNER to prevent its weirdness
This commit is contained in:
@@ -20,4 +20,5 @@
|
||||
<solid android:color="@android:color/white" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:drawable="?android:attr/selectableItemBackground"/>
|
||||
</layer-list>
|
||||
|
||||
@@ -3,89 +3,82 @@
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/indicator"
|
||||
android:id="@+id/content"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/background_profile"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="4dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:focusable="true"
|
||||
android:nextFocusRight="@+id/edit">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="4dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:focusable="true"
|
||||
android:nextFocusRight="@+id/edit"
|
||||
android:id="@+id/content"
|
||||
android:background="?android:attr/selectableItemBackground">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:id="@+id/container">
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:id="@+id/container">
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/share"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_social_share"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/share"
|
||||
android:focusable="true"
|
||||
android:nextFocusLeft="@+id/container"/>
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_image_edit"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/edit"
|
||||
android:focusable="true"/>
|
||||
</LinearLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center_vertical"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"/>
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/share"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp">
|
||||
<TextView
|
||||
android:id="@android:id/text2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@+id/traffic"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
<TextView
|
||||
android:id="@+id/traffic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
</RelativeLayout>
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_social_share"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/share"
|
||||
android:focusable="true"
|
||||
android:nextFocusLeft="@+id/container"/>
|
||||
<android.support.v7.widget.AppCompatImageView
|
||||
android:id="@+id/edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:layout_gravity="top"
|
||||
app:srcCompat="@drawable/ic_image_edit"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:contentDescription="@string/edit"
|
||||
android:focusable="true"/>
|
||||
</LinearLayout>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp">
|
||||
<TextView
|
||||
android:id="@android:id/text2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_toStartOf="@+id/traffic"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
<TextView
|
||||
android:id="@+id/traffic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:ellipsize="end"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
package com.github.shadowsocks
|
||||
|
||||
import android.content._
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import android.support.design.widget.Snackbar
|
||||
import android.support.v7.widget.RecyclerView.ViewHolder
|
||||
@@ -137,13 +136,9 @@ final class ProfilesFragment extends ToolbarFragment with Toolbar.OnMenuItemClic
|
||||
adView = new AdView(getActivity)
|
||||
adView.setLayoutParams(params)
|
||||
adView.setAdUnitId("ca-app-pub-9097031975646651/7760346322")
|
||||
adView.setAdSize(AdSize.FLUID)
|
||||
|
||||
if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
|
||||
adView.setAdSize(AdSize.FULL_BANNER)
|
||||
else
|
||||
adView.setAdSize(AdSize.SMART_BANNER)
|
||||
|
||||
itemView.findViewById[LinearLayout](R.id.indicator).addView(adView)
|
||||
itemView.findViewById[LinearLayout](R.id.content).addView(adView)
|
||||
|
||||
// Load Ad
|
||||
val adBuilder = new AdRequest.Builder()
|
||||
|
||||
Reference in New Issue
Block a user