Skip to content

Commit fe8ae33

Browse files
author
amatellanes
committed
Added Toasts
1 parent 359c42f commit fe8ae33

17 files changed

Lines changed: 280 additions & 0 deletions

File tree

Toasts/AndroidManifest.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.amatellanes.android"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
7+
<uses-sdk
8+
android:minSdkVersion="8"
9+
android:targetSdkVersion="18" />
10+
11+
<application
12+
android:allowBackup="true"
13+
android:icon="@drawable/ic_launcher"
14+
android:label="@string/app_name"
15+
android:theme="@style/AppTheme" >
16+
<activity
17+
android:name="com.amatellanes.android.MainActivity"
18+
android:label="@string/app_name" >
19+
<intent-filter>
20+
<action android:name="android.intent.action.MAIN" />
21+
22+
<category android:name="android.intent.category.LAUNCHER" />
23+
</intent-filter>
24+
</activity>
25+
</application>
26+
27+
</manifest>

Toasts/proguard-project.txt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}

Toasts/project.properties

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-18
1.04 KB
Loading
733 Bytes
Loading
1.4 KB
Loading
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:tools="http://schemas.android.com/tools"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:gravity="center"
6+
android:orientation="vertical"
7+
android:paddingBottom="@dimen/activity_vertical_margin"
8+
android:paddingLeft="@dimen/activity_horizontal_margin"
9+
android:paddingRight="@dimen/activity_horizontal_margin"
10+
android:paddingTop="@dimen/activity_vertical_margin"
11+
tools:context=".MainActivity" >
12+
13+
<Button
14+
android:id="@+id/btnToastBasic"
15+
android:layout_width="wrap_content"
16+
android:layout_height="wrap_content"
17+
android:clickable="true"
18+
android:onClick="onClick"
19+
android:text="@string/button_toast_basic" />
20+
21+
<Button
22+
android:id="@+id/btnToastGravity"
23+
android:layout_width="wrap_content"
24+
android:layout_height="wrap_content"
25+
android:clickable="true"
26+
android:onClick="onClick"
27+
android:text="@string/button_toast_gravity" />
28+
29+
<Button
30+
android:id="@+id/btnToastCustom"
31+
android:layout_width="wrap_content"
32+
android:layout_height="wrap_content"
33+
android:clickable="true"
34+
android:onClick="onClick"
35+
android:text="@string/button_toast_custom" />
36+
37+
</LinearLayout>

Toasts/res/layout/custom_toast.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:id="@+id/toast_layout_root"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:background="#E6003A"
6+
android:gravity="center"
7+
android:orientation="horizontal"
8+
android:padding="10dp" >
9+
10+
<ImageView
11+
android:layout_width="wrap_content"
12+
android:layout_height="wrap_content"
13+
android:layout_marginRight="8dp"
14+
android:contentDescription="@string/app_name"
15+
android:src="@android:drawable/ic_dialog_info" />
16+
17+
<TextView
18+
android:id="@+id/text_toast"
19+
android:layout_width="wrap_content"
20+
android:layout_height="wrap_content"
21+
android:textColor="#FFF" />
22+
23+
</LinearLayout>

Toasts/res/menu/main.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
2+
3+
<item
4+
android:id="@+id/action_settings"
5+
android:orderInCategory="100"
6+
android:showAsAction="never"
7+
android:title="@string/action_settings"/>
8+
9+
</menu>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<!--
4+
Customize dimensions originally defined in res/values/dimens.xml (such as
5+
screen margins) for sw600dp devices (e.g. 7" tablets) here.
6+
-->
7+
8+
</resources>

0 commit comments

Comments
 (0)