我有一個活動的主題爲Theme.AppCompat.Translucent,包含View Pager
使用(的圖像示出了在ImageView
號)https://github.com/moondroid/CoverFlow完成活動時上的ImageView的或外部的任何查看用戶觸摸
當用戶點擊圖片的外部我想完成我的活動。 我不知道這件事。請幫助解決它!
我的代碼如下
banner.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:coverflow="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#80000000"
tools:context=".ActivityCoverflowBanner">
<coverflowLibrary.FeatureCoverFlow
android:id="@+id/coverflow"
android:layout_width="match_parent"
android:layout_height="match_parent"
coverflow:coverHeight="180dp"
coverflow:coverWidth="150dp"
coverflow:maxScaleFactor="1.5"
coverflow:reflectionGap="-15px"
coverflow:rotationThreshold="50"
coverflow:scalingThreshold="0.9"
coverflow:spacing="0.5" />
</RelativeLayout>
item.xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/frameLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:cardCornerRadius="10dp"
card_view:cardElevation="3dp"
card_view:cardPreventCornerOverlap="false"
card_view:cardUseCompatPadding="true">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imgBanner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="fitXY"
android:src="@mipmap/demoimg" />
<ProgressBar
android:id="@+id/mProgressBar"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/corner_radius_s"
android:orientation="vertical">
<TextView
android:id="@+id/txtPackageName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/summary_button_margin"
android:gravity="center_horizontal"
android:textColor="@color/BlueTextColor"
android:textSize="12sp"
android:textStyle="bold" />
<TextView
android:id="@+id/txtViewMore"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="5dp"
android:background="@drawable/blackcurvedbutton"
android:padding="@dimen/card_margin_top"
android:text="@string/view_more"
android:textColor="@color/white"
android:textSize="10sp"
android:textStyle="bold" />
</LinearLayout>
</android.support.v7.widget.CardView>
</FrameLayout>
的manifest.xml
<activity
android:name=".ActivityCoverflowBanner"
android:label="@string/title_activity_coverflow_banner"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Translucent"
android:windowSoftInputMode="stateHidden|adjustResize" />
更新你的答案了View尋呼機XML文件。 –
我已更新我的代碼! –