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
41f52e8f
authored
Aug 24, 2017
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
CustomList improvement
parent
558087b7
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
34 deletions
android/Pictogram/commonlibrary/src/main/res/values/strings.xml
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/CustomList.java
android/Pictogram/tabletlibrary/src/main/res/layout/list_single.xml
android/Pictogram/tabletlibrary/tabletlibrary.iml
android/Pictogram/commonlibrary/src/main/res/values/strings.xml
View file @
41f52e8f
...
@@ -84,5 +84,6 @@
...
@@ -84,5 +84,6 @@
<string
name=
"fa_certificate"
>

</string>
<string
name=
"fa_certificate"
>

</string>
<string
name=
"fa_flask"
>

</string>
<string
name=
"fa_flask"
>

</string>
<string
name=
"fa_exclamation_triangle"
>

</string>
<string
name=
"fa_exclamation_triangle"
>

</string>
<string
name=
"fa_user_plus"
>

</string>
</resources>
</resources>
android/Pictogram/tabletlibrary/src/main/java/com/yottacode/pictogram/tabletlibrary/gui/login/CustomList.java
View file @
41f52e8f
...
@@ -23,6 +23,7 @@ import java.util.Vector;
...
@@ -23,6 +23,7 @@ import java.util.Vector;
import
static
com
.
yottacode
.
pictogram
.
R
.
string
.
fa_certificate
;
import
static
com
.
yottacode
.
pictogram
.
R
.
string
.
fa_certificate
;
import
static
com
.
yottacode
.
pictogram
.
R
.
string
.
fa_flask
;
import
static
com
.
yottacode
.
pictogram
.
R
.
string
.
fa_flask
;
import
static
com
.
yottacode
.
pictogram
.
R
.
string
.
fa_exclamation_triangle
;
import
static
com
.
yottacode
.
pictogram
.
R
.
string
.
fa_exclamation_triangle
;
import
static
com
.
yottacode
.
pictogram
.
R
.
string
.
fa_user_plus
;
/**
/**
* Creates a View for each student on the list with a photo and his/her name.
* Creates a View for each student on the list with a photo and his/her name.
...
@@ -30,7 +31,6 @@ import static com.yottacode.pictogram.R.string.fa_exclamation_triangle;
...
@@ -30,7 +31,6 @@ import static com.yottacode.pictogram.R.string.fa_exclamation_triangle;
*/
*/
public
class
CustomList
extends
ArrayAdapter
<
String
>{
public
class
CustomList
extends
ArrayAdapter
<
String
>{
private
boolean
color
;
private
final
Activity
context
;
private
final
Activity
context
;
private
final
String
[]
name_surname
;
private
final
String
[]
name_surname
;
private
final
Vector
<
Bitmap
>
images
;
private
final
Vector
<
Bitmap
>
images
;
...
@@ -48,7 +48,6 @@ public class CustomList extends ArrayAdapter<String>{
...
@@ -48,7 +48,6 @@ public class CustomList extends ArrayAdapter<String>{
this
.
name_surname
=
name_surname
;
this
.
name_surname
=
name_surname
;
this
.
images
=
images
;
this
.
images
=
images
;
this
.
licenses
=
licenses
;
this
.
licenses
=
licenses
;
this
.
color
=
true
;
}
}
/**
/**
...
@@ -60,15 +59,20 @@ public class CustomList extends ArrayAdapter<String>{
...
@@ -60,15 +59,20 @@ public class CustomList extends ArrayAdapter<String>{
@Override
@Override
public
View
getView
(
int
position
,
View
view
,
ViewGroup
parent
)
{
public
View
getView
(
int
position
,
View
view
,
ViewGroup
parent
)
{
LayoutInflater
inflater
=
context
.
getLayoutInflater
();
LayoutInflater
inflater
=
context
.
getLayoutInflater
();
View
rowView
=
inflater
.
inflate
(
R
.
layout
.
list_single
,
null
,
true
);
View
rowView
=
inflater
.
inflate
(
R
.
layout
.
list_single
,
null
,
true
);
Typeface
fontAwesome
=
Typeface
.
createFromAsset
(
getContext
().
getAssets
(),
"fonts/fontawesome-webfont.ttf"
);
// Name
// Name
TextView
txtTitle
=
(
TextView
)
rowView
.
findViewById
(
R
.
id
.
loginStudentName
);
TextView
txtTitle
=
(
TextView
)
rowView
.
findViewById
(
R
.
id
.
loginStudentName
);
txtTitle
.
setText
(
name_surname
[
position
]);
txtTitle
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
VerdeApp
));
// All students info, except last item (new student)
if
(!
name_surname
[
position
].
equals
(
getContext
().
getString
(
R
.
string
.
addStudent
))){
// License, except add student view
// License, except add student view
TextView
licenseView
=
(
TextView
)
rowView
.
findViewById
(
R
.
id
.
loginStudentLicense
);
TextView
licenseView
=
(
TextView
)
rowView
.
findViewById
(
R
.
id
.
loginStudentLicense
);
licenseView
.
setTypeface
(
fontAwesome
);
if
(!
name_surname
[
position
].
equals
(
getContext
().
getString
(
R
.
string
.
addStudent
))){
if
(
licenses
[
position
].
equals
(
"pro"
))
{
if
(
licenses
[
position
].
equals
(
"pro"
))
{
licenseView
.
setText
(
fa_certificate
);
licenseView
.
setText
(
fa_certificate
);
...
@@ -80,35 +84,32 @@ public class CustomList extends ArrayAdapter<String>{
...
@@ -80,35 +84,32 @@ public class CustomList extends ArrayAdapter<String>{
licenseView
.
setText
(
fa_exclamation_triangle
);
licenseView
.
setText
(
fa_exclamation_triangle
);
licenseView
.
setTextColor
(
getContext
().
getResources
().
getColor
(
R
.
color
.
text_danger
));
licenseView
.
setTextColor
(
getContext
().
getResources
().
getColor
(
R
.
color
.
text_danger
));
}
}
Typeface
font
=
Typeface
.
createFromAsset
(
getContext
().
getAssets
(),
"fonts/fontawesome-webfont.ttf"
);
licenseView
.
setTypeface
(
font
);
}
// Image
ImageView
imageView
=
(
ImageView
)
rowView
.
findViewById
(
R
.
id
.
loginStudentPhoto
);
txtTitle
.
setText
(
name_surname
[
position
]);
ImageView
fondo
=
(
ImageView
)
rowView
.
findViewById
(
R
.
id
.
fondo
);
//if(color){
// color = false;
// rowView.setBackgroundColor(ContextCompat.getColor(context, R.color.VerdeApp));
// txtTitle.setTextColor(ContextCompat.getColor(context, R.color.BlancoApp));
// fondo.setBackgroundResource(R.drawable.round_design_photo_green);
//}else{
// Student image
// color = true;
ImageView
imageView
=
(
ImageView
)
rowView
.
findViewById
(
R
.
id
.
loginStudentPhoto
);
rowView
.
setBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
BlancoApp
));
txtTitle
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
VerdeApp
));
fondo
.
setBackgroundResource
(
R
.
drawable
.
round_design_photo_white
);
//}
if
(
images
.
elementAt
(
position
)
!=
null
){
//imageView.setImageResource(R.drawable.user);
if
(
images
.
elementAt
(
position
)!=
null
){
imageView
.
setImageBitmap
(
images
.
elementAt
(
position
));
imageView
.
setImageBitmap
(
images
.
elementAt
(
position
));
}
else
{
}
else
{
imageView
.
setImageResource
(
R
.
drawable
.
anonymous_student
);
imageView
.
setImageResource
(
R
.
drawable
.
anonymous_student
);
}
}
}
else
{
// New student
TextView
newStudentView
=
(
TextView
)
rowView
.
findViewById
(
R
.
id
.
loginStudentNew
);
newStudentView
.
setTypeface
(
fontAwesome
);
newStudentView
.
setTextSize
(
64
);
newStudentView
.
setText
(
fa_user_plus
);
}
// Background
ImageView
fondo
=
(
ImageView
)
rowView
.
findViewById
(
R
.
id
.
fondo
);
fondo
.
setBackgroundResource
(
R
.
drawable
.
round_design_photo_white
);
// RowView
rowView
.
setBackgroundColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
BlancoApp
));
return
rowView
;
return
rowView
;
}
}
}
}
android/Pictogram/tabletlibrary/src/main/res/layout/list_single.xml
View file @
41f52e8f
...
@@ -35,6 +35,12 @@
...
@@ -35,6 +35,12 @@
android:layout_centerVertical=
"true"
android:layout_centerVertical=
"true"
android:layout_gravity=
"center"
/>
android:layout_gravity=
"center"
/>
<TextView
android:id=
"@+id/loginStudentNew"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:gravity=
"center_vertical|center_horizontal"
/>
</FrameLayout>
</FrameLayout>
<LinearLayout
<LinearLayout
...
...
android/Pictogram/tabletlibrary/tabletlibrary.iml
View file @
41f52e8f
...
@@ -62,13 +62,6 @@
...
@@ -62,13 +62,6 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/java"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/rs"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/main/shaders"
isTestSource=
"false"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/assets"
type=
"java-test-resource"
/>
...
@@ -76,6 +69,13 @@
...
@@ -76,6 +69,13 @@
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/androidTest/shaders"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/res"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/resources"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/assets"
type=
"java-test-resource"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/aidl"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/java"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/rs"
isTestSource=
"true"
/>
<sourceFolder
url=
"file://$MODULE_DIR$/src/test/shaders"
isTestSource=
"true"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/annotations"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/annotations"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/blame"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/bundles"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build/intermediates/bundles"
/>
...
...
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