FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
GlassCodeReader/src/lst/lst/ExpList.java at master · msacks/GlassCodeReader · GitHub
msacks
/
GlassCodeReader
Public
Notifications
You must be signed in to change notification settings
Fork
2
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
GlassCodeReader
/
src
/
lst
/
lst
/
ExpList.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
130 lines (102 loc) · 3.96 KB
Breadcrumbs
GlassCodeReader
/
src
/
lst
/
lst
/
ExpList.java
Copy path
File metadata and controls
130 lines (102 loc) · 3.96 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
/*
Copyright 2011 GlassCode Web Development Corporation www.glasscodeinc.com
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
lst
.
lst
;
import
android
.
app
.
ExpandableListActivity
;
import
android
.
content
.
Intent
;
import
android
.
net
.
Uri
;
import
android
.
os
.
Bundle
;
import
android
.
view
.
View
;
import
android
.
widget
.
AdapterView
;
import
android
.
widget
.
ExpandableListView
;
import
android
.
widget
.
ImageView
;
import
android
.
widget
.
SimpleExpandableListAdapter
;
import
android
.
widget
.
TextView
;
import
android
.
widget
.
Toast
;
import
android
.
widget
.
AdapterView
.
OnItemClickListener
;
import
android
.
widget
.
ExpandableListView
.
OnChildClickListener
;
import
java
.
util
.
List
;
import
java
.
util
.
ArrayList
;
import
java
.
util
.
Map
;
import
java
.
util
.
HashMap
;
public
class
ExpList
extends
ExpandableListActivity
implements
OnChildClickListener
{
ImageView
img1
,
img2
;
static
int
pos
=
0
;
static
ArrayList
<
String
>
a1
=
new
ArrayList
<
String
>();
static
ArrayList
<
String
>
b1
=
new
ArrayList
<
String
>();
static
ArrayList
<
Integer
>
c1
=
new
ArrayList
<
Integer
>();
@
Override
public
void
onCreate
(
Bundle
icicle
)
{
super
.
onCreate
(
icicle
);
setContentView
(
R
.
layout
.
main
);
img1
=(
ImageView
)
findViewById
(
R
.
id
.
ImageView01
);
img2
=(
ImageView
)
findViewById
(
R
.
id
.
ImageView02
);
SimpleExpandableListAdapter
expListAdapter
=
new
SimpleExpandableListAdapter
(
this
,
createGroupList
(),
// groupData describes the first-level entries
R
.
layout
.
child_row
,
// Layout for the first-level entries
new
String
[] {
"colorName"
},
// Key in the groupData maps to display
new
int
[] {
R
.
id
.
childname
},
// Data under "colorName" key goes into this TextView
createChildList
(),
// childData describes second-level entries
R
.
layout
.
child_title
,
// Layout for second-level entries
new
String
[] {
"shadeName"
,
"rgb"
},
// Keys in childData maps to display
new
int
[] {
R
.
id
.
childname
,
R
.
id
.
rgb
}
// Data under the keys above go into these TextViews
);
setListAdapter
(
expListAdapter
);
}
private
List
createGroupList
() {
ArrayList
result
=
new
ArrayList
();
result
.
clear
();
for
(
int
i
=
0
;
i
<
a1
.
size
() ;
i
++ ) {
HashMap
m
=
new
HashMap
();
m
.
put
(
"colorName"
,
a1
.
get
(
i
) );
result
.
add
(
m
);
}
return
(
List
)
result
;
}
private
List
createChildList
() {
ArrayList
result
=
new
ArrayList
();
int
n
=
0
;
for
(
int
i
=
0
;
i
<
a1
.
size
();
i
++)
{
ArrayList
secList
=
new
ArrayList
();
for
(
int
j
=
0
;
j
<
c1
.
get
(
i
) ;
j
++)
{
HashMap
child
=
new
HashMap
();
child
.
put
(
"shadeName"
,
b1
.
get
(
n
));
//child.put( "rgb", rssdb.ac.get(n+1) );
secList
.
add
(
child
);
n
++;
}
result
.
add
(
secList
);
}
return
result
;
}
public
boolean
onChildClick
(
ExpandableListView
parent
,
View
v
,
int
groupPosition
,
int
cp
,
long
id
) {
// use groupPosition and childPosition to locate the current item in the adapter
pos
=
0
;
for
(
int
i
=
0
;
i
<
groupPosition
;
i
++)
pos
=
pos
+
c1
.
get
(
i
);
pos
=
pos
+
cp
;
//pos=(groupPosition+cp);
/* Uri uri = Uri.parse(a);
startActivity( new Intent( Intent.ACTION_VIEW, uri ) );*/
//Toast.makeText(ExpList.this, rssdb.ac.get(pos), 2000).show();
// Toast.makeText(ExpList.this, String.valueOf(pos+cp), 2000).show();
startActivity
(
new
Intent
(
ExpList
.
this
,
hello
.
class
));
return
true
;
}
}
Back
|
FazBrowse Home
|
New Git URL