Skip to content

Commit 9478b89

Browse files
committed
Controles Personalizados y Tabs
1 parent 0e84eaa commit 9478b89

File tree

91 files changed

+1148
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1148
-0
lines changed
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="net.sgoliver.android.controlpers1"
3+
android:versionCode="1"
4+
android:versionName="1.0" >
5+
6+
<uses-sdk
7+
android:minSdkVersion="8"
8+
android:targetSdkVersion="15" />
9+
10+
<application
11+
android:icon="@drawable/ic_launcher"
12+
android:label="@string/app_name"
13+
android:theme="@style/AppTheme" >
14+
<activity
15+
android:name=".MainActivity"
16+
android:label="@string/title_activity_main" >
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
</application>
24+
25+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** Automatically generated file. DO NOT MODIFY */
2+
package net.sgoliver.android.controlpers1;
3+
4+
public final class BuildConfig {
5+
public final static boolean DEBUG = true;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
8+
package net.sgoliver.android.controlpers1;
9+
10+
public final class R {
11+
public static final class attr {
12+
}
13+
public static final class drawable {
14+
public static final int ic_action_search=0x7f020000;
15+
public static final int ic_launcher=0x7f020001;
16+
}
17+
public static final class id {
18+
public static final int menu_settings=0x7f070000;
19+
}
20+
public static final class layout {
21+
public static final int activity_main=0x7f030000;
22+
}
23+
public static final class menu {
24+
public static final int activity_main=0x7f060000;
25+
}
26+
public static final class string {
27+
public static final int app_name=0x7f040000;
28+
public static final int hello_world=0x7f040001;
29+
public static final int menu_settings=0x7f040002;
30+
public static final int title_activity_main=0x7f040003;
31+
}
32+
public static final class style {
33+
public static final int AppTheme=0x7f050000;
34+
}
35+
}
36.2 KB
Loading
Binary file not shown.
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+
#}
+14
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-16
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<RelativeLayout 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+
6+
<net.sgoliver.android.controlpers1.ExtendedEditText
7+
android:layout_width="match_parent"
8+
android:layout_height="wrap_content" />
9+
10+
</RelativeLayout>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<menu xmlns:android="http://schemas.android.com/apk/res/android">
2+
<item android:id="@+id/menu_settings"
3+
android:title="@string/menu_settings"
4+
android:orderInCategory="100"
5+
android:showAsAction="never" />
6+
</menu>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
3+
<style name="AppTheme" parent="android:Theme.Holo.Light" />
4+
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
3+
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />
4+
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<resources>
2+
3+
<string name="app_name">Controles Personalizados 1</string>
4+
<string name="hello_world">Hello world!</string>
5+
<string name="menu_settings">Settings</string>
6+
<string name="title_activity_main">Control Personalizado 1</string>
7+
8+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<resources>
2+
3+
<style name="AppTheme" parent="android:Theme.Light" />
4+
5+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package net.sgoliver.android.controlpers1;
2+
3+
import android.content.Context;
4+
import android.graphics.Canvas;
5+
import android.graphics.Color;
6+
import android.graphics.Paint;
7+
import android.graphics.Paint.Style;
8+
import android.util.AttributeSet;
9+
import android.widget.EditText;
10+
11+
public class ExtendedEditText extends EditText {
12+
private Paint p1;
13+
private Paint p2;
14+
15+
public ExtendedEditText(Context context, AttributeSet attrs, int defStyle){
16+
super(context, attrs, defStyle);
17+
18+
inicializacion();
19+
}
20+
21+
public ExtendedEditText(Context context, AttributeSet attrs) {
22+
super(context, attrs);
23+
24+
inicializacion();
25+
}
26+
27+
public ExtendedEditText(Context context) {
28+
super(context);
29+
30+
inicializacion();
31+
}
32+
33+
private void inicializacion()
34+
{
35+
p1 = new Paint(Paint.ANTI_ALIAS_FLAG);
36+
p1.setColor(Color.BLACK);
37+
p1.setStyle(Style.FILL);
38+
39+
p2 = new Paint(Paint.ANTI_ALIAS_FLAG);
40+
p2.setColor(Color.WHITE);
41+
}
42+
43+
@Override
44+
public void onDraw(Canvas canvas)
45+
{
46+
//Llamamos al método de la clase base (EditText)
47+
super.onDraw(canvas);
48+
49+
//Dibujamos el fondo negro del contador
50+
canvas.drawRect(this.getWidth()-30, 5,
51+
this.getWidth()-5, 20, p1);
52+
53+
//Dibujamos el número de caracteres sobre el contador
54+
canvas.drawText("" + this.getText().toString().length(),
55+
this.getWidth()-28, 17, p2);
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package net.sgoliver.android.controlpers1;
2+
3+
import android.os.Bundle;
4+
import android.app.Activity;
5+
import android.view.Menu;
6+
7+
public class MainActivity extends Activity {
8+
9+
@Override
10+
public void onCreate(Bundle savedInstanceState) {
11+
super.onCreate(savedInstanceState);
12+
setContentView(R.layout.activity_main);
13+
}
14+
15+
@Override
16+
public boolean onCreateOptionsMenu(Menu menu) {
17+
getMenuInflater().inflate(R.menu.activity_main, menu);
18+
return true;
19+
}
20+
}
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="net.sgoliver.android.controlpers2"
3+
android:versionCode="1"
4+
android:versionName="1.0" >
5+
6+
<uses-sdk
7+
android:minSdkVersion="8"
8+
android:targetSdkVersion="15" />
9+
10+
<application
11+
android:icon="@drawable/ic_launcher"
12+
android:label="@string/app_name"
13+
android:theme="@style/AppTheme" >
14+
<activity
15+
android:name=".MainActivity"
16+
android:label="@string/title_activity_main" >
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
20+
<category android:name="android.intent.category.LAUNCHER" />
21+
</intent-filter>
22+
</activity>
23+
</application>
24+
25+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** Automatically generated file. DO NOT MODIFY */
2+
package net.sgoliver.android.controlpers2;
3+
4+
public final class BuildConfig {
5+
public final static boolean DEBUG = true;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/* AUTO-GENERATED FILE. DO NOT MODIFY.
2+
*
3+
* This class was automatically generated by the
4+
* aapt tool from the resource data it found. It
5+
* should not be modified by hand.
6+
*/
7+
8+
package net.sgoliver.android.controlpers2;
9+
10+
public final class R {
11+
public static final class attr {
12+
/** <p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
13+
<p>This may also be a reference to a resource (in the form
14+
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
15+
theme attribute (in the form
16+
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
17+
containing a value of this type.
18+
*/
19+
public static final int login_text=0x7f010000;
20+
}
21+
public static final class drawable {
22+
public static final int ic_action_search=0x7f020000;
23+
public static final int ic_launcher=0x7f020001;
24+
}
25+
public static final class id {
26+
public static final int BtnAceptar=0x7f070005;
27+
public static final int CtlLogin=0x7f070000;
28+
public static final int LblMensaje=0x7f070006;
29+
public static final int TextView01=0x7f070001;
30+
public static final int TextView02=0x7f070003;
31+
public static final int TxtPassword=0x7f070004;
32+
public static final int TxtUsuario=0x7f070002;
33+
public static final int menu_settings=0x7f070007;
34+
}
35+
public static final class layout {
36+
public static final int activity_main=0x7f030000;
37+
public static final int control_login=0x7f030001;
38+
}
39+
public static final class menu {
40+
public static final int activity_main=0x7f060000;
41+
}
42+
public static final class string {
43+
public static final int app_name=0x7f040000;
44+
public static final int contrasena=0x7f040005;
45+
public static final int hello_world=0x7f040001;
46+
public static final int login=0x7f040006;
47+
public static final int menu_settings=0x7f040002;
48+
public static final int title_activity_main=0x7f040003;
49+
public static final int usuario=0x7f040004;
50+
}
51+
public static final class style {
52+
public static final int AppTheme=0x7f050000;
53+
}
54+
public static final class styleable {
55+
/** Attributes that can be used with a ControlLogin.
56+
<p>Includes the following attributes:</p>
57+
<table>
58+
<colgroup align="left" />
59+
<colgroup align="left" />
60+
<tr><th>Attribute</th><th>Description</th></tr>
61+
<tr><td><code>{@link #ControlLogin_login_text net.sgoliver.android.controlpers2:login_text}</code></td><td></td></tr>
62+
</table>
63+
@see #ControlLogin_login_text
64+
*/
65+
public static final int[] ControlLogin = {
66+
0x7f010000
67+
};
68+
/**
69+
<p>This symbol is the offset where the {@link net.sgoliver.android.controlpers2.R.attr#login_text}
70+
attribute's value can be found in the {@link #ControlLogin} array.
71+
72+
73+
<p>Must be a string value, using '\\;' to escape characters such as '\\n' or '\\uxxxx' for a unicode character.
74+
<p>This may also be a reference to a resource (in the form
75+
"<code>@[<i>package</i>:]<i>type</i>:<i>name</i></code>") or
76+
theme attribute (in the form
77+
"<code>?[<i>package</i>:][<i>type</i>:]<i>name</i></code>")
78+
containing a value of this type.
79+
@attr name android:login_text
80+
*/
81+
public static final int ControlLogin_login_text = 0;
82+
};
83+
}
36.2 KB
Loading
Binary file not shown.
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+
#}
+14
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-16
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)