package com.example.myapplication.graduation_project;
//主界面首页Fragment
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
@SuppressLint("ValidFragment")
public class Fragment_shouye extends Fragment {
//listview控件
ListView listview;
View view;
//网络请求返回的数据
String result;
//打log测试
final String TAG = "aaaaa";
//获取登录界面传过来的个人用户账号信息,企业账号信息
String intent_a,intent_b;
//搜索控件
EditText sousuo_str;//搜索框
Button sousuo_btn;//搜索按钮
//轮播图相关
private ViewPager viewPager; //轮播图模块
private int[] mImg;
private int[] mImg_id;
private String[] mDec;
private ArrayList<ImageView> mImgList;
private LinearLayout ll_dots_container;
private int previousSelectedPosition = 0;
boolean isRunning = false;
//中间导航栏相关(附近兼职,手机兼职等)
Button job_nearby, Campus_job, phone_job, Day_knot_job, home_job;
//中间标题栏相关(周末兼职,日结兼职等)
TextView Day_end_work, home_work, weekend_work, Campus_work, phone_work;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.inflate(R.layout.fg_shouye, container, false);
//获取登录界面传过来的个人用户账号信息
final Intent intent_account = getActivity().getIntent();
intent_a = intent_account.getStringExtra("account");
//获取搜索框,搜索按钮控件
sousuo_str = view.findViewById(R.id.sousuo_str);
sousuo_btn = view.findViewById(R.id.sousuo_btn);
//获取中间导航栏相关控件
job_nearby = view.findViewById(R.id.job_nearby);
Campus_job = view.findViewById(R.id.Campus_job);
phone_job = view.findViewById(R.id.phone_job);
Day_knot_job = view.findViewById(R.id.Day_knot_job);
home_job = view.findViewById(R.id.home_job);
//中间导航栏相关点击事件
Middle_navigation_bar();
//获取中间标题栏栏相关控件
Day_end_work = view.findViewById(R.id.Day_end_work);
home_work = view.findViewById(R.id.home_work);
weekend_work = view.findViewById(R.id.weekend_work);
Campus_work = view.findViewById(R.id.Campus_work);
phone_work = view.findViewById(R.id.phone_work);
//中间标题栏相关点击事件
Middle_title_bar();
//中间标题栏日结兼职网络post请求
Part_time_keywords("日结兼职");
//主线程更新UI
//创建一个线程
new Thread(new Runnable() {
@Override
public void run() {
//延迟两秒
try {
Thread.sleep( 1000 );
} catch (InterruptedException e) {
e.printStackTrace();
}
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
cardlist();////底部兼职信息卡片布局
}
});
}
}).start();
//地址选择下拉事件
Spinner spinner = view.findViewById(R.id.spin_one);
spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String[] address = getResources().getStringArray(R.array.address);
//ToastUtil.showToast(getActivity(),0,"你选择的是"+address[position]);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
}
});
//搜索按钮监听事件
sousuo_btn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String sousuo_string = sousuo_str.getText().toString();
Intent sousuo_intent = new Intent(getActivity(),sousuo.class);
sousuo_intent.putExtra("sousuo_str",sousuo_string);
sousuo_intent.putExtra("account",intent_a);
startActivity(sousuo_intent);
}
});
//实现轮播图
initLoopView();
return view;
}
//轮播图相关类
private void initLoopView() {
viewPager = (ViewPager) view.findViewById(R.id.loopviewpager);
ll_dots_container = (LinearLayout) view.findViewById(R.id.ll_dots_loop);
// 图片资源id数组
mImg = new int[]{
R.drawable.loop1,
R.drawable.loop2,
R.drawable.loop3,
R.drawable.loop4,
R.drawable.loop5
};
mImg_id = new int[]{
R.id.pager_img1,
R.id.pager_img2,
R.id.pager_img3,
R.id.pager_img4,
R.id.pager_img5
};
// 初始化要展示的5个ImageView
mImgList = new ArrayList<ImageView>();
ImageView imageView;
View dotView;
LinearLayout.LayoutParams layoutParams;
for (int i = 0; i < mImg.length; i++) {
//初始化要显示的图片对象
imageView = new ImageView(getContext());
imageView.setBackgroundResource(mImg[i]);
imageView.setId(mImg_id[i]);
imageView.setOnClickListener(new pagerOnClickListener(getContext()));
mImgList.add(imageView);
//加引导点
dotView = new View(getContext());
dotView.setBackgroundResource(R.drawable.dot);
layoutParams = new LinearLayout.LayoutParams(10, 10);
if (i != 0) {
layoutParams.leftMargin = 10;
}
//设置默认所有都不可用
dotView.setEnabled(false);
ll_dots_container.addView(dotView, layoutParams);
}
ll_dots_container.getChildAt(0).setEnabled(true);
previousSelectedPosition = 0;
//设置适配器
viewPager.setAdapter(new LoopViewAdapter(mImgList));
// 把ViewPager设置为默认选中Integer.MAX_VALUE / t2,从十几亿次开始轮播图片,达到无限循环目的;
int m = (Integer.MAX_VALUE / 2) % mImgList.size();
int currentPosition = Integer.MAX_VALUE / 2 - m;
viewPager.setCurrentItem(currentPosition);
viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int i, float v, int i1) {
}
@Override
public void onPageSelected(int i) {
int newPosition = i % mImgList.size();
ll_dots_container.getChildAt(previousSelectedPosition).setEnabled(false);
ll_dots_container.getChildAt(newPosition).s
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
基于Android大学生兼职相关的设计与实现源码.zip 基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与实现源码.zip基于Android大学生兼职相关的设计与
资源推荐
资源详情
资源评论
收起资源包目录
基于Android大学生兼职系统的设计与实现源码.zip (2000个子文件)
responsive.css 18KB
select2.css 17KB
base.css 16KB
select2.min.css 15KB
widgets.css 10KB
autocomplete.css 8KB
forms.css 8KB
changelists.css 6KB
rtl.css 3KB
nav_sidebar.css 2KB
responsive_rtl.css 2KB
login.css 1KB
ol3.css 657B
fonts.css 423B
dashboard.css 380B
technical_500.html 17KB
default_urlconf.html 16KB
guanyuwomen.html 6KB
tabular.html 4KB
base.html 4KB
change_list.html 3KB
change_form.html 3KB
technical_404.html 2KB
delete_confirmation.html 2KB
stacked.html 2KB
change_password.html 2KB
delete_selected_confirmation.html 2KB
password_change_form.html 2KB
login.html 2KB
openlayers.html 2KB
model_detail.html 2KB
index.html 2KB
fieldset.html 2KB
template_filter_index.html 2KB
view_index.html 2KB
template_tag_index.html 2KB
app_list.html 2KB
change_list_results.html 2KB
related_widget_wrapper.html 1KB
object_history.html 1KB
openlayers.html 1KB
password_reset_confirm.html 1KB
index.html 1KB
model_index.html 1KB
bookmarklets.html 1KB
actions.html 1KB
submit_line.html 1KB
template_detail.html 1KB
search_form.html 1KB
password_reset_form.html 988B
view_detail.html 928B
missing_docutils.html 784B
password_change_done.html 695B
password_reset_done.html 691B
clearable_file_input.html 618B
password_reset_email.html 612B
500.html 551B
pagination.html 549B
password_reset_complete.html 521B
date_hierarchy.html 518B
clearable_file_input.html 511B
clearable_file_input.html 511B
multiple_input.html 462B
invalid_setup.html 447B
multiple_input.html 431B
logged_out.html 425B
change_form_object_tools.html 403B
app_index.html 389B
select.html 384B
change_list_object_tools.html 378B
openlayers-osm.html 378B
select.html 365B
foreign_key_raw_id.html 341B
filter.html 338B
popup_response.html 327B
add_form.html 320B
base_site.html 316B
404.html 282B
nav_sidebar.html 276B
split_datetime.html 238B
input_option.html 219B
input_option.html 219B
url.html 218B
prepopulated_fields_js.html 214B
object_delete_summary.html 192B
input.html 189B
read_only_password_hash.html 185B
attrs.html 172B
attrs.html 172B
input.html 172B
textarea.html 145B
textarea.html 145B
select_option.html 127B
multiwidget.html 117B
osm.html 111B
select_option.html 110B
multiwidget.html 86B
checkbox_select.html 57B
radio.html 57B
checkbox_select.html 57B
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
不安分的小女孩
- 粉丝: 9270
- 资源: 2015
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功