Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
e9fb5c5e
authored
Dec 19, 2016
by
german
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Design Repaired (Appear list when keyboard is hide faults)
parent
51c69a8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
44 deletions
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/SerialActivity.java
android/Pictogram/tabletlibrary/src/main/res/layout/activity_serial.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/SerialActivity.java
View file @
e9fb5c5e
package
com
.
yottacode
.
pictogram
.
tabletlibrary
.
gui
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.res.Configuration
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.KeyEvent
;
import
android.view.View
;
import
android.view.View.OnClickListener
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.view.inputmethod.InputMethodManager
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.LinearLayout
;
...
...
@@ -29,6 +33,8 @@ public class SerialActivity extends Activity {
private
final
String
LOG_TAG
=
this
.
getClass
().
getSimpleName
();
// Or .getCanonicalName()
protected
boolean
is_legal_user
(
String
user_name
,
Activity
activity
)
{
return
true
;}
LinearLayout
stuList
;
LinearLayout
supList
;
/**
* Return the default user+pwd when login.The policy is
...
...
@@ -48,6 +54,7 @@ public class SerialActivity extends Activity {
}
return
new
String
[]{
username
,
password
};
}
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
...
...
@@ -65,35 +72,59 @@ public class SerialActivity extends Activity {
String
username
=
default_user
[
0
];
String
password
=
default_user
[
1
];
final
InputMethodManager
imm
=
(
InputMethodManager
)
this
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
// Escribo el último valor indicado de username
mSerialViewMail
.
setText
(
username
);
mSerialViewPass
.
setText
(
password
);
final
LinearLayout
stuList
=
(
LinearLayout
)
findViewById
(
R
.
id
.
stuLay
);
final
LinearLayout
supList
=
(
LinearLayout
)
findViewById
(
R
.
id
.
supLay
);
stuList
=
(
LinearLayout
)
findViewById
(
R
.
id
.
stuLay
);
supList
=
(
LinearLayout
)
findViewById
(
R
.
id
.
supLay
);
mSerialViewMail
.
setOnFocusChangeListener
(
new
View
.
OnFocusChangeListener
()
{
@Override
public
void
onFocusChange
(
View
view
,
boolean
hasFocus
)
{
if
(
hasFocus
){
stuList
.
setVisibility
(
View
.
INVISIBLE
);
supList
.
setVisibility
(
View
.
INVISIBLE
);
if
(
imm
.
isActive
(
view
))
{
Log
.
i
(
"Keyboard"
,
"Activo"
);
stuList
.
setVisibility
(
View
.
INVISIBLE
);
supList
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
Log
.
i
(
"Keyboard"
,
"Inactivo"
);
stuList
.
setVisibility
(
View
.
VISIBLE
);
supList
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
});
mSerialViewMail
.
setOnClickListener
(
new
View
.
OnClickListener
(){
@Override
public
void
onClick
(
View
v
){
stuList
.
setVisibility
(
View
.
INVISIBLE
);
supList
.
setVisibility
(
View
.
INVISIBLE
);
}
});
mSerialViewPass
.
setOnFocusChangeListener
(
new
View
.
OnFocusChangeListener
()
{
@Override
public
void
onFocusChange
(
View
view
,
boolean
hasFocus
)
{
if
(
hasFocus
){
stuList
.
setVisibility
(
View
.
INVISIBLE
);
supList
.
setVisibility
(
View
.
INVISIBLE
);
if
(
hasFocus
)
{
if
(
imm
.
isActive
(
view
))
{
Log
.
i
(
"Keyboard"
,
"Activo"
);
stuList
.
setVisibility
(
View
.
INVISIBLE
);
supList
.
setVisibility
(
View
.
INVISIBLE
);
}
else
{
Log
.
i
(
"Keyboard"
,
"Inactivo"
);
stuList
.
setVisibility
(
View
.
VISIBLE
);
supList
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
});
// Escribo el último valor indicado de username
mSerialViewMail
.
setText
(
username
);
if
(!
username
.
equals
(
""
)
&&
!
password
.
equals
(
""
)
&&
!
getIntent
().
getBooleanExtra
(
"resetPrevUser"
,
true
))
new
UserLogin
().
login
(
username
,
password
,
SerialActivity
.
this
,
PictogramActivity
.
class
,
LoginActivity
.
class
);
...
...
android/Pictogram/tabletlibrary/src/main/res/layout/activity_serial.xml
View file @
e9fb5c5e
...
...
@@ -21,6 +21,20 @@
android:layout_toEndOf=
"@+id/serialmail"
/>
<EditText
android:id=
"@+id/serialmail"
android:layout_width=
"400px"
android:layout_height=
"wrap_content"
android:hint=
"@string/prompt_serial_mail"
android:imeActionId=
"@+id/login"
android:imeOptions=
"actionUnspecified"
android:inputType=
"text"
android:maxLines=
"1"
android:layout_marginStart=
"145dp"
android:selectAllOnFocus=
"false"
android:layout_alignParentTop=
"true"
android:layout_alignStart=
"@+id/stuLay"
/>
<EditText
android:id=
"@+id/serialpass"
android:layout_width=
"400px"
android:layout_height=
"wrap_content"
...
...
@@ -30,9 +44,10 @@
android:imeOptions=
"actionUnspecified"
android:inputType=
"textPassword"
android:maxLines=
"1"
android:singleLine=
"true"
android:layout_below=
"@+id/serialmail"
android:layout_toStartOf=
"@+id/imageView"
/>
android:layout_toStartOf=
"@+id/imageView"
android:selectAllOnFocus=
"false"
android:singleLine=
"false"
/>
<Button
android:id=
"@+id/entrar_button"
style=
"?android:textAppearanceSmall"
...
...
@@ -52,70 +67,57 @@
android:layout_alignParentEnd=
"true"
android:layout_marginEnd=
"18dp"
/>
<EditText
android:id=
"@+id/serialmail"
android:layout_width=
"400px"
android:layout_height=
"wrap_content"
android:hint=
"@string/prompt_serial_mail"
android:imeActionId=
"@+id/login"
android:imeOptions=
"actionUnspecified"
android:inputType=
"text"
android:maxLines=
"1"
android:layout_marginStart=
"212dp"
android:layout_alignParentTop=
"true"
android:layout_alignParentStart=
"true"
/>
<LinearLayout
android:orientation=
"vertical"
android:background=
"@color/blue"
android:layout_height=
"350px"
android:layout_marginStart=
"67dp"
android:background=
"@color/darkred"
android:layout_width=
"400px"
android:layout_alignParentBottom=
"true"
android:layout_alignStart=
"@+id/entrar_button"
android:layout_marginStart=
"270dp"
android:id=
"@+id/supLay"
>
android:layout_alignParentStart=
"true"
android:id=
"@+id/stuLay"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/labelSup"
tools:text=
"Supervisores"
android:text=
"@string/supervisores"
android:textAppearance=
"@style/TextAppearance.AppCompat"
android:id=
"@+id/labelStu"
tools:text=
"Alumnos"
android:text=
"@string/alumnos"
android:textAlignment=
"center"
android:textSize=
"18sp"
/>
android:textSize=
"18sp"
android:textColor=
"@android:color/black"
/>
<ListView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/supList"
/>
android:id=
"@+id/stuList"
/>
</LinearLayout>
<LinearLayout
android:orientation=
"vertical"
android:background=
"@color/blue"
android:layout_height=
"350px"
android:layout_marginStart=
"67dp"
android:background=
"@color/darkred"
android:layout_width=
"400px"
android:layout_alignParentBottom=
"true"
android:layout_alignParentStart=
"true"
android:id=
"@+id/stuLay"
>
android:layout_alignStart=
"@+id/entrar_button"
android:layout_marginStart=
"270dp"
android:id=
"@+id/supLay"
>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/labelStu"
tools:text=
"Alumnos"
android:text=
"@string/alumnos"
android:textAppearance=
"@style/TextAppearance.AppCompat"
android:id=
"@+id/labelSup"
tools:text=
"Supervisores"
android:text=
"@string/supervisores"
android:textAlignment=
"center"
android:textSize=
"18sp"
/>
android:textSize=
"18sp"
android:textColor=
"@android:color/black"
/>
<ListView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:id=
"@+id/stuList"
/>
android:id=
"@+id/supList"
/>
</LinearLayout>
</RelativeLayout>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment