Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haihang
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐丛奇
haihang
Commits
4e83b2ee
Commit
4e83b2ee
authored
Sep 04, 2018
by
chengxiuhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test main
parent
a3e0beeb
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
163 additions
and
41 deletions
+163
-41
MorePeopleTestActivity.java
app/src/main/java/com/oo/eye/activity/MorePeopleTestActivity.java
+1
-1
SinglePeopleTestActivity.java
app/src/main/java/com/oo/eye/activity/SinglePeopleTestActivity.java
+52
-8
TestResurtListActivity.java
app/src/main/java/com/oo/eye/activity/TestResurtListActivity.java
+1
-1
PopuAdapter.java
app/src/main/java/com/oo/eye/adapter/PopuAdapter.java
+20
-3
TestListAdapter.java
app/src/main/java/com/oo/eye/adapter/TestListAdapter.java
+5
-2
PopuBean.java
app/src/main/java/com/oo/eye/bean/PopuBean.java
+29
-0
activity_singletest.xml
app/src/main/res/layout/activity_singletest.xml
+55
-26
No files found.
app/src/main/java/com/oo/eye/activity/MorePeopleTestActivity.java
View file @
4e83b2ee
...
@@ -142,7 +142,7 @@ public class MorePeopleTestActivity extends BaseActivity {
...
@@ -142,7 +142,7 @@ public class MorePeopleTestActivity extends BaseActivity {
ColorDrawable
cd
=
new
ColorDrawable
(
0x00ffffff
);
// 背景颜色全透明
ColorDrawable
cd
=
new
ColorDrawable
(
0x00ffffff
);
// 背景颜色全透明
popupWindow
.
setBackgroundDrawable
(
cd
);
popupWindow
.
setBackgroundDrawable
(
cd
);
ListView
listView
=
(
ListView
)
conview
.
findViewById
(
R
.
id
.
list_view
);
ListView
listView
=
(
ListView
)
conview
.
findViewById
(
R
.
id
.
list_view
);
listView
.
setAdapter
(
new
PopuAdapter
(
this
));
listView
.
setAdapter
(
new
PopuAdapter
(
this
,
null
));
int
[]
location
=
new
int
[
2
];
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
view
.
getLocationOnScreen
(
location
);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
...
...
app/src/main/java/com/oo/eye/activity/SinglePeopleTestActivity.java
View file @
4e83b2ee
package
com
.
oo
.
eye
.
activity
;
package
com
.
oo
.
eye
.
activity
;
import
android.graphics.drawable.ColorDrawable
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.ListView
;
import
android.widget.PopupWindow
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.app.baselibrary.base.common.BaseActivity
;
import
com.app.baselibrary.base.common.BaseActivity
;
import
com.oo.eye.EyeConfig
;
import
com.oo.eye.EyeConfig
;
import
com.oo.eye.R
;
import
com.oo.eye.R
;
import
com.oo.eye.adapter.PopuAdapter
;
import
com.oo.eye.bean.StudentBean
;
import
com.oo.eye.bean.StudentBean
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
...
@@ -22,6 +29,10 @@ import butterknife.OnClick;
...
@@ -22,6 +29,10 @@ import butterknife.OnClick;
public
class
SinglePeopleTestActivity
extends
BaseActivity
{
public
class
SinglePeopleTestActivity
extends
BaseActivity
{
@BindView
(
R
.
id
.
begin_test
)
@BindView
(
R
.
id
.
begin_test
)
TextView
mBeginTest
;
TextView
mBeginTest
;
@BindView
(
R
.
id
.
selete_area_tv
)
TextView
mSeleteAreaTv
;
@BindView
(
R
.
id
.
selete_area_lay
)
LinearLayout
mSeleteAreaLay
;
@Override
@Override
protected
int
getLayoutId
()
{
protected
int
getLayoutId
()
{
...
@@ -39,13 +50,46 @@ public class SinglePeopleTestActivity extends BaseActivity {
...
@@ -39,13 +50,46 @@ public class SinglePeopleTestActivity extends BaseActivity {
ButterKnife
.
bind
(
this
);
ButterKnife
.
bind
(
this
);
}
}
@OnClick
(
R
.
id
.
begin_test
)
@OnClick
({
R
.
id
.
selete_area_lay
,
R
.
id
.
do_search
,
R
.
id
.
begin_test
})
public
void
onClick
()
{
public
void
onClick
(
View
view
)
{
ArrayList
<
StudentBean
>
list
=
new
ArrayList
<>();
switch
(
view
.
getId
())
{
StudentBean
student
=
new
StudentBean
();
case
R
.
id
.
selete_area_lay
:
student
.
setRealname
(
"游客"
);
showPopWindow
();
list
.
add
(
student
);
break
;
EyeConfig
.
getInstance
().
setStudents
(
list
);
case
R
.
id
.
do_search
:
startActivity
(
BeforeEyeTestActivity
.
class
);
break
;
case
R
.
id
.
begin_test
:
ArrayList
<
StudentBean
>
list
=
new
ArrayList
<>();
StudentBean
student
=
new
StudentBean
();
student
.
setRealname
(
"游客"
);
list
.
add
(
student
);
EyeConfig
.
getInstance
().
setStudents
(
list
);
startActivity
(
BeforeEyeTestActivity
.
class
);
break
;
}
}
private
void
showPopWindow
()
{
try
{
View
conview
=
View
.
inflate
(
this
,
R
.
layout
.
popu_list
,
null
);
PopupWindow
popupWindow
=
new
PopupWindow
(
conview
,
RelativeLayout
.
LayoutParams
.
WRAP_CONTENT
,
RelativeLayout
.
LayoutParams
.
WRAP_CONTENT
);
popupWindow
.
setFocusable
(
true
);
popupWindow
.
setOutsideTouchable
(
true
);
ColorDrawable
cd
=
new
ColorDrawable
(
0x00ffffff
);
// 背景颜色全透明
popupWindow
.
setBackgroundDrawable
(
cd
);
ListView
listView
=
(
ListView
)
conview
.
findViewById
(
R
.
id
.
list_view
);
listView
.
setAdapter
(
new
PopuAdapter
(
this
,
null
));
int
[]
location
=
new
int
[
2
];
mSeleteAreaLay
.
getLocationOnScreen
(
location
);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
conview
.
measure
(
View
.
MeasureSpec
.
UNSPECIFIED
,
View
.
MeasureSpec
.
UNSPECIFIED
);
int
xoff
=
-(
conview
.
getMeasuredWidth
()
/
2
-
mSeleteAreaLay
.
getWidth
()
/
2
);
popupWindow
.
showAsDropDown
(
mSeleteAreaLay
,
xoff
,
0
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
app/src/main/java/com/oo/eye/activity/TestResurtListActivity.java
View file @
4e83b2ee
...
@@ -142,7 +142,7 @@ public class TestResurtListActivity extends BaseActivity {
...
@@ -142,7 +142,7 @@ public class TestResurtListActivity extends BaseActivity {
ColorDrawable
cd
=
new
ColorDrawable
(
0x00ffffff
);
// 背景颜色全透明
ColorDrawable
cd
=
new
ColorDrawable
(
0x00ffffff
);
// 背景颜色全透明
popupWindow
.
setBackgroundDrawable
(
cd
);
popupWindow
.
setBackgroundDrawable
(
cd
);
ListView
listView
=
(
ListView
)
conview
.
findViewById
(
R
.
id
.
list_view
);
ListView
listView
=
(
ListView
)
conview
.
findViewById
(
R
.
id
.
list_view
);
listView
.
setAdapter
(
new
PopuAdapter
(
this
));
listView
.
setAdapter
(
new
PopuAdapter
(
this
,
null
));
int
[]
location
=
new
int
[
2
];
int
[]
location
=
new
int
[
2
];
view
.
getLocationOnScreen
(
location
);
view
.
getLocationOnScreen
(
location
);
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
// popupWindow.setAnimationStyle(R.style.style_pop_animation);// 动画效果必须放在showAsDropDown()方法上边,否则无效
...
...
app/src/main/java/com/oo/eye/adapter/PopuAdapter.java
View file @
4e83b2ee
...
@@ -10,6 +10,10 @@ import android.widget.ImageView;
...
@@ -10,6 +10,10 @@ import android.widget.ImageView;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.oo.eye.R
;
import
com.oo.eye.R
;
import
com.oo.eye.bean.PopuBean
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* Date : 2018/8/31.
* Date : 2018/8/31.
...
@@ -18,9 +22,15 @@ import com.oo.eye.R;
...
@@ -18,9 +22,15 @@ import com.oo.eye.R;
public
class
PopuAdapter
extends
BaseAdapter
{
public
class
PopuAdapter
extends
BaseAdapter
{
private
Context
mContext
;
private
Context
mContext
;
public
PopuAdapter
(
Context
context
){
private
List
<
PopuBean
>
mBeanList
=
new
ArrayList
<>();
mContext
=
context
;
public
PopuAdapter
(
Context
context
,
List
<
PopuBean
>
beans
)
{
mContext
=
context
;
if
(
beans
!=
null
)
{
mBeanList
=
beans
;
}
}
}
@Override
@Override
public
int
getCount
()
{
public
int
getCount
()
{
return
6
;
return
6
;
...
@@ -42,7 +52,14 @@ public class PopuAdapter extends BaseAdapter {
...
@@ -42,7 +52,14 @@ public class PopuAdapter extends BaseAdapter {
View
view
=
inflater
.
inflate
(
R
.
layout
.
item_popu_more
,
null
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
item_popu_more
,
null
);
final
TextView
textView
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name_tv
);
final
TextView
textView
=
(
TextView
)
view
.
findViewById
(
R
.
id
.
name_tv
);
ImageView
imageView
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
choice_tv
);
ImageView
imageView
=
(
ImageView
)
view
.
findViewById
(
R
.
id
.
choice_tv
);
// PopuBean bean=mBeanList.get(position);
// if (bean.isChick()){
// imageView.setVisibility(View.VISIBLE);
// imageView.setImageResource(R.drawable.selectitem);
// }else {
// imageView.setVisibility(View.INVISIBLE);
// }
// textView.setText(data[position]);
// textView.setText(data[position]);
return
view
;
return
view
;
}
}
}
}
app/src/main/java/com/oo/eye/adapter/TestListAdapter.java
View file @
4e83b2ee
...
@@ -3,6 +3,7 @@ package com.oo.eye.adapter;
...
@@ -3,6 +3,7 @@ package com.oo.eye.adapter;
import
android.content.Context
;
import
android.content.Context
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.TextView
;
import
com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter
;
import
com.app.baselibrary.recycler.adapter.BaseRecyclerViewAdapter
;
import
com.app.baselibrary.recycler.itemholder.ItemViewHolder
;
import
com.app.baselibrary.recycler.itemholder.ItemViewHolder
;
...
@@ -17,8 +18,9 @@ import java.util.List;
...
@@ -17,8 +18,9 @@ import java.util.List;
* Author: cxh
* Author: cxh
*/
*/
public
class
TestListAdapter
extends
BaseRecyclerViewAdapter
<
StudentBean
,
ItemViewHolder
>
{
public
class
TestListAdapter
extends
BaseRecyclerViewAdapter
<
StudentBean
,
ItemViewHolder
>
{
private
final
LayoutInflater
mInflater
;
private
final
LayoutInflater
mInflater
;
public
TestListAdapter
(
List
<
StudentBean
>
list
,
Context
context
)
{
public
TestListAdapter
(
List
<
StudentBean
>
list
,
Context
context
)
{
super
(
list
,
context
);
super
(
list
,
context
);
mInflater
=
LayoutInflater
.
from
(
mContext
);
mInflater
=
LayoutInflater
.
from
(
mContext
);
...
@@ -31,7 +33,8 @@ public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean,ItemVie
...
@@ -31,7 +33,8 @@ public class TestListAdapter extends BaseRecyclerViewAdapter<StudentBean,ItemVie
@Override
@Override
public
void
onBindViewHolder
(
ItemViewHolder
holder
,
int
position
)
{
public
void
onBindViewHolder
(
ItemViewHolder
holder
,
int
position
)
{
TextView
testOrder
=
(
TextView
)
holder
.
itemView
.
findViewById
(
R
.
id
.
test_order
);
testOrder
.
setText
((
position
+
1
)
+
""
);
}
}
...
...
app/src/main/java/com/oo/eye/bean/PopuBean.java
0 → 100644
View file @
4e83b2ee
package
com
.
oo
.
eye
.
bean
;
import
com.app.baselibrary.bean.BaseBean
;
/**
* Date : 2018/9/4.
* Author: cxh
*/
public
class
PopuBean
extends
BaseBean
{
private
String
name
;
private
boolean
isChick
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
boolean
isChick
()
{
return
isChick
;
}
public
void
setChick
(
boolean
chick
)
{
isChick
=
chick
;
}
}
app/src/main/res/layout/activity_singletest.xml
View file @
4e83b2ee
...
@@ -20,44 +20,73 @@
...
@@ -20,44 +20,73 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_70"
android:layout_marginTop=
"@dimen/dp_70"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/search"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/selete_area_lay"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"
vertic
al"
>
android:orientation=
"
horizont
al"
>
<
EditText
<
TextView
android:id=
"@+id/
key_test
"
android:id=
"@+id/
selete_area_tv
"
android:layout_width=
"
140dip
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_6"
android:text=
"黄冈校区22323"
android:background=
"@null"
android:textColor=
"@color/white"
android:hint=
"输入学员编号后4位"
android:textSize=
"@dimen/sp_18"
/>
android:textColorHint=
"@color/hint_text_color"
android:textSize=
"@dimen/sp_16"
/>
<View
<ImageView
android:layout_width=
"match_parent"
android:id=
"@+id/selete_area_iv"
android:layout_height=
"1px"
android:layout_width=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_1"
android:layout_height=
"wrap_content"
android:background=
"@color/hint_text_color"
></View>
android:layout_marginLeft=
"@dimen/dp_6"
android:src=
"@drawable/more"
/>
</LinearLayout>
</LinearLayout>
<
TextView
<
LinearLayout
android:
id=
"@+id/do_search
"
android:
layout_marginLeft=
"@dimen/dp_20
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:gravity=
"center_vertical"
android:text=
"查询"
android:orientation=
"horizontal"
>
android:textColor=
"@color/indicator_color"
android:textSize=
"@dimen/sp_18"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/search"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<EditText
android:id=
"@+id/key_test"
android:layout_width=
"140dip"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_6"
android:background=
"@null"
android:hint=
"输入学员编号后4位"
android:textColorHint=
"@color/hint_text_color"
android:textSize=
"@dimen/sp_16"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1px"
android:layout_marginTop=
"@dimen/dp_1"
android:background=
"@color/hint_text_color"
></View>
</LinearLayout>
<TextView
android:id=
"@+id/do_search"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:text=
"查询"
android:textColor=
"@color/indicator_color"
android:textSize=
"@dimen/sp_18"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
<LinearLayout
...
...
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