Apply text gradient only over text, fade out after clicking on image

This commit is contained in:
Jimmy Shih
2013-11-14 15:40:25 -08:00
parent 6b050d6236
commit 982828d0af
2 changed files with 99 additions and 92 deletions
+6 -2
View File
@@ -24,6 +24,9 @@ limitations under the License.
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_width="match_parent" android:layout_width="match_parent"
android:scaleType="centerCrop" /> android:scaleType="centerCrop" />
<FrameLayout
android:layout_height="wrap_content"
android:layout_width="match_parent" >
<!-- A gradient on top of the text --> <!-- A gradient on top of the text -->
<ImageView <ImageView
android:alpha=".6" android:alpha=".6"
@@ -34,7 +37,7 @@ limitations under the License.
android:src="@drawable/text_gradient" /> android:src="@drawable/text_gradient" />
<!-- Table 1 --> <!-- Table 1 -->
<TableLayout <TableLayout
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:minHeight="?android:attr/listPreferredItemHeight" android:minHeight="?android:attr/listPreferredItemHeight"
android:paddingBottom="12dp" android:paddingBottom="12dp"
@@ -92,9 +95,9 @@ limitations under the License.
android:id="@+id/list_item_marker_count_icon" android:id="@+id/list_item_marker_count_icon"
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="1dp"
android:layout_marginLeft="2dp" android:layout_marginLeft="2dp"
android:layout_marginRight="2dp" android:layout_marginRight="2dp"
android:layout_marginBottom="1dp"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:scaleType="centerInside" android:scaleType="centerInside"
android:src="@drawable/ic_menu_insert_marker" /> android:src="@drawable/ic_menu_insert_marker" />
@@ -123,4 +126,5 @@ limitations under the License.
style="@style/TextSmall" /> style="@style/TextSmall" />
</TableRow> </TableRow>
</TableLayout> </TableLayout>
</FrameLayout>
</FrameLayout> </FrameLayout>
@@ -127,6 +127,9 @@ public class MarkerDetailFragment extends Fragment {
int visibility = waypointInfo.getVisibility() == View.GONE ? View.VISIBLE : View.GONE; int visibility = waypointInfo.getVisibility() == View.GONE ? View.VISIBLE : View.GONE;
textGradient.setVisibility(visibility); textGradient.setVisibility(visibility);
waypointInfo.setVisibility(visibility); waypointInfo.setVisibility(visibility);
if (visibility == View.VISIBLE) {
handler.postDelayed(hideText, HIDE_TEXT_DELAY);
}
} }
}); });
textGradient = (ImageView) view.findViewById(R.id.marker_detail_waypoint_text_gradient); textGradient = (ImageView) view.findViewById(R.id.marker_detail_waypoint_text_gradient);